# "state" and  "protocol" structures are mandatory, when defined?

**URL:** https://discourse.openehr.org/t/state-and-protocol-structures-are-mandatory-when-defined/15005
**Category:** Technical (archive)
**Created:** [15 July 2010 15:57 UTC](https://discourse.openehr.org/t/state-and-protocol-structures-are-mandatory-when-defined/15005 "2010-07-15T15:57:22Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Leonardo\_Moretti](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/l/b38774/32.png) [@Leonardo\_Moretti](https://discourse.openehr.org/u/Leonardo_Moretti)
#### Post date: [15 July 2010 15:57 UTC](https://discourse.openehr.org/t/state-and-protocol-structures-are-mandatory-when-defined/15005/1 "2010-07-15T15:57:22Z")

</div>

Hi all,  
I have a doubt in interpretating the archetype definition when there are  
"state" or "protocol" structure. For example, looking at "Blood  
Pressure" in [http://openehr.org/knowledge/](http://openehr.org/knowledge/), I'm wondering if "protocol"  
structure is mandatory, as it seems looking at the archetype. If I don't  
know any details about the protocol, do I have to insert an empty tag  
\<protocol\> however?

Best regards  
leo

---

<div class="post-metadata">

### Author: ![Alessandro\_Torrisi](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/a/8baadc/32.png) [@Alessandro\_Torrisi](https://discourse.openehr.org/u/Alessandro_Torrisi)
#### Post date: [15 July 2010 17:31 UTC](https://discourse.openehr.org/t/state-and-protocol-structures-are-mandatory-when-defined/15005/2 "2010-07-15T17:31:39Z")

</div>

Leo,

as far as i can see the protocol section is not mandatory :

protocol matches {  
ITEM\_TREE[at0011] matches { – lijst structuur  
items cardinality matches {0..\*; unordered} matches {

as you can see 0..\* (means zero times until unbounded times), so not mandatory

Alessandro

---

<div class="post-metadata">

### Author: ![Leonardo\_Moretti](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/l/b38774/32.png) [@Leonardo\_Moretti](https://discourse.openehr.org/u/Leonardo_Moretti)
#### Post date: [16 July 2010 09:47 UTC](https://discourse.openehr.org/t/state-and-protocol-structures-are-mandatory-when-defined/15005/3 "2010-07-16T09:47:11Z")

</div>

Hi Alessandro,  
items cardinality matches {0..\*; unordered} is referred to "items" elements,  
not to "protocol" element

This means we can have something like this:  
\<observation\>  
\<data\>  
...  
\</data\>  
\<protocol archetype\_node\_id="at0011" xsi:type="ITEM\_TREE"\>  
&nbsp;&nbsp;&nbsp;&nbsp;\<name\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<value\>\*List(en)\</value\>  
&nbsp;&nbsp;&nbsp;&nbsp;\</name\>  
\</protocol\>  
\<observation\>

Is the section  
\<protocol archetype\_node\_id="at0011" xsi:type="ITEM\_TREE"\>  
&nbsp;&nbsp;&nbsp;&nbsp;\<name\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<value\>\*List(en)\</value\>  
&nbsp;&nbsp;&nbsp;&nbsp;\</name\>  
\</protocol\>  
mandatory, even if it doesn't have any items?  
Looking at the archetype defintion, so it seems!

leo

Alessandro Torrisi-3 wrote:

---

<div class="post-metadata">

### Author: ![Alessandro\_Torrisi](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/a/8baadc/32.png) [@Alessandro\_Torrisi](https://discourse.openehr.org/u/Alessandro_Torrisi)
#### Post date: [16 July 2010 10:12 UTC](https://discourse.openehr.org/t/state-and-protocol-structures-are-mandatory-when-defined/15005/4 "2010-07-16T10:12:57Z")

</div>

Leo,

perhaps you can look to this :

[http://www.openehr.org/svn/specification/TRUNK/publishing/architecture/rm/ehr\_im.pdf](http://www.openehr.org/svn/specification/TRUNK/publishing/architecture/rm/ehr_im.pdf)

then section 8.3.3. CARE\_ENTRY Class

over there you can see that protocol is 0..1 So never be mandatory

Alessandro

---

<div class="post-metadata">

### Author: ![thomas.beale](https://discourse.openehr.org/user_avatar/discourse.openehr.org/thomas.beale/32/35_2.png) [@thomas.beale](https://discourse.openehr.org/u/thomas.beale)
#### Post date: [16 July 2010 10:33 UTC](https://discourse.openehr.org/t/state-and-protocol-structures-are-mandatory-when-defined/15005/5 "2010-07-16T10:33:17Z")

</div>

In general questions like this can be answered by looking at any of:

- the relevant specifications: [http://www.openehr.org/releases/1.0.2/roadmap.html](http://www.openehr.org/releases/1.0.2/roadmap.html) , in this case, [http://www.openehr.org/releases/1.0.2/architecture/rm/ehr\_im.pdf](http://www.openehr.org/releases/1.0.2/architecture/rm/ehr_im.pdf)

- the online UML - root link: [http://www.openehr.org/svn/specification/TAGS/Release-1.0.1/publishing/architecture/computable/UML/uml\_start\_view.html](http://www.openehr.org/svn/specification/TAGS/Release-1.0.1/publishing/architecture/computable/UML/uml_start_view.html) ; in this case, [http://www.openehr.org/uml/release-1.0.1/Browsable/\_9\_0\_76d0249\_1109249648736\_872559\_12384Report.html](http://www.openehr.org/uml/release-1.0.1/Browsable/_9_0_76d0249_1109249648736_872559_12384Report.html)

- the ADL Workbench schema, at [http://www.openehr.org/svn/ref\_impl\_eiffel/BRANCHES/specialisation/apps/adl\_workbench/app/rm\_schemas/openehr\_rm\_102.dadl](http://www.openehr.org/svn/ref_impl_eiffel/BRANCHES/specialisation/apps/adl_workbench/app/rm_schemas/openehr_rm_102.dadl)

- thomas beale

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

---

<div class="post-metadata">

### Author: ![Leonardo\_Moretti](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/l/b38774/32.png) [@Leonardo\_Moretti](https://discourse.openehr.org/u/Leonardo_Moretti)
#### Post date: [16 July 2010 12:09 UTC](https://discourse.openehr.org/t/state-and-protocol-structures-are-mandatory-when-defined/15005/6 "2010-07-16T12:09:45Z")

</div>

Thanks Alessandro,  
yes you are right, generally protocol is optional in RM, but I'm wondering  
if it becomes mandatory when defined in the archetype.  
ADL doesn't explicit the occurrences of protocol (I imagine the default is  
0..1), but in XML representation of the archetype I find  
...  
\<attributes xsi:type="C\_SINGLE\_ATTRIBUTE"\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<existence\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<lower\_unbounded\>false\</lower\_unbounded\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<upper\_unbounded\>false\</upper\_unbounded\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<lower\>1\</lower\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<upper\>1\</upper\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\</existence\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<rm\_attribute\_name\>protocol\</rm\_attribute\_name\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<children xsi:type="C\_COMPLEX\_OBJECT"\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<rm\_type\_name\>ITEM\_TREE\</rm\_type\_name\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<occurrences\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<upper\_included\>true\</upper\_included\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<lower\_included\>true\</lower\_included\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<upper\_unbounded\>false\</upper\_unbounded\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<lower\_unbounded\>false\</lower\_unbounded\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<upper\>1\</upper\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<lower\>1\</lower\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\</occurrences\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<node\_id\>at0011\</node\_id\>  
...

where lower occurences number is 1 and not 0! Maybe is the XML serialization  
wrong!?

leo

Alessandro Torrisi-3 wrote:

---

<div class="post-metadata">

### Author: ![Alessandro\_Torrisi](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/a/8baadc/32.png) [@Alessandro\_Torrisi](https://discourse.openehr.org/u/Alessandro_Torrisi)
#### Post date: [16 July 2010 12:57 UTC](https://discourse.openehr.org/t/state-and-protocol-structures-are-mandatory-when-defined/15005/7 "2010-07-16T12:57:17Z")

</div>

Leo,

it is an interseting question.

in general it is 0..1 we agree on that  
if it is defined in the archetype i think it is mandatory, so 1..1

however the items inside the ITEM\_STRUCTURE (suppose ITEM\_TREE) can be set to 0..1

so.. it is requierd, but not the content..

Alessandro

---

<div class="post-metadata">

### Author: ![Leonardo\_Moretti](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/l/b38774/32.png) [@Leonardo\_Moretti](https://discourse.openehr.org/u/Leonardo_Moretti)
#### Post date: [26 July 2010 14:57 UTC](https://discourse.openehr.org/t/state-and-protocol-structures-are-mandatory-when-defined/15005/8 "2010-07-26T14:57:14Z")

</div>

Probably this is another case where the existence attribute creates  
ambiguity.

As stated in  
[http://www.openehr.org/wiki/display/dev/Existence+of+Attributes+(AOM,+ADL+and+XML)](http://www.openehr.org/wiki/display/dev/Existence+of+Attributes+%28AOM,+ADL+and+XML%29)  
[http://www.openehr.org/wiki/display/dev/Existence+of+Attributes+(AOM,+ADL+and+XML)](http://www.openehr.org/wiki/display/dev/Existence+of+Attributes+%28AOM,+ADL+and+XML%29)  
, Java reference adl parser and serializer consider the absence of existence  
attribute as [1..1] as default.  
I imagine we can consider this as a temporary anomaly and assuming existence  
attribute of "protocol" and "state" as [0..1].

leo

Alessandro Torrisi-3 wrote:

---

<div class="post-metadata">

### Author: ![thomas.beale](https://discourse.openehr.org/user_avatar/discourse.openehr.org/thomas.beale/32/35_2.png) [@thomas.beale](https://discourse.openehr.org/u/thomas.beale)
#### Post date: [26 July 2010 15:17 UTC](https://discourse.openehr.org/t/state-and-protocol-structures-are-mandatory-when-defined/15005/9 "2010-07-26T15:17:33Z")

</div>

This 1..1 default for existence is an unfortunate error in the ADL 1.4 specification, and is gone in the ADL 1.5 specification. For the most reliable place to validate archetypes, see the new ADL 1.5 Workbench, coming out in a few days.

- thomas beale

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