AOM/Archetype Slot: How to get include and exclude information?

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

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

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