Skip to content

mauriziocarioli/PHM-Processes

Repository files navigation

Population Health Management

Read this series of articles for more information:

This is a new version. The old version, which is the one used in the articles, has been released at v1.0.0

Requirements

  • Install Zookeeper

  • Install Kafka

  • Install event listeners: PHM-Tracing

  • Import and deploy the model PHM-Model

  • Import and deploy the model PHM-Model

  • Create users and groups (see Wildfly script in src/main/sh)

  • Configure a mock SMTP server such as https://mailtrap.io and set the following environment variables: DEMO_SMTP_SERVER, DEMO_SMTP_PORT, DEMO_SMTP_USER, DEMO_SMTP_PWD

  • Set EAP system property org.jbpm.var.log.length to 65536

  • Set variable length in the database accordingly:

If the database is either H2 or MySql

ALTER TABLE VARIABLEINSTANCELOG MODIFY VALUE VARCHAR(65536);
ALTER TABLE VARIABLEINSTANCELOG MODIFY OLDVALUE VARCHAR(65536);

If the database is PostgreSQL

ALTER TABLE VARIABLEINSTANCELOG ALTER COLUMN VALUE TYPE CHARACTER VARYING(65536);
ALTER TABLE VARIABLEINSTANCELOG ALTER COLUMN OLDVALUE TYPE CHARACTER VARYING(65536);

Run On Your Computer

  • Start zookeeper and Kafka

  • Start the PHM Integration Service by running

mvn spring-boot:run

in the integration service project directory

  • Start the end-user UI by running

mvn clean install
java -jar target/phm-process-ui-1.0.0-fat.jar

in the end-user UI project directory

Scenarios

These scenarios demonstrate

  • a workflow where tasks are created only after another task is closed,

  • the implementation of both soft close of a task (determined by task completion) and hard close of a task (determined by an external system),

  • reminders and escalations.

Start the process with a POST at the end point:

http://localhost:8181/camel/trigger

by posting:

{
     "memberId": "xyz",
     "triggerId": 74
}

If a task requires to be hard closed just send a signal with this POST end point:

http://localhost:8080/kie-server/services/rest/server/containers/PHM-Processes/processes/instances/{{processInstanceId}}/signal/hard_close

where {{processInstanceId}} is the specific task process instance id and the POST body is empty.

Baseline Scenario (Happy Path)

Mary has an insurance program with Health-Insurance.com and has reumathoid arthritis. Her DMARD prescription has run out of refills. This is the trigger for several actions to be taken.

  • Peter, Mary’s doctor, must be notified and write a new prescription. This action is considered complete only after the claim for the new prescription has been approved (hard close)

  • Charlie, Mary’s case manager, must be notified and do back office work. This action is considered complete only after the new prescription has been approved (hard close)

  • Mary must be notified after Peter’s action has hard closed that is after her new prescription has been written. This action is completed after the notification is acknowledged (soft close)

  • Robert, Mary’s pharmacist must be notified after Peter’s action has hard closed. This action is completed after the notification is acknowleged (soft close)

Each task failure to soft close in a timely manner will cause an email reminder to be sent.

Each task failure to hard close in a timely manner will cause an escalation.

Login as the jBPM administrator and follow the execution of the process and subprocesses in the Manage section of Business Central. See that by submitting the data above three processes are started: the Trigger process and two Action processes, the one for Peter and the one for Charlie.

Use end-user UI to login as the actors listed below:

  • Actor: Peter (pro) is the provider. Complete the task and hard close it. See how two more processes are started: the Action processes for Mary and Robert.

  • Actor: Mary (mem) is the Insurance member. Complete the task.

  • Actor: Robert (rxs) is the pharmacist. Complete the task.

  • Actor: Charlie (chw) is the Insurance case nurse. Complete the task and then hard close it.

Reminder Scenario

  • Change reminder timer in Charlie’s subprocess to 15s (R/PT15S), deploy and start the process.

  • Let the 15s timer expires.

  • See that reminder service has executed. Check the mailbox for the reminder email. Login in the end-user UI as the actor below:

  • Actor: Charlie (chw). Complete the task.

  • See that the reminder has stopped.

  • Hard close the task.

Escalation Scenario

  • Change escalation timer in Charlie’s subprocess to 30s

  • Charlie completes the task but the hard code signal is not thrown

  • Let 30s timer expires. Login in the end-user UI as the actor below:

  • Actor: Marc (mch) is the Insurance case manager. Complete the task.

A Different Trigger Scenario

This scenario demonstrates that a change in the input data produces a different workflow with no need to manually define one.

Start the process with this payload:

{
     "memberId": "xyz",
     "triggerId": 184
}

The actors are now only Peter (the doctor) and Robert (the pharmacist).