Menu

Flummoxed by cds rule logic

2016-01-29
2016-02-12
  • Harley Tuck

    Harley Tuck - 2016-01-29

    Hi Folks-

    Can somebody please explain the logic behind the filters and criteria in the Rule Detail panel? I've been studying the existing rules but they don't seem to apply very directly.

    I'm trying to make a rule that pops an active alert if a pt's allergies issue still has the original "[checkbox] None" showing. I figure that looking in lists_touch.type to see if 'allergies' does NOT appear captures what I'm looking for.

    One of the most promising setups I've tried is:

    Demographics filter criteria:
    Criteria Characteristics Requirements
    lists_touch.type Required Exclusion Value: allergy | Frequency: = 0
    Target/ Action Groups:
    No Clinical Targets
    Actions: Assessment: (I added item "ALLERGIES NOT ASSESSED" to Clinical Rule Action Item list)

    However, that particular arrangement doesn't trigger on anybody's record. Other permutations I've tried have all failed in various ways.

    My understanding is that the Demographics filter determines, "if this person has this condition"
    The Clinical Target is what to look for to know that the alert has been satisfied
    Actions is what sort of activity to tell the user to do.
    What really throws me is the "optional/ inclusion" "yes/ no" thing

    Ideas?

    Thanks- Harley

     
  • Brady Miller

    Brady Miller - 2016-01-29

    Hi Harley,

    Don't set a filter. Instead just set a target(see attached). This will work but you will have an issue with the interval in future; this a bug and the gui should support adding a target without a interval. After you create the rule, you can remove the interval setting manually from the rule_target sql table. The row that need to be removed is highlighted in screenshot below.

    It appears the GUI rule editor has flip flopped the Option/Required setting. This setting correlates with the required_flag in both the rule_target and rule_filter tables(note the comment of the sql row also appears to be flip flopped; 1 should means required and 0 should mean optional). This setting solves the problem when there are multiple filter items or target items. When it is set to 1, then that filter or target is required to pass (for example, if there are two elements in a target and both need to be there, then would set this to 1; a good example if a blood pressure where need the systolic BP and diastolic BP columns to be populated). When it is set to 0, then that filter or target is not required itself to pass, but only one of them is required to pass(a good example of this is when filtering through 20 ICD10 codes; in this case only 1 is needed to pass(ie. considered optional))(another good example if when looking for immunization targets where there are several possible targets(ie. CVX codes), but only 1 needs to be positive). Recommend doing a quick glance through the rule_filters and rule_target sql tables and it will make things much more clear.

    It appears three easy to fix bugs are apparent from looking at this:
    1. The Rules GUI for the targets should give option of not setting a Interval.
    2. The Rules GUI for the filters and targets should flip/flop the Required/Optional settings.
    3. The sql comments for the required_flag sql row in the rule_target and rule_filters sql tables should be flip flopped(I am guessing this is what originally threw off Aaron when he wrote the GUI rule editor).

    Any developers want to take this on? It would be a moderately easy(and small) project.

    -brady
    OpenEMR

     

    Last edit: Brady Miller 2016-01-29
    • Harley Tuck

      Harley Tuck - 2016-02-01

      Hi Brady-

      Thnks for the detailed response but it didn't work for me.
      I went in and deleted target_interval for my rule. With no demogs filter criteria, and the target set per your pic, I get an alert every time I pull up any pt, no matter if they have any allergy entry (including OpenEMR's "None" or NewCrop's variations on "NKDA") in their issues or the original "[checkbox] None".

      I set the allergy frequency to " = 0" and I get no popups on any pt.

      Taking a different approach, I see that the pt summary page right column's "Allergies" widget says "Nothing Recorded" until an entry is made. Where does that widget get its information? I could just have my rule look there.
      - HT

       
  • Art Eaton

    Art Eaton - 2016-01-30

    I'll gladly hit it. It seems like a pretty trivial bit of code that would reduce a lot of confusion...and tis the season for this stuff.
    I need to actually do some stuff with the code base on this for extra familiarization. The pieces (cdr, cqm, and all the different and sometimes oddly or legacy named stuff like PQRI) are pretty scattered and it is hard to follow when just diving in.
    I have a long way to go before I am able to use OpenEMR to do 9 measure groups of PQRS (And later MIPS) for any of the billion individual measures...and in a comprehensive way.

     
  • Tony McCormick

    Tony McCormick - 2016-02-02

    Nothing Recorded means that there are no records for allergies OR that the NONE check box has not been checked. Clicking None writes a record to the list_touch table

     
  • Art Eaton

    Art Eaton - 2016-02-09

    Havn't abandoned this bit, just doing a LOT of stuff with the rules engine at the moment.

     
  • Art Eaton

    Art Eaton - 2016-02-10

    Big huge disasterous issues with Rules:
    First..just a funny one...It is supposed to be NQF, not NFQ.

    Second, wanna make the rules run twice as fast as it does right now, and enjoy an environment where (currently) you can't easily destroy the whole system by renaming a calendar category from "Office Visit" to something else?
    Well, instead of the elaborate joins to look up calendar categories and search up strings that might be changed, you can simply use the facility location code (POS="11" for office visit) from the billing line item.
    Viola: Utter dependability, and a huge speed improvement!

    -I have found about a dozen different places to massively improve the queries for rules.

     
  • Tony McCormick

    Tony McCormick - 2016-02-11

    Place of Service code ... a USA standard since 1972 I think :-)

     
  • Art Eaton

    Art Eaton - 2016-02-12

    Should be good for backwards compatibility then.

     

Log in to post a comment.