Modifying your BSA guideline – Units

Health data can be measured in different units, i.e. lab data in mg/dl or mol/l, etc. Many formulas, however, hold only if the correct unit is supplied. In this chapter you can learn how to verify the input’s unit and how to define the output’s unit and precision.

1. Import the zip file containing the archetypes if not already imported.

  • If the Editor is not running start Docker and type docker run -p 8080:8080 cdsplatform/gdl2-editor:2.4.4 command in it. This will start the GDL Editor in the background.
  • After Docker started Docker 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 (you can scroll up in the terminal if it already disepeared)
  • If your Editor is already running click on the Guideline > Import Archetype/FHIR Profile menu item (see screenshot).

    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.

  • Click on the Upload file button in the dialog box.

    Dialog box when importing Archetype

    Dialog box when importing Archetype. To continue click on the Upload file button in the dialog box.

  • Choose the zip file you have created and click on the Open button in your OS language.

    Dialog box for file selection

    Dialog box for file selection. To import all archetypes choose the zip file you have created and click on the Open button in your OS language.

  • This will load all the archetypes inside the zip file. While the archetypes are loading you will see the following screen. When this screen disepears you can continue to use the Editor.

    Screenshot when loading archetypes

    Screenshot when loading archetypes. While the archetypes are loading you will see the following screen. When this screen dissepears you can continue to use the Editor.


2. Open the previously created BSA guideline if it is not already open.

  • To load a guideline click on Guideline > Load Guideline from a 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 it is (if needed, presumably it is already there), choose the file by clicking on it. Choose BSA.v0.gdl.json, the one we created in the previous tutorial. After selecting your file, click on the check mark to confirm your selection.

    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 BSA.v0.gdl1.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.

  • After opening the guideline the Editor will show its content. Since we were in the Description tab you will see the Description of BSA, if you were in an other tab before loading the guideline, you will see the content of that tab.

3. Open the Rule list tab

  • Click on the Rule list label in the second row of the editor.

    Screenshot after opening the guideline and location of the Rule list tab

    Screenshot after opening the guideline and location of the Rule list tab. After opening the guideline it will show its content. Since we were in the Description tab you will see the Description of BSA, if you were in an other tab before loading the guideline, you will see the content of that tab. To switch to the Rule list tab click on the Rule list label (red box) in the second row of the editor.

  • This will show the rule you have created when making the BSA guideline.

    Screenshot after switching to the Rule list tab.

    Screenshot after switching to the Rule list tab. After switching to the Rule list tab you will see the formula you entered when creating the BSA guideline.


4. Create the conditions that only kg is accepted as the unit for weight and cm as the unit for height.

  • The first step is to create an empty condition by dragging the Attribute comparison button to the Rule conditions field.

    The first step to tell the guideline to verify the unit of the input (height)

    The first step to tell the guideline to verify the unit of the input (height). The first step is to create an empty condition: drag the Attribute comparison button (red box) to the Rule conditions field (yellow box).

  • This will show a new row (the empty condition) in this field. To continue click on the Element@attribute label.

    Second step to create a condition

    Second step to create a condition. To continue click on the Element@attribute label (red box).

  • This will show you a dialog box to select an attribute to compare. To select the unit of height select the @unit element in this dialog box below Height/Length and click on the check mark to confirm your selection.

    Dialog box to select what to compare

    Dialog box to select what to compare. In the dialog box select the @unit element (yellow box) below Height/Length and click on the check mark to confirm your selection.

  • The dialog box will dissepear, and now you will see the unit of Height/Length in the new condition. Since you want the unit to be equal to cm select the == operator from the drop-down list in the row.

    Screenshot about selecting the operator for comparison

    Screenshot about selecting the operator for comparison. To continue select the operator for comparison. Select == (as seen in the red box), since you want the unit to be equal to cm.

  • Click on the Expression label in the row.

    First screenshot to select the unit

    First screenshot to select the unit. To continue creating your condition click on the Element label (red box).

  • Choose the required unit in the drop down list. Here we chose cm as the required unit.

    Second screenshot to select the unit

    Second screenshot to select the unit. To continue selecting the unit, choose the required unit in the drop down list (red box). Here we chose cm as the required unit.

  • To finalize your selection click on the check mark in the dialog box.

    Last screenshot to select the unit

    Last screenshot to select the unit. To finalize your selection click on the check mark (red box).

  • Now, you should repeat the previous steps with weight as well.
    • First, create an empty condition by dragging the Attribute comparison button to the Rule conditions field.
    • After dragging the Attribute comparison button to the Rule conditions field click on the Element@attribute label.

      Screenshot about the steps to verify the unit of the second input (weight)

      Screenshot about the steps to verify the unit of the second input (weight). After dragging the Attribute comparison button to the Rule conditions field click on the Element@attribute label (red box).

    • In the dialog box select the @unit element (yellow box) below Weight and click on the check mark to confirm your selection. Pay attention not to mix with the other @unit element (corresponding to Height/Length) in the dialog box.

      Dialog box to select what to compare

      Dialog box to select what to compare. In the dialog box select the @unit element (yellow box) below Weight and click on the check mark to confirm your selection. Pay attention not to mix with the other @unit element (corresponding to Height/Length) in the dialog box.

    • The dialog box will dissepear, and now you will see the unit of Weight in the new condition. Since you want the unit to be equal to kg select the == operator from the drop-down list in the row.
    • Click on the Expression label in the row.
    • Choose the required unit in the drop down list. Here we chose kg as the required unit.
    • To finalize your selection click on the check mark in the dialog box. If you completed the steps correctly you should the second rule as it is displayed inside the red box.

      Screenshot after entering the condition about the unit of weight

      Screenshot after entering the condition about the unit of weight. If you completed the steps correctly you should the second rule as it is displayed inside the red box.


