gematik / epa-deployment

Project includes docker-compose file to start all relevant services (including VAU encryption/decryption) for an ePA environment.
Apache License 2.0
7 stars 1 forks source link

FHIR-requests: missing medicationReference in resource MedicationDispense in response in xml-representation #14

Closed mge-medisoftware closed 2 months ago

mge-medisoftware commented 3 months ago

Hallo,

i am missing medicationReference in resource MedicationDispense (cardinality 1..1) in response in xml-representation, not mapped form json to xml? Also missing elements meta/profile. And is versioning planned? (Something like <profile value="https://gematik.de/fhir/epa-medication/StructureDefinition/epa-medication-dispense|1.0.2" /> analog to KBV-profiles) And can you add an examle with substitution=yes?

Thank you!

xml should look like this:

<MedicationDispense xmlns="http://hl7.org/fhir">
  <id value="4e6e1623-778e-44a3-b208-8479f5339e43" />
  <meta>
    <versionId value="1" />
    <lastUpdated value="2025-01-22T14:43:33.244+00:00" />
    <profile value="https://gematik.de/fhir/epa-medication/StructureDefinition/epa-medication-dispense" />
  </meta>
  <extension url="https://gematik.de/fhir/epa-medication/StructureDefinition/rx-prescription-process-identifier-extension">
    <valueIdentifier>
      <system value="https://gematik.de/fhir/epa-medication/sid/rx-prescription-process-identifier" />
      <value value="160.153.303.257.459_20250122" />
    </valueIdentifier>
  </extension>
  <identifier>
    <system value="https://gematik.de/fhir/epa-medication/sid/rx-originator-process-identifier" />
    <value value="5d8fbf7c-bdb0-44c2-95fe-423ae0404ccd_160.153.303.257.459" />
  </identifier>
  <status value="completed" />
  <medicationReference>
    <reference value="Medication/2571d29b-e213-40ec-b817-a1490718a490" />
  </medicationReference>
  <subject>
    <identifier>
      <system value="http://fhir.de/sid/gkv/kvid-10" />
      <value value="X110411319" />
    </identifier>
  </subject>
  <performer>
    <actor>
      <reference value="Organization/3856402c-7636-4fbd-98bd-d278852b8e88" />
    </actor>
  </performer>
  <authorizingPrescription>
    <reference value="MedicationRequest/bb91cde8-0426-4f4b-a766-5d818d0605bd" />
  </authorizingPrescription>
  <whenHandedOver value="2025-01-22" />
  <dosageInstruction>
    <text value="1-0-0-0" />
  </dosageInstruction>
  <substitution>
    <wasSubstituted value="false" />
  </substitution>
</MedicationDispense>

source file in repo: medication-dispense-example-id-11.json

