# Question about ArchetypeSlot.path()

**URL:** https://discourse.openehr.org/t/question-about-archetypeslot-path/14954
**Category:** Reference Implementation: Java (archive)
**Created:** [16 January 2010 02:16 UTC](https://discourse.openehr.org/t/question-about-archetypeslot-path/14954 "2010-01-16T02:16:52Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![pablo](https://discourse.openehr.org/user_avatar/discourse.openehr.org/pablo/32/3505_2.png) [@pablo](https://discourse.openehr.org/u/pablo)
#### Post date: [16 January 2010 02:16 UTC](https://discourse.openehr.org/t/question-about-archetypeslot-path/14954/1 "2010-01-16T02:16:52Z")

</div>

Hi,

I’ve a SECTION archetype with 3 slots:

definition  
SECTION[at0000] matches { – Evaluación de vía aérea  
items cardinality matches {0.._; unordered} matches {  
allow\_archetype EVALUATION[at0002] occurrences matches {0..1} matches { – EVALUATION  
include  
archetype\_id/value matches {/openEHR-EHR-EVALUATION.via\_aerea(-[a-zA-Z0-9\_]+)_.v1/}  
}  
allow\_archetype ACTION[at0003] occurrences matches {0..1} matches { – ACTION  
include  
archetype\_id/value matches {/openEHR-EHR-ACTION.via\_aerea(-[a-zA-Z0-9\_]+)_.v1/}  
}  
allow\_archetype ACTION[at0004] occurrences matches {0..1} matches { – ACTION  
include  
archetype\_id/value matches {/openEHR-EHR-ACTION.resumen\_actuacion(-[a-zA-Z0-9\_]+)_.v1/}  
}  
}  
}

**When I use the ADL parser to get the AOM Archetype instance and print out it’s definition as XML, I see this:**

- The SECTION node has path “/”, OK!
- The SECTION has an “items” attribute, this attribute has path “/items”, OK!!!
- The first children of “items” is an ArchetypeSlot with nodeId “at0002”, so I spect that this node has path “/items[at0002]” but has path=“/items”, like the parent attribute.

**- Is this correct or is a bug in the ADL Parser?**

I’m using adl-parser-1.0.1.jar, the same happens with adl-parser-1.0.2-SNAPSHOT.jar

BTH, I use XStream to serialize the objects to XML.

\<org.openehr.am.archetype.constraintmodel.CComplexObject\>  
false  
/  
SECTION  
  
1  
1  
true  
true  
  
at0000  
  
\<org.openehr.am.archetype.constraintmodel.CMultipleAttribute\>  
false  
/items  
items  
REQUIRED  
  
\<org.openehr.am.archetype.constraintmodel.ArchetypeSlot\>  
false  
/items  
EVALUATION  
  
0  
1  
true  
true  
  
at0002  
… the XML continues

Best regards,  
Pablo Pazos Gutierrez

---

<div class="post-metadata">

### Author: ![pablo](https://discourse.openehr.org/user_avatar/discourse.openehr.org/pablo/32/3505_2.png) [@pablo](https://discourse.openehr.org/u/pablo)
#### Post date: [16 January 2010 23:05 UTC](https://discourse.openehr.org/t/question-about-archetypeslot-path/14954/2 "2010-01-16T23:05:52Z")

</div>

More info,

I think it’s a bug because in the archetype.pathNodeMap field I have only 2 nodes with paths: “/” and “/items”.  
In archetype.pathNodeMap[“/items”] is the 3rd slot of the archetype, so I think when the /items attribute is found it is loaded into the archetype.pathNodeMap with the key “/items”, when the 1st slot is found it is loaded into the pathNodeMap with the same path “/items”, and so on, so the last processed node is the 3rd slot (node 0004) and it entry override the previous “/items” key.

I’m stuck with this 😕

Any ideas?

this is the XML view of the pathNodeMap:

/ /items

Thanks,  
Pablo.

---

<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: [26 January 2010 08:18 UTC](https://discourse.openehr.org/t/question-about-archetypeslot-path/14954/3 "2010-01-26T08:18:41Z")

</div>

Hi Pablo,

Thanks for this bug report. It would be very helpful if you could  
provide a minimum archetype and testcase that could demonstrate this  
bug and possibly the fix.

Cheers,  
Rong

---

<div class="post-metadata">

### Author: ![pablo](https://discourse.openehr.org/user_avatar/discourse.openehr.org/pablo/32/3505_2.png) [@pablo](https://discourse.openehr.org/u/pablo)
#### Post date: [26 January 2010 17:38 UTC](https://discourse.openehr.org/t/question-about-archetypeslot-path/14954/4 "2010-01-26T17:38:37Z")

</div>

Hi Rong,

Attached is the adl archetype that I mention in my first email from Jan 15 2010.

It is a section with archetype slots to entries.

The same thing (entries with the path of the parent attribute) happens with all my Section archetypes with slots to entries.

I hope this helps.

Best regards,  
Pablo.

> **(attachments)**
>
> [openEHR-EHR-SECTION.evaluacion\_via\_aerea.v1.adl](https://discourse.openehr.org/404) (1.69 KB)
