# Extract archetypes

**URL:** https://discourse.openehr.org/t/extract-archetypes/15505
**Category:** Technical (archive)
**Created:** [30 November 2017 11:55 UTC](https://discourse.openehr.org/t/extract-archetypes/15505 "2017-11-30T11:55:26Z")
**Posts on this page:** 15
**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: [30 November 2017 11:55 UTC](https://discourse.openehr.org/t/extract-archetypes/15505/1 "2017-11-30T11:55:26Z")

</div>

Hi,

Since that it is so that some extract-classes derive from Locatable, they can be used to use them as RM-class for an archetype-definition.

But how would the ArchetypeId look like, special the rmName. Would it be something like openEHR-Extract-Extract........ ?

Thanks in advance for answering

Bert

---

<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: [30 November 2017 12:04 UTC](https://discourse.openehr.org/t/extract-archetypes/15505/2 "2017-11-30T12:04:13Z")

</div>

Hi Bert,

I would say that the “rm name” would be “EHR\_Extract”, as it is the way the package is called in the documentation [http://www.openehr.org/releases/RM/latest/docs/ehr\_extract/ehr\_extract.html](http://www.openehr.org/releases/RM/latest/docs/ehr_extract/ehr_extract.html) (notice that demographics and EHR are the other package names).

After that you would put the corresponding class name to constraint

Regards

---

<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: [30 November 2017 12:06 UTC](https://discourse.openehr.org/t/extract-archetypes/15505/3 "2017-11-30T12:06:05Z")

</div>

Having said that, I’m not sure current regex for archetype ids allows the use of spaces or undescores on the rm part. I’ll have to check that

---

<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: [30 November 2017 12:07 UTC](https://discourse.openehr.org/t/extract-archetypes/15505/4 "2017-11-30T12:07:00Z")

</div>

Thanks Diego, that seems a good suggestion based on good reasoning.

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: [30 November 2017 12:09 UTC](https://discourse.openehr.org/t/extract-archetypes/15505/5 "2017-11-30T12:09:23Z")

</div>

The test package is called “test\_pkg” at least in adl2 – so underscores are supported.

Pieter

---

<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: [30 November 2017 12:09 UTC](https://discourse.openehr.org/t/extract-archetypes/15505/6 "2017-11-30T12:09:36Z")

</div>

I was too fast with my compliments 😉 In that case, we can leave the underscore out, It remains readable. Bert

---

<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: [30 November 2017 12:11 UTC](https://discourse.openehr.org/t/extract-archetypes/15505/7 "2017-11-30T12:11:31Z")

</div>

underscore it is then! 😃

---

<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: [30 November 2017 12:20 UTC](https://discourse.openehr.org/t/extract-archetypes/15505/8 "2017-11-30T12:20:07Z")

</div>

Quick and firm No objections 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: [30 November 2017 13:40 UTC](https://discourse.openehr.org/t/extract-archetypes/15505/9 "2017-11-30T13:40:31Z")

</div>

The ADL 1.4 identifier syntax is [here](http://www.openehr.org/releases/BASE/latest/docs/base_types/base_types.html#_syntaxes), and permits underscores. The ADL2 syntax for the type ARCHETYPE\_HRID I think is not visible anywhere except code, so we’ll need to remedy that. The [relevant code](https://github.com/openEHR/adl-tools/blob/1fc0e5c9432b3fca55d301652601838d9f78a32f/libraries/openehr/src/am/archetype/archetype_hrid.e#L50) shows that underscores are accepted as well.

I would suggest using the proper specification name as various tools are starting to depend on consistent use of names across specifications, UML packages and classes, and archetypes. In fact I suspect that right now the ADL Workbench would not recognise an Extract archetype that didn’t have EHR\_EXTRACT as the RM class qualifier, because the [relevant BMM](https://github.com/openEHR/reference-models/tree/master/models/openEHR/Release-1.0.3/BMM) is named that way (I haven’t checked though).

I would go with the id template openEHR-EHR\_EXTRACT-EXTRACT.something.v1.0.0. There are [examples](https://github.com/openEHR/adl-archetypes/tree/master/Example/openEHR/ehr_extract_template/Working/Archetypes/ehr_extract) already of this in the archetype test repo.

- thomas

---

<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: [30 November 2017 13:43 UTC](https://discourse.openehr.org/t/extract-archetypes/15505/10 "2017-11-30T13:43:01Z")

</div>

I spoke too fast - the ARCHETYPE\_HRID syntax is specified [here in the Archetype Identification spec.](http://www.openehr.org/releases/AM/latest/docs/Identification/Identification.html#_human_readable_identifier_hrid)

---

<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: [30 November 2017 13:55 UTC](https://discourse.openehr.org/t/extract-archetypes/15505/11 "2017-11-30T13:55:47Z")

</div>

So, there are also considerations I did not see.

I can live a few days more without having a definite policy 😉  
But the classes are there and people will want to use them.

I think Thomas proposal is in line with the other rmNames, like EHR and DEMOGRAPHIC (which are capitalized), and therefor indeed EHR\_EXTRACT seems to me the best solution. Sorry for agreeing with previous suggestions.

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: [30 November 2017 14:23 UTC](https://discourse.openehr.org/t/extract-archetypes/15505/12 "2017-11-30T14:23:08Z")

</div>

I think the string matching should be case-insensitive, and the current regexes allow for any case. Various tools implementers would need to check to see if their tools match 'ehr\_extract' to 'EHR\_EXTRACT' etc.

- thomas

---

<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: [30 November 2017 14:31 UTC](https://discourse.openehr.org/t/extract-archetypes/15505/13 "2017-11-30T14:31:35Z")

</div>

> I think the string matching should be case-insensitive, and the current regexes allow for any case. Various tools implementers would need to check to see if their tools match 'ehr\_extract' to 'EHR\_EXTRACT' etc.

This is like Diego and Pieter also suggested.  
Okay, thanks.

---

<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: [30 November 2017 15:01 UTC](https://discourse.openehr.org/t/extract-archetypes/15505/14 "2017-11-30T15:01:38Z")

</div>

I agree about the case insensitivity. Archie still does this case sensitive, so I just created [https://github.com/openEHR/archie/issues/8](https://github.com/openEHR/archie/issues/8) (

Pieter

&nbsp;&nbsp;&nbsp;&nbsp;I think the string matching should be case-insensitive, and the current  
&nbsp;&nbsp;&nbsp;&nbsp;regexes allow for any case. Various tools implementers would need to  
&nbsp;&nbsp;&nbsp;&nbsp;check to see if their tools match 'ehr\_extract' to 'EHR\_EXTRACT' etc.  
&nbsp;&nbsp;&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;- thomas

---

<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: [30 November 2017 15:09 UTC](https://discourse.openehr.org/t/extract-archetypes/15505/15 "2017-11-30T15:09:31Z")

</div>

Note that for class and property names, we tend to stick to typical programming convantions, which is

- class - first letter capital
- property / method name - first letter lower-case

One reason to do this is to be able to distinguish a class name on its own, e.g. in an ADL archetype, and not mix it up with a property name. The ADL workbench does this, and I would argue we want to keep these rules.

Nothing is ever completely simple…

- thomas
