Stream: implementers
Topic: Query MedicationStatement based on ingredient
Nikolaos Tselas (Feb 07 2019 at 12:10):
Hi ,
I have a question on how to query combined resources. I have a MedicationStatement linked with a Medication that includes the ingredient using Snomed Code as shown below.
I wanted to ask if there is a way to fetch MedicationStatement based on ingredient of Medication that is linked
Thanks !!!
{
"resource": {
"resourceType": "Medication",
"text": {
"status": "generated",
"div": "<div xmlns='http://www.w3.org/1999/xhtml'>Heparin<a name='mm'/></div>"
},
"id": "cf-1549540582337",
"ingredient": [
{
"itemCodeableConcept": {
"coding": [
{
"code": "372877000",
"system": "http://snomed.info/sct",
"display": "Heparin"
}
]
}
}
]
}
},
{
"resource": {
"resourceType": "MedicationStatement",
"text": {
"status": "generated",
"div": "<div xmlns='http://www.w3.org/1999/xhtml'>Heparin<a name='mm'/></div>"
},
"id": "cf-1549540671859",
"subject": {
"reference": "Patient/cf-1549443666155"
},
"medicationReference": {
"reference": "Medication/cf-1549540582337"
}
}
},
Michael Donnelly (Feb 07 2019 at 14:08):
At a workflow level, are you looking for all the medications anyone in in the system is taking that have that ingredient (in the case of a recall or something)?
Nikolaos Tselas (Feb 07 2019 at 14:13):
Thanks @Michael Donnelly for your response. I am looking all the medications of a specific Patient based on ingredient.
I can retrieve all MedicationStatements using something like this:
http://fhirtest.uhn.ca/baseDstu3/MedicationStatement?subject=Patient/cf-1549443666155
So every Medication is linked to a Medication that contains the ingredient.
My question is how can I fetch the medication that contains a specific ingredient?
Michael Donnelly (Feb 07 2019 at 14:19):
Do you want to search for
1. Medications that have the ingredient
2. MedicationStatements that have a Medication that have the ingredient
3. Something else?
Nikolaos Tselas (Feb 07 2019 at 14:22):
If it is possible I want both Medication & MedicationStatement containing an Ingredient of specific Patient :
1. Medications of patient A, that contain ingredient X
2. MedicationStatements of patient A, that contain the Medication which ingredient is X
Michael Donnelly (Feb 07 2019 at 14:44):
The FHIR standard may have chained queries that do what you want, but I definitely wouldn't assume servers have implemented them. I'd break it into smaller pieces.
- Medication has search parameters:
- ingredient - Reference to a Substance or to another Medication (for compounds)
- ingredient-code - CodableConcept for Medication.ingredient
- MedicationStatement
- patient - you know this part already
- medication - Reference to a Medication
I'd search for [base]/Medication?ingredient=http%3A%2F%2Fsnomed.info%2Fsct|386983007
to get the Medications with Alprazolam as an ingredient. Then for each of medication returned I'd search [base]/MedicationStatement?patient=cf-1549443666155&medication=thatMed
.
Michael Donnelly (Feb 07 2019 at 14:49):
FHIR allows you to combine the latter into [base]/MedicationStatement?patient=cf-1549443666155&medication=med1,med2,med3
or combine the whole thing into [base]/MedicationStatement?patient=cf-1549443666155&medication.ingredient=http%3A%2F%2Fsnomed.info%2Fsct|386983007
. But I wouldn't develop that without first confirming that the FHIR server(s) I was likely to work with actually supported that chain.
Lloyd McKenzie (Feb 07 2019 at 15:41):
@Melva Peters Is this something we want to build a short-cut search parameter for?
Melva Peters (Feb 07 2019 at 19:05):
I'll raise a tracker item for Pharmacy Work Group to consider
Melva Peters (Feb 07 2019 at 19:09):
GF tracker added 20364 https://gforge.hl7.org/gf/project/fhir/tracker/?action=TrackerItemEdit&tracker_item_id=20364
Nikolaos Tselas (Feb 08 2019 at 10:23):
Thanks @Michael Donnelly ! You were really helpful !
Last updated: Apr 12 2022 at 19:14 UTC