Question about ArchetypeSlot.path()

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

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 :confused:

Any ideas?

this is the XML view of the pathNodeMap:

/ /items

Thanks,
Pablo.

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

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 (1.69 KB)