CDR Engine

bradymiller wrote on Thursday, August 02, 2012:

Hi,

In the last conference call, there was interest in improving the CDR engine, especially in regards to allowing per-patient custom rules. Placed these potential projects into the wiki Active Project page:
http://www.open-emr.org/wiki/index.php/Active_Projects#Clinical_Decision_Rules_.28CDR.29_Engine

Sounds like MI2 will take on the first three (and maybe the last one :slight_smile: ). Regarding the first one, my proposal seems to be a good way to set up the back-end for per-patient custom rules (I am sure a couple things will come up in the engine when doing this, but should be able to get up and working with minimal resources; note gui elements will need to be built around it, though, which will likely be where the majority of the resources will go towards).

-brady
OpenEMR

aethelwulffe wrote on Friday, August 24, 2012:

I am providing some input from a *somewhat* non-technical standpoint.

Introduction:
A requirement for a workflow system, a multi-level provider scheme, and other functions to be implemented in OpenEMR came up with the following observations:
1.  The existing CDR engine can be expanded and refined to provide access control and perform administrative task automation for both patient care and user access.  This would be more than a “Clinical Decision Rules” system, but I’ll keep that term for this discussion.
2.  The ACL system, while we barely tap the power of it, is not really designed to be the basis of a CDR engine, but the CDR engine may be able to take over it’s role.
The basic ideas follow:
Access control
A user logs in.  The users access checks, as well as global practice/clinic-level variables are checked via admin configured rules (much as the existing ACL system does), yet is equipped with much more comprehensive access elements than the current system comes equipped with.  The administrator configures the access rules for the user are configured via a GUI that does not require hard-coded access checks in every file in the code, allowing much better control and user configuration.  Access to reports etc… is controlled as you might expect.  Then it gets weird.  Access to patients is controlled by a CDR cross-check.  This could make it so that a provider only has access to patients assigned to them, probably via the patient demographics.  Access could be restricted by provider, squad, or level of the provider using a configured patient data target.

Patient Workflow requirements
  Patients can have rules assigned to them by program, insurance variables, individual configuration, diagnosis code in the “issues” system, or from a treatment plan form (or all of the above).  If the CDR engine has this data, it can be used to send dated reminders, create appointments for the patient or their provider, send messages (including using the Alerts system) and other administrative functions that require admin assistants many hours.  It can also set prerequisites, such as not permitting billing to be entered or visits to be scheduled when some prerequisite has not been fulfilled.  These elements are the basis of both basic business workflow, as well as a plan based treatment system.  Many of the intents and defined Meaningful Use standards seem to be pointing to exactly this sort of capability.

One of the remaining questions is how the rules are configured at the individual patient level.  The best suggestion seems to be to configure via forms, such as a Treatment Plan form, either as an encounter form or otherwise.

I have identified a few development goals that I think can help achieve this.  The B.O.D. of OEMR and attending members of the community have discussed a few of the following:

The following upgrades to the CDR engine may help provide workflow, specialty and treatment plan functionality in OpenEMR:

1.  Full GUI configuration of rules.  Currently, full configuration and expansion of the existing capabilities can only be achieved via code.

2.  CDR/ACL interface.  Throughout the EMR code, instances of acl checks can be replaced to simply check access as per the CDR system.  This allows:
     a.  Per Patient, per patient group or program, and per user checks for access control at every level, configured via the CDR GUI.
     b.  Checks against workflow requisites to be made by the same call against the CDR to ensure that the user has not bypassed a workflow element.
     c.  A simplification of the ACL checks in the code.
     d.  Multi-level providers/users to be configured via a practice-wide CDR rule.
     e.  Possibly supercede the ACL system, as the CDR would need to perform many of the same functions anyway.
     f.  Allow the Rules to essentially control the user session variables, compressing the expansiveness of the code and streamlining the approach.

3.  CDR functionality added for Calender appointment checks/creation/interface.

4.  CDR interface with an upgraded “issues” system to allow configured issue categories to allow that legacy system to be used to determine elements in a patients treatment plan or treatment protocol.  “Issues” may need an expansion or supplement in the form of a Treatment Plan form.  (final configuration of this needs more discussion, my arguments based on Mental Health and Behavioral Health having already been presented).