{
  "resourceType": "MedicationDispense",
  "status": "completed",
  "performer": [
    {
      "actor": {
        "reference": "Practitioner/3"
      }
    }
  ],
  "authorizingPrescription": [
    {
      "reference": "MedicationRequest/8"
    }
  ],
  "medication": {
    "reference": {
      "reference": "Medication/5"
    }
  },
...

curl -H "Accept: application/xml" --location "http://localhost:8084/fhir/MedicationDispense"

<Bundle xmlns="http://hl7.org/fhir">
   <id value="798d3fd9-af3b-401a-814e-76f9f487c160"/>
   <meta>
      <lastUpdated value="2024-06-13T14:09:50.652+00:00"/>
   </meta>
   <type value="searchset"/>
   <total value="3"/>
   <link>
      <relation value="self"/>
      <url value="http://localhost:8084/fhir/MedicationDispense"/>
   </link>
   <entry>
      <fullUrl value="http://localhost:8084/fhir/MedicationDispense/11"/>
      <resource>
         <MedicationDispense xmlns="http://hl7.org/fhir">
            <id value="11"/>
            <meta>
               <versionId value="1"/>
               <lastUpdated value="2024-06-13T13:58:30.621+00:00"/>
               <source value="#rjyslpX0PPkJgazq"/>
            </meta>
            <status value="completed"/>
            <performer>
               <actor>
                  <reference value="Practitioner/3"/>
               </actor>
            </performer>
            <authorizingPrescription>
               <reference value="MedicationRequest/8"/>
            </authorizingPrescription>
            <quantity>
               <value value="6"/>
               <system value="http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"/>
               <code value="TAB"/>
            </quantity>
            <daysSupply>
               <value value="5"/>
               <unit value="Day"/>
               <system value="http://unitsofmeasure.org"/>
               <code value="d"/>
            </daysSupply>
            <note>
               <text value="Patient soll es zum Essen einnehmen"/>
            </note>
            <dosageInstruction>
               <sequence value="1"/>
               <text value="Zwei Tabletten auf einmal"/>
               <additionalInstruction>
                  <coding>
                     <system value="http://snomed.info/sct"/>
                     <code value="311504000"/>
                     <display value="Zum Essen"/>
                  </coding>
               </additionalInstruction>
               <timing>
                  <repeat>
                     <frequency value="1"/>
                     <period value="1"/>
                     <periodUnit value="d"/>
                  </repeat>
               </timing>
               <route>
                  <coding>
                     <system value="http://snomed.info/sct"/>
                     <code value="26643006"/>
                     <display value="Oral Route"/>
                  </coding>
               </route>
               <method>
                  <coding>
                     <system value="http://snomed.info/sct"/>
                     <code value="421521009"/>
                     <display value="Swallow - dosing instruction imperative (qualifier value)"/>
                  </coding>
               </method>
               <doseAndRate>
                  <type>
                     <coding>
                        <system value="http://terminology.hl7.org/CodeSystem/dose-rate-type"/>
                        <code value="ordered"/>
                        <display value="Ordered"/>
                     </coding>
                  </type>
                  <doseQuantity>
                     <value value="2"/>
                     <unit value="TAB"/>
                     <system value="http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"/>
                     <code value="TAB"/>
                  </doseQuantity>
               </doseAndRate>
            </dosageInstruction>
            <dosageInstruction>
               <sequence value="2"/>
               <text value="Zwei Tabletten täglich für  4 Tage"/>
               <additionalInstruction>
                  <coding>
                     <system value="http://snomed.info/sct"/>
                     <code value="311504000"/>
                     <display value="Zum Essen"/>
                  </coding>
               </additionalInstruction>
               <timing>
                  <repeat>
                     <boundsDuration>
                        <value value="4"/>
                        <unit value="days"/>
                        <system value="http://unitsofmeasure.org"/>
                        <code value="d"/>
                     </boundsDuration>
                     <frequency value="1"/>
                     <period value="1"/>
                     <periodUnit value="d"/>
                  </repeat>
               </timing>
               <route>
                  <coding>
                     <system value="http://snomed.info/sct"/>
                     <code value="26643006"/>
                     <display value="Oral Route"/>
                  </coding>
               </route>
               <doseAndRate>
                  <type>
                     <coding>
                        <system value="http://terminology.hl7.org/CodeSystem/dose-rate-type"/>
                        <code value="ordered"/>
                        <display value="Ordered"/>
                     </coding>
                  </type>
                  <doseQuantity>
                     <value value="1"/>
                     <unit value="TAB"/>
                     <system value="http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"/>
                     <code value="TAB"/>
                  </doseQuantity>
               </doseAndRate>
            </dosageInstruction>
         </MedicationDispense>
      </resource>
      <search>
         <mode value="match"/>
      </search>
   </entry>
   <entry>
      <fullUrl value="http://localhost:8084/fhir/MedicationDispense/12"/>
      <resource>
         <MedicationDispense xmlns="http://hl7.org/fhir">
            <id value="12"/>
            <meta>
               <versionId value="1"/>
               <lastUpdated value="2024-06-13T13:58:30.743+00:00"/>
               <source value="#IumFTZGxT7uMjajR"/>
            </meta>
            <status value="completed"/>
            <performer>
               <actor>
                  <reference value="Practitioner/3"/>
               </actor>
            </performer>
            <authorizingPrescription>
               <reference value="MedicationRequest/9"/>
            </authorizingPrescription>
            <quantity>
               <value value="6"/>
               <system value="http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"/>
               <code value="TAB"/>
            </quantity>
            <daysSupply>
               <value value="5"/>
               <unit value="Day"/>
               <system value="http://unitsofmeasure.org"/>
               <code value="d"/>
            </daysSupply>
            <whenHandedOver value="2024-01-14T07:13:00+05:00"/>
            <note>
               <text value="Patient soll es zum Essen einnehmen"/>
            </note>
            <dosageInstruction>
               <sequence value="1"/>
               <text value="Zwei Tabletten auf einmal"/>
               <additionalInstruction>
                  <coding>
                     <system value="http://snomed.info/sct"/>
                     <code value="311504000"/>
                     <display value="Zum Essen"/>
                  </coding>
               </additionalInstruction>
               <timing>
                  <repeat>
                     <frequency value="1"/>
                     <period value="1"/>
                     <periodUnit value="d"/>
                  </repeat>
               </timing>
               <route>
                  <coding>
                     <system value="http://snomed.info/sct"/>
                     <code value="26643006"/>
                     <display value="Oral Route"/>
                  </coding>
               </route>
               <method>
                  <coding>
                     <system value="http://snomed.info/sct"/>
                     <code value="421521009"/>
                     <display value="Swallow - dosing instruction imperative (qualifier value)"/>
                  </coding>
               </method>
               <doseAndRate>
                  <type>
                     <coding>
                        <system value="http://terminology.hl7.org/CodeSystem/dose-rate-type"/>
                        <code value="ordered"/>
                        <display value="Ordered"/>
                     </coding>
                  </type>
                  <doseQuantity>
                     <value value="2"/>
                     <unit value="TAB"/>
                     <system value="http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"/>
                     <code value="TAB"/>
                  </doseQuantity>
               </doseAndRate>
            </dosageInstruction>
         </MedicationDispense>
      </resource>
      <search>
         <mode value="match"/>
      </search>
   </entry>
   <entry>
      <fullUrl value="http://localhost:8084/fhir/MedicationDispense/13"/>
      <resource>
         <MedicationDispense xmlns="http://hl7.org/fhir">
            <id value="13"/>
            <meta>
               <versionId value="1"/>
               <lastUpdated value="2024-06-13T13:58:30.853+00:00"/>
               <source value="#liIS5M4CRh0NhkqH"/>
            </meta>
            <status value="completed"/>
            <performer>
               <actor>
                  <reference value="Practitioner/3"/>
               </actor>
            </performer>
            <authorizingPrescription>
               <reference value="MedicationRequest/10"/>
            </authorizingPrescription>
            <quantity>
               <value value="6"/>
               <system value="http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"/>
               <code value="TAB"/>
            </quantity>
            <daysSupply>
               <value value="5"/>
               <unit value="Day"/>
               <system value="http://unitsofmeasure.org"/>
               <code value="d"/>
            </daysSupply>
            <whenHandedOver value="2024-01-03T07:13:00+05:00"/>
            <note>
               <text value="Patient soll es zum Essen einnehmen"/>
            </note>
            <dosageInstruction>
               <sequence value="1"/>
               <text value="Zwei Tabletten auf einmal"/>
               <additionalInstruction>
                  <coding>
                     <system value="http://snomed.info/sct"/>
                     <code value="311504000"/>
                     <display value="Zum Essen"/>
                  </coding>
               </additionalInstruction>
               <timing>
                  <repeat>
                     <frequency value="1"/>
                     <period value="1"/>
                     <periodUnit value="d"/>
                  </repeat>
               </timing>
               <route>
                  <coding>
                     <system value="http://snomed.info/sct"/>
                     <code value="26643006"/>
                     <display value="Oral Route"/>
                  </coding>
               </route>
               <method>
                  <coding>
                     <system value="http://snomed.info/sct"/>
                     <code value="421521009"/>
                     <display value="Swallow - dosing instruction imperative (qualifier value)"/>
                  </coding>
               </method>
               <doseAndRate>
                  <type>
                     <coding>
                        <system value="http://terminology.hl7.org/CodeSystem/dose-rate-type"/>
                        <code value="ordered"/>
                        <display value="Ordered"/>
                     </coding>
                  </type>
                  <doseQuantity>
                     <value value="2"/>
                     <unit value="TAB"/>
                     <system value="http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"/>
                     <code value="TAB"/>
                  </doseQuantity>
               </doseAndRate>
            </dosageInstruction>
         </MedicationDispense>
      </resource>
      <search>
         <mode value="match"/>
      </search>
   </entry>
</Bundle>
sonerd commented 3 months ago

Hi @mge-medisoftware,

we have fixed the problem with the reference. It will be included in the next release. The meta information is also added to the dispense samples.

Kind regards, Soner

mge-medisoftware commented 3 months ago

Hello @sonerd,

thank you, this was fast!

But there are more differences compared to definition of gematik-resource MedicationRequest

instance-reference used in "epa-deployment":

<subject>
    <reference value="Patient/4"/>
</subject>

identifier used in https://simplifier.net/epa-medication (makes more sense, because in ePA-context patient is known):

<subject>
   <identifier>
      <system value="http://fhir.de/sid/gkv/kvid-10" />
      <value value="X110411319" />
   </identifier>
</subject>

And second example, requester in "epa-deployment" does not reference to PractionerRole:

<requester>
    <reference value="Practitioner/3"/>
    <display value="Dr. Max Manfred Mustermann"/>
</requester>

https://simplifier.net/epa-medication:

<requester>
   <reference value="PractitionerRole/3856402c-7636-4fbd-98bd-d278852b8e88" />
</requester>

This complicates tests of building the medicationlist via the medication-service of the docker-container, and there are no other possibilities at this time...

Kind regards

fnoGematik commented 3 months ago

Hey @mge-medisoftware,

we just released an updated version of epa-deployment (v1.0.8) including the meta information for all dispenses, corrected references to the medication as well as a medication dispense example having a substitution.

We are still checking you're other comments.

Stay tuned and best regards,

sonerd commented 2 months ago

Hi @mge-medisoftware ,

the latest release includes the changes you have mentioned. Please take a look so that we can close this issue.

Thanks and best regards.

mge-medisoftware commented 2 months ago

Hello @sonerd, thanks a lot, mentioned problems are solved.

Found more (for next update?): MedicationDispense should reference an organization (pharmacy) as performer/actor (not Practitioner)

:-)

sonerd commented 2 months ago

Hi @mge-medisoftware,

the problem you have mentioned is fixed in the latest release which we have released today.