Decision Model “Patient Therapy”

Building Decision Model in Excel
Testing Decision Model

Business Logic

This decision model specifies decision logic for helping a doctor to determine a patient therapy after the doctor determined that the patient has Acute Sinusitis. Here are the medical guidelines for this case.

Medication Rules:
If Patient is 18 years old or older, then a therapy choice is Amoxicillin.
If Patient is younger than 18, a therapy choice is Cefuroxime.
If Patient Penicillin allergic, the therapy of choice is Levofloxacin.

Dosing Rules:
For patients between 15 and 60, the dose is 500mg every 24 hours for 14 days.
If Patient’s creatinine level (PCr) > 1.4, commence creatinine clearance (CCr) calculations according to the formula:If Patient’s creatinine clearance < 50 ml/min, then the dose is 250 mg every 24 hours for 14 days.

Drug Interaction Rules:
Check if a patient on active medication. Coumadin and Levofloxacin can result in reduced effectiveness of Coumadin. Produce the proper warning.

Building Decision Model in Excel

  1. The ultimate goal “Patient Therapy” can be presented in the decision table “DeterminePatientTherapy”:

The condition in the first allows us to limit our decision model to the Encounter Diagnosis “Acute Sinusitis” only. From the definition of the Patient Therapy we may conclude that we need to specify 3 sub-goals:

  • Recommended Medication
  • Recommended Dose
  • Drug Interaction Warning

2. To specify the sub-goal “Recommended Medication” we can use the following decision table:

This table of the type “Decision” by executing all satisfied rules allows us to override a recommended medication if the patient is allergic to Penicillin. 

3. To specify the sub-goal “Recommended Dose” we can use the following decision table:

While Patient Age and Patient Creatinine Level should be known, to define Recommended Dose we need first to calculate Patient Creatinine Clearance using the above formula.  It can be done using the following unconditional table:

4. And finally we can define “Drug Interaction Warning” using the following decision table:

We placed all these 4 decision tables in the file “rules/Rules.xls”.

To complete our decision model we need to put all decision variables (goals and input variables used in the above tables) in one Glossary :

The glossary is located in the file “rules/Glossary.xls”.

Testing Decision Model

Test cases with expected results defined in this table:

We placed this table in the file “rules/Test.xls”.

We also created the file “rules/DecisionModel.xls” that contains only one table of teh type “Environment” that tells OpenRules where all related files are located:

To execute these test-cases, we should adjust the standard file ““:

To execute our test-cases, we may simply double-click on the standard bat-files test.bat that will automatically determine all dependencies within the decision model, transforms the model in the executable code, and execute the model against all test-cases. Here are the execution results  results for the last test-case:

Here is the automatically generated HTML report that explains which rules were actually executed and why: