# Is there any modeling tool that supports creating EHR\_STATUS archetypes and templates?

**URL:** https://discourse.openehr.org/t/is-there-any-modeling-tool-that-supports-creating-ehr-status-archetypes-and-templates/3009
**Category:** Tools
**Created:** [22 September 2022 00:55 UTC](https://discourse.openehr.org/t/is-there-any-modeling-tool-that-supports-creating-ehr-status-archetypes-and-templates/3009 "2022-09-22T00:55:38Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![pablo](https://discourse.openehr.org/user_avatar/discourse.openehr.org/pablo/32/3505_2.png) [@pablo](https://discourse.openehr.org/u/pablo)
#### Post date: [22 September 2022 00:55 UTC](https://discourse.openehr.org/t/is-there-any-modeling-tool-that-supports-creating-ehr-status-archetypes-and-templates/3009/1 "2022-09-22T00:55:38Z")

</div>

I have tested Better Designer and VeraTech LinkEHR and none support EHR\_STATUS artifact definition.

---

<div class="post-metadata">

### Author: ![damoca](https://discourse.openehr.org/user_avatar/discourse.openehr.org/damoca/32/2606_2.png) [@damoca](https://discourse.openehr.org/u/damoca)
#### Post date: [22 September 2022 09:20 UTC](https://discourse.openehr.org/t/is-there-any-modeling-tool-that-supports-creating-ehr-status-archetypes-and-templates/3009/2 "2022-09-22T09:20:56Z")

</div>

Hello Pablo,

I was not even aware that EHR\_STATUS is a LOCATABLE 😅  
So yes, technically it should be possible to create archetypes for it. I have prepared a Quick and Dirty patch. I generated this file from the latest RM XDS. Just copy the files into your LinkEHR Studio folder, inside of [LINKEHR\_FOLDER]/data/rm/openehr/EHR/archetypes/

[EHR\_STATUS.adl](https://discourse.openehr.org/uploads/short-url/jYad5DoVl6XF0iHtwrPlLxJQLim.adl) (58,9 KB)

Then it you should see that class as an option when creating a new archetype.

![image](https://discourse.openehr.org/uploads/default/original/2X/3/33476da0df32739862fcd11f1efafae9bf039d63.png)

The main limitation is that there doesn’t exist a dedicated UI for it, so you have to edit the archetype using the generic archetype tree. Otherwise you wont see any attributes.

![image](https://discourse.openehr.org/uploads/default/original/2X/4/4d61267263f6d0f930ac06c1e1281480df6661df.png)

---

<div class="post-metadata">

### Author: ![siljelb](https://discourse.openehr.org/user_avatar/discourse.openehr.org/siljelb/32/12_2.png) [@siljelb](https://discourse.openehr.org/u/siljelb)
#### Post date: [22 September 2022 10:39 UTC](https://discourse.openehr.org/t/is-there-any-modeling-tool-that-supports-creating-ehr-status-archetypes-and-templates/3009/3 "2022-09-22T10:39:37Z")

</div>

Out of curiosity, what’s the use case for archetyping the EHR\_STATUS class?

---

<div class="post-metadata">

### Author: ![pablo](https://discourse.openehr.org/user_avatar/discourse.openehr.org/pablo/32/3505_2.png) [@pablo](https://discourse.openehr.org/u/pablo)
#### Post date: [22 September 2022 14:50 UTC](https://discourse.openehr.org/t/is-there-any-modeling-tool-that-supports-creating-ehr-status-archetypes-and-templates/3009/4 "2022-09-22T14:50:20Z")

</div>

Cool, thanks @damoca !

---

<div class="post-metadata">

### Author: ![pablo](https://discourse.openehr.org/user_avatar/discourse.openehr.org/pablo/32/3505_2.png) [@pablo](https://discourse.openehr.org/u/pablo)
#### Post date: [22 September 2022 14:55 UTC](https://discourse.openehr.org/t/is-there-any-modeling-tool-that-supports-creating-ehr-status-archetypes-and-templates/3009/5 "2022-09-22T14:55:44Z")

</div>

Formally, any LOCATABLE subclass could be archetyped, and any root class should be archetyped, since it should have archetype\_node\_id and archetype\_details != empty.

Technically, having an archetype and template for LOCATABLE roots allows automatic data validation, automatic data generation, enables GUI generation, among other things.

All these classes should be archetyped and have templates:

COMPOSITION  
FOLDER  
EHR\_STATUS  
any concrete descendant of PARTY (demographic)

Note those are also the types that could be versioned in an openEHR data repository.

---

<div class="post-metadata">

### Author: ![pablo](https://discourse.openehr.org/user_avatar/discourse.openehr.org/pablo/32/3505_2.png) [@pablo](https://discourse.openehr.org/u/pablo)
#### Post date: [22 September 2022 15:17 UTC](https://discourse.openehr.org/t/is-there-any-modeling-tool-that-supports-creating-ehr-status-archetypes-and-templates/3009/6 "2022-09-22T15:17:28Z")

</div>

@damoca is it possible to create archetypes and templates for FOLDER?

---

<div class="post-metadata">

### Author: ![ian.mcnicoll](https://discourse.openehr.org/user_avatar/discourse.openehr.org/ian.mcnicoll/32/4430_2.png) [@ian.mcnicoll](https://discourse.openehr.org/u/ian.mcnicoll)
#### Post date: [22 September 2022 15:39 UTC](https://discourse.openehr.org/t/is-there-any-modeling-tool-that-supports-creating-ehr-status-archetypes-and-templates/3009/7 "2022-09-22T15:39:18Z")

</div>

THe immediate requirement is that ‘officially’ the EHR\_STATUS class is Locatable so should carry and archetype. However early CDRs seem to have ignored that until the REST API came along and (correctly) insists that there is some sort of archetype metadata in there.

```auto
{
  "_type": "EHR_STATUS",
  "archetype_node_id": "openEHR-EHR-EHR_STATUS.generic.v1",
  "name": {
    "value": "EHR Status"
  },
  "subject": { ......

```

So for now it is really a bit of a technical requirement only. We have never used a ‘real’ EHR\_STATUS archetype but we have added structured content to the other\_details part of the EHR\_STATUS structure. In the example beow to carry minimal anonymised personal data to make population querying easier. Now that works and can be queried via AQL but there is no way of applying a template when the data is submitted to the CDR so it is essentially unvalidated.

```auto
{
        "_type": "EHR_STATUS",
        "name": {
            "_type": "DV_TEXT",
            "value": "ehr status"
        },
        "subject": {
            "_type": "PARTY_SELF",
            "external_ref": {
                "_type": "PARTY_REF",
                "namespace": "uk_nhs_nhs_number",
                "type": "PERSON",
                "id": {
                    "_type": "HIER_OBJECT_ID",
                    "value": "61246978-1742-4430-9c11-a52c3e4c6d2b"
                }
            }
        },
        "other_details": {
		"_type": "ITEM_TREE",
		"items": [
			{
				"_type": "CLUSTER",
				"archetype_details": {
					"_type": "ARCHETYPED",
					"archetype_id": {
						"_type": "ARCHETYPE_ID",
						"value": "openEHR-EHR-CLUSTER.person_anonymised_parent.v1"
					},
					"rm_version": "1.0.1"
				},
				"archetype_node_id": "openEHR-EHR-CLUSTER.person_anonymised_parent.v1",
				"items": [
					{
						"_type": "ELEMENT",
						"archetype_node_id": "at0001",
						"name": {
							"_type": "DV_TEXT",
							"value": "Administrative Gender"
						},
						"value": {
							"_type": "DV_CODED_TEXT",
							"defining_code": {
								"_type": "CODE_PHRASE",
								"code_string": "at0009",
								"terminology_id": {
									"_type": "TERMINOLOGY_ID",
									"value": "local"
								}
							},
							"value": "<gender>"
						}
					},
					{
						"_type": "ELEMENT",
						"archetype_node_id": "at0002",
						"name": {
							"_type": "DV_TEXT",
							"value": "Birth Sex"
						},
						"value": {
							"_type": "DV_CODED_TEXT",
							"defining_code": {
								"_type": "CODE_PHRASE",
								"code_string": "at0009",
								"terminology_id": {
									"_type": "TERMINOLOGY_ID",
									"value": "local"
								}
							},
							"value": "<gender>"
						}
					},
					{
						"_type": "ELEMENT",
						"archetype_node_id": "at0003",
						"name": {
							"_type": "DV_TEXT",
							"value": "Vital Status"
						},
						"value": {
							"_type": "DV_CODED_TEXT",
							"defining_code": {
								"_type": "CODE_PHRASE",
								"code_string": "at0004",
								"terminology_id": {
									"_type": "TERMINOLOGY_ID",
									"value": "local"
								}
							},
							"value": "Alive"
						}
					},
					{
						"_type": "ELEMENT",
						"archetype_node_id": "at0014",
						"name": {
							"_type": "DV_TEXT",
							"value": "Birth Year"
						},
						"value": {
							"_type": "DV_DATE",
							"value": "<birth_year>"
						}
					}
				]
			}
		]
	},

```

---

<div class="post-metadata">

### Author: ![pablo](https://discourse.openehr.org/user_avatar/discourse.openehr.org/pablo/32/3505_2.png) [@pablo](https://discourse.openehr.org/u/pablo)
#### Post date: [22 September 2022 16:08 UTC](https://discourse.openehr.org/t/is-there-any-modeling-tool-that-supports-creating-ehr-status-archetypes-and-templates/3009/8 "2022-09-22T16:08:14Z")

</div>

Note without the OPT for EHR\_STATUS, the other\_details field can’t be queried internally, since you don’t know which structure is there, so you can query to get the whole other\_details, but can use an internal path of the other\_details as a filter or projection in a query. The OPT is actually the “schema” in which the query is defined, and without that info all you know is the RM with a generic ITEM\_STRUCTURE there.

---

<div class="post-metadata">

### Author: ![ian.mcnicoll](https://discourse.openehr.org/user_avatar/discourse.openehr.org/ian.mcnicoll/32/4430_2.png) [@ian.mcnicoll](https://discourse.openehr.org/u/ian.mcnicoll)
#### Post date: [22 September 2022 16:21 UTC](https://discourse.openehr.org/t/is-there-any-modeling-tool-that-supports-creating-ehr-status-archetypes-and-templates/3009/9 "2022-09-22T16:21:07Z")

</div>

You can actually query on the more granular data in the Better CDR, even without a template for EHR\_STATUS. Of course you are completely reliant on that data having been committed correctly without template-base validation. And you have to know the structure committed with out it being documented in a template.

```auto
...
AND e/ehr_status/other_details/items[openEHR-EHR-CLUSTER.person_anonymised_parent.v1]/items[at0001]/value/value = 'Male'

```

---

<div class="post-metadata">

### Author: ![borut.jures](https://discourse.openehr.org/user_avatar/discourse.openehr.org/borut.jures/32/1391_2.png) [@borut.jures](https://discourse.openehr.org/u/borut.jures)
#### Post date: [22 September 2022 16:42 UTC](https://discourse.openehr.org/t/is-there-any-modeling-tool-that-supports-creating-ehr-status-archetypes-and-templates/3009/10 "2022-09-22T16:42:31Z")

</div>

> [@ian.mcnicoll](#):
>
> You can actually query…

And when you do, you should get a deprecation warning 😉

Years later nobody will remember how this data was committed and what is its structure.

---

<div class="post-metadata">

### Author: ![pablo](https://discourse.openehr.org/user_avatar/discourse.openehr.org/pablo/32/3505_2.png) [@pablo](https://discourse.openehr.org/u/pablo)
#### Post date: [22 September 2022 16:43 UTC](https://discourse.openehr.org/t/is-there-any-modeling-tool-that-supports-creating-ehr-status-archetypes-and-templates/3009/11 "2022-09-22T16:43:53Z")

</div>

I’m not saying it’s technically impossible, I’m saying you rely on external knowledge of the internal structure of the other\_details, which IMO is a very insecure way of querying. When querying, the underlying schema should be known beforehand and with some formal definition (i.e. the OPT).

---

<div class="post-metadata">

### Author: ![ian.mcnicoll](https://discourse.openehr.org/user_avatar/discourse.openehr.org/ian.mcnicoll/32/4430_2.png) [@ian.mcnicoll](https://discourse.openehr.org/u/ian.mcnicoll)
#### Post date: [22 September 2022 16:50 UTC](https://discourse.openehr.org/t/is-there-any-modeling-tool-that-supports-creating-ehr-status-archetypes-and-templates/3009/12 "2022-09-22T16:50:58Z")

</div>

Yup - I agree with you there.

Does anyone have a practical/actual usage of an EHR\_STATUS archetype other than as a container to add ‘other details’ as e.g Cluster archetypes. I cannot think of anything myself.

---

<div class="post-metadata">

### Author: ![pablo](https://discourse.openehr.org/user_avatar/discourse.openehr.org/pablo/32/3505_2.png) [@pablo](https://discourse.openehr.org/u/pablo)
#### Post date: [22 September 2022 16:54 UTC](https://discourse.openehr.org/t/is-there-any-modeling-tool-that-supports-creating-ehr-status-archetypes-and-templates/3009/13 "2022-09-22T16:54:06Z")

</div>

I guess the usage could be to add any metadata required by an implementation at the EHR level, e.g. some IDs, organization information, or even basic demographic data to allow querying.

My concern is not domain use cases right now, but to have a workflow that allows me to verify conformance with openEHR on any system, which includes archetyping EHR\_STATUS, which should be doable considering the openEHR specs.

---

<div class="post-metadata">

### Author: ![birger.haarbrandt](https://discourse.openehr.org/user_avatar/discourse.openehr.org/birger.haarbrandt/32/24_2.png) [@birger.haarbrandt](https://discourse.openehr.org/u/birger.haarbrandt)
#### Post date: [23 September 2022 11:57 UTC](https://discourse.openehr.org/t/is-there-any-modeling-tool-that-supports-creating-ehr-status-archetypes-and-templates/3009/14 "2022-09-23T11:57:08Z")

</div>

@ian.mcnicoll I have been keen for a long time to support Archetypes on “other” locatable objects in the EHR. Maybe not happening tomorrow in EHRbase, but definitely something I aim at.
