GDL2 Guideline Tutorial I – BMI

Introduction

Creating a Guideline

Metadata

Definitions

Rules

Overview and Trial Run


Introduction

This tutorial guide is a supplement to the Archetypes guide, utilising existing models to provide a step-by-step demonstration on how to design basic guidelines for different types of clinical decision support (CDS) applications using the GDL2 Editor.

Creating a Guideline

In order to generate data for storage and documentation, a guideline is required. Guidelines are used to express clinical rules and algorithms, and use one or more archetypes or profiles to mimic the rules used in clinical practice. Even if two guidelines use the same archetypes/profiles they can be used to model different concepts according to the rules used in each guideline.

This guide provides step-by-step instructions on building a common calculation-based guideline model using the GDL2 Editor. This example builds on the steps from the earlier introductory guide that provides instructions on installing and setting up the GDL2 Editor.

The BMI provides a height- and weight-based method of categorizing the body mass of a person. There are different categories to take in to consideration, the main three ones are however: underweight, normal weight, and overweight. An overview of the finished BMI guideline is displayed below:

Metadata

First, add metadata in the Description tab which is opened upon launching the program:

  1. Name the guideline.
  2. Enter the author details including organisation and date of creation.
  3. Select Author draft from the Authorship lifecycle drop-down menu.
  4. Add the Copyright.
  5. Use the + to add and – to remove keywords. The pencil icon can be used to edit existing keywords.
  6. Enter the names of any Contributors.

Next, enter text into the 1. Description, 2. Purpose, 3. Use, 4. Misuse and 5. References sections:

Once all the metadata is filled in, ensure the model is saved (6). Additionally, loading necessary openEHR Archetypes or FHIR Profiles will be required in order to build models in the coming steps. Loading Archetypes or FHIR Profiles are done by clicking (6), “Guideline” – and then “Import Archetype/FHIR Profile”.

Clicking “Import Archetype/FHIR Profile” will open up a subwindow within the Editor.

Clicking “Upload file” will point to the local repository. One archetype or FHIR profile can be selected, it is also possible to load multiple files in a compressed format (.zip).

Definitions

After all the metadata has been added, the next tab to go to is the Definitions tab.

Complete definitions of the BMI are shown in the image below. There are two input archetypes and one output archetype. The input archetypes are created to hold the input of height and weight and the output archetype holds the BMI calculation:

The input parameters are defined in the left bar, and the output parameters are defined in the right bar.

  1. Drag and drop the Archetype instantiation element from the left-hand side to the main modelling screen.
  2. Drag and drop two Element instantiation elements by dropping them on top of the already instantiated blank Data binding.
  3. Drag and drop the Function Predicate element on top of the already instantiated blank Data binding.

Assign the blank elements as shown below:

  1. Click on Data binding.
  2. Choose the body weight archetype from the folder.
  3. Click on the check mark to select it.

Next, the element attributes can be entered:

  1. Click on the Element slot.
  2. Choose the Quantity value Weight.
  3. Click on the check mark.

Do the same for the next element, instantiating Event Time.

Instantiate Event Time also in the Function Predicate element and select max from the dropdown list to ensure use of the most recent weight value.

Repeat the above sequence to create another blank input profile instantiation to hold the Height data element needed for calculating the BMI score as mentioned earlier. Instantiate a Height archetype to contain a Height Quantity element and a Date Time element with Function Predicate set to max.

The last instantiated archetype is an output archetype which holds the BMI calculation result. This is made up of only one internal element: the holder for the calculated BMI value. There is no need for an effectiveDateTime element, as the calculation is triggered anew upon usage.

Make sure to select the Output type when instantiating the archetype:

  1. Click on Data binding within the archetype instantiation slot
  2. Choose Output in the drop down menu located in the upper right corner
  3. Choose the body_mass_index archetype from the folder
  4. Click on the check mark to select it.

Complete the BMI archetype by instantiating the Quantity value Body Mass Index.

Rules

Once the definitions have been created, they can be used to construct the rules for the BMI calculation.

BMI has only one rule that calculates the body mass index. The following section will display the construction of the rule.

  1. Go to the Rule list tab.
  2. Click on Add new Rule.
  3. Enter the rule name and click on the check mark.

Once the check mark has been clicked, the guide shows a new window for the specific rule:

  1. Name of the created rule.
  2. Conditions modelling area.
  3. Actions modelling area.
  4. Condition elements – used to model the conditions required to be fulfilled for the rules to fire.
  5. Action elements – trigger when the conditions assigned in the top modelling area are fulfilled.

Conditions that must be fulfilled for the rule to calculate BMI:

Drag and drop two Attribute Comparison elements into the rule conditions modelling screen.

  1. Click into the first Element[@attribute] element.
  2. Choose unit  from the body weight profile.
  3. Click on the check mark.

Choose the == from the drop-down menu.

Click on Expression and choose kg from the drop-down menu.

Do the same steps for the Height archetype and choose unit “cm”.

Once all the conditions for the BMI calculation rule have been entered, the actions in the bottom part of the rule modelling window can be set:

Instantiate two Set Attribute elements.

  1. Click on the first Element[@attribute] element.
  2. Select unit from the body mass index profile.
  3. Click on the check mark.

Click on Expression and select the unit kg/m2 from the drop-down menu

  1. Click on the second Element[@attribute] element.
  2. Select the magnitude attribute from the body mass index archetype.
  3. Click on the check mark.

Click on Expression to open the Create Expression window. This window holds the Expression editor, where the expression for BMI can be created. The expression reads:

BMI [kg/m2] = weight [kg]/(height [cm]/100)^2 

  1. Double click on magnitude from the body weight archetype to instantiate it in the expression editor on the left.

  1. After [Weight].magnitude, write /( to continue the expression.
  2. Double click on magnitude from the body height archetype, after which it appears in the Expression Editor.
  3. Finish the expression by writing /100)^2 in the editor.
  4. Click on the check mark.

Once all the conditions and actions have been set – remember to save the model, which is done through Guideline in the menu.

Overview and Trial Run

Once all the data has been added, the Terminology tab displays the codes:

All that is left is to test the model. This is done in the Execution tab:

In the Execution tab, the Input fields are on the left, and the output fields are on the right.

There are several kinds of input types:

  1. Write input data in the text boxes.
  2. Click on the calender sign to open a calender. Click on a date och choose a time to set the Date Time for the observation.

  1. Input data in all input fields.
  2. Click on Execute.

  1. Clicking Execute executes the guideline’s rules.
  2. Execution results shows the calculated BMI
  3. Fired rules shows that the rule Calculate BMI has been fired.
  4. Guideline fixture generates a test case based on the current input data.

Further testing can be done in the Test tab:

This tab holds a text fixture editor where test fixtures can be created, saved and uploaded to enable more extensive testing.

  1. Copy and paste the test fixture from the Execution tab. Add more test cases using the same structure if desired.
  2. Click on Execute.
  3. See the result for each test case.