Modifying your MAP guideline – Event Time

In the first example, we created a calculator where the user can manually enter diastolic and systolic blood pressure values, and the clinical decision support system calculates the mean arterial pressure using this values. While these calculators are useful, a clinical decision support system should be able to communicate with an EHR system. An EHR system usually contains many health data about a patient, it is common that a patient has several blood pressure measurements registered in the EHR (e.g. the physician takes blood pressure measurements at each visit). For the clinical decision support system, old measurements are not important, only the most recent measurement is essential. To tell the GDL editor that it should look for the most recent measurements one more step should be included.

1. Open the previously created MAP guideline if it is not already open.

  • Run the GDL Editor (if not already open). If you are unsure how to run the GDL Editor refer to Chapter 1.
  • Import openEHR-EHR-OBSERVATION.blood_pressure.v1.adl blood pressure archetype (if not already imported).
    • You can start to import an archetype by clicking Guideline -> Import Archetype/FHIR Profile in the top menu.

      Location of the Import Archetype/FHIR Profile menu item

      Location of the Import Archetype/FHIR Profile menu item. To import archetypes click on this menu item.

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

      Dialog box when importing Archetype

      Dialog box when importing Archetype. To continue click on the Upload file button in 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.

  • If not already open load the MAP_test.v0.gdl.json guideline
    • Select the Guideline > Load guideline from file menu item.

      Loading a guideline in the Editor

      Loading a guideline in the Editor. To load a guideline click on Guideline > Load Guideline from a File menu item (red box).

    • This will show a dialog box asking for your confirmation. If you have all your previous work saved click on the Upload file button. If you forgot to save anything click on the cross sign to cancel the upload. You can continue to create your new guideline by repeating the previous step after saving your work.

      Dialog box when loading a guideline

      Dialog box when loading a guideline. If you have all your previous work saved click on the Upload file button. If you forgot to save anything click on the cross sign to cancel the upload. You can continue to create a new guideline by repeating the previous step after saving your work.

    • If you confirmed that you wish to open an existing guideline, the Editor will show a file selection window. To choose the file to upload navigate to the directory where it is saved (if needed, presumably it is already there) and choose the file by clicking on it. Select the previously saved MAP_test.v0.gdl2.json file.

      Dialog box to choose the location of the guideline to be loaded

      Dialog box to choose the location of the guideline to be loaded. To choose the file to upload navigate to the directory it is (if needed, presumably it is already there), choose the file by clicking on it. Here, we chose MAP_test.v0.gdl.json (yellow box), the one we created in the previous chapter. After selecting your file click on the check mark (red box) to confirm your selection.

    • You can directly download the file from here.

2. Open the Defintions tab

Click on the Definitions label in the second row of the editor.


3. Instantiate Event time as a new element inside the input archetype.

  • Drag the Element instantiation button into the already instantiated blood pressure archetype inside the inputs. Before you drop it the archetype should look selected. If the drag was successful you will see something similar to the screenshot.

    Start of Element instantiation

    Start of Element instantiation. Drag the Element instantiation button (red box) into the already instantiated blood pressure archetype (yellow box) inside the inputs. Before you drop it the archetype should look selected.

  • Click on the Element label on the newly dragged item.

    Location of the Element label

    Location of the Element label. To continue click on the Element label (red box) on the newly dragged item.

  • A select elements box appears where you can see the elements inside the imported archetypes. You should select Event time as shown in the screenshot.
  • Click the check mark to accept your selection.

    Dialog box to select elements

    Dialog box to select elements. The dialog box shows the elements inside the imported archetypes. You should select Event time (yellow box) as shown in the screenshot. Click the check mark (red box) to accept your selection.


4. Create a function predicate with Event time being max.

  • Drag the Function Predicate button to the input blood pressure archetype.

    First step to tell the Editor that Event time should be maximal

    First step to tell the Editor that Event time should be maximal. Drag the Function Predicate button (yellow box) to the input blood pressure archetype (red box).

  • Click on Element label in the new row.

    Second step to tell the Editor that Event time should be maximal

    Second step to tell the Editor that Event time should be maximal. Click on Element label in the new row.

  • A select elements box appears where you can see the elements inside the imported archetypes. You should select Event time as shown in the screenshot.

    Dialog box to select element

    Dialog box to select element. You should select Event time (yellow box) as shown in the screenshot. Click the check mark (red box) to accept your selection.

  • Choose max from the drop down list in the row.

    Last step to tell the Editor that Event time should be maximal

    Last step to tell the Editor that Event time should be maximal. Choose max from the drop down list in the row.


5. Switch to the Execution tab, click refresh and check your guideline whether it works as required.

  • Open the Execution tab by clicking the Execution label in the second row of the Editor.
  • Click on the Refresh button.
  • Enter meaningful values into Systolic and Diastolic BP fields, then click on the calendar icon inside the Event Time field.

    Screenshot about the Execution tab showing the guideline

    Screenshot about the Execution tab showing the guideline. Enter meaningful values into Systolic and Diastolic BP fields (red boxes), then click on the calendar icon (yellow box) inside the Event Time field.

  • This will open a Date and Time selector. Select an arbitrary date and time as Event time, by first adjusting the time then clicking on the required date.

    Screenshot showing how to choose an Event time

    Screenshot showing how to choose an Event time. First select time (yellow box), then click on your chosen date (red box). You can also switch month by clicking the simple arrows (green boxes) or the year by clicking the double arrows (blue boxes).

  • This will show the time in the right format in the Event time field.
  • Click on the Execute button.

    The result of choosing an arbitrary Event time

    The result of choosing an Event time. The chosen time will be shown in the right format in the Event time field (yellow box). To make the calculations click on the Execute button (red box).

  • This will show the result of the calculation in the Execution result.

    The result of the Execution

    The result of the Execution. This will show the result of the calculation in the Execution result (red box).


6. Save your changes to a new file. We recommend changing the version number to v1.

  • 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_calculator.v1” (v1 indicating version 0) as file name.
  • Click on the check mark to accept your changes.
  • Save the file to your local file system by clicking Save in the next dialog. We recommend not to change the file name here. Depending on your browser settings you might have to do slightly different steps here.