5.  CDR interface (depending on issues discussed in the introduction) with accounts receivable/billing activity to allow reminders, messages and calender provider/patient appointments to auto-populate based on configured requirements.  _EXAMPLE:  As per a Medicaid prepaid counseling program, a patient must have a Treatment Plan completed 45 days after the first billable service.  When the first billable service is completed, the rule must then create a dated reminder for the patient’s assigned counseling provider (demographics field).  The dated reminder system MIGHT expanded to check for an encounter that completes the plan, but even without it, the CDR could restrict access and not permit another billable service to be entered without the treatment plan being in the system.  When the plan is complete, another rule takes over to identify the date at which the plan review is due…and so on.
_
Performance of the system while running the CDR engine in this manner has been discussed.  Despite the issues with running reporting for meaningful use, the actual CDR portion does not seem to have the issues that other bits of the meaningful use “package” does.

Thanks for listening
-Art

bradymiller wrote on Monday, August 27, 2012:

Hi,

Regarding the combination of CDR and access controls, never remember discussing this topic. No need to use CDR for this; can always build upon the current ACL system (for example, if want to track protected stuff via the database rather than hard-coding in files). Could even guard each rule if wanted (by making a *_acl table that mapped rules to acl groups in a 1 to many function). There is a HUGE amount of room for the current access control to grow; nobody seems to really touch this because of the apparent complexity. Something that is really needed is a gacl upgrade script that is delimited into versions (such as the current sql_upgrade.php script) to avoid reversings a users customizations.

Configuring of the rules at the patient level is described here:
http://open-emr.org/wiki/index.php/Active_Projects#Add_mechanism_to_allow_patient_specific_rules_and_plans
(note the backend part of this will need to be supported by gui elements, such as the Treatment Plan form)

Regarding numbered issues above:
1. Agreed. Placed things that need to added to gui here:
http://open-emr.org/wiki/index.php/Active_Projects#Integrate_Plans_into_the_Admin_GUI
http://open-emr.org/wiki/index.php/Active_Projects#Integrate_Procedures_into_the_Admin_GUI

2. As discussed above.

3. Agreed. Placed specifics on active projects screen here:
http://open-emr.org/wiki/index.php/Active_Projects#Integrate_clinic_appointments_into_the_CDR_engine_and_Admin_GUI

4. Current CDR engine already works with custom Issues, however the admin GUI would need to be modified to support this.

5. Probably don’t need to complicate by creating Dated Reminders since the CDR already creates reminders. Regarding the interface, again, suggest figuring out what you specifically need, which will then drive:
a. the gui elements
b. the rules to place in the cdr engine

-brady
OpenEMR

aethelwulffe wrote on Monday, August 27, 2012:

On #1: 
I’ll get a list of patient rules and targets together for stuff I can think of, and we can add to it to ensure the bases are covered.  My reservation is that we have come up with this idea that we need patient level rules, yet we have not put heads together and challenged that premise.  It sounds reasonable/logical, but we should play the devil’s advocate.  I would like to put this to a forum discussion, starting with tomorrow’s meeting.  I don’t know enough about the system mechanic to say if doing this requires a separate layer of logic in the code, or if it only requires a new way of thinking about the existing system.

#2:
  No, we didn’t discuss this in forum, and I was mostly throwing it out there, as enhanced access control is a very much desired feature…and not just for mental health.  I’ve just been thinking that the CDR engine will be making user, patient, and clinic rules checks to support workflow prerequisites, so does it check a rule, then check the ACL, or is not the rule enough?.  The line kinda blurs to my thinking.  Obviously, if the two work together, lines must be determined as to when one takes over, and there might be some of the old “mom said ask you” deadlocks happening.
  I discussed something like this with Tony a couple of weeks ago.  Hopefully he can provide some input here as well.

#3:
  I hope THIS item is as straightforward as it seems!

#4
I think we may also need to discuss where the “issues” function is at, what it was intended to be, and what we should make of it in a workflow system.  Seems like it is something that could be heavily tapped for a lot of functionality.

