Create a Template using the Archetype Designer

We’ve seen the openEHR Clinical Knowledge Manager, or CKM, and the archetypes available in it. But how do you combine them into a template to answer clinical needs?

In this lesson, we will create a simple template using the Archetype Designer. This template will contain two commonly used data points, blood pressure and pulse.

Step 1: Download archetypes from CKM

Let’s search for the archetypes we need beginning with blood pressure.

Searching for blood pressure
Searching for blood pressure

There are multiple formats in which to export an archetype. We will use the ADL format.

The ADL or Archetype Definition Language is a human-readable structured format used to represent openEHR archetypes. Tools like Archetype Designer can parse this to understand what the archetype looks like.

The screenshot below shows the options available.

Export Archetype options
Export Archetype options

You can repeat the same process with the Pulse/Heart beat archetype.

Pulse/Heart beat archetype
Searching for the Pulse/Heart beat archetype

Once you find the archetype, export it in the ADL format.

Select the right archetype version

You might find draft versions of archetypes when browsing the CKM. In that case, select the latest published version or most stable version using the option shown below.

Select archetype version
Select archetype version

Step 2: Setting up Archetype Designer

Next, open the Archetype Designer.

The Archetype Designer is a browser-based openEHR modelling tool. It is maintained by Better, and is the most widely used way to create and edit templates.

Archetype Designer home page
Archetype Designer home page

You can log in with Google, Microsoft or Github.

Once you sign in, you will see your repositories. Let’s create a new repository, and call it ‘openEHR fundamentals course’.

Create a new repository
Create a new repository

Step 3: Import archetypes

Then, you can import the archetypes you downloaded from the CKM.

Import archetype
Import archetypes

Make sure that you can see the uploaded archetypes before you proceed.

Check uploaded archetypes
Check uploaded archetypes

Before creating a template, you also need to download a root archetype of type COMPOSITION from the CKM. We will be using an Encounter archetype. An encounter is used to represent any interaction between a patient and a provider.

Encounter archetype of type COMPOSITION
Encounter archetype of type COMPOSITION

Download the archetype as an ADL file, and import it into the CKM as we did with Blood Pressure and Pulse/Heart beat.

Once the archetypes are imported, you can reuse them for any artefacts you create in this repository.

Step 4: Create a template

The next step is to create a template in the Archetype Designer. Click NewTemplate.

Create a template
Create a template

You will see a dialog box, shown below.

Create new template dialog box
Create new template dialog box

For field values,

  • Rm Type: Select COMPOSITION
  • Root Archetype ID: Here, select the archetype we just uploaded, openEHR-EHR-COMPOSITION.encounter.v1.adl. Templates derive from root archetypes and tell the CDR what to expect.
  • Template ID: Name your template anything you’d like and version it. There are no explicit naming conventions, but using snake case, followed by a version number is a good way to approach it.

Step 5: Add archetypes to the template

Now let’s build our template by adding archetypes, starting with Pulse/Heart Beat.

Archetypes are added under the content field.

Adding archetypes in the content field
Adding archetypes in the content field

If you open the Pulse archetype, you will see that it has a lot of elements.

Archetypes are maximal datasets, they capture all possible details that could be recorded. In practice, you almost never need all of them.

Under each archetype, you will see the possible ways to capture that information.

Information capture under archetypes
Information capture under archetypes
  • Any event: Information captured at a point in time or interval which can be specified.
  • 24 hour average: In the case of blood pressure, this is an estimate of average blood pressure over a 24 hour period.
  • Maximum: In the case of pulse, this indicates the maximum pulse rate observed during a period of exertion.

Next, you can select the fields that are relevant to you, and deactivate or prohibit everything else. You can do this by selecting the field and changing the Occurrence.

Changing occurrence of data points
Changing occurrence of data points

Cardinality or occurrence of an element is represented in the form X..Y where

  • X is the minimum number of times the element can occur
  • Y is the maximum number of times the element can occur

So, to disable an element, set the cardinality to 0..0. To enable it, set it to 0..1.

Usually, you can capture multiple values under Any Event, so restrict that to 1 by changing the occurrence.

Step 6: Save and export the template

When you are done, you can export the template. There are a few different formats you can use:

  • Use an OPT when interacting with an openEHR CDR or data platform
  • Use File Set to import a template back into the Archetype Designer

Congratulations, you’ve created your first template! Keep the downloaded file somewhere safe, we’ll use it in later lessons.

Comments (0)

No comments yet. Be the first to comment!