Stream: cql
Topic: CQL FHIR follow and read reference instead of searching
Michael Riley (Dec 06 2021 at 18:30):
Hi all, I know I've talked about this issue before, but I was wondering if there was anymore work in using references to pull related information on MedicationStatements/MedicationReferences before.
Let's say I have a script that is something like:
using FHIR version '3.0.0'
codesystem "icd10cm": 'http://hl7.org/fhir/sid/icd-10-cm'
define "MedAConcept": Concept { Code 'A' from icd10cm }
define "MedAMedication": [Medication: "MedAConcept"]
define "MedAMedicationRequest": [MedicationStatement: "MedAConcept"] medStatement
with "MedAMedication" med
such that exists (
(medStatement.medication.reference) ref
where EndsWith(ref, '/' + meds.id)
)
So this block has multiple issues with it:
1) It will only work with MedicationStatements that have a medicationReference, not a medicationCodeableConcept, so the statement must be revised based on how the FHIR server presents its resources.
2) It requires a SEARCH on Medication and a SEARCH on MedicationStatement. This is an issue I'm running into right now with an Epic server, the epic server supports SEARCH on MedicationStatement, but only a READ on the Medication, so the script will 405 Method not allow in these cases.
Is there anyway we could use a SEARCH then READ strategy somehow? All I really want is to pull some codes from the medication into the relevant medicationstatement context. It really should not have to be 2 different searches to find supplemental information like this. Is there grammer to support some sort of WITH clause in the retrieval context?
Last updated: Apr 12 2022 at 19:14 UTC