Separating Models from Implementation

Ok, let’s go back to the original ask/suggestion :

What I would like to see is an option to separate the Clinical model from any dependencies introduced by OpenEHR, such as the RM. I can see how the RM is very useful for Clinical Modellers, but there should be an option to express (export from the CKM) the model in a more generic way, one that does not require any understanding of the RM, or indeed require OpenEHR tooling to parse/understand.

This I think would increase the usage of the OpenEHR clinical models.

Essentially an export to XML, JSON or similar, with no dependency on the RM, the model exported a concrete rather than meta-model. - the closest thing I can see to this at the moment is the mind-map or printable version of the archetype.

What do I think people would do with it ?

I think follow more of a DDD approach rather than meta-model. Not saying one is better than the other, but surely better to have >1 way to implement the model ?

2 Likes

I asked if you would prefer to have DDLs or ORM model classes for openEHR archetypes. No RM or anything openEHR related. Just pure classes.

Wouldn’t that enable your DDD approach?

1 Like

Possibly, but I think the option I suggest is neater, then folks can generate their own ORM, classes etc

Personally I prefer .NET, so if I was going to do this then I’d want to take advantage of the features in C#.

1 Like

Can we find a way to make the archetype models more ‘RM-independent’ - to which the answer is yes - but the RM carries a lot of critical ‘clinical’ parts of the models e.g datatypes, provenance, utility structures like Action, without which they make no sense, unless you add the same things back in again. So the answer to your question is not to make the archetype RM -indpendent because they can’t be any more than clinical SCI-XML models could be independent of the base types , or FHIR resources could work without their pre-defined datatypes. So what we need to do is to be able to fold in those parts of the RM that are critical to the faithful clinical meaning of the archetype.

There are a number of different ways of doing that, and this is not dissimilar to what developers end up with in pure openEHR-land, via Web templates, flattened data forms, proxy object generation - these are all about folding things back together and hiding most of the RM ‘persistence’ sub-structure away, where it needs to be inside CDRs

I’d really like you to have a look at the Web template example and say what is wrong with it from your POV. All of the model, including those critical parts of the RM are expressed in a readily parsable way in JSON.

3 Likes

I’m one of the folks that is generating my own “ORM”, classes etc. I offered to generate the same for you. In .NET or whichever language you prefer.

I took what openEHR offers and did it. It took me 40 days after first finding out that the openEHR exists.

I could spend those 40 days complaining it is too hard and complicated and would be where you are today.

Stop complaining. Start doing. Ask for help.

1 Like

In that particular case I think the (quite reasonable) question could then be formulated as - should we go for:

  1. either some tested closed EHR platform supported by a supplier (like Cerner) with some API interaction points (e.g. FHIR+proprietary) for predefined data sets
  2. or an open (vendor neutral) EHR platform with everything open - both APIs (full+simplified) and the full internal semantics/structures open. And in case #2 either…
  • 2a. do it ourselves or
  • 2b. do it together with a partner/group that provides and helps us use an openEHR based platform and clinical modelling

In case #1 your architects would have found the internal data models of the platform (in this case Cerner’s) to be even more complicated than openEHR’s - if they were allowed to look at them - but they likely never saw them, only big picture architecture and the things Cerner choose to expose via API - and that may look simple enough.

For case #2 to be comparable you could also choose to NOT have the architects look at the internal openEHR models, and instead only look at APIs for certain use cases, e.g. openEHR simplified formats for the particular templates/use-cases that solution #1 would also expose. In that case - to achieve the comparable situation as with buying Cerner - you should also go for #2b and pick an openEHR supplier (or supplier group) that gives you corresponding support, including creating templates and documenting simplified APIs for external parties that do not want to dive into openEHR internals.

Going for #2 without a partner with strong openEHR skills, international network and general EHR experience is like trying yourself to do all things Cerner have done to build their platform. (But with openEHR you’d at least get a good head start with a basic framework compared to starting from scratch.) It’s doable but it took Cerner some years to get there - and has taken openEHR platform suppliers some (but considerably fewer) years to do similar things…

The discussion of going for #1 or #2 is reasonable and still a living in reality (at least in Sweden)- A couple of years ago most big organisations (and consulting firms) would argue for #1, nowadays many argue for #2 after seeing the drawbacks of #1 and the possibilities and examples of #2. At least in region Stockholm (where I work) there are still people arguing for a mini-version of #1 after we stopped the procurement of a big (EPIC/Cerner-sized) procurement in #1-style. They think it will be way to complicated and take too long to go for #2. I personaly think #2 is certainly doable by having good partners/suppliers and simultaneously continue to train/recruit a strong team of our own. Two other Swedish Regions chose Cerner some years ago and are now working to implement/configure it to be able to run it in production.

