Skip to content

AppContext Implementation #10

@maxsibilla

Description

@maxsibilla

In the current DDI CDS application, the process to obtain patient information is a bit redundant compared to how the app launch should work. Currently when the app is launched, either from a (synthetic) EHR or via stand alone, the app is passed the ID of a patient and then subsequent calls are made to the FHIR server to obtain MedicationStatements, MedicationRequests, Observations, etc., parses through that data and determines what drugs the patient is on or what conditions they have. This is how the toggles are flipped in the UI. The problem is that this entire process occurs even after a CDS call is made and app is launched via the card returned. Duplicate calls to the FHIR server are being made.

We want to modify the CDS Service, specifically the PlanDefinition, for the specific rule that is being fired so that the cards returned contain "appContext": An optional field that allows the CDS Service to share information from the CDS card with a subsequently launched SMART app. The appContext field and value will be sent to the SMART app as part of the OAuth 2.0 access token response, alongside the other SMART launch parameters when the SMART app is launched.

The issue is that the CQF-Ruler and the CDS Hooks component of the CQF Ruler (the project responsible for evaluating the PlanDefinition and the CQL) do not support the appContext functionality.

I plan on

  1. modifying the exisiting PlanDefinition action.documentation (https://www.hl7.org/fhir/metadatatypes.html#RelatedArtifact) to contain a sub-documentation of type "Attachment" (https://www.hl7.org/fhir/datatypes.html#Attachment). This object will contain a base64 encoding of a JSON object that will describe the rule that is being triggered (see the data field in Attachment)
  2. I will also need to modify the exisitng CDS Hooks component of the CQF Ruler (https://github.com/DBCG/org-opencds-cqf-cds) to be able to detect this embedded object as it does not do so currently and to set the appContext field on the cards being returned from the call
  3. Finally I will need to parse the object in the controller of the DDI CDS application during app launch

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions