Drools at Intermountain Healthcare. Herman Post Homer Warner Center 5/9/2011



Similar documents
Open Source Business Rules Management System Enables Active Decisions

Integration of an open source rule engine to enhance the IHTSDO Workbench testing

Rules and Business Rules

Drools Complex Event Processing with Twitter4J. Toshiya Kobayashi Red Hat Senior Software Maintenance Engineer

Clinical Decision Support Systems An Open Source Perspective

Semantic Business Process Management

BUSINESS RULES CONCEPTS... 2 BUSINESS RULE ENGINE ARCHITECTURE By using the RETE Algorithm Benefits of RETE Algorithm...

A methodology for graphical modeling of business rules

SQL Databases Course. by Applied Technology Research Center. This course provides training for MySQL, Oracle, SQL Server and PostgreSQL databases.

Find the Information That Matters. Visualize Your Data, Your Way. Scalable, Flexible, Global Enterprise Ready

Monitoring BPMN-Processes with Rules in a Distributed Environment

Next-Generation ESB. Kevin Conner SOA Platform Architect, Red Hat Keith Babo JBoss ESB Project Lead, Red Hat. June 23rd, 2010

G-Cloud Framework. Service Definition. Oracle Fusion Middleware Design and Implementation

A Service Oriented Approach for Guidelines-based Clinical Decision Support using BPMN

Requirements Specifications for: The Management Action Record System (MARS) for the African Development Bank

Flexible Engineering Process Automation Process: Continuous Integration & Test

JBOSS ENTERPRISE SOA PLATFORM AND JBOSS ENTERPRISE DATA SERVICES PLATFORM VALUE PROPOSITION AND DIFFERENTIATION

Business Application Services Testing

Oracle Service Bus Examples and Tutorials

DEPLOYMENT ARCHITECTURE FOR JAVA ENVIRONMENTS

1 Copyright 2011, Oracle and/or its affiliates. All rights reserved.

A standards-based approach to application integration

Monitoring BPMN-Processes with Rules in a Distributed Environment

Experiences with Open-Source BPM/SOA-based Stack using Java EE Rok Povše, Matjaž B. Jurič

Software Architecture Document

Koen Aers JBoss, a division of Red Hat jbpm GPD Lead

Automated Data Ingestion. Bernhard Disselhoff Enterprise Sales Engineer

Data processing goes big

Programming Without a Call Stack: Event-driven Architectures

Oracle SOA Suite: The Evaluation from 10g to 11g

DataDirect XQuery Technical Overview

<Insert Picture Here> Increasing the Effectiveness and Efficiency of SOA through Governance

IBM WebSphere ILOG Rules for.net

How To Write A Composition Engine In A Microsoft Ip System

FINANCIAL SERVICES: FRAUD MANAGEMENT A solution showcase

Oracle Database: SQL and PL/SQL Fundamentals NEW

Open Source egovernment Reference Architecture Osera.modeldriven.org. Copyright 2006 Data Access Technologies, Inc. Slide 1

An Oracle White Paper October Maximize the Benefits of Oracle SOA Suite 11g with Oracle Service Bus

Adam Rauch Partner, LabKey Software Extending LabKey Server Part 1: Retrieving and Presenting Data

Business-Driven Software Engineering Lecture 3 Foundations of Processes

Open source business rules management system

<Insert Picture Here> Extending Hyperion BI with the Oracle BI Server

Frequently Asked Questions Plus What s New for CA Application Performance Management 9.7

GAIN BETTER INSIGHT FROM BIG DATA USING JBOSS DATA VIRTUALIZATION

Building a Modular Server Platform with OSGi. Dileepa Jayakody Software Engineer SSWSO2 Inc.

Unified Batch & Stream Processing Platform

Oracle Service Bus: - When to use, where to use and when not to use

Oracle Service Bus vs. Oracle Enterprise Service Bus vs. BPEL wann soll welche Komponente eingesetzt werden?

SERVICE ORIENTED ARCHITECTURE

INTRODUCTION TO BUSINESS PROCESS MODELING NOTATION BPMN 1.2 AND BPMN 2.0

Rule based programming with Drools

Guiding Principles for Technical Architecture

Oracle Business Activity Monitoring 11g New Features

Magnus Larsson Callista Enterprise AB

Enterprise Informatization LECTURE

Tech Note. TrakCel in the wider Clinical Ecosystem: Accelerating Integration and Automation

Glassbox: Open Source and Automated Application Troubleshooting. Ron Bodkin Glassbox Project Leader

c 2013 IFIP

What's new in Decision Management and BPM?

SOLUTION BRIEF. JUST THE FAQs: Moving Big Data with Bulk Load.

ORACLE SOA SUITE. Product Overview

Oracle SOA Suite Then and Now:

Oracle Database: SQL and PL/SQL Fundamentals NEW

Service Oriented Data Management

D61830GC30. MySQL for Developers. Summary. Introduction. Prerequisites. At Course completion After completing this course, students will be able to:

Patent Public Advisory Committee Meeting PE2E Status. David Landrith Patents Portfolio Manager July 14, 2011

Federated, Generic Configuration Management for Engineering Data

Enterprise Service Bus

WELCOME TO Open Source Enterprise Architecture

CERTIFIED MULESOFT DEVELOPER EXAM. Preparation Guide

<Insert Picture Here> Java EE 7. Linda DeMichiel Java EE Platform Lead

Quick start. A project with SpagoBI 3.x

2012 LABVANTAGE Solutions, Inc. All Rights Reserved.

Operational Decision Manager and IBM

Databricks. A Primer

1 What Are Web Services?

TRANSFORM BIG DATA INTO ACTIONABLE INFORMATION

Oracle Data Integrator 11g New Features & OBIEE Integration. Presented by: Arun K. Chaturvedi Business Intelligence Consultant/Architect

JBoss Enterprise Middleware

1 What Are Web Services?

Creating new university management software by methodologies of Service Oriented Architecture (SOA)

Complex Event Processing (CEP) - A Primer

Papermule Workflow. Workflow and Asset Management Software. Papermule Ltd

Cloud Computing and Advanced Relationship Analytics

Creating a Simple Business Collaboration Scenario With a BPMS

MatchPoint Technical Features Tutorial Colygon AG Version 1.0

S o l u t i o n O v e r v i e w. Turbo-charging Demand Response Programs with Operational Intelligence from Vitria

Integration in Action using JBoss Middleware. Ashokraj Natarajan - Cognizant

JBOSS ENTERPRISE APPLICATION PLATFORM MIGRATION GUIDELINES

Transcription:

Drools at Intermountain Healthcare Herman Post Homer Warner Center 5/9/2011

What is Drools? Drools is a Business Logic Integration Platform which provides a unified and integrated platform for Rules, Workflow and Event Processing. Currently represents 4 types of logic: Expert System production rules system Workflow or BPMN2 Complex Event Processing (CEP) Solver network, scheduling based problems

Drools Tools Guvnor web based BRMS, authoring, testing, versioning, security, repository Eclipse plugins rules, BPMN Decision tables map to rules Domain Specific Language (DSL)

What is Drools? Open source (Apache License) started in 2001 under SourceForge Drools federated under JBoss in 2005, JBoss acquired by RedHat 2006 (Linux distro) JBoss Rules is commercially supported version of Drools Testing, training, support Drools core team of 5 supported by JBoss, managed as open source project Drools has 2 independently published books this year

Drools Resources http://www.jboss.org/drools/ Documenation http://www.jboss.org/drools/documentation.html Downloads documentation (5.0) Best source start with Expert Blog releases, significant info http://blog.athico.com/ Forum very active, good info http://www.nabble.com/drools---userf11823.html Wiki see Articles, Tips, Tricks & FAQ

Expert Drools Rules Production Rules System Roots in Artificial Intelligence from 1970 s Early systems include MYCIN Stanford U., diagnosis of bacterial infections; 500 rules diagnosing 100 infections XCON Carnegie Mellon, used by DEC for many years for complex systems configuration (VAX) Derivative of CLIPS, JESS Model human reasoning Handle 100,000 s of rules efficiently Rete algorythm

Production Rule The term "Production Rule" originates from formal grammar - where it is described as "an abstract structure that describes a formal language precisely, i.e., a set of rules that mathematically delineates a (usually infinite) set of finite-length strings over a (usually finite) alphabet" (wikipedia). <integer> ::= ['-'] <digit> {<digit>} <digit> ::= '0' '1' '2' '3' '4' '5' '6' '7' '8' '9' What does this have to do with Drools? When <condition> Then <actions>

Production Rule A Production Rule System is Turing Complete with a focus on knowledge representation to express propositional and first order logic in a concise, nonambiguous and declarative manner. The brain of a Production Rules System is an Inference Engine that is able to scale to a large number of rules and facts. The Inference Engine matches facts and data against Production Rules - also called Productions or just Rules - to infer conclusions which result in actions. A Production Rule is a two-part structure using First Order Logic for knowledge representation. (from Drools Expert)

