GDL2 Guideline Tutorial II – MAP

This guide will show you how to create a simple calculator (Mean Arterial Pressure) through a step-by-step guide. Follow the steps, which each contain some explanation that you can expand if you click on the steps’ title. Several screenshots are available which you can see by clicking on their captions.

1. To create the MAP guideline, open the GDL2 Editor .

2. Import openEHR-EHR-OBSERVATION.blood_pressure.v1.adl blood pressure archetype.

Archetypes are containers of health data, they correspond to basic medical concepts. Very often archetypes correspond to observations such as blood pressure, height, and weight. Here we use only one archetype, blood pressure, which is available in the openEHR-EHR-OBSERVATION.blood_pressure.v1.adl file inside the archetype folder of the Git repository. Direct link to the file: here.

  • You can start to import an archetype by clicking File -> Import Guidelines, Archetypes, FHIR resources in the top menu.
  • When asked to choose a new archetype to import, click on the Upload file.
  • Select the openEHR-EHR-OBSERVATION.blood_pressure.v1.adl from the folder you have download it to.

3. Give a name to the project. Here we use Mean Arterial Pressure.

On the Description tab in the editor you can write some description about your project. It is recommended that you fill in most of the fields on this page (a possible fill can be seen in the screenshot).


While you are learning, you can leave out most of the fields except the name field, which is obligatory to fill in. We recommend to give a name which makes sense. Here we use Mean Arterial Pressure as this project is meant to calculate Mean Arterial Pressure.

4. Open the "Definitions" tab where you can instantiate the necesssary archetypes.

After you have imported the blood pressure archetype (i.e. the editor knows about it), you have to instantiate the archetypes (i.e. tell the editor how you will use them). To start the process, you should open the “Definitions” tab.

  • Accessing the “Definitions” tab is fairly simple, you need to click on the Definitions label in the second row of the editor.

5. Instantiate a blood pressure archetype in the INPUTS field

You will use one blood pressure archetype as input.

  • You can instantiate it by dragging the Archetype instantiation button into the “INPUT definition entries” field. Before you drop the dragged item, the field should look selected (i.e. becomes light blue). If the drag was successful, you will see an empty archetype space in the INPUT field.
  • To tell which archetype you want to instantiate, you should click on the “Data binding” label.
  • This will open a dialog box. In the “Choose an Archetype” dialog box you can see all imported archetypes in a tree structure. If you followed the previous instructions, you will see the following screen. Select the openEHR-EHR-OBSERVATION.blood_pressure.v1 item and click the check mark.

6. Instantiate systolic and a diastolic blood pressure as elements in the archetype.

Inside the input archetype you should instantiate two elements. These will be the two input fields in your calculator: systolic and diastolic blood pressure.

  • To start to instantiate systolic blood pressure drag the Element instantiation button into the already instantiated blood pressure archetype inside the input. Before you drop it the archetype should look selected. See screenshot for help.
  • Click on the Element label on the newly dragged item.
  • A “Select elements” box appears where you can see the elements inside the imported archetypes. You should select Systolic BP as shown in the screenshot.
  • Click the check mark to accept your selection.
  • Repeat the previous steps with diastolic blood pressure as well. In the “Select elements” box now you have to select Diastolic BP. After completing these steps you should see the following screen:

7. Instantiate a blood pressure archetype in the OUTPUTS field

  • Drag the Archetype instantiation button into the “OUTPUT definition entries” field. Before you drop the dragged item, the field should look selected (i.e. becomes light blue). If the drag was successful, you will see an empty archetype space in the OUTPUT field.
  • Click on the Data binding label.
  • In the “Choose an Archetype” dialog select the openEHR-EHR-OBSERVATION.blood_pressure.v1 item and click the check mark.

8. Instantiate Mean Arterial Pressure in the output archetype instance.

  • Drag the Element instantiation button into the already instantiated blood pressure archetype inside the outputs. Before you drop it the archetype should look selected. If the drag was successful you will see something similar to the screenshot.
  • Click on the Element label on the newly dragged item.
  • You should select Mean Arterial Pressure in the Select elements box, as shown in the screenshot.
  • Click the check mark to accept your selection.

9. Switch to the Rule List tab.

Click on the Rule List label in the second row of the editor.

10. Add a new rule by clicking on "New Rule" and naming it "Calculate MAP".

  • Click on the “Add new rule” label on the right side of the screen.
  • A box appears where you can name your rule. You can give any name to the new rule, we recommend using “Calculate MAP”.

11. Add Rule conditions and Rule Actions

To add Rule conditions, drag and drop the “Element Existence” to the Rule conditions field. Then click on the Element and a new window opens up to select the required elements. Here, Systolic pressure is selected.

Drag the “Set attribute” button into the Rule actions field. You might need to resize the panels on your screen. You can easily adjust the size of the panels by dragging the separator between the panels.

12. Set the Element@attribute field to Mean Arterial pressure.

  • Click on the Element@attribute label
  • You will see a Select elements box where you can select between the attributes of all output elements. Here we only have mean arterial pressure as output element. It has several attributes, such as magnitude and unit. Here we need the magnitude attribute of mean arterial pressure as the Mean Arterial Pressure formula gives this as a result.

13. Insert the Mean Arterial Pressure formula into the Expression field in the right format.

  • Click on the Expression label in the Rule Actions field. This will open a Create Expression dialog where you can set the formula you want to calculate.
  • In the Create Expression dialog you can type the required formula on the left side of the panel. You can select variables from the right side of the panel.
  • First, select the value of systolic blood pressure. You can select it by double-clicking for the OBSERVATION > Systolic BP > @magnitude item in the drop-down list on the right side. This will insert the “[Systolic BP].magnitude” text into the expression editor on the left side of the panel.
  • In the expression editor type *2 and a + sign right after [Systolic BP].magnitude text. Pay attention not to overwrite the previous text.
  • Now select the value of diastolic blood pressure. You can select it by double-clicking for the OBSERVATION > Diastolic BP > @magnitude item in the drop-down list on the right side. This will insert the “[Diastolic BP].magnitude” text into the expression editor on the left side of the panel. Now, your expression should look like:
  • Put the previous expression into parentheses and write /3 after the expression. Now the complete expression should look like:
  • Click on the check mark to accept your changes.
  • Set attribute unit to “mmHg” by following similar steps.

14. Switch to Exectution tab and click on the Refresh button.

  • By switching to the execution tab you can test your calculator. Click on the Execution label on the second row of the editor.
  • On the execution tab click on the Refresh button. This will load the current guideline (i.e. your calculator).

15. Check whether your calculator works correctly.

  • Insert meaningful values to the Systolic BP and Diastolic BP fields. E.g. 120 and 80 mm[Hg].
  • Click on the Execute button. Then you should see the following screen, showing the value of Mean Arterial Pressure in mmHg. Here it is 93.