5. Create two actions: one that sets the output’s unit to m2 and one that sets its precision to 2

  • To start to define the output’s unit, drag the Set Attribute button (to the Rule Action field where you can already see the BSA formula). You will create a new action setting the unit attribute to m2

    First screenshot about defining the unit of the output

    First screenshot about defining the unit of the output. To start to define the output's unit, drag the Set Attribute button (red box) to the Rule Action field (yellow box) where you can already see the BSA formula.

  • In the empty action click on the Element@attribute label.

    Second screenshot about defining the unit of the output

    Second screenshot about defining the unit of the output. To continue click on the Element@attribute label (red box).

  • To select the unit attribute click on the @unit attribute below the Body Surface Area archetype. To confirm your selection click on the check mark.

    Dialog box to select the unit attribute

    Dialog box to select the unit attribute. To select the precision attribute click on the @unit attribute (yellow box) below the Body Mass Index archetype. To confirm your selection click on the check mark (red box).

  • The dialog box will dissepear. Click on the Expression label to open a dialog box to choose the unit of the output.

    Screenshot about choosing the unit of the output

    Screenshot about choosing the unit of the output. To choose the unit of the output click on the Expression label (red box).

  • In the dialog box choose the unit of the output select the desired unit (m2) in the drop-down list.

    Dialog box to choose the unit of the output

    Dialog box to choose the unit of the output. To choose the unit of the output select the desired unit (m2) in the drop-down list (red box).

  • To finalize your selection click on the check mark.

    Screenshot about finalizing the selection

    Screenshot about finalizing the selection. To finalize your selection click on the check mark (red box).

  • To start to define the output’s precision, drag the Set Attribute button (to the Rule Action field where you already have your two actions). You will create a new action setting the precision attribute to 2.
  • In the empty action click on the Element@attribute label. This will open a dialog box to select the attribute to compare.
  • In the dialog box select the precision attribute click on the @precision attribute below the Body Surface Area archetype. To confirm your selection click on the check mark (red box).

    Dialog box to select the precision attribute

    Dialog box to select the precision attribute. To select the precision attribute click on the @precision attribute (yellow box) below the Body Surface Area archetype. To confirm your selection click on the check mark (red box).

  • After selecting precision as the attribute to be defined, click on the Expression label.

    Screenshot about defining the precision of the output

    Screenshot about defining the precision of the output. After selecting precision as the attribute to be defined, click on the Expression label (red box).

  • To set the precision of the output enter 2 in the Expression editor, meaning the output will contain 2 decimals. To accept your selection, click on the check mark.

    Dialog box to set the precision of the output

    Dialog box to set the precision of the output. To set the precision of the output enter 2 in the Expression editor (yellow box), meaning the output will contain 2 decimals. To accept your selection, click on the check mark (red box).


6. Check your guideline in the Execution tab.

You can similarly check your guideline as in the previous cases. You can try to use different input units. If they are not as they are required, your guideline would not work.


7. Save your guideline naming it as BSA.v1 .

  • To save your guideline click on the Guideline > Save Guideline to a File menu item.

    Screenshot about saving your guideline

    Screenshot about saving your guideline. To save your guideline click on the Guideline > Save Guideline to a File menu item (red box).

  • This will show a dialog box to name your file. Write a name to the File Name field, we recommend using BSA.v1 (v1 referring to version 1 compared to the previous version: version 0). To confirm your choice click on the check mark.

    Screenshot about naming your file

    Screenshot about naming your file. To name your file write a name to the File Name field (yellow box), we recommend using BSA.v1 (v1 referring to version 1 compared to the previous version: version 0). To confirm your choice click on the check mark (red box).

  • Depending on your browser configuration your browser might show a dialog box for confirmation. If it shows make sure Save file is selected, then click on the OK button. The screenshot shows an example where this happened while creating a BMI calculator.

    Dialog box shown by your browser (optional)

    Dialog box shown by your browser. Your browser might show a similar dialog box (depending on your browser settings). Make sure Save file is selected (yellow box), then click on the OK button (red box).

  • Depending on your browser configuration your browser might show a dialog box to choose the location of your file to be saved. Make sure the file name is displayed correctly in the File Name field, then click on the Save button in your OS language. The screenshot shows an example where this happened while creating a BMI calculator.

    Last step of saving your guideline

    Last step of saving your guideline. Choose the location of your file to be saved, make sure its name is displayed correctly in the File Name field (yellow box), then click on the Save button in your OS language (red box).