# AOM/Archetype Slot: How to get include and exclude information? **Category:** [Reference Implementation: Java (archive)](https://discourse.openehr.org/c/reference-implementation-java-archive/154) **Created:** 2011-06-13 19:01 UTC **Views:** 16 **Replies:** 2 **URL:** https://discourse.openehr.org/t/aom-archetype-slot-how-to-get-include-and-exclude-information/14065 --- ## Post #1 by @Kohl_Christian Dear all, after parsing an archetype \(openEHR\-EHR\-OBSERVATION\.sample\_blood\_pressure\.v1\.adl \- see below\) which contains archetype slots I tried to use its AOM\-representation to identify archetypes which are allowed for these slots\. I used the following code to display information on archetype slots: private void printInfo \(ArchetypeSlot archetypeSlot\_, int iLevel\_\) \{     Iterator<Assertion> iterator\_;     Assertion assertion\_;     System\.out\.println\("\\n\\n\+ \[Level: " \+ iLevel\_ \+ "\] " \+ archetypeSlot\_\.path\(\)\);     System\.out\.println\("\- Class : " \+ archetypeSlot\_\.getClass\(\)\.getName\(\)\);     System\.out\.println\("\- RM Type : " \+ archetypeSlot\_\.getRmTypeName\(\)\);     System\.out\.println\("\- Node\-ID : " \+ archetypeSlot\_\.getNodeID\(\)\);     System\.out\.println\("\- Any allowed? : " \+ archetypeSlot\_\.isAnyAllowed\(\)\);     System\.out\.println\("\- Required : " \+ archetypeSlot\_\.isRequired\(\)\);     System\.out\.println\("\- Occurences : " \+ archetypeSlot\_\.getOccurrences\(\)\.getLower\(\) \+                                 " \- " \+ archetypeSlot\_\.getOccurrences\(\)\.getUpper\(\)\);     // Includes     System\.out\.println\("\- Includes :"\);     if \(archetypeSlot\_\.getIncludes\(\) \!= null\)     \{         iterator\_ = archetypeSlot\_\.getIncludes\(\)\.iterator\(\);            while \(iterator\_\.hasNext\(\)\)         \{             assertion\_ = \(Assertion\)iterator\_\.next\(\);             System\.out\.println\(" > " \+ assertion\_\.getStringExpression\(\) \+             " / " \+ assertion\_\.getTag\(\)\);         \}     \}     else     \{         System\.out\.println\(" \- "\);     \}     // Excludes     System\.out\.println\("\- Excludes :"\);     if \(archetypeSlot\_\.getExcludes\(\) \!= null\)     \{         iterator\_ = archetypeSlot\_\.getIncludes\(\)\.iterator\(\);            while \(iterator\_\.hasNext\(\)\)         \{             assertion\_ = \(Assertion\)iterator\_\.next\(\);             System\.out\.println\(" > " \+ assertion\_\.getStringExpression\(\) \+                                         " / " \+ assertion\_\.getTag\(\)\);         \}     \}     else     \{         System\.out\.println\(" > \- "\);     \} \} Unfortunately, I got the following output: \+ \[Level: 2\] /protocol\[at0011\]/items\[at1025\] \- Class : org\.openehr\.am\.archetype\.constraintmodel\.ArchetypeSlot \- RM Type : CLUSTER \- Node\-ID : at1025 \- Any allowed? : false \- Required : false \- Occurences : 0 \- null \- Includes : > null / null \- Excludes : > \- Even though, the ADL\-file shows include infromation for the respective slot "assertion\_\.getStringExpression\(\)" returns NULL\. How may I accees the required information \(in this example "/openEHR\-EHR\-CLUSTER\\\.device\\\.v1/"\)? Best regards,    Christian --- ## Post #2 by @system Hi Christian, Sorry for the delay. I am just back from a month vacation in China. The stringExpression field of Assertion is not implemented yet. Instead you can find the specification for archetype_slot in the expression field, which is of ExpressionItem type. You can look at the testcase for archetype slot parsing (adl-parser/src/test/java/se/acode/openehr/parser/ArchetypeSlotTest.java) to find out how to inspect the details of an ExpressionItem. Hope this helps. /Rong --- ## Post #3 by @system Hi again, I just implemented the proper stringExpression support in assertion parsing (archetype_slot is kind of assertion in ADL). I also updated the testcase to reflect this change, which you can find at adl-parser/src/test/java/se/acode/openehr/parser/ArchetypeSlotTest.java Cheers, Rong --- **Canonical:** https://discourse.openehr.org/t/aom-archetype-slot-how-to-get-include-and-exclude-information/14065 **Original content:** https://discourse.openehr.org/t/aom-archetype-slot-how-to-get-include-and-exclude-information/14065