CDS Support in O3: Engine & more
Summary:
OpenMRS needs a solution for:
(1) a CDS Engine,
(2) Authoring that's Clinician-friendly,
(3) a way to test rules, and;
(4) sources of content that are trustworthy, free, and actively maintained.
Key Links
Discussion in Talk Thread: https://talk.openmrs.org/t/o3-cds-a-way-forward-for-clinical-decision-support-must-haves/43089/6?u=grace
CDS Engine Repo: https://github.com/openmrs/openmrs-module-drools
1. Problem
A Recipe for CDS
CDS is a massive topical field. It helps to think about it as a “Recipe” with some key “Ingredients” (components). We need a solution for each of these.
A Recipe for CDS |
|
|
---|---|---|
Ingredient | Notes | How we plan to solve this |
| A brain/engine the software uses to calculate rules Examples include:
| Drools |
| BA-friendly way to represent and write rules, content Way to safely QA / review rules that is Clinician- or BA-friendly. | DMN (graph/chart), BPMN (), decision tables Drools Docs: Defining spreadsheet decision tables https://docs.drools.org/8.44.0.Final/drools-docs/drools/language-reference/index.html#decision-tables-defining-proc |
| This is usually overlooked. Having a way to write tests as you go, automated, is absolutely critical. E.g.: Something that will alarm when a rule stops working. | Drools' DMN offers a way to specify and run sample test cases before your eyes: https://docs.drools.org/8.44.0.Final/drools-docs/drools/getting-started/index.html#test-scenarios-intro-con_getting-started-decision-services |
| Examples include:
| GAP. Need to find: Are there public datasets out there? |
| Attached to content, but separated here because not all terminology sets include CDS connections. |
|
| E.g. Forms, Orders, other data collection points where system obtains info about patients and groups. |
|
| Examples include: Flags, Tasks, Modals (limit popups as much as possible though) As you’re developing the alerts: Sometimes it’s correct, but not useful. Eg OB-Gyn getting alerts saying “did you know your patient is pregnant?” Think about: Triggers, Data source (and quality of that data), and intended effect on who is the end user. |
|
“Escape Clause” / Override Mechanism | Way for users to say “This was wrong”. Change rule, turn off rule. Override or cancel for that patient/population. |
|
Audit Logging | Need a way to understand how an answer was derived at that point in time. | Drools has some tooling around this. |
Feedback Loop |
|
|
2. User Stories
Backlog of CDS-related Roadmap Items / use cases for OpenMRS: https://openmrs.atlassian.net/jira/polaris/projects/OMRS/ideas/view/6314977
Static Image:
Dynamic Widget:
How to think about a CDS MVP:
The goal is not to go from nothing to an all-powerful CDS engine - because that can’t help us in the meantime, or for simpler, lower-hanging use cases that will still make a difference in Clinical Decisions.
Instead, we will focus on use cases that we can grow from: Starting with some value, some more value, and then lots of value!
ROADMAP for Low-Hanging Fruit Iterations:
Green = things Grace thinks are most promising right now
Favor Simple Alerts: Simple alerts are typically better than complex alerts. If your data quality is dubious, if you have complex alerts dependent on too many pieces of data, then odds are good that one of those pieces of data are bad. E.g.: geriatrics: “>70, opiates >3 days → get a laxative” (well what if the pt has diarrhea? what if…? List of exceptions was long. So in rule text we mention some of the more common reasons you should not do this. Decided not to write in all the exceptions to the rule itself, because then it would seem like the rule randomly appears.
Company A and Company B: A has very few; B has loads. But what they advise on are very similar, b/c there’s a set of rules made by the dutch gov’t. How these are handled in the different systems is different. In A, a lot of the rules go to the Pharmacy; in B a lot go straight to the prescriber.
Standards to look at: CDS-Hooks (effort to be a standard), OpenCDS project; paper: requirements for knowledge authoring tools (coming soon - includes interview with Teich)
Area | Real “MVP”
| v1 | v2 |
---|---|---|---|
Allergies | Show Allergies in Drug Order UI
| Alert when Allergy is chosen as exact Drug Order https://openmrs.atlassian.net/browse/OMRS-333 Requires Rule Engine. | Alert when an Allergy related Drug is chosen Requires Rule Engine + Content. |
Pediatrics: Weight-based dosing | Show patient weight in Drug Order UI "The Pediatric Pharmacy Association recommends that patient weight, recorded in kilograms, be required on all medication prescriptions in both the inpatient and outpatient settings." https://pmc.ncbi.nlm.nih.gov/articles/PMC10547047/ | Show warning in Dosage section of Order Form: “patient is <18; consider Weight-based dose”. Requires Rule Engine. |
|
Forms: Recommended Forms | Custom Form buttons on focused widgets (e.g. “ANC Form” button on an ANC widget, like OHRI did) (Already done.) | "If patient is [obs] = X and [visit type] = Y, then recommend these forms". Requires Rule Engine. |
|
Tasks: Recommended Tasks |
|
eg HIV+ + Female >XXyrs old → Cervical CA Screening needed Requires Rule Engine. |
|
Cohorts: Catch Patients who will fall through “Gaps” | Add phone # to Patient Lists. Makes it easier for manual LTFU follow up. | Add patients to a general System List with fairly simple logic, e.g. “Did not show up for appointment” E.g. Show me patients I have seen recently in the last 2 weeks (eg, if I want to do remote follow up) | Detailed Cohorts: “Build me a list of all patients who X and Y etc” → then Dynamically up-to-date list of those patients. E.g. if selected “Refer to Psych” → Add to a Psychiatrist List |
Recommended Orders | Order Templates (Already have, partially.) | Stars / favoriting | Order Sets: “Based on Dx/CC etc, consider: …” |
Forms: Templates for free text notes | Show “last data entered” in Forms UI; enables user to see and re-use past data in discrete questions. (Already done.) | Manually select a form template from a UI shown within long-form Text boxes (e.g. “SOAP”, “PQRST”, etc.) | Suggest a form template based on words typed |
3. Market Analysis
SMART Guidelines & CQL “101”
Explaining our approach to SMART Guidelines & CQL Engine in 2023.
SMART Guidelines & CQL (Clinical Quality Language):
Analysis of Categories of ANC WHO CDS Rules https://docs.google.com/spreadsheets/d/14sTL6D7ZcuYPMJ3IkBRgpWFTDk2x6EU9LhcKosOynn4/edit?gid=0#gid=0
Docs about what we set up: Implementing SMART Guideline Indicators and CDS in OpenMRS
Sample ANC Maternity CDS rules in spreadsheet format: https://docs.google.com/spreadsheets/d/1lRXhJg7JQboYl9sGif8Tslc3HYK17jG2/edit?gid=206805698#gid=206805698
Sample HIV CDS rules in spreadsheet format: https://docs.google.com/spreadsheets/d/117bKXdJ1GnAuQgR5JdftFOlPY7EOpTZT/edit?gid=1103435742#gid=1103435742
UW-DIGI and several OpenMRS Community Members (eg Mozzy, Ian, Piotr, Patric) worked on a way using CQL to implement PlanDefinitions / CarePlans in OpenMRS: https://talk.openmrs.org/t/o3-cds-a-way-forward-for-implementing-plandefinitions-activitydefinitions-and-careplans-in-openmrs-with-fhir/43665
Learning from Bahmni
Learning from Bahmni’s CDS efforts & SNOMED CT project:
CDSS alert notification in Bahmni for drug-diagnosis interaction using SNOMED CT https://www.youtube.com/watch?v=P7BRsMra6_M&ab_channel=BahmniCommunity
Bahmni CDSS Demo and E2E automation testing https://www.youtube.com/watch?v=PAkgaq6Qjuk&ab_channel=BahmniCommunity
Licensing Constraints: SNOMED-CT → comprehensive → $$$ license; vs. SNOMED-GPS → global, free license, but far less comprehensive
Technical approach: Global prop → fhir terminology server. Running a CDS server that supports FHIR CDS Hooks; more enterprise approach.
Learning from USA
https://www.youtube.com/watch?v=adIDR2r8VNc at the 54 min mark, see how this gets implemented in a large USA EHR...
There are a lot of resources on the AHRQ website too https://cds.ahrq.gov
Often USA rule examples, at the repository-level, have very site-specific rules.
Learning from Publications
Arden/CQL History article: _______
Other historic links & resources from previous CDS initiatives:
Miro: Brainstorming / mind-map about CDS for OpenMRS, and notes from CDS session in 2024: https://miro.com/app/board/uXjVKcNhIQ8=/
Talk: O3 & CDS: A way forward for Clinical Decision Support must-haves https://talk.openmrs.org/t/o3-cds-a-way-forward-for-clinical-decision-support-must-haves/43089
Old CDS hooks initiative: https://openmrs.atlassian.net/wiki/spaces/projects/pages/26937523
OpenMRS NoviGuide Module Demo.mov https://drive.google.com/file/d/1i3oTZIRu81sExDp8Qf_K7e6Ygx2l1gOr/view
4. Technical Considerations & Dependencies
5. QA Plan:
SAFER Guide for CDS: Safety checklist
The US HealthIT program’s “SAFER Guides” offer a checklist to review to ensure you minimize CDS risks in your EMR. It’s designed for hospital administrators to double-check their implementation, but we can use some of the Recommended Practices to guide us.
We will rely heavily on this guideline: (link/source)
Additional SAFER Guides to review for CDS-relevant Safety insights
High Priority Practices: https://www.healthit.gov/sites/default/files/safer/guides/safer_high_priority_practices.pdf
System Interfaces: https://www.healthit.gov/sites/default/files/safer/guides/safer_system_interfaces.pdf
System Configuration: https://www.healthit.gov/sites/default/files/safer/guides/safer_system_configuration.pdf
TBC: The plan for QA, such as how we will discover and address edge cases
TBC: Plan for automated tests to be added to new components (unit tests) or workflows (e2e tests)
6. Safety & Tech Risks
TBC: Is there any reason you could regret rolling out this feature? (e.g. possible patient harm, heavy tech debt like introducing an unsupported library)
TBC: Have you thought through the risks for this particular solution? And, how to reduce/address those?
Hierarchy/Subsumption: Bahmni’s Lesson: You need subsumpsion: Say “not just this concept, but anything that might be subsumed under that conept” so you don’t have to consider every possible code. (SNOMED GPS doesnt offer hierarchy.) May need to specify what sub-components are relevant.
BUT: Mappings can be wrong → means CDS calculation can end up being very wrong. How is this handled?
One approach: “Rule isn’t doing anything, just notifying” → Need workflow to signal “I’ve seen and will review/make a decision”.
Justification: Show exactly how or why that result was obtained. (REQUIRED.) May include Level of Evidence.
BUT: Need to handle smaller than/greater than. Is SAME-AS always appropriate?
Expiry Dates / Acceptable Time Frame: Of input data; Of rule. E.g. if chest pain was reported 2 years ago, shouldn’t be part of a rule today. If Pre-ecclampsia risk in previous pregnancy, shouldn’t show today.
“The Curly Brace Problem” from Arden Syntax
How to Handle Missing Data, Sparse Data: If there’s no data for something (e.g. a missing VS), or you don’t have a lot of data points for a patient or population, how will you handle that?