CDCgov / prime-reportstream

ReportStream is a public intermediary tool for delivery of data between different parts of the healthcare ecosystem.
https://reportstream.cdc.gov
Creative Commons Zero v1.0 Universal
71 stars 40 forks source link

Vocabulary mapping for CWE #12553

Open brick-green opened 10 months ago

brick-green commented 10 months ago

User Story

As a RS engineer I want to map values from HL7 CWE fields to FHIR coding elements and back to HL7 CWE fields based on tables defined in the Vocabulary Mapping column of the mapping inventory sheets.

Description/Use Case

The mapping inventory sheets have a column for vocabulary mapping. For some fields a table is defined identifying the fields and values to convert. Our mappings for CWE/CodeableConcept are not able to map the second alternate values for incoming data as defined by those tables. Further we do not currently have the ability to map values back to HL7 for any of the CWE fields.

Dev Notes

HL7 to FHIR

The file datatype/CodeableConcept.yml has these elements defined:

# Generalized CWE for alternate codes handles mismatched systems and codes
coding_3:
  valueOf: $coding
  generateList: true
  condition: $coding NOT_NULL
  specs: CWE
  vars:
    coding: CODING_SYSTEM_V2_ALTERNATE, CWE

# Generalized CWE through CODING_SYSTEM_V2 handles mismatched systems and codes
coding_4:
  valueOf: $coding
  generateList: true
  condition: $coding NOT_NULL && nameOfSystem NOT_EQUALS SCT
  specs: CWE
  vars:
    coding: CODING_SYSTEM_V2, CWE
    nameOfSystem: CWE.3

We need to add elements to the coding element in CWE/CodeableConcept.yml using the data types CODING_SYSTEM_V2 and CODING_SYSTEM_V2_ALTERNATIVE.

There is no data type for CODING_SYSTEM_V2_SECOND_ALTERNATE. That will need to be added to the hl7v2-fhir-converter library. See CODING_SYSTEM_V2 in SimpleDataValueResolver and SimpleDataTypeMapper classes for a guide on implementation.

FHIR to HL7

The linuxforhealth Terminology.lookup() function uses the FHIR Registry to retrieve mappings from HL7 to FHIR. Using the same library we could add a CustomFHIRFunction to maps the values from FHIR back to HL7.

Acceptance Criteria

Andrey-Glazkv commented 10 months ago

Hey team! Please add your planning poker estimate with Zenhub @arnejduranovic @jack-h-wang @jalbinson @JessicaWNava @JFU-NAVA-PBC @jimmyfagan @mkalish @thetaurean