FHIR Chat · BCSE MedicationDispense resource · cql

Stream: cql

Topic: BCSE MedicationDispense resource


view this post on Zulip Vasyl Herman (Jun 15 2021 at 17:46):

Hello, I am testing the BCSE measure. The problem is that Dementia Medications In Year Before or During Measurement Period always returns false unless I set [MedicationDispense] instead of [MedicationDispense: "Dementia Medications"]. I have checked vsac_cache/valueset-db.json file and yes 314214 exists there. I am wondering what could be a problem. My Bandle? Please help!
I am using cql-execution library. Everything worked fine unless I started to test MedicationDispense. I am not sure how the type.conding list works here.
Here we have a piece of cql code:

library BCSe version '0.0.1'
using FHIR version '4.0.1'

valueset "Dementia Medications": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.196.12.1510'
parameter "Measurement Period" Interval<DateTime>

define "Dementia Medications In Year Before or During Measurement Period":
  exists ([MedicationDispense: "Dementia Medications"])

I am trying to construct Patient bundle file like that:

{
  "resourceType": "Bundle",
  "entry": [
    {
      "resource": {
        "resourceType": "Patient",
        "id": "97373",
        "gender": "female",
        "birthDate": "1952-01-20"
      }
    },
    {
      "resource": {
        "resourceType": "MedicationDispense",
        "id": "286b7c84-60d6-4ab5-ad7f-571fa1f93051",
        "type": {
          "coding": [
            {
              "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
              "code": "314214"
            }
          ]
        },
        "subject": {
          "reference": "Patient/97373"
        },
        "whenHandedOver": "2020-04-11"
      }
    }
  ]
}

view this post on Zulip Vasyl Herman (Jun 15 2021 at 18:44):

Here is my vsac_cache/valueset-db.json:

{
  "2.16.840.1.113883.3.464.1003.196.12.1510": {
    "Latest": {
      "oid": "2.16.840.1.113883.3.464.1003.196.12.1510",
      "version": "Latest",
      "codes": [
        {
          "code": "1100184",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "1308569",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "1599803",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "1599805",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "1805420",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "1805425",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "310436",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "310437",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "312835",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "312836",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "314214",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "314215",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "579148",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "725021",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "725023",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "860695",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "860707",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "860715",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "860901",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "996561",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "996571",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "996594",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "996603",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "996609",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "996615",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "996740",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "997220",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "997223",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "997226",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        },
        {
          "code": "997229",
          "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
          "version": "2021-05"
        }
      ]
    }
  }
}

view this post on Zulip Michael Ryan (Jun 16 2021 at 11:31):

(deleted)

view this post on Zulip Bryn Rhodes (Jun 16 2021 at 22:02):

Hi @Vasyl Herman , I suspect the problem is that the MedicationDispense has a choice type for the primary code path. Can you try putting an explicit code path in the retrieve:

[MedicationDispense: medication in "Dementia Medications"]

view this post on Zulip Vasyl Herman (Jun 17 2021 at 17:01):

Thanks, it worked out!
Could you please give me a clue how can I check what is default code path?

view this post on Zulip Bryn Rhodes (Jun 17 2021 at 18:41):

There is documentation here: https://github.com/cqframework/clinical_quality_language/wiki/FHIRModelInfo#retrievable-types-r4


Last updated: Apr 12 2022 at 19:14 UTC