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 an easy calculator you should open the GDL Editor in Docker.

  • To run the GDL Editor you should type docker run -p 8080:8080 cdsplatform/gdl2-editor:2.4.4 into the Docker terminal and press enter. This will start the GDL Editor in the background and you should see that Docker shows a similar screen as in the screenshot below.
  • After Docker started GDL Editor in the background (10-20 seconds), you should be able to access GDL Editor in any browser on your computer. Type: http://localhost:8080/gdl2-editor/ or http://192.168.99.100:8080/gdl2-editor/ into your browser depending on your configuration. If neither link works, it is possible the IP address (i.e. the first 4 numbers) might be different depending on your environment. You can see what IP address you should use by checking the initial screen of Docker (as seen on the screenshot, you can scroll up in the terminal if it already disappeared).

    Screenshot from Docker showing the IP address (click to expand)

    Docker showing the IP address you should type into your browser.


    What if I get an error message? (Click to expand)

    COMING SOON

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 avalaible 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 Guideline -> Import Archetype/FHIR Profile in the top menu.

    The initial screen with the menu items to be selected.

    The initial screen with the menu items to be selected.

  • When asked to choose new archetype to import, click on Upload file.

    The dialog box

    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.

Screenshot showing how to fill the fields in the Description tab. The name field (surrounded with a red box) is obligatory. Fields within the yellow boxes are recommended to be filled in.


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.

    The empty definitions tab. You can access it by clicking the Definitions label in the second row of the editor (marked with a red box).

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

    Drag Archetype instantiation button (red box) to the INPUT Definitions entries field (yellow box).

  • To tell which archetype you want to instantiate, you should click on the “Data binding” label.

    The location of the Data binding label

    The location of Data binding label (marked with red box) within the archetype instance.

  • 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

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

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

    Screenshot after adding Diastolic BP as element. The complete blood pressure archetype can be seen in the red box.

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

    Screenshot about instantiating the output. Drag archetype instantiation (red box) to the OUTPUT definition entities (yellow box).

  • Click on the Data binding label.

    The location of the Data binding label

    The location of the Data binding label. To instantiate the blood pressure archetype as an output archetype, click on the Data binding label (red box).

  • 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

    Screenshot after dragging Element instantiation to the output archetype. The output archetype is highlighted with a red box.

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

Screenshot after adding a new empty rule. To adjust the screen, drag the separator (yellow line), to add the calculation definition drag Set attribute (red box) into rule actions field (green box).

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

  • Click on the Element@attribute label

    Screenshot to select what to define.

    Screenshot to select what to define. You can select for which output data you want to define by clicking the Element@attribute label (red box).

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

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.

    Screenshot about the execution tab. You can select the tab by clicking the Execution label (yellow box) and then the Refresh button (red box).

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

    Screenshot about entering data in the Execution tab. To test your formula enter meaningful data inside the Execution tab. A possible fill can be seen in the screenshot (inside yellow box), we choose 120 and 80 mm[Hg] as blood pressures. To continue click on the Execute button (red box).

  • 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

    Screenshot showing the result of the execution. After successfully executing your guideline, you will see the result inside the execution results field. The mean arterial pressure is shown within this field (see red box).

16. Save your calculator by choosing the Guideline > Save guideline menu item.

  • Click on Guideline > Save guideline menu item.The Saving Guideline to a File appears on the screen. You can name your file here. We recommend to use “MAP_test.v0” (v0 indicating version 0) as file name.
  • Click on the check mark to accept your changes.

    Dialog box to name the saved file

    To save the calculator name the file (within the yellow field). You can continue saving by clicking the check mark (red box)

  • Save the file to your local file system by clicking Save in the next dialog. We recommend not to change the file name here.

    Dialog box to choose directory and finish saving the file.

    To save the file to your computer, you will see the filename (within the red box), click on the Save button in your OS language (yellow box)

  • Depending on your browser settings you might have to do slightly different steps here. E.g. you might see a dialog box where you have to confirm that you want to save the file.

    Dialog box in your browser (might not show up).

    Your browser might show a similar dialog box. Select saving (within the yellow box) and click OK (red box).