FHIR Chat · PlanDefinition->Action->Condition · cql

Stream: cql

Topic: PlanDefinition->Action->Condition


view this post on Zulip Rich Boyce (May 26 2021 at 19:45):

I have a segment of a PlanDefinition that utilizes two subpopulations that looks like this:
{
"title": "Use only if benefit outweighs risk and monitor patient ECG",
"description": "Increased risk of prolonged QTc likely",
"condition": [{
"kind": "applicability",
"expression": {
"language": "text/cql",
"expression": "There exists a medication statement with a code from Citaloprams whose value is greater than or equal to 60 mg/d OR There exists a medication request with a code from Citaloprams whose value is greater than or equal to 60 mg/d"
}
}, {
"kind": "applicability",
"expression": {
"language": "text/cql",
"expression": "There exists a medication statement with a code from QT Prolonging Agents OR There exists a medication request with a code from QT Prolonging Agents"
}
}],
"dynamicValue": [{
"path": "activity.extension",
"expression": {
"language": "text/cql",
"expression": "Indicator"
}
}],
"action": [{
"prefix": "Usually Avoid Combination"
}]
}

My problem is that when I run this rule I get a card returned when each expression is true. My understanding was that if I have multiple conditions they are combined using AND semantics so the overall condition is only true if both conditions are true. Therefore I should only have 1 card returned instead of two identical ones.

view this post on Zulip David Winters (May 27 2021 at 10:33):

That's my understanding as well based upon the comment on the condition element.

view this post on Zulip David Winters (May 27 2021 at 10:35):

@Rich Boyce I'm assuming you're using cqf-ruler? Have you tried testing the CQL separately to ensure it's operating the way you expect it to?

view this post on Zulip Rich Boyce (May 27 2021 at 11:37):

I am using the cqf-ruler. I have tested portions of the CQL and it seems to work appropriately, however when I string the entire thing together as in the section I shared, that is when I am experiencing odd behavior

view this post on Zulip Bryn Rhodes (May 27 2021 at 12:49):

That is not expected behavior, especially if you’re getting duplicate cards from the same action. Is there a way we can repro?

view this post on Zulip Rich Boyce (May 27 2021 at 13:06):

I can bundle the PlanDefinition, Library, CQL, ValueSets, and the patient-view request I am making if you would like. Currently I am testing this locally.

view this post on Zulip Rich Boyce (May 28 2021 at 17:54):

I think the issue is in https://github.com/DBCG/org-opencds-cqf-cds/blob/master/src/main/java/org/opencds/cqf/cds/hooks/R4HookEvaluator.java. It doesn't seem to me that the logic described in the HL7 documentation is met here. I think actionComponents should be a Set instead of a List and if conditionsMet is false then actionComponents should be cleared.

view this post on Zulip JP (May 28 2021 at 18:46):

Would you mind filing an issue on that github repo?

view this post on Zulip Rich Boyce (May 28 2021 at 19:03):

@JP Will do


Last updated: Apr 12 2022 at 19:14 UTC