#5
Agreed.  At this point, I have not seen a CDR reminder, so I am using my imagination.  These days, people expect any communication medium to be pretty robust and intuitive (damn them), but we need some discipline in regards to what a CDR reminder is, and what it isn’t.  On the other hand, I would like to see the CDR engine configurable to push stuff just about anywhere in the system, even if it just has a feature that looks for add-on scripts that let it do so.

Thanks Brady.  I am going to have tons of questions to bounce off you guys.

bradymiller wrote on Tuesday, August 28, 2012:

Hi,

1. Custom patient rules would be meaningful and this can be illustrated with a simple example. Currently, openemr has a coumadin rule where if a patient is on coumadin, then the rule ensures a INR is drawn every 4 weeks. The rule can be turned on/off per patient, however it can not be further modified (for example, some patients have labile INR’s and get weekly INR’s while some are rock stable and may got to a every 2-3 month plan). Rather than thinking of this as a rule, can think of it more as a template. It would be the ‘Coumadin Management - INR Monitoring Template’ and as described in the wiki section below, could be built into the current rule engine (if choose this template for a patient, then the template would be cloned as a new rule only for that patient, which would essentially allow full customization of that rule; so could use whatever timeframe that was clinically applicable to monitor a patient’s INR - and since the original template identifier is left in the rule as a “hook”, it will always have an applicable name when displaying/modifiying/reporting):
http://open-emr.org/wiki/index.php/Active_Projects#Add_mechanism_to_allow_patient_specific_rules_and_plans
(This is how to get it into the back end (ie. database) and initial thoughts on getting the backend code/fx to work with it; I predict initially that some wheels may go flying in unpredictable directions, but should be manageable; most of the work will come into designing the gui and specific underlying template/templating functions)

2. Regarding access control, the current gacl mechanism that is in place is only being utilized to about 1% of its capabilities with a very small number of aco’s; in comparison Vista has hundreds and hundreds of “keys” for access control. If we run into an issue where a rule/template is specific to a certain group, then can just map it one to many to access control groups via a database tables, but just guessing. I think this type of thing will be best to work out after a substantial amount of work has been completed.

4. Placed a section on the Active Projects regarding the “issues” functions:
http://open-emr.org/wiki/index.php/Active_Projects#Integrate_support_for_custom_issue_categories_into_the_Admin_GUI

5. At this point the CDR patient reminders only work for email and in theory voice (via the Maviq thing that I am very confident does not work), while the clinical reminders are real time messages to users. But easy for anybody to come along and add more routes of contact along with hooks to other elements in OpenEMR.

Looking forward to seeing a list of rules/templates/features that you are trying to get at. Then will be much more tangible to come up with practical solutions.

-brady

aethelwulffe wrote on Thursday, October 11, 2012:

http://www.open-emr.org/wiki/index.php/ … .29_Engine

Brady had undertaken converting the essence of the active treatment plan system supporting mental health etc… into some hard specifications for improving the CDR engine. While I cannot verify how comprehensive these specifications are and how completely they satisfy the sample end use criteria, Brady (and the rest of us) seemed to very much be on the same page during the discussion so I well imagine that the specs listed in the link above represent a very good start.
While simple rule of thumb project management dictates that anything we do that does not have an alpha-omega implementation plan will require revision or augmentation, these specifications are for improvements to a background engine, and seem to have obvious merit in their own right. Funding further development of the CDR will improve the whole project greatly on many levels.

From our discussions, specific implementations of this engine will be achieved using forms that use the engine functions. Those forms will need to be planned, designed and funded as a stage 2 or stage 3. Concurrent or immediately after base engine development we will need some sort of test implementation. Hopefully we can either use previously posted specifications for behavioral health treatment plans, or a general treatment plan form and interface for proof of concept and test purposes. If there is some other specific application that might better serve some Stage 2 meaningful use goal, please advise.

Jack has laid out a very comprehensive set of specifications here for a variety of needs. We should be able to use his lists and set development priorities using them here:  http://www.oemr.org/phpBB3/viewtopic.php?f=33&t=139&p=938#p938