Production System

Forward Chaining

Sample Rule rule "Glucose <= 40, Insulin On" when then $msg : GlucoseMsg(glucoseFinding <= 40, currentinsulindrip > 0 ) glucoseprotocolresult.setinstruction(glucoseinstructions.glucose _LESS_THAN_40_INSULIN_ON_MSG); end

Rule Semantics When <one or more facts in Working Memory, or data from external sources, matches this rule> Then <update, insert or retract some facts in Working Memory>

Advantages of Rules Engine Declarative Programming what not how First Order Logic without imperative language (1.3.1) Logic and Data Separation Loose coupling of business logic and applications Speed and Scalability Centralization of Knowledge Knowledge Engineering Tools Understandable Rules Common Rule Syntax (shareable) (from Drools Expert 1.2.1)

Drools Guvnor Business Rules Management System (BRMS) Knowledge asset repository Versioning, build and package Security Authoring Guided rules, models Test scenarios, analysis, justification Decision tables Domain Specific Language (DSL) Eclipse integration

Drools Workflow jbpm5 JBoss merger of two workflow solutions: Drools Workflow and JBoss jbpm5 Business Process Management Notation 2 (BPMN2) JBoss Busness Process Management 5 (jbpm5) Drools source moved to jbpm project Runtime still integrated into Drools Process Engine

Drools jbpm5 Drools Flow is a workflow or process engine that allows advanced integration of processes and rules. end business users struggle understanding the differences between rules and processes, and more recently rules and event processing. For them they have this problem in their mind and they just want to model it using some software. (Flow documentation)

Drools Flow Features Sequencing of Rule groups rules and flow seamlessly integrated Processes anything you want (in code) WS HumanTask 1.0 implementation http://download.boulder.ibm.com/ibmdl/pub/soft ware/dw/specs/ws-bpel4people/ws- HumanTask_v1.pdf Doman specific Workitems preconfigured Processes that appear as tools Sub-flows

Drools BPM Features Timers Internal and external events Branching Logic Drag&drop authoring Process Management Console (5.1) http://blog.athico.com/2009_05_01_archive.html Eclipse Human Task Plugin

BPM Features Explicit, declarative, stateful programming model Trend towards stateless, simplified programming REST, Spring Do we sometimes force state onto clients just to make our services stateless? Some problems are stateful Long running clinical protocols Current Foresight model state is protocol dependent stack of AlertEvents each protocol is unique BPM is an explicit model for stateful programming all problems have the same toolset, look the same

Drools BPM

Drools Fusion " Complex Event Processing, or CEP, is primarily an event processing concept that deals with the task of processing multiple events with the goal of identifying the meaningful events within the event cloud. CEP employs techniques such as detection of complex patterns of many events, event correlation and abstraction, event hierarchies, and relationships between events such as causality, membership, and timing, and event-driven processes." -- wikipedia

Drools Fusion Support Events, with their proper semantics, as first class citizens. Allow detection, correlation, aggregation and composition of events. Support processing of Streams of events. Support temporal constraints in order to model the temporal relationships between events. Support sliding windows of interesting events. Support a session scoped unified clock. Support the required volumes of events for CEP use cases. Support to (re)active rules. Support adapters for event input into the engine (pipeline). (Fusion documentation)

Fusion Temporal Reasoning [ALLEN81] Allen, J.F.. An Interval-based Representation of Temporal Knowledge. 1981. [ALLEN83] Allen, J.F.. Maintaining knowledge about temporal intervals. 1983. Drools implements all 13 operators defined by Allen and also their logical complement (negation). This section details each of the operators and their parameters. After, before, coincides, during, finishes, finished by, includes, meets, met by, overlaps, overlapped by, starts, started by

Current CDS at Intermountain Foresight System Rule triggering Data normalization Rule execution Alert distribution abandoned BlazeDS due to cost, limitations currently Java based rules in Knowledge Repository

Drools anticipated advantages Rule accessibility by clinicians BPMN, decision tables, DSL; collaborative authoring Inference engine for certain types of problems Knowledge Sharing - common rule representation or translation Declarative programming BPMN represents an explicit, declarative stateful programming model Authoring by domain experts Tight integration of rules and workflow

Current Drools Projects at Intermountain Screening Framework (in production) Bayesian based diagnostic rules Drools for data acquistion, data filtering, data transformation, activation, alerting, acknowledgement Mothers to be survey rules Analytics Health Repository POC L2 to L3 create cohorts for diabetes, depression, Charlson comorbidity index ICU Sepsis Protocol POC Rivers Protocol for severe sepsis, septic shock

