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.
    The initial screen with the menu items to be selected

  • When asked to choose a new archetype to import, click on the Upload file.
    The dialog box

  • Select the openEHR-EHR-OBSERVATION.blood_pressure.v1.adl from the folder you have download it to.
    Screenshot to select the file.

     First select the file, then click to Open.

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).

Screenshot showing how to fill the Description.


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.
    Screenshot accessing the Definitions tab.

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.
    Screenshot showing input creation

  • To tell which archetype you want to instantiate, you should click on the “Data binding” label.
    The location of 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.
    The dialog box to select archetype

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.
    Screenshot before instantiating any elements in the input.

    Screenshot before instantiating any elements in the input. To instantiate drag Element instantiation (red box) to the input archetype (yellow box).

  • Click on the Element label on the newly dragged item.
    The location of the Element label

    Click on the element label (red box) to choose the element you want to instantiate.

  • 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.
    The dialog box to select Elements.

    The dialog box to select Elements. To select Systolic Blood Pressure, click on Systolic BP (yellow box) and then click on the check mark (red box).

  • 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:
    Screenshot after adding Diastolic BP as element

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.
    Screenshot about instantiating the output

  • Click on the Data binding label.
    The location of the Data binding label

  • In the “Choose an Archetype” dialog select the openEHR-EHR-OBSERVATION.blood_pressure.v1 item and click the check mark.
    The dialog box to select archetype

    Dialog box to select the archetype. First select openEHR-EHR-OBSERVATION.blood_pressure.v1 by clicking within the yellow box, Then click on the check mark (marked by a red box).

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.
    Screenshot after dragging Element instantiation to the output archetype

  • 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.
    The dialog box to select mean arterial pressure

    The dialog box to select mean arterial pressure.

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.
    The empty Rule list tab.

    The empty Rule list tab. You can open the tab by clicking Rule list label (yellow box). You can add new rule by clicking Add new rule (red box).

  • A box appears where you can name your rule. You can give any name to the new rule, we recommend using “Calculate MAP”.
    Screenshot of the dialog box to name a rule

    To name the rule type a name within the yellow field then click on the check mark (red box).

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 "Element Existence" to the Rule condition field

Select Systolic pressure

Systolic pressure Existence condition is thus added

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.

Screenshot about adding a new empty rule.

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

  • Click on the Element@attribute label
    Screenshot to select what to define.

  • 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.
    Screenshot to choose the output data.

    Screenshot to choose the output data. You should choose the Value of MAP by clicking within the yellow box and then clicking the check mark (red box).

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.
    The dialog box to create an expression.

    The dialog box to create an expression. You can type and edit the expression within the Expression editor (red box). You can select an input or output data by choosing it from the right panel. E.g. you can select the value of Systolic blood pressure by clicking within the yellow field.

  • 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:
    Screenshot about editing the formula.

    Screenshot about editing the formula. You can select the diastolic blood pressure's value by clicking the @magnitude item below Diastolic BP (red box). You should edit the expression by adding the operations inside the yellow boxes.

  • Click on the check mark to accept your changes.
  • Set attribute unit to “mmHg” by following similar steps.
    Set attribute Unit to mmHg

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).
    Screenshot about the execution tab.

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].
    Screenshot about entering data in the Execution tab

  • 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.
    Screenshot showing the result of the execution