Stream: inferno
Topic: MedicationRequest contained Medication
James Dinsmore (Aug 19 2021 at 19:51):
For IV orders we use a contained Medication within MedicationRequest and are currently receiving two errors in Inferno. I don't get any errors using the FHIR Validator or other validation tools. Any assistance is appreciated.
USCMR-10: MedicationRequest resources returned from previous search conform to the US Core MedicationRequest Profile.
MedicationRequest/id-ORDER.58.0.10018045.1: MedicationRequest.medication.ofType(Reference): Unable to find matching profile for #1 among choices: http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication
USCMR-11: Medication resources returned conform to US Core v3.1.1 profiles
Medication/1: Medication.ingredient[0].item.ofType(Reference): Unable to resolve resource '#2'<br/> Medication/1: Medication.ingredient[0].item.ofType(Reference): ref-1: SHALL have a contained resource if a local reference is provided ( (url: 2; ids: )) [(reference = '#') or reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids'))]
{
"resourceType": "MedicationRequest",
"id": "id-ORDER.58.0.10018045.1",
"contained": [
{
"resourceType": "Medication",
"id": "1",
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/sid/ndc",
"code": "9999999999",
"display": "DEXTROSE 5%-WATER IV SOLN: 1000ML JC"
}
],
"text": "DEXTROSE 5%-WATER IV SOLN: 1000ML JC"
},
"ingredient": [
{
"itemReference": {
"reference": "#2"
},
"strength": {
"numerator": {
"value": 1000,
"unit": "ML"
},
"denominator": {
"value": 1,
"unit": "bag"
}
}
}
]
},
{
"resourceType": "Medication",
"id": "2",
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/sid/ndc",
"code": "9999999999",
"display": "DEXTROSE 5%-WATER IV SOLN: 1000ML JC"
}
],
"text": "DEXTROSE 5%-WATER IV SOLN: 1000ML JC"
}
}
],
"status": "active",
"intent": "order",
"reportedBoolean": false,
"medicationReference": {
"reference": "#1"
},
"subject": {
"reference": "Patient/id-58.58.14477"
},
"encounter": {
"reference": "Encounter/id-58.10018045"
},
"authoredOn": "2021-07-29T16:34:00-05:00",
"requester": {
"reference": "Practitioner/id-58.58.0.0.jameswd.778899.0",
"display": "DINSMORE JAMES"
},
"dosageInstruction": [
{
"text": "40 ml/hr IV PIGGY",
"additionalInstruction": [
{
"coding": [
{
"display": "PREDEFINED NS TIME OF"
},
{
"display": "1000"
}
],
"text": "PREDEFINED NS TIME OF 1000"
}
],
"timing": {
"code": {
"coding": [
{
"system": "http://thrive.com/frequency-code",
"code": "DAILY",
"display": "DAILY"
}
]
}
},
"route": {
"coding": [
{
"system": "http://snomed.info/sct",
"display": "IV PIGGY"
},
{
"system": "http://thrive.com/medication-route",
"code": "IV",
"display": "IV PIGGY"
}
],
"text": "IV PIGGY"
},
"doseAndRate": [
{
"doseQuantity": {
"value": 40,
"unit": "ml/hr"
}
}
]
}
],
"dispenseRequest": {
"validityPeriod": {
"start": "2021-07-29T16:34:00-05:00"
},
"numberOfRepeatsAllowed": 0,
"quantity": {
"value": 0
}
}
}
Yunwei Wang (Aug 19 2021 at 21:22):
Hello @James Dinsmore I run some tests using the MedicationRequest you provided. I could not reproduce the error on USCMR-10 while I did get the same on USCMR-11. image.png
If you have other MedicationRequest resource that fails on USCMR-10, I could take a look again.
The problem for USCMR-11 is based on the cross reference between these two contained Medications where the Medication.1 has a reference to Medcation.2.
Though this is kindly correct in MedicationRequest, Inferno has to take those contained resources out and send them one at time to validator in order to validate them against US Core profiles. When validator test Medication.1, it sees that Medicaiton.1 has a local reference to contained resource "#2" but it could not find contained resource in Medication.1.
I understand your use case but such usage of contained resource is not recommended by FHIR standard. As FHIR spec states that
Resources can only be contained in other resources if there is a reference from the resource to the contained resource, or if the contained resource references the container resource.
In the example you provided, there is no reference from the container resource MedicationRequest to the contained resource Medicaiton.2 and there is not reference from the contained Medicaiton.2 to its container MedicationRequest.
So the reference between contained resources is tricky. I would suggest not using that practice.
James Dinsmore (Aug 20 2021 at 16:41):
Thank you @Yunwei Wang. It appears that the issue we are seeing with USCMR-10 must be fixed in 1.6.1 or 1.6.2 as our Inferno server is still on 1.6. As for the contained references I understand and will change ingredient.itemReference to ingredient.itemCodeableConcept.
Last updated: Apr 12 2022 at 19:14 UTC