Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

FHIR Bundle import for Patient and Condition. #535

Open
CzarMich opened this issue Jan 27, 2022 · 5 comments
Open

FHIR Bundle import for Patient and Condition. #535

CzarMich opened this issue Jan 27, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@CzarMich
Copy link

CzarMich commented Jan 27, 2022

  1. At the moment FHIR Bundle exports for profile PATIENT is producing a non compliant error, which makes me think this has not yet been implemented, but good to have. I have placed the error reproduced below the sample bundle.
    As for profile CONDITION, the error generated is a validation error, which I have also placed below the sample transaction bundle for condition. I will be glad for any help.

  2. Is there anyway for FHIR-BRIDGE to check if a Patient ID exists before creating one. Assuming ehrBASE gets data from 2 sources: A: Parent system that Generates Patient ID hence EHR ID, and one that uses the Patient ID for further processing before being sent to FHIR-Bridge which in the end has to store that data in openEHR/ ehrBase.

### Sample Patient Transaction Bundle FHIR Resource:

{
  "resourceType": "Bundle",
  "type": "transaction",
  "entry": [ {
    "fullUrl": "Patient/Patient-tWn9eF5coYuGC6bz7Ykqko",
    "resource": {
      "resourceType": "Patient",
      "id": "Patient-tWn9eF5coYuGC6bz7Ykqko",
      "meta": {
        "profile": [ "https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/Patient" ]
      },
      "extension": [ {
        "url": "https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/ethnic-group",
        "valueCoding": {
          "system": "http://snomed.info/sct",
          "code": "261665006"
        }
      }, {
        "url": "https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/age",
        "extension": [ {
          "url": "dateTimeOfDocumentation",
          "valueDateTime": "2021-07-01"
        }, {
          "url": "age",
          "valueAge": {
            "value": 56,
            "unit": "years",
            "system": "http://unitsofmeasure.org",
            "code": "a"
          }
        } ]
      } ],
      "active": true,
      "birthDate": "1965-01-01"
    },
    "request": {
      "method": "POST",
      "url": "Patient/Patient-tWn9eF5coYuGC6bz7Ykqko"
    }
  } ]
}

ERROR:

{
    "resourceType": "OperationOutcome",
    "issue": [
        {
            "severity": "error",
            "code": "processing",
            "diagnostics": "Unsupported transaction: provided Bundle should have a resource that uses on of the following profiles: https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/blood-gas-panel, https://www.medizininformatik-initiative.de/fhir/core/modul-labor/StructureDefinition/DiagnosticReportLab"
        }
    ]
}

### Sample Condition Transaction Bundle FHIR resource:

{
  "resourceType": "Bundle",
  "type": "transaction",
  "entry": [ {
    "fullUrl": "Condition/GastrointestinalUlcers-17",
    "resource": {
      "resourceType": "Condition",
      "id": "GastrointestinalUlcers-17",
      "meta": {
        "profile": [ "https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/gastrointestinal-ulcers" ]
      },
      "verificationStatus": {
        "coding": [ {
          "system": "http://snomed.info/sct",
          "code": "410594000"
        } ]
      },
      "category": [ {
        "coding": [ {
          "system": "http://snomed.info/sct",
          "code": "394584008"
        } ]
      } ],
      "code": {
        "coding": [ {
          "system": "http://snomed.info/sct",
          "code": "40845000"
        } ]
      },
      "subject": {
        "reference": "Patient/Patient-tWn9eF5coYuGC6bz7Ykqko"
      },
      "recordedDate": "2021-07-01"
    },
    "request": {
      "method": "PUT",
      "url": "Condition/GastrointestinalUlcers-17"
    }
  } ]
}

ERROR:

{
    "resourceType": "OperationOutcome",
    "issue": [
        {
            "severity": "error",
            "code": "processing",
            "diagnostics": "Condition.verificationStatus.coding:conditionVerificationStatus: minimum required = 1, but only found 0 (from https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/gastrointestinal-ulcers)",
            "location": [
                "Bundle.entry[0].resource.ofType(Condition).verificationStatus",
                "Line 13, Col 20"
            ]
        }
    ]
}


@subigre What do you think of issue (2).

@CzarMich CzarMich added the bug Something isn't working label Jan 27, 2022
@SevKohler SevKohler self-assigned this Jan 27, 2022
@SevKohler
Copy link
Contributor

Will take a look as soon as i got time.

@subigre
Copy link

subigre commented Jan 28, 2022

Regarding the first issue, the current implementation of the FHIR Bridge has a limitation regarding Bundle and it expects and supports only 2 types:

  • DiagnosticReportLab
  • Blood Gas Panel

I already thought about improving the code to support any bundle that contains resources and profiles supported by the FHIR Bridge. There is not so much to do but I haven't found the time yet.

Regarding the second issue, the FHIR Bridge already searches for an existing patient before creating a new one.
However, this checks is based on the internal database and not using EHRbase.

By the way the second error comes from the missing verificationStatus according to the profile:
image

The versificationStatus should look like the following:

{
  "verificationStatus": {
    "coding": [
      {
        "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
        "code": "confirmed",
        "display": "Confirmed"
      },
      {
        "system": "http://snomed.info/sct",
        "code": "410594000"
      }
    ]
  }
}

@CzarMich
Copy link
Author

Hi @subigre , yes that is true, but as you can see, the cardinality for display is 0..1, which means it is optional and not mandatory as code or system. So I expected this not to raise and flags.

"verificationStatus": {
       "coding": [ {
         "system": "http://snomed.info/sct",
         "code": "410594000"
       } ]

Yes, for the bundles, it will surely be good to have the main resources& profiles at least being supported as bundles too: Condition, Patient, Procedure and medication/medication statement.

@SevKohler
Copy link
Contributor

SevKohler commented Jan 31, 2022

You have to turn on either a Terminology server that automatically adds this information (as we programmed) or add the display since openEHR DVCodedText requires it.
You can configure the TermServer in the application.yml

Yes, for the bundles, it will surely be good to have the main resources& profiles at least being supported as bundles too: Condition, Patient, Procedure and medication/medication statement.

I agree anyhow its an opensource project neither I or @subigre are currently working on the bridge, feel free to add it its open, we can surely do the code reviews. We will still try to help you if we can, but features wont be added for now from our side.

@SevKohler SevKohler assigned SevKohler and unassigned SevKohler Jan 31, 2022
@subigre
Copy link

subigre commented Jan 31, 2022

Hi @subigre , yes that is true, but as you can see, the cardinality for display is 0..1, which means it is optional and not mandatory as code or system. So I expected this not to raise and flags.

"verificationStatus": {
       "coding": [ {
         "system": "http://snomed.info/sct",
         "code": "410594000"
       } ]

I wanted to say that both mappings are mandatory, SNOMED CT and HL7:

Condition.verificationStatus.coding:conditionVerificationStatus: minimum required = 1, but only found 0 (from https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/gastrointestinal-ulcers)

Regarding display attribute, @SevKohler is right. This optional in FHIR but mandatory in openEHR so either you use a terminology server that allow you to populate the missing display, either you have to set it by hand.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants