-
Notifications
You must be signed in to change notification settings - Fork 0
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
PlanDefinition & CQL for PHQ9 and GAD7 administration #41
base: master
Are you sure you want to change the base?
Conversation
... bare minimum, aiming for sufficient for first-pass $apply of PlanDefinition to CarePlan
@achen2401 @pbugni just FYI at this point. I'm aiming to run this through encender $apply today on my local install of that. |
Out of scope for this MR:
|
@achen2401 if the screener is going to request $apply from encender I think it would do so at https://github.com/uwcirg/asbi-screening-app/blob/master/src/components/Survey.vue#L411 , ie after it has successfully saved each QR. Per https://github.com/ccsm-cds-tools/encender#usage , I think it would call that applyPlan, get the new CarePlan from encender, and then write that new CarePlan to the SoF host. Thoughts? Aside: one complexity is that for DCW (and probably most other projects) we expect most CarePlans to have multiple questionnaires, and for daily administration of each questionnaire. We'll probably iterate a bit on the level of sophistication we implement here... For example, after processing the first QR per above, the new CarePlan would ideally not include the Questionnaire that was just presented, since it is no longer needed - I think it would be on me to build that into the PlanDefinition logic. |
@mcjustin I was thinking more like here, where we call $apply so that the careplan is generated first and the app can look in the care plan to see what questionnaire(s) are to be administered. (see here ) I think there should be logic in the Plan Definition that will determine what questionnaire(s) is required still from the questionnaire responses. Here is a breakdown of my thought process:
|
@achen2401 your suggested approach is intriguing... it implies that any consumer of a CarePlan will need to call $apply to get it, whereas my approach puts the onus on the system which is doing the modifying, to both call $apply and POST/PUT it to the FHIR store.
Advantages to the modifier calling $apply and persisting it:
Since fEMR isn't calling $apply yet, and since the screener is the only thing changing data of relevance (for the DCW MVP, we're starting w/ a set of test patients - no need to add patients or modify their clinical state once they've been seeded), I'd be inclined for the screener to either call after QR write, or do it both before and afterwards... @pbugni care to weigh in? |
@mcjustin Before proceeding further with this, I need to note that it seems, unfortunately, that encender only works in the |
@achen2401 From your console screenshot, it looks like you have the isNodeJs flag set to true (default) here: https://github.com/ccsm-cds-tools/encender/blob/main/src/simpleResolver.js#L18 . Have you tried changing that? Below is a chat between me and David Winters from August. David Winters: Encender uses the cql-worker library, which works in both the browser or server-side. Web workers are used in the browser and worker threads are used in Node. David Winters: See this line in Encender. David Winters: If you don't provide a worker factory function via the aux input, then Encender defaults to using Node worker threads. This is what happens when you run the Encender built in tests. David Winters: Here's an example of running Encender with Node.js: https://github.com/ccsm-cds-tools/ccsm-cds-with-tests/blob/main/apply/screening-example.js David Winters: Here's an example of creating a web worker in the browser: https://github.com/ccsm-cds-tools/ccsm-cds-dashboard/blob/main/src/hooks/useCds/index.js#L33 |
@mcjustin thanks. I am not certain if that is the issue as I was still encountering errors after setting the variables.
Feel free to try out the branch I started here. This is the latest error (see the screenshot): There is a discussion of that error here. Noting that both |
@achen2401 It looks like you need to pass cql.worker.js to the Worker() constructor like they do here: Also, is your order of parameters correct here? https://github.com/uwcirg/asbi-screening-app/pull/44/files#diff-8c11bc890bb34855fbe12928704387db4d404de2fae418849b0eead8d61001d6R91-R95 ? It differs from the useCds example. |
…nDefinition_PHQ9_GAD7.json to use it (theoretically)
No description provided.