Drools current directions Vet out BPM for long running protocols Clinician accessibility, collaborative authoring Runtime model Performance, scalability, resource util., high availability Rapid development model UI integration with Human Task Integration of alternate inferencing models Bayesian, etc

Intermountain/Drools current directions Drools Knitting Group collaboration with UofU, opencds (Kamamoto), Socratic Grid (Fry) Intermountain Drools Framework CDS as service API (opencds?) Common Fact Model (CEM based?) Common rule output (AlertEvent?) Guvnor based repository Datadrive, Timedrive and synchronous access State management UI association to Human Tasks Protocol testing autogen TestUI; data-driven unit tests

Drools Knitting Group Analytics Health Repository POC 4/15/2011

Analytics Health Repository (AHR) Sub group in Intermountain EDW team AHR L2 scrubbed EDW data AHR L3 derived cohorts such as episode of depression, diabetes Currently using PL/SQL Drools Proof of Concept Demonstrate that Drools can be used to produce L3 cohorts in an efficient, accessible, re-useable manner Use of authoring tools by non-programmers

Problem We implemented the first AHR Problem-based depression rule (#3) using Drools. The goal of this rule is to group depression related Problems into episodes, where an episode is defined as a sequence of problems where no two consecutive problems are more than 12 months apart. A patient may have multiple episodes of depression.

POC Workflow Our approach was to use Java and JDBC to read all Problems from AHR L2 for all patients using Java and JDBC. We then group the problems by patient and insert them into a Drools KnowledgeSession. The Drools rules then do the following: Identify all depression related problems and insert them into Working Memory Indentify the oldest Depression Problem and add it to a new Episode in Working Memory Cycle through any other Depression Problems in chronilogical order and add to the current Episode if within 12 months Close the current Episode and create a new Episode if there are remaining Depression Problems When the rules have created Episodes for all patients they are then written to a Morbidity table in a development database that is similar to the AHR L3 Morbidity table

/* Identify DepressionProblems from all Problems and place in WorkingMemory. Test problemtype against global HashSet and test certainty against implict list. */ rule "Identifiy Depression Problems" salience 100 no-loop when $p : Problem( problemtype memberof depressiontypes, certainty memberof ( certaintytypes )) then end insert(new DepressionProblem($p));

rule "Insert a new Episode with the oldest Depression Problem" when not Episode() $episodes : Episodes() $deprob : DepressionProblem( $problemdate : recordeddate ) not DepressionProblem( recordeddate < $problemdate ) then Episode e = new Episode(); e.setinitdate($deprob.getrecordeddate()); e.settermdate(addmonths($deprob.getrecordeddate(), 12)); e.setempi($deprob.getempi()); insert(e); retract($deprob); $episodes.getlist().add(e); end

rule "Update Episode with chained Problems" when $e : Episode() $deprob : DepressionProblem( $problemdate : recordeddate ) not DepressionProblem( recordeddate < $problemdate ) eval(($e.gettermdate().gettime()) >= ($problemdate.gettime())) then $e.settermdate(addmonths($problemdate, 12)); retract($deprob); end

rule "Remove Episode when no more chained Problems" when $e : Episode() $deprob : DepressionProblem( $problemdate : recordeddate ) not DepressionProblem( recordeddate < $problemdate ) eval($e.gettermdate().gettime() < $problemdate.gettime()) then retract($e); end

Outcome For the Drools implementation, the AHR-L2 problems were read from the EDW Oracle database. The Java code used to read and write the data, and Drools Rules were run from a developer s laptop. The episode data was written to a MySql database deployed on a Windows 2003 Server. The AHR PL-Sql implemenation runs entirely on the EDW Oracle database server. Rows Read Rows Written 1 Total Time (secs) AHR PL Sql 74945 73,364 100 Drools 157,291 2 73,364 178 1 - A row corresponds to one Episode of depression for a patient. 2 - The Drools implementation reads all Problem data in order to apply filter criteria in the rule rather than the query. This strategy will enable reuse of the Problem rule session for future applications.

Lessons Learned Minimize Java code outside of KnowledgeSession insert all Problems into WM Issues related to a shared KnowledgeSession among multiple rule writers. Facts should be immutable and preserved Derived knowledge should be preserved and published (Episodes and DepressionProblems)

Lessons Learned Use of fact inheritance, requires no-loop oldest logic pattern for Episodes Lack of else construct, must use complementary rule All three of us had similar implementations