ehrbase / fhir-bridge

FHIR Bridge acts as a broker between an HL7 FHIR client and an openEHR server.
32 stars 20 forks source link

Creating Patient error: expected: //fhir.hl7.org/ValueSet/$expand, actual: http://snomed.info/sct\"] #533

Open CzarMich opened 2 years ago

CzarMich commented 2 years ago

I managed to get V1.4.2 running with BETTER EHR. But Creating Patient is not responding as expected. @birgerhaarbrandt

When I try to CREATE/post the current sample patient via Postman; I end up with the error:

{
    "resourceType": "OperationOutcome",
    "issue": [
        {
            "severity": "error",
            "code": "processing",
            "diagnostics": "Error occurred while merging composition in EHRbase: Wrong Status code. Expected: [200, 201, 204]. Got: 422. Error message: {\"message\":\"Composition validation failed (there are missing or invalid values).\",\"validation_errors\":[\"Invalid terminology at /content[openEHR-EHR-ADMIN_ENTRY.person_data.v0,'Personendaten']/data[at0001,'Baum']/items[openEHR-EHR-CLUSTER.ethnischer_hintergrund.v0,'Ethnischer Hintergrund']/items[at0002,'Ethnischer Hintergrund']/value/defining_code, expected: //fhir.hl7.org/ValueSet/$expand, actual: http://snomed.info/sct\"]}"
        }
    ]
}

I was thinking of editing the template in the EHR to rather: "http://snomed.info/sct\". Any suggestions?

This is how it looks like on the opt/ template in the ehr server file for patient.

   "localizedDescriptions": {
        "de": "Der ethnische Hintergrund einer Person."
      },
      "inputs": [
        {
          "list": [],
          "suffix": "code",
          "type": "TEXT",
          "terminology": "//fhir.hl7.org/ValueSet/$expand?url=https://www.netzwerk-universitaetsmedizin.de/fhir/ValueSet/ethnic-groups"
        },
        {
          "list": [],
          "suffix": "value",
          "type": "TEXT",
          "terminology": "//fhir.hl7.org/ValueSet/$expand?url=https://www.netzwerk-universitaetsmedizin.de/fhir/ValueSet/ethnic-groups"
        }
      ]
    }
  ]
SevKohler commented 2 years ago

can you provide me the fhir resource ?

CzarMich commented 2 years ago

can you provide me the fhir resource ? Attached. POLAR_Testdaten_UKB.zip

SevKohler commented 2 years ago

First of all thats super a lot of resources how am i supposed to debug which one does not work ? Secondly the bundles ocntain ressources that are not supported for the NUM CODEX and therefore was never mapped. For all supported profiles check the Profile.java class. If you want me to help you please provide me the exact resource.

CzarMich commented 2 years ago

Here is a test patient that you can use. This is the resource producing the mentioned error: Sources; Postman Collections

`{
    "resourceType": "Patient",
    "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": "186019001",
                "display": "Other ethnic, mixed origin"
            }
        },
        {
            "extension": [
                {
                    "url": "dateTimeOfDocumentation",
                    "valueDateTime": "2020-10-01"
                },
                {
                    "url": "age",
                    "valueAge": {
                        "value": 68,
                        "unit": "years",
                        "system": "http://unitsofmeasure.org",
                        "code": "a"
                    }
                }
            ],
            "url": "https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/age"
        }
    ],
    "identifier": [
        {
            "system": "http://www.netzwerk-universitaetsmedizin.de/sid/crr-pseudonym",
            "value": "codex_6348Q7"
        }
    ],
    "birthDate": "1952-09-30"
}`
SevKohler commented 2 years ago

Anyhow currently my term server does not work and requires reconfig i asked @subigre to help me with that. With a newer version now the identifier requires a type, you need to add it. This does not explain the error, but you should at it.

{
  "resourceType": "Patient",
  "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": "186019001",
        "display": "Other ethnic, mixed origin"
      }
    },
    {
      "extension": [
        {
          "url": "dateTimeOfDocumentation",
          "valueDateTime": "2020-10-01"
        },
        {
          "url": "age",
          "valueAge": {
            "value": 68,
            "unit": "years",
            "system": "http://unitsofmeasure.org",
            "code": "a"
          }
        }
      ],
      "url": "https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/age"
    }
  ],
  "identifier": [
    {
      "system": "http://www.netzwerk-universitaetsmedizin.de/sid/crr-pseudonym",
  "type": {
                "coding":  [
                    {
                        "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
                        "code": "ANON"
                    }
                ]
            },      "value": "codex_6348Q7"
    }
  ],
  "birthDate": "1952-09-30"
}
CzarMich commented 2 years ago

Identifier type added.

CzarMich commented 2 years ago

So I deleted the extension: { "url": "https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/ethnic-group", "valueCoding": { "system": "http://snomed.info/sct", "code": "186019001", "display": "Other ethnic, mixed origin" } }

Pushed to server and Patient was created. I believe this can be used to close/solve the issue #534

I checked on Better EHR server, and Patient does exists. šŸ‘

subigre commented 2 years ago

Dear @CzarMich

First of all, I apologize for the late reply but I did not pay attention to this repository since a while as I am now working on EHRbase only.

Based on the initial error and the web template. I think that the issue comes from the Better server.

Could you please try the following (even if it is completely wrong):

 "system": "http://snomed.info/sct",

by

 "system": "//fhir.hl7.org/ValueSet/$expand",
CzarMich commented 2 years ago

Hi @subigre , I had tried this already, I do get the error below;

{
    "resourceType": "OperationOutcome",
    "issue": [
        {
            "severity": "error",
            "code": "processing",
            "diagnostics": "Coding.system must be an absolute reference, not a local reference",
            "location": [
                "Patient.extension[0].value.ofType(Coding)",
                "Line 12, Col 53"
            ]
        }
    ]
}
subigre commented 2 years ago

Ah right, this one comes from the FHIR Bridge and HAPI FHIR validation API šŸ˜¢