GDL2 GUIDELINE TUTORIAL I – BMI
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 into 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:
- Name the guideline.
- Enter the author’s details including organization and date of creation.
- Select Author draft from the Authorship lifecycle drop-down menu.
- Add the Copyright.
- Use the + to add and – to remove keywords. The pencil icon can be used to edit existing keywords.
- 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), “File” – and then “Load Guidelines, Archetypes, FHIR Profile”.
Clicking “Load Guidelines, Archetypes, FHIR Profile” will open up a sub-window within the Editor.
Clicking “Select file(s)” 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.
- Drag and drop the Archetype instantiation element from the left-hand side to the main modelling screen.
- Drag and drop two Element instantiation elements by dropping them on top of the already instantiated blank Data binding.
- Drag and drop the Function Predicate element on top of the already instantiated blank Data binding.
Assign the blank elements as shown below:
- Click on Data binding.
- Choose the body weight archetype from the folder.
- Click on the checkmark to select it.
Next, the element attributes can be entered:
- Click on the Element slot.
- Choose the Quantity value Weight.
- Click on the checkmark.
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 the 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:
- Click on Data binding within the archetype instantiation slot
- Choose Output in the drop-down menu located in the upper right corner
- Choose the body_mass_index archetype from the folder
- Click on the checkmark 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.
- Go to the Rule list tab.
- Click on Add new Rule.
- Enter the rule name and click on the checkmark.
Once the checkmark has been clicked, the guide shows a new window for the specific rule:
- Name of the created rule.
- Conditions modelling area.
- Actions modelling area.
- Condition elements – used to model the conditions required to be fulfilled for the rules to fire.
- 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.
- Click into the first Element[@attribute] element.
- Choose unit from the body weight profile.
- Click on the checkmark.
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.
- Click on the first Element[@attribute] element.
- Select unit from the body mass index profile.
- Click on the checkmark.
Click on Expression and select the unit kg/m2 from the drop-down menu
- Click on the second Element[@attribute] element.
- Select the magnitude attribute from the body mass index archetype.
- Click on the checkmark.
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
- Double click on the magnitude from the body weight archetype to instantiate it in the expression editor on the left.
- After [Weight].magnitude, write /( to continue the expression.
- Double click on the magnitude from the body height archetype, after which it appears in the Expression Editor.
- Finish the expression by writing /100)^2 in the editor.
- Click on the checkmark.
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:
- Write input data in the text boxes.
- Click on the calendar sign to open a calendar. Click on a date och choose a time to set the Date Time for the observation.
- Input data in all input fields.
- Click on Execute.
- Clicking Execute executes the guideline’s rules.
- Execution results show the calculated BMI
- Fired rules show that the rule Calculate BMI has been fired.
- The 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.
- Give a name for the test case from the Execution tab. Add more test cases using the same structure if desired.
- Click on Add test fixture.
- The test cases are added to the test fixture in the Test Tab.
- Click on Execute.
- See the result summary showing the total number of tests passed or failed, the percentage of rules covered by the test fixture, and the results for each test case.