1. Home
  2. Sample Projects
  3. Patient Carers Alert

Patient Carers Alert

◷ Reading Time: 8 minutes

The Patient Carers Alert tutorial will use the scenario of checking the symptoms of a patient and alert the career with the next best action to be taken.

How to Run

Before starting the run, set up the project following the instructions under Project Setup.

  1. Double-click and open the file MainFlow.xml
Project Explorer view showing the logic documents in the project and the MainFlow.xml selected

2. Click on Debug with JSON composer

Detail view of the Debug with JSON compose menu item

3. Load the given sample JSON file Symptoms.jc.json in the folder SampleInput in your project folder, or enter data manually.

Detail view of the Load JSON file menu item
Sample inputs view showing the populated data for the test run input

4. If you loaded the sample input we provided, you have to manually enter the following input parameters. You can use the same email address in all three places.

  • emailsender.EmailAddress: The email address that will be used to send emails from
  • emailsender.EmailPassword: Password of the email address that will be used to send emails from
  • PrimaryCarePartnershipEmailAddresses: Email addresses of the primary care partnership. You can add a list of email addresses.
  • ControlSelfAssessmentEmailAddresses: Email addresses of the control self-assessment. You can add a list of email addresses.
Sample inputs view showing the manually added parameter details

5. Click OK

Detail view of the ok button

6. Click Next Step to go step by step.

Detail view of the Debug Next Step menu item

7. Once the execution is successful, you will see the actions under the Parameters window

Parameters view showing the output of the test run

You will also receive alert emails to the email addresses given under PrimaryCarePartnershipEmailAddresses and ControlSelfAssessmentEmailAddresses

Example of email inbox showing the email subject
Example of email inbox showing the email content

Patient Carers Alert process steps

These are the process steps.

  1. The patient can select the symptoms and their status
  2. The system will go through a set of business rules to do the initial diagnosis and decide the next best action to be taken
  3. Finally, an alert email will be sent to the carers along with the next best action

Project Description

In this project, we have used the Dynamic Routing capability of FlexRule. It allows you to make decisions dynamically during runtime. Therefore, if you want to update the project by adding more symptoms that can be done easily.

The project contains the following files:

Flow

  • MainFlow.xml: This is the flow that connects all the steps. Therefore, it works as the orchestration layer

Decision Table

  • Symptom Decisions.xml: Select the symptom decision tables during the runtime depending on the inputs
  • Symptoms Decision Tables (ChestPain.xml, Cough.xml, etc.): Business rules on each symptom
  • Carer Instructions.xml: Build instructions for the next best action

Fact Concept

  • Concept.xml: Define the symptom and action concepts

Business Glossary

  • BusinessGlossary.xml: Define the business terms of the project

Business Formulas

  • BusinessFormula.xml: Define the expressions of the project

The Flow Design

1. Define the symptom and action concepts.

  • Concept.xml
Fact concept showing the symptom parameters entered

2. Define the business terms

  • BusinessGlossary.xml
View of the Business Glossary with the input terms for the project

3. Define the expressions

  • BusinessFormula.xml
Business Formula showing the defined values

4. Create the symptom decision tables

  • Temperature.xml, Cough.xml, etc.
Symptoms Decision table example

5. Create a decision table to route the symptoms to each symptom table

  • Symptom Decisions.xml
Decision table showing the symptoms

6. Create a decision table to build instructions

  • Carer Instructions.xml
Decision table with instructions for the carer

7. Create the Flow and connect all the decision tables.

  • MainFlow.xml
Main Flow diagram for the Patient Carers Alert project

8. Add a decision node to define the two paths

– If there is any alert
– If there are no alerts

Main Flow diagram for the Patient Carers Alert project showing the new Alert node added.

9. Terminate the flow if there are no alerts

Main Flow diagram for the Patient Carers Alert project showing the new Alert and termination nodes added

10. If there is any alert, use the Send Email option to email the carers.

Main Flow diagram for the Patient Carers Alert project showing the Alert node added.

Project Setup

In the Patient Carers Alert project, we will be using an email address to send alert emails. Therefore, as the input, you will have to enter the following data.
You can use the same email address in all three places.

Sender email

  • emailsender.EmailAddress: The email address that will be used to send emails from
  • emailsender.EmailPassword: Password of the email address that will be used to send emails from

Reciever email

  • PrimaryCarePartnershipEmailAddresses: Email addresses of the primary care partnership. You can add a list of email addresses.
  • ControlSelfAssessmentEmailAddresses: Email addresses of the control self-assessment. You can add a list of email addresses.

Therefore, the following settings need to be updated before running the project.

1. Email server

You may have to update the email server settings (SMTP configurations) in MainFlow.xml according to the email provider you use.
In this example, we have used the settings for Gmail.

Properties view with Server detail highlighted to show where to enter the email server derails

2. Turn on Third-party access to your email account

You may have to change certain security features of your email address provided under the input variable emailSender.EmailAddress in order to run this project.

In Gmail, you have to turn on Third-party access under your Gmail account settings. This will allow the FlexRule project to access your email account to send emails.

GMail third part access nodal

Download Project

Download the project using the attachment at the end of the page.

Updated on February 26, 2024

Article Attachments

Was this article helpful?

Related Articles