EHRBase questions


I’m new to the openEHR world and this is my first time posting!

I’ve been going through the EHRBase documentation (which has been great) but I have some questions I haven’t been able to find the answer for.

  1. Regarding 2.5. Step 4: Load Data — EHRbase documentation . How can the flat format be used in an application? Would the application need to parse the web template and construct the paths which map to a specific field/value?

  2. Regarding 2.5. Step 4: Load Data — EHRbase documentation . I’m confused how to use the EHRBase Client Library. Where can I find it and how can I use it?

  3. The docs include two ways to do most things: use the client library or use the REST API. For example, using the client library to create a composition or using the flat format API. Is there a preference to use one method over the other? Is it purely up to preference, or are there some usecases that make one option favourable over the other?

Thanks in advance!


The CDR should handle that conversion. Basically the app maps it;s data entry fields to the FLAT format then simply sends the completed JSON composition opbject tothe CDR via a /composition call, though right now this has to be via a local proprietary API not the formal openEHR REST API. Fortunately (well deliberately!!) the ehrBase varient is identical to the Better equivalent, other than the Base URL.

The only challenge here is figuring out what the FLAT format object should look like - for that you do need to parse the Web template and figure out how the flat paths are constructed from the ‘id’ segments. Better provide a ?template/example Ehrscape call that does this for you and generates a dummy FLYT composition, which is really helpful. I believe that is on it’s way for ehrBase.

That is purely developer choice. I like the REST API, for training purposes as it is programming language agnostic, but the client library approach is often preferred by java coders for obvious reasons, and I expect other languages will become supported.

Ultimately they all end up as a composition instance object, compliant with the RM, validated against a specific template, and wholly interchangable form a data retrieval and querying persepective. And CDR neutral, of course

1 Like

Ah, we should update this part. This refers to the openEHR SDK that you can find here: GitHub - ehrbase/openEHR_SDK

There are lots of examples inside the project structure, especially as part of the unit tests. Along with the written description, this should give you a good overview of the usage. Though, we will surely try to cover the details better in the read the docs documentation.

The SDK can be included into your Java project like any other libraries. We have one example project that covers some parts of the SDK: GitHub - ehrbase/angular-sdk-example

1 Like

Hi Ian!

Few follow up questions if you may.

  1. When you say: " And CDR neutral, of course", does that mean that I can technically take the data that EHRBase produces and use it with any other openEHR compliant library (Ex. Ehrscape)?
  2. I somehow missed Ehrscape while researching open source libraries that implement the openEHR specification. It doesn’t seem like they have a public github repo. Do you know if it is actually open source? I see the API you mentioned in their documentation (Reference Guide) , but I can’t find where the codebase lives to see how they’ve implemented it.
1 Like

So If i’m using the EHRbase repo, would I need to also include the EHRbase SDK within it?

1 Like

You can use EHRbase with or without the SDK. I hope this figure I just made spontaneously helps to make this a bit clearer:

The SDK uses the same REST API endpoints but for Java devs, there is lots of utilities including code generation and querying. Especially with WebTemplate format, it should be possible to develop with any language but the SDK will boost productivity when you develop in Java.

EHRbase uses the SDK anyways (because it uses things as validation from the SDK) but you have to think about your own app that you want to build based on EHRbase.

1 Like

Ehrscape is not open source but parts of the ‘proprietary’ aspects are becoming ‘de-facto’ standards e.g Web templates and the FLAT composition serialisations (supported by ehrBase) and will be used as the basis fo formal standardisation.

1 Like