Most other Swedish regions have Cambio Cosmic that used to be of type #1 but is now piece by piece moving over to #2(b) using openEHR. (The Cambio case has similarities with what DIPS in Norway has done and what TietoEVRY is doing.)

@ToStupidForOpenEHR Does this reasoning resonate with your experiences and thoughts? Would such a modified #1 vs #2a/#2b comparison be of use if you’d get into similar situations again?

5 Likes

Can I suggest you (or someone) start a new topic on ‘ADL export formats’ or similar - that problem can be solved, but the details of what you want need to be discussed.

This thread is really more about openEHR and HIT solutions generally I think.

The decision is never mine. I’m an independent Enterprise Architect trying to help clients define their target architecture.

I have been promoting OpenEHR for 4+ years, trying to help increase the uptake.

4 Likes

I’d suggest the opposite, the intend of the author of the topic is to discuss ADL export options. But others (including me) have hijacked the topic to state why you shouldn’t want it (still my position). So I think it’s nice to the author to split of that general HIT discussion and keep this topic focused on export of ckm models in a meaningful and clinically safe way in a format that allows Gary to do DDD.

Either fine - but what we need to work out is:

  • do you want to start from a template (use-case specific data set) or an archetype?
  • how do you want the necessary RM context attributes to appear?

A manual exercise to sketch out a converted archetype, say a heart rate Observation inside a Composition might be a good starting point. Can @ToStupidForOpenEHR provide a steer on what you want to see in the output in a chunk of rough JSON or other common format? If we can see the source and target, we will have a better idea of what you want. I think it is probably very close to TDS / TDO, which was developed over a decade ago, but not used that much these days.

2 Likes

@ToStupidForOpenEHR Now I found the thread on Twitter, I started in the Discourse end. sorry about possible confusion/sidetracking added.

I find your original request there very reasonable. I believe that what you are asking for is exactly what the TDS/TSS approach did/does using normal XML-schema and XML instances (that any XML tool understood, without being an openEHR-specific tool). We’d need a JSON schema-based equivalent nowadays. (And likely a similar GraphQL approach.) Would the approach discussed in post #12 above achieve what you are asking for?

The Web template JSON-files are semantically a schema like TDS but in a custom JSON structure, not in a format that non-openEHR tools like Altova can ingest. Let’s fix that by creating a way to generate proper (template specific) JSON schema (that can be used in regular non-openEHR tools).

The openEHR vendor Better has separated out some generic things (user, language etc) into a context (ctx) object that can be reused in API calls and automatically populate some COMPOSITION and VERSION values from that. That kind separation would likely be clever to allow if we want a simpler format for specific templates.

3 Likes

Thanks for taking the time to look at this.

Yes, what you have in post 12 is closer to my suggestion, a format that non-OpenEHR Tools can ingest.

Let me give you a simple use case. Let’s say an app developer in the UK wants to build a small app for Diabetes patients, they know that the concrete classes will be small, they conclude that a single level model approach is sufficient, rather than two-level. At the moment they have the choice of creating the information model themselves, trying to adapt something from FHIR or going to somewhere like https://theprsb.org/ or using models designed by the OpenEHR clinical community. As it stands the models from the OpenEHR community are only available to those with OpenEHR tools and I think in fairness do require at least a decent understanding of the relationship between the RM, Archetypes and Templates.

If the model could just be exported from the CKM or as you suggest from Templates then I think more people would use the OpenEHR clinical models. This app developer may in due course realise the power of OpenEHR and expand their offering, at which time they may decide to fully adopt OpenEHR.

5 Likes

where can I read more on TDS/TSS ?

Yes, that’s a great usecases for the described export!
I think we should do OpenAPI as a format mainly because it allows code generation from the models to first class citizen, so no RM/openEHR or anything! (More detail in the topic by Pieter references by Borut)
You state you don’t want a multi level modelling approach. The challenge here is what kind of data do you record and how does the app record enough context (meta information) to make it meaningful. Simplest way to do this would be to only use the BP observation archetype and set an (potentially implicit) default context (e.gl time, non professional recorder, etc) in the app. This might be ok, but I’d still say it’s much easier and safer to export the relevant RM attributes (qualification of recorder, time of measurement etc) from the RM with the archetypes. These are the ones on CKM you see at the ‘reference model tab’ Clinical Knowledge Manager

