-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CQL expression is not returning expected result. #1015
Comments
Thank you @umeshprasad123 for raising this issue. Unfortunately, the description you have given is not very helpful to determine what the actual issue is. I would recommend splitting up the expression into smaller parts to determine where the failure surfaces. For some general feedback, I would recommend using the DateTime comparison operators (https://cql.hl7.org/09-b-cqlreference.html#datetime-operators-2) instead of the general comparison operators to account for precision differences. |
Thanks Chris for your comment and suggestion! Issue description : Issue : Expression "Remote BP Dates" returns an empty list Fix : I was unable to push a 'Pull request'. Hence attaching code; see file QueryEvaluator.java. I have also attached a work around solution CQL code. Idea here is to use different expression alias name ( see file : CQL_example - work_around_solution.cql ) After fixing CQL-Engine code or CQL code ( see file : CQL_example - work_around_solution.cql ), expression "Remote BP Dates" returns [2019-05-03] I have also attached patient file for you to unit test code. Let me know if you need any additional information. Thank you! 'Pull request' difference :
|
Following CQL expression suppose to return non-empty list, however it is returning an empty list.
define "Nonacute Inpatient Encounter Dates":
[Procedure] P
where IsCompleted(P)
and GetStrippedCode(P.code) in "Nonacute Inpatient"
and "Has Hypertension"
and (date from P.performed."start" > "Hypertension Index Date"
or (not "Hypertension Index Date In Year Prior to Measurement Period" and date from P.performed."start" = "Hypertension Index Date"))
return date from P.performed."start"
Please note, the following functions evaluated against patient test case data, return results as expected, but not in the grouped expression as shown above.
define function IsCompleted(p Procedure): p.status is null or p.status = 'completed'
define Separator: '-'
define function ExtractCodeStr(CodeStr String): if PositionOf(Separator, CodeStr) > 0 then Substring(CodeStr, 0, PositionOf(Separator, CodeStr)) else CodeStr
define function GetStrippedCode(C CodeableConcept): Code {code: ExtractCodeStr(C.coding[0].code), system: C.coding[0].system, display: C.coding[0]."display"}
The text was updated successfully, but these errors were encountered: