LinuxForHealth / hl7v2-fhir-converter

Converts HL7 v2 Messages to FHIR Resources
Apache License 2.0
89 stars 36 forks source link

Fix Org.contact.telecom.use; better telecom test #409

Closed cragun47 closed 2 years ago

cragun47 commented 2 years ago

Signed-off-by: Brian Cragun cragun@us.ibm.com

We don't want to map IN1.7.2 to Organization.Contact.telecom.use. Previously hard-coded to work, this seemed redundant.

We're creating a FHIR ContactPoint. use is optional, BUT if it is present it MUST be from this value set: home | work | temp | old | mobile Explained, here: https://build.fhir.org/valueset-contact-point-use.html

IN1.7.2 has these values: (It’s an XTN and comes from table 201) https://hl7-definition.caristix.com/v2/HL7v2.6/Tables/0201

Because we must map to home | work | temp | old | mobile, there isn't a really good mapping:

ASN. null
BPN. null (or mobile)
EMR. null (is it mobile or work or home?)
NET. null (not a phone)
ORN. HOME
PRN. HOME
PRS. HOME ??
VHN. HOME ??
WPN. WORK

At this point, it seems better just to leave it empty and unmapped.

This defect also adds a test for a situation fixed in https://github.com/LinuxForHealth/hl7v2-fhir-converter/pull/405.

The issue was that some phone numbers were not getting processed to telecom. This test is added to ensure the problem doesn't return.