Creating a Guideline




Overview and Trial Run


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 Guideline Editor.

It is vital the model of a clinical concept is founded on a solid scientific basis, and therefore it is essential that proper research has been done ahead of construction. When published, any user should be able to quickly review the material the model is based on; always make sure to list the references.

Resources containing more in-depth information are listed at the end of the document for quick access in case they are needed. There is also a link to our CDS Apps Overview page on GitHub containing over 100 demo applications (using 250+ archetypes) available in this section.
The guide has been written by the Clinical Modelling Group at Cambio Healthcare Systems. If you have any questions or would like to provide feedback on this document, please send us an e-mail at

All the best,
Clinical Modelling Group

Eneimi Allwell-Brown
Jimmy Axelsson
Syeeda S. Farruque
Dennis Forslund


In order to generate data for storage and documentation, a guideline is required. Guidelines are used to express clinical rules and algorithms. Their format is based on a publicly available specification called the Guideline Definition Language (GDL). Guidelines use one or more archetypes to mimic the rules used in clinical practice. Even if two guidelines use the same archetypes 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 Guideline Editor (GE). This example builds on the steps from the earlier introductory guide that provides instructions on installing and setting up the Guideline Editor, and is an extension on the previous guide on creating an archetype for the Ideal Body Weight (IBW) model.

The IBW is a calculation based on the Devine formula, and provides a weight-based method of adjusting medication dosage for adequate prescriptions. An overview of the finished IBW guideline is displayed below:


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:

  1. Once all the metadata is filled in, ensure the model is saved.


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

Complete definitions of the IBW are shown in the image below. There are two input (EHR) archetypes and one output (CDS) archetype. The input archetypes are created to hold the input of height and gender and the output archetype holds the IBW calculation:

The input or EHR definitions which are indicated in the above image (1), are instantiated as shown in the following images:

  1. Drag and drop the Archetype instantiation element from the right-hand side to the main modelling screen.
  2. Drag and drop the Element instantiation by dropping it on top of the already instantiated blank archetype.
  3. Drag and drop the Predicate (Function) element on top of the already instantiated blank archetype.

Assign the blank elements as shown below:

  1. Click on Archetype within the archetype instantiation slot.
  2. Choose the basic demographic archetype from the folder.
  3. Click on Accept to select it.

Next, the element attribute can be entered:

  1. Click on the Element slot.
  2. Choose the coded text (cT) for Gender.
  3. Click on Accept.

The last part to enter is the Predicate (function) element:

  1. Click on Element within the Predicate (Function) slot.
  2. Choose the Event time data attribute from the list.
  3. Click on Accept.
  4. Choose max from the event time drop-down menu. This will ensure the values used in the tool are always the most recent.

Repeat the above sequence to create another blank EHR archetype instantiation to hold the Height data element needed for calculating the IBW score as mentioned earlier. Instantiate a Height observation archetype to contain a height element and maximum event time element.

The last instantiated archetype is an output or CDS archetype which holds the IBW calculation result. This is made up of only one internal element: the holder for the calculated IBW value for men and for women. There is no need for an event time element, as the calculation is triggered anew upon usage. Make sure to select the CDS format when instantiating the archetype:

The CDS/EHR selection is made at the top of the archetype instantiation window as shown in the image below (1).


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

IBW has two rules, one for men and one for women, as the calculation formula differs between the sexes. These rules are numbered 1 and 2 in the image below.

The following section will display the construction of the rule intended for males. For females, simply apply the same principles and adjust the gender and formula in accordance with the instructions.

Rule number one – Calculate IBW for males:

  1. Click on the Add rule button on the top row.
  2. Type the name of the rule in the RuleName text box – this is the “Calculate Ideal Body Weight Male” rule.
  3. Click on Accept.

Once the accept button has been clicked, the guide opens 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 IBW for men:

  1. Drag and drop the Compare (DataValue) into the main conditions modelling screen.
  2. Drag and drop the Compare (Attribute) into the main conditions modelling screen.

  1. Click into the Compare (DataValue) element.
  2. Choose cT Gender (coded text).
  3. Click on Accept.

  1. Choose == from the drop-down menu, and then click on DataValue.
  2. Select male from the gender drop-down menu.
  3. Click on Accept.

The other condition in the IBW rule for men is to ensure height has been measured in a specific unit, as the formula is based on the use of inches.

  1. Click on the Element attribute field of the Compare (Attribute) element.
  2. Choose units from the Height/Length element.
  3. Click on Accept.

  1. Choose == from the drop-down menu, and then click on Expression.
  2. Select in (inches).
  3. Click on Accept.

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

Create three blank Set (Attribute) elements to contain the three action triggers.

The calculation itself is contained within a magnitude attribute element:

  1. Click on Element attribute.
  2. Select the IBW magnitude attribute in the break-out box.
  3. Click on Accept.

  1. Click on Expression, which opens the Expression editor.
  2. Enter the calculation for men which is: (2.3x (Height (in inches) – 60 inches)) + 50.
  3. The height value is accessed from the right side – here the EHR_Height/Length_magnitude.
  4. Click on Accept.

The units with which the calculation is based is set as well:

  1. Click on Element attribute.
  2. Select the IBW units attribute from the list.
  3. Click on Accept.

  1. Click into the Expression slot to set the unit.
  2. Select Kg as the calculation unit from the drop-down menu.
  3. Click on Accept.

  1. Click on the last Element attribute slot.
  2. Select Precision from the list under IBW. Precision determines the number of decimal places used for the resulting value.
  3. Click on Accept.

  1. Click on the final Expression slot.
  2. Enter 2 into the top editor window to choose a precision of two decimal places.
  3. Click on Accept.

Repeat the same steps to build the rule for women – choosing female instead of male in the model. The formula for women to be entered into the expression editor is:

((2.3 * (Height/Length – 60)) + 45.5)

Once all the conditions and actions have been set – remember to save the model (1). It is possible to return to the main screen by clicking the “Back to guide” button (2) on the top menu:


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

All that is left is to test the model by clicking on the Run button:

  1. Enter height in inches.
  2. Select inches (in) from the units drop-down menu.
  3. Choose gender.
  4. Click on the date field or the small calendar icon to enter the date in both date slots.
  5. Click on Execute to run the model.

The editor then issues a result for the values used for input, displayed at the bottom of the panel: