Stream: cql
Topic: FHIR and CQL Impl
Rishi Tarar (May 12 2018 at 15:22):
Trying to get my head around CQL and producing a real unit of work for a Usecase.
Need some feed back on
1. CQL Execution
2. Actual Action Evaluation via PlanDef
Does this flow look right?
@ArunSrinivasan @Marcelo caldas @Chris Moesel download.jpg
Bryn Rhodes (May 12 2018 at 16:05):
Can you give a little more context about what this is a depiction of?
Rishi Tarar (May 13 2018 at 11:29):
@Bryn Rhodes Attached here is more context. There are muitiple usecases for this pattern. For simplicity I'll decribe one such usecase below.
Paul Coverdell Stroke Registry
When Stroke Patients get discharged, there is a follow-up that happens by care provider orgs ,(eg: Hospice , In home care and many other entities).
The follow up is usally a set of questions are are asked of the patient 7,14,30,... days after discharge. The key here is timeliness. Most of the time this identification of a cohort is a very manual process. Also a lot of Patients are missed in this manual identification of a cohort.
The pattern is -> initial trigger -> subsequent adjudication -> Cohort Match found
Now initial trigger could be a CDS Hooks based or Subscription based trigger.
For subsequent adjudication , we liked the CQL approach and we think that it could scale. So we are trying to implement a Remote CDS Service , which loads CQL as a Resource. for eample stroke.cql would be exposed as RemoteCDSSErviceURL/cds-services/stroke/ . The idea is for Triggering mechanisms to dump POST requests with resources as Payloads to this service.
This would mean that the CDS Service will receive a FHIR Resource payload (or a ref) to it so the CQL mapped to that endpoint could be executed and measures calculated. These measures are then applied to PlanDef on the server.
We were trying to validate our understanding and would welcome some feedback or course corrections.We are leveraging one of your implementations @github , trying to undertstand on how cqf-ruler or cqf-engine would fit the need(or develop our own tooling).
Adding another diagram with a bit more context:
@ArunSrinivasan @Marcelo caldas
Chris Moesel (May 14 2018 at 16:51):
(deleted)
Chris Moesel (May 14 2018 at 20:04):
@Bryn Rhodes is more familiar w/ the FHIR Clinical Reasoning side of things, and particularly associated Operations, than I am. That said, my understanding of $apply
(mostly from here) is that you can't POST the CQL results as input. I think the $apply
operation expects the FHIR server to execute the CQL as part of the operation -- so having a CQL exec service separate from the FHIR server probably doesn't work for this case.
Chris Moesel (May 14 2018 at 20:07):
If this was intended as a point-of-care clinical invocation, then you could probably wrap the CQL in a CDS Hooks service and return suggestion cards -- but it sounds like your use case is for this to be a bit more behind-the-scenes, not necessarily at or during the point of care. Is that right, @Rishi Tarar?
Bryn Rhodes (May 14 2018 at 20:21):
CQL can be loaded into a FHIR server for execution with the CQL engine using a Library resource. The CQF engine is a stand-alone component that can run CQL and access data from any FHIR server (you provide an endpoint as part of configuring the engine). The CQF ruler is a HAPI FHIR derivative that plugs a CQL engine in and loads CQL from Library resources on the server. In that configuration, the engine will use the JPA layer to access FHIR data in the local FHIR server.
Chris Moesel (May 14 2018 at 20:24):
@Bryn Rhodes -- is my understanding of $apply
(see above) correct? And if so, does CQF engine or CQF ruler support $apply
?
Bryn Rhodes (May 14 2018 at 20:24):
So the middle layer here could either be a FHIR server (a modified CQF Ruler would work) or just a custom service that subscribes to the FHIR server generating the events, and then runs the CQL using the FHIR server that originated the event as the endpoint.
Bryn Rhodes (May 14 2018 at 20:24):
That's correct, $apply isn't a general CQL $evaluate, $apply is specifically about running a PlanDefinition.
Bryn Rhodes (May 14 2018 at 20:25):
Yes, the CQF Ruler supports $apply, that's what we use in the CDS Hooks servlet to process rules.
Bryn Rhodes (May 14 2018 at 20:26):
We've toyed with a general $evaluate operation ($cql maybe?) and it would be trivial to implement, but we haven't yet.
Chris Moesel (May 14 2018 at 20:28):
Does $apply
actually post the resulting CarePlan to the server as well? Or does it just return it and it's up to the caller to post it back if they want to save it?
Bryn Rhodes (May 14 2018 at 21:05):
It just returns it, it's up to the caller to decide what to do with it.
Rishi Tarar (May 14 2018 at 23:11):
This is awesome feedback @Chris Moesel @Bryn Rhodes .
I am thinking of a way where the CDS Package which could constitute of
1. CQL
2. Associated Libraries (Terminology Valuesets etc)
3. Trigger Criteria (CDS Hook or Subscription )
On the flow:
So from what I understood a modified cqf-ruler (custom service) would work. See below
1. Input from either a CDS Hooks(UI Based) or Subscription callback rest hook(backend)
2. The said custom service then "runs" the CQL against the FHIR Server that originated the call
3. The CQL Output measure is determined and CDS SErvice takles and action (Send Card back for CDS Hooks , Take an Action to log a Match for a cohort for Subscription based triggering)
The "runs" part
Running a CQL against the data from the FHIR Server
1. Looking at the cqf-ruler on git hub , it appears that CQL and Libs are loaded on cql-ruler
2. FHIR Server onbly provides the data
The Plan Definition
It appears Plan Definition and Care Plan are very specific to a FHIR Server and in-situ feedback on Clinical Workflow pathways.
It seems to me they may not be relevant, to what I am trying to achieve for sentinel background actions like the stroke usecase.
A Custom CQF-RULER type service can meet our needs.
Does this make sense?
Chris Moesel (May 16 2018 at 03:11):
You're getting much deeper into @Bryn Rhodes 's territory than mine, so I'm afraid I can't provide much confirmation at this point -- as I don't really have any experience w/ cqf-ruler.
Bryn Rhodes (May 16 2018 at 06:39):
@Rishi Tarar , yes, from what I understand of the use case, this sounds reasonable and a modified CQF-Ruler or equivalent middle layer should be able to handle it.
Bryn Rhodes (May 16 2018 at 06:41):
You're right that PlanDefinition and CarePlan are about representing workflow, but I'll just note that PlanDefinition can be used to build Event-Condition-Action rules.
Bryn Rhodes (May 16 2018 at 06:42):
I'm still a little unclear about how CDS Hooks fits into what you're describing, but if it's part of a provider workflow and requires provider interaction then yes, that makes sense.
Rishi Tarar (May 16 2018 at 13:30):
@Bryn Rhodes @Chris Moesel Thanks for clarifications.
You are right Bryn. The abstract view is that CDS(verb) will have two types of usecases
1. UI Based .. where provider feed back is indeed required
2. Sentinel .. non UI scenarios
The CDS mechanism to deliver "the package" differs for both of these as for UI based you could have PlanDef (Event-Condition-Action) and for Sentinel, you could have (Remote CDS and subsequent downstream actions without burdening the provider or the EHR)
Most of the Pop Health and Public health use cases align well with the Sentinel Scenario. This is only a technical and standards aspect. However the Data USe and Security "must" be respected. And that could be the next level of conversation with the community.
We will give cqf-ruler impl a try.. We are trying to
1. Package cqf-ruler as a Springboot App
2. Expose the cql-engine tooling
3. Try to modularize Loading of "CDS Package" and expose it as an Endpoint.
We may have some follow up questions.
Thanks for all the feedback. We will see you guys at FHIRDevDays....
@Marcelo caldas @ArunSrinivasan
-RIshi
Bryn Rhodes (May 16 2018 at 14:47):
@Rishi Tarar , that sounds fantastic, see you at FHIRDevDays!
Last updated: Apr 12 2022 at 19:14 UTC