Reference Model as Archetypes ?

Hello,
Is there somewere a machine readable definition available which describes the content of the openEHR Reference Model as Archetypes ?
The Reference Model classes should be expressable as Archetypes, shouldn't they ? At least concerning their logical data model. The methods they also possibly provide can hardly be expressed using Archetypes.
Greetings
Georg

Hi Georg,

That’s exactly how we define reference models with LinkEHR. We generated them from the XSD schemas (and more recently, from BMM). It fits quite nicely with the archetype methodology (every archetype is an specialization, which eases validation).
If you want to try or test them you can download LinkEHR and get them from there.

Regards

Diego,

what do you use as the underlying information model in that case? Presumably the BMM/UML meta-model, i.e. things like Class, Attribute etc?

- thomas

It is basically AOM, serialized as ADL files

As an example, this is the Observation archetype

https://pastebin.com/WhehexLR

I think this is more or less the same as a kind of archetype with no codes at all, only containing RM elements.

I was expecting something more like:

CLASS [Observation_code] matches {
attributes matches {
ATTRIBUTE [Observation_data_code] matches {
name matches {"data"}
...
}
ATTRIBUTE [Observation_state_code] matches {
name matches {"state"}
...
}
}
}
``

or you could do it with C_OBJECT and C_ATTRIBUTE, which is a workable meta-model.

- thomas

But in this case the archetype you create couldn’t be use for validation purposes. I think I’m not fully understanding what you mean with this

Hi Diego,
Thank you, that is exactly what I was looking for.
In the DEMOGRAPHICS and the EHR package there are 6 archetypes which have the same name but differ only in their full path name: CLUSTER, ELEMENT, ITEM_LIST, ITEM_SINGLE, ITEM_TABLE and ITEM_TREE. Why are they two versions of those archetypes with almost identical content ?
Greetings
Georg

They are generated from different “root” XML Schemas (demographics and ehr), but in principle the contents should be the same. Models are generated in a standalone way, so no assumptions are made regarding if ehr model shares classes with demographic one (or any other model already imported). As they are archetypes from these classes on the demographic archetypes of CKM, the classes were selected as archetypable in the RM import process, and thus generated. They should virtually equivalent (apart from changes in the archetype identifier).

Hi Diego,
I just tried to parse the .adl files from LinkEHR and got several Exceptions. I currently use the adl-parser from org.openehr.java-libs_v_1.0.71.
Which parser can I use to parse those archetypes ?
Greetings
Georg

We used that one as a basis and generalized mostly to allow the special RM ‘at’ codes we created. I can send you the modified grammar or the parser if you want.

Hi Diego,
Yes, if you have a working parser for those archetypes that would be useful. The modified grammer would also be useful.
What are the copyright constraints on your parser and your grammmer file ?
I managed to get one of the archetypes parsed by lowercasing the language codes and removing all elements that include a recursive use_node statement.
Is the inability to parse use_nodes that reference a node upwards in the same branch of the element a bug in version 1.0.71 ?
Greetings
Georg

Hi Diego,
In the Archetypes contained in the LinkEHR files I am missing the subclasses that are subclassed by the root archetypes. In ACTION for example the subclass INSTRUCTION_DETAILS is used. This is used in the ACTION.adl file and it is parseable but I wonder if there is an INSTRUCTION_DETAILS.adl file somewhere, which possibly defines something that is not yet defined in the ACTION.adl file. Or can be assumed that the subclasses wherever they are mentioned are fully desribed at the places where they are introduced ?
Greetings
Georg

Wouldn't that disturb interoperability processes? One could wonder: Which one is the right grammar, which one is the right parser?

Bert

Hello,
In the LinkEHR files the archetypes for the "EHR Infomation Model" are contained (ACTION, CLUSTER, etc.). Are there also somewhere archetypes that describe the "Data Types Information Model" (e.g. DV_QUANTITY, DV_MEDIA, etc.).
Greetings
Georg

Grammar (and parser classes) are derived from the original one available in the repo, so the same license applies.
These are edge cases we detected the original parser didn’t treat well (recursive internal references) and were also fixed.

When importing the schema you can chose which are your business entities for a given RM. If you need that archetype you can reimport the model any time you want from the schemas and select more classes as archetypable.

The official one, these are ‘hacks’ that allow you to handle requirements and edge cases only present in these RM archetypes

I don’t think they are currently generated, but you can generate them if you reimport the model and select them

Diego, I don't want to be harsh about LinkEhr, which is a very strong product. But this situation raises questions. I already had this discussion a few times.

Especially because it is not mentioned on the LinkEhr website that it does not support the official OpenEhr out of the box.

You should have an option in the application for creating "official" archetypes, this to avoid confusion.

I think it is very good that you fix issues you experience, but this way, by implementing without explicit notifying does not seem the royal way.

It is bad, because in this way, the OpenEhr-software-ecosystem-base may become too narrow, and it is easy to fix by you, as you indicate to Georg Fette

Best regards

Bert