num-codex / odm2fhir

This tool maps study/patient data in CDISC ODM based on the GECCO data dictionary to HL7 FHIR which adheres to the GECCO profiles, value sets and code systems.
MIT License
4 stars 1 forks source link

Missing elements `status` & `occurence` in `immunization` resource #12

Closed j-frei closed 3 years ago

j-frei commented 3 years ago

Describe the bug In our setup, the output JSON file bundle-*.json (retrieved by odm2fhir_online.sh) contains the following entry.

{
  "fullUrl": "urn:uuid:*a-uuid*",
  "resource": {
    "resourceType": "Immunization",
    "id": "*a-uuid*",
    "meta": {
      "profile": [ "https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/immunization" ]
    },
    "vaccineCode": {
      "coding": [ {
        "system": "http://snomed.info/sct",
        "code": "261665006",
        "display": "Unknown (qualifier value)"
      } ]
    },
    "patient": {
      "reference": "Patient/*a-patient-uuid*"
    },
    "protocolApplied": [ {
      "targetDisease": [ {
        "coding": [ {
          "system": "http://snomed.info/sct",
          "code": "6142004"
        } ]
      } ],
      "_doseNumberString": {
        "extension": [ {
          "url": "http://hl7.org/fhir/StructureDefinition/data-absent-reason",
          "valueCode": "unknown"
        } ]
      }
    } ]
  },
  "request": {
    "method": "POST",
    "url": "Immunization"
  }
}

It seems that the resource lacks the required properties status and a occurrence-property.

The error message (HTTP Code 400) looks like this:

{"resourceType":"OperationOutcome","issue":[{"severity":"fatal","code":"invalid","details":{"text":"FHIRProvider: Missing required element: 'status' [Bundle.entry[46]]"},"expression":["Bundle.entry[46]"]}]}

We are using the Docker instance of the IBM FHIR server (As docker-compose https://git.rz.uni-augsburg.de/freijoha/ibm-fhir-server) . The FHIR server version was set to 4.5.4.

Is this expected? Is there a potential misconfiguration of our local REDCap instance that is responsible for this?

cerbelding commented 3 years ago

Thank you for your report.

I assume the answer of this particular question was "unknown"?

For "Yes" the Status is already set to "COMPLETED" for "No" to "NOTDONE" I just added "NOTDONE" to all Immunizations with "Unknown", as this is the definition here.

The Fix will be published in the next version of the app.

j-frei commented 3 years ago

Thank you for your reply.

Unfortunately, I have no further knowledge of the details of our local REDCap testing instance. But it seems that you have already found the root of our initial problem.

Similar to "status" in "immunization" we are also facing issues with missing "occurrence" properties.

Old error log: ibm

cerbelding commented 3 years ago

Which FHIR-Ressource should this be? (Bundle.entry[47])?

The occurence-property is filled using the field impfungen_XXXXX_datum maybe this field is malformed in your CDISC-ODM or not answered?

j-frei commented 3 years ago

The resource looks like this:

"resource": {
      "resourceType": "Immunization",
      "id": "*a-uuid*",
      "meta": {
        "profile": [ "https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/immunization" ]
      },
      "vaccineCode": {
        "coding": [ {
          "system": "http://snomed.info/sct",
          "code": "some-snomed-code",
          "display": "Unknown (qualifier value)"
        } ]
      },
      "patient": {
        "reference": "Patient/*a-patient-uuid*"
      },
      "protocolApplied": [ {
        "targetDisease": [ {
          "coding": [ {
            "system": "http://snomed.info/sct",
            "code": "some-snomed-code"
          } ]
        } ],
        "_doseNumberString": {
          "extension": [ {
            "url": "http://hl7.org/fhir/StructureDefinition/data-absent-reason",
            "valueCode": "unknown"
          } ]
        }
      } ]
    },

It seems plausible that this field has not been answered in our ODM. Is it required to be answered in order to convert it to a valid FHIR format?

cerbelding commented 3 years ago

Yes, according to the FHIR-Profile https://simplifier.net/forschungsnetzcovid-19/immunization , occurence is mandatory item. Maybe we can use some sort of default-occurence for unanswered *_datum-fields.

cerbelding commented 3 years ago

Issue will be closed as status & occurence of immunization-resource were already fixed in version 0.3.0.