# Building Archetypes

**URL:** https://discourse.openehr.org/t/building-archetypes/14785
**Category:** Implementers (archive)
**Created:** [10 July 2008 20:38 UTC](https://discourse.openehr.org/t/building-archetypes/14785 "2008-07-10T20:38:05Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Tim\_Cook2](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/t/57b2e6/32.png) [@Tim\_Cook2](https://discourse.openehr.org/u/Tim_Cook2)
#### Post date: [10 July 2008 20:38 UTC](https://discourse.openehr.org/t/building-archetypes/14785/1 "2008-07-10T20:38:05Z")

</div>

Hi All,

I am currently attempting to build Instruction archetypes and I'm a bit  
confused.

From the NHS tree there are two:  
openEHR-EHR-INSTRUCTION.haemodialysis\_prescription.v1draft  
and  
openEHR-EHR-INSTRUCTION.disposition.v2draft

That have ITEM\_TREEs that do not have openEHR datatypes in them.  
They contain a 0 (zero) where I expect to find a datatype  
(DV\_TEXT,DV\_COUNT,etc.)

The definition section of the first one is below:

---

<div class="post-metadata">

### Author: ![Thilo\_Schuler1](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/t/a4c791/32.png) [@Thilo\_Schuler1](https://discourse.openehr.org/u/Thilo_Schuler1)
#### Post date: [11 July 2008 19:51 UTC](https://discourse.openehr.org/t/building-archetypes/14785/2 "2008-07-11T19:51:29Z")

</div>

Hi Tim,

the archetype contains a slot which references this  
[http://www.openehr.org/wsvn/knowledge/archetypes/dev-uk-nhs/adl/openehr/ehr/structure/openEHR-EHR-ITEM\_TREE.haemodialysis.v1draft.adl?op=file&rev=0&sc=0](http://www.openehr.org/wsvn/knowledge/archetypes/dev-uk-nhs/adl/openehr/ehr/structure/openEHR-EHR-ITEM_TREE.haemodialysis.v1draft.adl?op=file&rev=0&sc=0)  
ITEM\_TREE archetype. There you find the datatypes you are looking  
for...

It is a common pattern in instruction and action archetypes to  
reference the same ITEM\_TREE structure. As usually they come in pairs  
meaning that often you first issue and instruction (recorded by the  
instruction archetype) and possibly later the corresponding action is  
conducted (recorded by the action archetype). The data items that need  
to be recorded are often quite similar, therefore a reusable ITEM\_TREE  
structure is factored out. See 8.2.5.7 on page 65-67 here:  
[http://svn.openehr.org/specification/TRUNK/publishing/architecture/rm/ehr\_im.pdf](http://svn.openehr.org/specification/TRUNK/publishing/architecture/rm/ehr_im.pdf)

The instruction/action distinction makes it possible to record a  
workflow (worflow engines can interact with it). As mentioned ususally  
they are used in pairs, but if an instruction has never been carried  
out (e.g. forgotten) the EHR would not contain a corresponding action.  
Conversely it is possible to record 'ad-hoc' action if suited (see  
8.2.5.1 in the above linke document for this second case).

INSTRUCTIONS and ACTIONS are the most "experimental" (meaning there is  
the least experience designing and using them) archetype types. I will  
create a number of them soon (as par of a chronic wound use case) in  
the next weeks and I plan to report on that on the list.

Hope this helped, Thilo

P.S. : Cross-posted to the clinical list as this might be of interest.

---

<div class="post-metadata">

### Author: ![Tim\_Cook2](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/t/57b2e6/32.png) [@Tim\_Cook2](https://discourse.openehr.org/u/Tim_Cook2)
#### Post date: [11 July 2008 21:03 UTC](https://discourse.openehr.org/t/building-archetypes/14785/3 "2008-07-11T21:03:09Z")

</div>

Hi Thilo,

Thanks for the great explanation even though I didn't state the correct  
question. 🙂

I am building 'instances' of archetypes; not the archetypes themselves.

I will be taking a look at my parser to see how I missed the slot  
references.

Cheers,  
Tim

---

<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: [17 July 2008 01:54 UTC](https://discourse.openehr.org/t/building-archetypes/14785/4 "2008-07-17T01:54:08Z")

</div>

Hi Tim  
I think you got an answer somewhere else on this but in case:

When the activity description and the action description are the same data then it is useful to use an embedded archetype to carry the data. This is the slot you are seeing and it carries a regex of the name of the archetype:

```auto
allow_archetype ITEM_TREE occurrences matches {0..*} matches {
						include
							archetype_id/value matches {/haemodialysis\.v1draft/}

```

the archetype to go in this slot is: openEHR-EHR-ITEM\_TREE.haemodialysis.v1draft

I hope that helps - Sam

Tim Cook wrote:

> **(attachments)**
>
> ![OceanInformaticsl.JPG](https://discourse.openehr.org/images/transparent.png)