But what the app builder will also have to do is to only render the relevant datapoints from multiple archetypes in a form like ui: e.g. to record a glucose measurement once a day, you need 3-5 archetypes, and disable 95% of the available data points. And if you also want to record say blood pressure and some more related data this gets to be a lot off work quickly. And there’s already a solution for this in the form of templates. And tools to easily create those to achieve the described requirements and export to a webtemplate.
So I’d argue the best way to achieve your scenario currently would be to use archetype designer to do the data modelling work, export as webtemplate and use medblocks ui to render it. Should be doable in less than a day without knowing about openEHR.
If you don’t want an openEHR export format (again I’d prefer openapi), someone would have to build that into Archetype designer (or CKM). What would you be able to contribute to get this done?

Hi @erik.sundvall I don’t see any issues on working on the tech side to build frameworks, SDKs, libraries and tools to make things easier, I did that myself.

What I tried to tell, and might be misunderstood, is my own experience with openEHR and it’s learning curve, and based on that experience, my own opinion on why some companies run away from openEHR, since I don’t think the main issue is complexity of the specs or the lack of tooling available. Though I see more issues in the tooling side than in the spec complexity side. That is also why I created my own tools :slight_smile: (https://toolkit.cabolabs.com/).

Another thing is what was proposed here about separating the RM from the AOM just doesn’t work since AOM depends on a RM. My point was that the AOM is already abstracted from the RM since it can be ANY RM, even a custom one, but at design time the RM should be defined so archetypes and templates could be created. The key think to get clear is: this is the core design of openEHR, it is not right or wrong, is the design, so any change at that core area is basically not going in the openEHR way.

2 Likes

That is totally fine, I guess they have a list of core requirements / problems to solve, and some knowledge about what openEHR is for, and openEHR wasn’t a fit for the project. Though there are other things to consider like hidden business goals and politics. I guess they didn’t share with you a detailed rationale why they are not including openEHR in the architecture.

If a decision is made at a strategic level without having a clear list of requirements and knowledge about the specs that could help tackling those requirements, they are clearly considering other things to decide what goes in or not, despite any logic reason.

I mean, some people see interoperability as a business killer, and they promote vendor lock-in. Bottom line: openEHR is not for everyone and that is OK.

You need to define those “things” so the different programs could take a look, community input is important, but we need details.

For instance, what you mention on your first message of separating the RM from the AOM, is not possible as I already mentioned, but the AOM is not depending on the RM, you can use any RM or define your own. The issue is tools available can’t support multiple models (I think only LinkEHR supports multiple models).

1 Like

My message is not about a lecture, it’s about my own experience when starting from scratch with openEHR, and my opinion why some companies don’t get into openEHR. I thought that could help giving a sample path for people just starting with openEHR, specially to give an idea of the time required to get proficient in openEHR specs and implementation, which is information you can’t find out there…

4 Likes

I just read this paper from @thomas.beale

Which does a good description of describing the thinking behind OpenEHR that had not jumped out at me from the specs page.

Now, I am used to a single model approach, that not only encapsulates data but business logic in the domain model, as per Eric Evans and DDD, and Fowler in PEAA (domain model and all the design patterns)

OpenEHR seems to have started of as a two-level approach (which I think still holds true for RM and Archetype), and is now a multi-level approach (I think templates are the 3rd level on this stack)

I’m asking can OpenEHR models stored as multi-level (I think I want RM+ArcheType+Template) also be exported as single-level. The multi-level approach suggests this would be doable

2 Likes

Correct.

It is; just a question of the details. I think between the OpenAPI, TDS (others will explain) and Web template options, you will get a solution. My suspicion is that OpenAPI might do the better job today. This allows us to look at it as a model-to-model transform problem - the output is a kind of custom single level UML equivalent, with the concrete format being OpenAPI. But we could pump out real UML or Java, or… whatever you want.

Fellow propeller-heads - do we have an OpenAPI conversion that compresses useful parts of the RM into the output?

2 Likes

BTW, just remembered that CKM Rest API actually allows you to get the mindmap directly just by knowing the id
For example, for Blood pressure this is the link to the mindmap
https://ckm.openehr.org/ckm/rest/v1/archetypes/1013.1.3574/mindmap

1 Like