CDCgov / data-exchange-hl7

Enterprise Data Exchange (DEX) is a new cloud-native centralized data ingestion, validation, and observation service scoped for common data types (HL7, FHIR, CDA, XML, CSV) sent to the CDC. It helps public health stakeholders who send data to the CDC while reducing the maintenance efforts, complexity, and duplication of ingestion points to CDC.
Apache License 2.0
10 stars 14 forks source link

Design how to handle dynamic identifiers based on Value sets for Hep. MMGs #316

Closed mscaldas2012 closed 1 year ago

mscaldas2012 commented 1 year ago

The Hep MMGs have some dynamic mappings based on Value sets.

ex.:

 {
      "id": "3",
      "type": "Single",
      "name": "Contact Type",
      "startingDescription": "START: Contact Type Section ",
      "endingDescription": "END: Contact Type Section ",
      "elements": [
        {
          "name": "Contact Type",
          "description": "During the  2 -6 weeks prior to the onset of symptoms, type of contact the subject had with a person with confirmed or suspected Hepatitis virus infection?(Coded)",
          "dataType": "Coded",
          "codeSystem": "Code System from the value set \"Contact Type (Hepatitis A)\" for INV603 would be used as a data element code system.",
          "legacyPriority": "P",
          "priority": "1",
          "isRepeat": false,
          "mayRepeat": "N",
          "valueSetCode": "PHVS_ContactType_HepatitisA",
          "mappings": {
            "hl7v251": {
              "legacyIdentifier": "INV603",
              "identifier": "Concept Code  from the value set \"Contact Type (Hepatitis A)\" for INV603 would be used as a data element identifier.",
              "messageContext": "OBX segment with\nOBX-3.1=Value from value set",
              "dataType": "CWE",
              "segmentType": "OBX",
              "obrPosition": 1,
              "fieldPosition": 3,
              "componentPosition": 1,
              "usage": "R",
              "cardinality": "[1..1]",
              "literalFieldValues": {},
              "repeatingGroupElementType": "NO",
              "implementationNotes": "Contact Type (INV603) value set concept codes that would come in OBX-3 are listed below.\n\nContact Type Indicator (INV828) would be used as a response in OBX-5.",
            }
          }
        }

What that translates to, is that the message should have one OBX for each Value Set concept.:

OBX|41|CWE|INV602^Contact with Confirmed or Suspected Case^2.16.840.1.114222.4.5.232^INV602^During the 2-6 weeks prior to onset, was patient a contact of a confirmed or suspected case?^L||Y^Yes^2.16.840.1.113883.12.136||||||F
OBX|42|CWE|43018001^Babysitter^2.16.840.1.113883.6.96^INV603_1^Babysitter of This Patient (Contact Type)^L||UNK^Unknown^2.16.840.1.113883.5.1008||||||F
OBX|43|CWE|PHC299^Child cared for by this patient^2.16.840.1.114222.4.5.232^INV603_2^Child Cared For By This Patient (Contact Type)^L||UNK^Unknown^2.16.840.1.113883.5.1008||||||F
OBX|44|CWE|PHC300^Household member (non-sexual)^2.16.840.1.114222.4.5.232^INV603_3^Household Member (Non-Sexual) (Contact Type)^L||N^No^2.16.840.1.113883.12.136||||||F
OBX|45|CWE|PHC301^Playmate^2.16.840.1.114222.4.5.232^INV603_4^Playmate (Contact Type)^L||N^No^2.16.840.1.113883.12.136||||||F
OBX|46|CWE|225517006^Sexual partners^2.16.840.1.113883.6.96^INV603_5^Sex Partner (Contact Type)^L||Y^Yes^2.16.840.1.113883.12.136||||||F
OBX|47|CWE|PHC1304^Other Contact Type^2.16.840.1.114222.4.5.232^INV603_6^Other (Contact Type)^L||UNK^Unknown^2.16.840.1.113883.5.1008||||||F

Currently, MMG Vaidation and Transformation do not understand this. Needs enhancements.

couple of potential solutions:

Solution A

Generate a single element on the MMG for each of the concepts.

Pros:

Cons: MMG must be re-generated if Value set changes.

Solution B

Handle this dynamic behavior in the validation / transformation code.

Pros:

Cons:

Potential schema generation for this:

Option A:

"contact_type": [
    {
        "name": "BABYSITTER",
        "code": "480001",
        "value": {
                "identifier": "UNK",
                "text": "Unknown",
                 "code_system": "PHINVADS"
        }
    },
  {
        "name": "Child cared for by this patient",
        "code": "PCH299",
        "value": {
                "identifier": "Y",
                "text": "Yes",
                 "code_system": "PHINVADS"
        }
    },
...
]

option B: (This applies to Solution A above)

"contact_type_babysitter": {
                "identifier": "UNK",
                "text": "Unknown",
                 "code_system": "PHINVADS"
        }
"contact_type_child_cared_for_by_this_patient": {
                "identifier": "UNK",
                "text": "Unknown",
                 "code_system": "PHINVADS"
        }
...

Option C:

"contact_type": {
    "babysitter": {  "identifier": "UNK",   "text": "Unknown",  "code_system": "PHINVADS" }
    "contact_type_child_cared_for_by_this_patient": {  "identifier": "UNK",   "text": "Unknown",  "code_system": "PHINVADS" }
  .....
mscaldas2012 commented 1 year ago

We're going with Solution A - hardcode the elements at the MMG. the transformation will abide by option B by default (existing code will work as is).