# ArchetypeNodeId of an archetypeslot

**URL:** <https://discourse.openehr.org/t/archetypenodeid-of-an-archetypeslot/15008>\
**Category:** Technical (archive)\
**Created:** [22 August 2010 12:04 UTC](https://discourse.openehr.org/t/archetypenodeid-of-an-archetypeslot/15008 "2010-08-22T12:04:16Z")\
**Posts on this page:** 6\
**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:** [22 August 2010 12:04 UTC](https://discourse.openehr.org/t/archetypenodeid-of-an-archetypeslot/15008/1 "2010-08-22T12:04:16Z")

</div>

Hi,

Excuse me if (I) asked before, it stills keeps puzzling me.

When we have this archetype-definition (this from Rong's repository from  
test-archetypes for the adl-parser)

---

<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 August 2010 13:27 UTC](https://discourse.openehr.org/t/archetypenodeid-of-an-archetypeslot/15008/2 "2010-08-22T13:27:42Z")

</div>

Hi Bert,

This is essentially a template, with the slot ‘filled’ by an archetype reference, and is defined in the forthcoming ADL AOM 1.5 specifications

[http://www.openehr.org/300-OE.html?branch=1&language=1](http://www.openehr.org/300-OE.html?branch=1&language=1)  
[http://www.openehr.org/wiki/display/spec/openEHR+Templates+and+Specialised+Archetypes](http://www.openehr.org/wiki/display/spec/openEHR+Templates+and+Specialised+Archetypes)

```auto

use_archetype OBSERVATION[openEHR-EHR-OBSERVATION.blood_pressure.v1] ∈ {
    /items ∈ {
        use_archetype EVALUATION[at0001, org.openehr::openEHR-EHR-OBSERVATION.blood_pressure.v1]
    }
}

```

In the resultant template, the atNode of the filler/called archetype (at0000) , identifies the ‘filled slot’ node, not the parent/caller (at0001) but is always qualified by the archetypeID

```auto

FROM EHR [ehr_id/value=$ehrUid] CONTAINS COMPOSITION [openEHR-EHR-COMPOSITION.encounter.v1]
CONTAINS OBSERVATION obs [openEHR-EHR-OBSERVATION.blood_pressure.v1]
WHERE obs/data[at0001]/events[at0006]/data[at0003]/items[at0004]/value/value >= 140

```

```auto

```

```auto

Note too that, specialised archetypes also support the same mechanism of filled lots, which allows compound archetypes to be defined i.e with some pre-filled slots.

```

```auto

```

```auto

Ian

```

```auto

```

Dr Ian McNicoll  
office / fax +44(0)141 560 4657  
mobile +44 (0)775 209 7859  
skype ianmcnicoll  
[ian.mcnicoll@oceaninformatics.com](mailto:ian.mcnicoll@oceaninformatics.com)  
[ian@mcmi.co.uk](mailto:ian@mcmi.co.uk)

Clinical Analyst Ocean Informatics  
Honorary Senior Research Associate, CHIME, University College London  
openEHR Archetype Editorial Group  
Member BCS Primary Health Care SG Group [www.phcsg.org](http://www.phcsg.org) / BCS Health Scotland

---

<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:** [23 August 2010 10:51 UTC](https://discourse.openehr.org/t/archetypenodeid-of-an-archetypeslot/15008/3 "2010-08-23T10:51:53Z")

</div>

Thanks Ian,

I will not surprise you that I don’t work with ADL 1.5.  
So I have to understand your answer to this issue in ADL 1.4 context.

Archetypeslots are typically very convenient in templates, but also in archetypes.

In archetypes, the convenience is it makes it possible for easily archetype (code)-reuse.  
But in an archetype the approach is different because the locatable constructed around the archetype (in the slot) is a property from the locatable constructed around the archetype which calls the archetype(slot).  
(sorry the express this so complicated, I don’t know a more simpler way to say this)

This is not the case in a template, because they serve another purpose.

I must confess, in my software I do not use templates, for now, but I will in the next release.  
So the only purpose for me for archetype-slots is as a part of an archetype.

Please correct me if I state following wrong:

The archetype-node-id in a locatable constructed around an archetype in an archetypeslot is the archetype-node-id it gets from its own archetype (which is called in the slot).  
The archetype-node-id in a locatable constructed around the archetype calling the archetypeslot is to be ignored.

Is this correct?

Thanks, Bert

Op 22-08-10 15:27, Ian McNicoll schreef:

---

<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:** [23 August 2010 12:19 UTC](https://discourse.openehr.org/t/archetypenodeid-of-an-archetypeslot/15008/4 "2010-08-23T12:19:09Z")

</div>

Hi Bert,

I appreciate you will be currently using ADL1.4, but in essence, by aggregating archetypes as you suggest, you are creating a template. ADL 1.4 does not define this aggregation/template behaviour, which is why I pointed you to the ADL1.5 specs, which cover both the templates and specialised archetypes. We, therefore do not have an official ADL1.4 answer to your question but your final statement is correct :

The archetype-node-id in a locatable constructed around an archetype in an archetypeslot is the archetype-node-id it gets from its own archetype (which is called in the slot).  
The archetype-node-id in a locatable constructed around the archetype calling the archetypeslot is to be ignored.

Also remember that there is no absolute requirement for a single slot to have an atnode name but Heather and I now pretty well always assign one routinely as it helps document the usage of the slot for downstream users.

Ian

Dr Ian McNicoll  
office / fax +44(0)141 560 4657  
mobile +44 (0)775 209 7859  
skype ianmcnicoll  
[ian.mcnicoll@oceaninformatics.com](mailto:ian.mcnicoll@oceaninformatics.com)  
[ian@mcmi.co.uk](mailto:ian@mcmi.co.uk)

Clinical Analyst Ocean Informatics  
Honorary Senior Research Associate, CHIME, University College London  
openEHR Archetype Editorial Group  
Member BCS Primary Health Care SG Group [www.phcsg.org](http://www.phcsg.org) / BCS Health Scotland

---

<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:** [23 August 2010 12:34 UTC](https://discourse.openehr.org/t/archetypenodeid-of-an-archetypeslot/15008/5 "2010-08-23T12:34:37Z")

</div>

Thanks, Ian, your answer makes it clear to me.

kind regards  
Bert

Op 23-8-2010 14:19, Ian McNicoll schreef:

---

<div class="post-metadata">

**Author:** ![Mahdi\_Asgari](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@Mahdi\_Asgari](https://discourse.openehr.org/u/Mahdi_Asgari)\
**Post date:** [2 May 2011 05:40 UTC](https://discourse.openehr.org/t/archetypenodeid-of-an-archetypeslot/15008/6 "2011-05-02T05:40:26Z")

</div>

Hi dear Ian

According to openEHR-technical Digest, Vol 49, Issue 12 see bellow  
statements: (in scope of ADL 1.4)

1- The archetype-node-id in a locatable constructed around an archetype  
in an archetypeslot is the archetype-node-id it gets from its own archetype  
(which is called in the slot).  
2- The archetype-node-id in a locatable constructed around the  
archetype calling the archetypeslot is to be ignored.

I have a validation problem:  
If the archetype-node-id in a locatable constructed around an archetype in  
an archetypeslot is the archetype-node-id it gets from its own archetype,  
means at0000(child archetype node id) instead of at0001(slot node id) so how  
can I apply occurrence of slot? for example

Entry[at0000] matches { -- Encounter  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;content matches {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;allow\_archetype INSTRUCTION [at0001] occurrences matches {0..1}  
matches {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;include  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;domain\_concept matches {/instruction.v1/}  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;allow\_archetype OBSERVATION [at0002] occurrences matches {1..1}  
matches {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;include  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;domain\_concept matches {/observation.v1/}  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;&nbsp;}

the object may be something like this:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<content xsi:type="INSTRUCTION"  
archetype\_node\_id="at0000"\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.....  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\</content\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<content xsi:type="OBSERVATION"  
archetype\_node\_id="at0000"\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.....  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\</content\>

In the above example how I can apply occurrence for INSTRUCTION objects  
optional or just one occurrence and OBSERVATION only one occurrence must be  
appear.  
Or maybe we must bypass constraint defined on slots?  
What is the main constraint applied? Slot constraint or child archetype  
constraint?

Thanks in advance
