# Reference Model as Archetypes ?

**URL:** https://discourse.openehr.org/t/reference-model-as-archetypes/15546
**Category:** Technical (archive)
**Created:** [11 December 2018 09:19 UTC](https://discourse.openehr.org/t/reference-model-as-archetypes/15546 "2018-12-11T09:19:44Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [11 December 2018 09:19 UTC](https://discourse.openehr.org/t/reference-model-as-archetypes/15546/1 "2018-12-11T09:19:44Z")

</div>

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

---

<div class="post-metadata">

### Author: ![yampeku](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yampeku/32/25_2.png) [@yampeku](https://discourse.openehr.org/u/yampeku)
#### Post date: [11 December 2018 09:40 UTC](https://discourse.openehr.org/t/reference-model-as-archetypes/15546/2 "2018-12-11T09:40:23Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [11 December 2018 10:51 UTC](https://discourse.openehr.org/t/reference-model-as-archetypes/15546/3 "2018-12-11T10:51:06Z")

</div>

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

---

<div class="post-metadata">

### Author: ![yampeku](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yampeku/32/25_2.png) [@yampeku](https://discourse.openehr.org/u/yampeku)
#### Post date: [11 December 2018 10:53 UTC](https://discourse.openehr.org/t/reference-model-as-archetypes/15546/4 "2018-12-11T10:53:34Z")

</div>

It is basically AOM, serialized as ADL files

---

<div class="post-metadata">

### Author: ![yampeku](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yampeku/32/25_2.png) [@yampeku](https://discourse.openehr.org/u/yampeku)
#### Post date: [11 December 2018 10:58 UTC](https://discourse.openehr.org/t/reference-model-as-archetypes/15546/5 "2018-12-11T10:58:26Z")

</div>

As an example, this is the Observation archetype

[https://pastebin.com/WhehexLR](https://pastebin.com/WhehexLR)

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [11 December 2018 11:36 UTC](https://discourse.openehr.org/t/reference-model-as-archetypes/15546/6 "2018-12-11T11:36:34Z")

</div>

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`

---

<div class="post-metadata">

### Author: ![yampeku](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yampeku/32/25_2.png) [@yampeku](https://discourse.openehr.org/u/yampeku)
#### Post date: [11 December 2018 12:08 UTC](https://discourse.openehr.org/t/reference-model-as-archetypes/15546/7 "2018-12-11T12:08:03Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [12 December 2018 11:20 UTC](https://discourse.openehr.org/t/reference-model-as-archetypes/15546/8 "2018-12-12T11:20:50Z")

</div>

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

---

<div class="post-metadata">

### Author: ![yampeku](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yampeku/32/25_2.png) [@yampeku](https://discourse.openehr.org/u/yampeku)
#### Post date: [12 December 2018 11:43 UTC](https://discourse.openehr.org/t/reference-model-as-archetypes/15546/9 "2018-12-12T11:43:22Z")

</div>

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).

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [12 December 2018 11:45 UTC](https://discourse.openehr.org/t/reference-model-as-archetypes/15546/10 "2018-12-12T11:45:24Z")

</div>

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

---

<div class="post-metadata">

### Author: ![yampeku](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yampeku/32/25_2.png) [@yampeku](https://discourse.openehr.org/u/yampeku)
#### Post date: [12 December 2018 11:53 UTC](https://discourse.openehr.org/t/reference-model-as-archetypes/15546/11 "2018-12-12T11:53:12Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [12 December 2018 12:18 UTC](https://discourse.openehr.org/t/reference-model-as-archetypes/15546/12 "2018-12-12T12:18:56Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [12 December 2018 12:35 UTC](https://discourse.openehr.org/t/reference-model-as-archetypes/15546/13 "2018-12-12T12:35:45Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [12 December 2018 12:41 UTC](https://discourse.openehr.org/t/reference-model-as-archetypes/15546/14 "2018-12-12T12:41:14Z")

</div>

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

Bert

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [12 December 2018 12:43 UTC](https://discourse.openehr.org/t/reference-model-as-archetypes/15546/15 "2018-12-12T12:43:31Z")

</div>

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

---

<div class="post-metadata">

### Author: ![yampeku](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yampeku/32/25_2.png) [@yampeku](https://discourse.openehr.org/u/yampeku)
#### Post date: [12 December 2018 12:45 UTC](https://discourse.openehr.org/t/reference-model-as-archetypes/15546/16 "2018-12-12T12:45:57Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![yampeku](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yampeku/32/25_2.png) [@yampeku](https://discourse.openehr.org/u/yampeku)
#### Post date: [12 December 2018 12:47 UTC](https://discourse.openehr.org/t/reference-model-as-archetypes/15546/17 "2018-12-12T12:47:42Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![yampeku](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yampeku/32/25_2.png) [@yampeku](https://discourse.openehr.org/u/yampeku)
#### Post date: [12 December 2018 12:48 UTC](https://discourse.openehr.org/t/reference-model-as-archetypes/15546/18 "2018-12-12T12:48:03Z")

</div>

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

---

<div class="post-metadata">

### Author: ![yampeku](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yampeku/32/25_2.png) [@yampeku](https://discourse.openehr.org/u/yampeku)
#### Post date: [12 December 2018 12:49 UTC](https://discourse.openehr.org/t/reference-model-as-archetypes/15546/19 "2018-12-12T12:49:03Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [12 December 2018 13:27 UTC](https://discourse.openehr.org/t/reference-model-as-archetypes/15546/20 "2018-12-12T13:27:37Z")

</div>

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

[Next page](https://discourse.openehr.org/t/reference-model-as-archetypes/15546.md?page=2)
