clinical-reasoning
clinical-reasoning copied to clipboard
"In modifier is unsupported" is being thrown
I see the following exception being thrown when doing a basic "IN" CQL statement like [Observation: "HbA1c Laboratory Test"]
:
org.opencds.cqf.cql.engine.exception.CqlException: Error evaluating expression Exclusions: In modifier is unsupported
which is in the following file in the "isMatchCoding" method: https://github.com/cqframework/clinical-reasoning/blob/master/cqf-fhir-utility/src/main/java/org/opencds/cqf/fhir/utility/matcher/ResourceMatcher.java#L214
This method is not being overwritten by either R4 or R5 classes.
This is caused by this CQL looking for Observation lab values with codes in the "HbA1c Laboratory Test" ValueSet:
library RT2DM version '1.0.0' using FHIR version '4.0.1' include FHIRHelpers version '4.0.1' called FHIRHelpers valueset "HbA1c Laboratory Test": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1013' context Patient define "Has A1c Lab": [Observation: "HbA1c Laboratory Test"] A1cLab where A1cLab.status ~ 'final' return A1cLab
This is the VSAC ValueSet:
{ "resourceType": "ValueSet", "id": "2.16.840.1.113883.3.464.1003.198.12.1013", "meta": { "versionId": "19", "lastUpdated": "2022-03-02T18:03:30.000-05:00" }, "url": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1013", "version": "20170504", "name": "HbA1c Laboratory Test", "status": "active", "date": "2022-03-03T18:46:01-05:00", "publisher": "NCQA PHEMUR", "expansion": { "identifier": "urn:uuid:cc591c5d-8659-48b4-8d36-94ece5daf89d", "timestamp": "2022-11-02T14:15:16-04:00", "total": 3, "offset": 0, "parameter": [ { "name": "count", "valueInteger": 1000 }, { "name": "offset", "valueInteger": 0 } ], "contains": [ { "system": "http://loinc.org", "version": "2.73", "code": "17856-6", "display": "Hemoglobin A1c/Hemoglobin.total in Blood by HPLC" }, { "system": "http://loinc.org", "version": "2.73", "code": "4548-4", "display": "Hemoglobin A1c/Hemoglobin.total in Blood" }, { "system": "http://loinc.org", "version": "2.73", "code": "4549-2", "display": "Hemoglobin A1c/Hemoglobin.total in Blood by Electrophoresis" } ] } }
R4 FHIR Patient:
{ "resourceType": "Patient", "id": "91dddcf1-f422-4fc1-b6d0-6b95a1e075e7", "name": [ { "use": "official", "family": "Harvey", "given": [ "Thomas", "L" ] } ], "gender": "male", "maritalStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/v3-MaritalStatus", "code": "M", "display": "Married" } ] }, "birthDate": "1961-04-17" }
R4 FHIR Observation:
{ "resourceType": "Observation", "id": "31f0c498-781c-4e64-a849-efd866461627", "status": "final", "category": [ { "coding": [ { "code": "laboratory", "display": "Laboratory", "system": "http://terminology.hl7.org/CodeSystem/observation-category" } ] } ], "code": { "coding": [ { "code": "4548-4", "display": "Hemoglobin A1c/Hemoglobin.total in Blood", "system": "http://loinc.org" } ], "text": "Hemoglobin A1c/Hemoglobin.total in Blood" }, "valueQuantity": { "value": 12.3, "unit": "%", "system": "http://unitsofmeasure.org", "code": "%" }, "interpretation": [ { "coding": [ { "code": "H", "display": "High", "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation" } ] } ], "subject": { "reference": "urn:uuid:91dddcf1-f422-4fc1-b6d0-6b95a1e075e7", "display": "Thomas L. Harvey" }, "effectiveDateTime": "2022-02-23" }
Take a look at this Zulip thread. The short version is that this behavior is configurable: https://chat.fhir.org/#narrow/stream/179220-cql/topic/In.20modifier.20is.20unsupported/near/423489106
Let me know if this answers your question.