A step by step guide on openEHR - from CKM to Forms using Medblocks UI and EHRbase
openEHR provides a robust way to build any clinical application while separating the data from the application logic. Applications come and go, but healthcare data is for life.
The way openEHR achieves this is by defining archetypes and templates - think of them like database schemas, but with the ability to model data on 2 levels.
The first level is the archetype - A maximal dataset that's agreed upon by a global community of clinicians and informaticians. Think of these as lego bricks that have been crafted to perfection over years of trial and error. For instance, the blood_pressure.v2 archetype you see below has gone through almost multiple revisions and has about 23 data points currently. This represents almost anything you will need to capture when it comes to the concept of "blood pressure".
Archeypes are like lego bricks
The second level is the template - The same archetypes can be put together in different ways according to the situation. Here, you can get creative and cut out data points from the archetypes you don't need and include others you do. For example, a General Practitioner may only need the systolic and diastolic data points from the blood pressure archetype, whereas a cardiologist may need the position, location of measurement, and a 24-hour average.
These variations along with many other things can be expressed in a template.
Templates are the end products of putting archetypes together
Clinical Data Repository
The templates are posted to an openEHR Clinical Data Repository through its REST API. Open-source openEHR CDRs like EHRbase are becoming very popular for this.
The applications that need to persist information then use the same REST API to commit data as compositions and can query the data using the AQL API.
The advantage of this approach is that the meaning of each concept, for example, "blood pressure" still remains. AQL can be used later to get all blood pressure values - limiting to both within a template or otherwise. This allows applications to interoperate without knowing about each other. They just need to use the correct archetypes to record clinical data.
More importantly, the alternative - which is to store the clinical data in a format specific to the application is prevented. This prevents data silos from forming in the first place and completely avoids the expensive "mapping work" to make these applications interoperable.
You can find more views on why openEHR is the right decision for clinical data in these articles below.
Why openEHR is Eating Healthcare
A blog post by Alastair Allen, CTO of Better
What is openEHR and why is it important? - ECHAlliance
NHS Whales - technical evaluation into openEHR
Creating an openEHR Template
Before we get started with the code, we need to create an openEHR template. Let's do that first.
Download archetypes needed for the form from Clinical Knowledge Manager (CKM)
Archetypes needed for your system can be scoped out from openEHR's Clinical Knowledge Manager website and downloaded. Download the Archetype files in ADL format and make sure to include at least one Root Archetype. You can also download all archetypes by going into Archetypes -> Bulk Export -> Click the Bulk Export button.
Clinical Knowledge Manager
Downloading Archetypes in CMK
Create a new repository in Archetype Designer
Archetype Designer is a tool provided by Better to create templates and archetypes. If you cannot find an archetype specific to your needs, you can create one on Archetype Designer. But in this guide, we'll be using the archetypes from the openEHR CKM.
Creating a new Repository in Archetype Designer
Import all the archetypes downloaded to the repository
Open the newly created Repository, click the import button and select all the archetypes downloaded and click Upload All to upload the archetypes. You can also directly upload the .zip file you downloaded in the bulk exoprt process.
Archetypes Imported in the Repository
Create a new template
Select 'New' and 'Template' to create a new template. You will have to select an RM Type and a Root Archetype id and give an id for the template.
Clicking the New button
Creating a new template
Add the imported archetypes as required to the template
After following the above steps a blank template will be created. Add your imported archetypes by pressing the "+"(add) button on "content". Customize your template according to the requirements, you can deselect attributes of archetypes that are unnecessary.
Adding archetypes to the template
Export the Template
After you are done editing your template, click export and select "Web Template" while exporting. This will export your template in a JSON format which will be used to create Clinical forms.
Export the template in OPT format also, you will need to post this file to openEHR server for posting compositions.
Exporting the template
For more information on how to create an openEHR template, watch this video: