# ITEM\_TREE spec confusing?

**URL:** <https://discourse.openehr.org/t/item-tree-spec-confusing/12389>\
**Category:** Technical (archive)\
**Created:** [8 May 2007 17:25 UTC](https://discourse.openehr.org/t/item-tree-spec-confusing/12389 "2007-05-08T17:25:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![erik.sundvall](https://discourse.openehr.org/user_avatar/discourse.openehr.org/erik.sundvall/32/1961_2.png) [@erik.sundvall](https://discourse.openehr.org/u/erik.sundvall)\
**Post date:** [8 May 2007 17:25 UTC](https://discourse.openehr.org/t/item-tree-spec-confusing/12389/1 "2007-05-08T17:25:03Z")

</div>

Hi!

The spec...  
[http://svn.openehr.org/specification/TAGS/Release-1.0.1/publishing/architecture/rm/common\_im.pdf](http://svn.openehr.org/specification/TAGS/Release-1.0.1/publishing/architecture/rm/common_im.pdf)  
...indicates that an ITEM\_TREE should contain it's items as an  
attribute "items: LIST\<ITEM\> Physical representation of the tree."

The function as\_hierarchy reads...  
"as\_hierarchy: CLUSTER Generate a CEN EN13606-compatible hierarchy,  
which is the same as the tree's physical representation."

Then in another part of the spec:  
"4.2.4 ITEM\_TREE  
Data of an ITEM\_TREE instance are simply replicated as is to produce  
the correct EN13606 hierarchical form"

Then the instance structure examples in 4.4.4. seems to have placed  
the items as a list directly under the ITEM\_TREE

It's a bit confusing and some further documentation (at least of  
as\_hierarchy) might be good for pedagogical reasons.

Is the "as\_hierarchy" to be interpreted as something like create and  
return a new CLUSTER object where the cluster root node takes its  
attributes like name etc from the ITEM\_TREE object and copy the  
"items" list from the ITEM\_TREE to the new CLUSTER? Any thoughts about  
what kind of copying should be done in an implementation? Creating new  
identical "item" objects or just point to the existing ones?

Is there any other important difference between CLUSTER and ITEM\_TREE  
than the extra functions has\_element\_path, element\_at\_path and  
as\_hierarchy (and the class hierarchy)?

Can anybody elaborate a bit on this? Maybe I've just been sitting too  
long in front of the computer, time to go...

Best regards,  
Erik Sundvall  
[http://www.imt.liu.se/~erisu/](http://www.imt.liu.se/~erisu/)
