Rong,
I have a several questions related to the lifecycle of archetypes once
they are created.
Question 1
==========
I use The following code fragment to create an object from an archetype
rmobj = archetype.buildRMObject(valueMap, errorMap, sysmap());
One of my constraints for this archetype is optional, as shown below
ELEMENT[at0004] occurrences matches {0..1} matches {
value matches {
DVTEXT matches {
value matches {/.+/}
}
}
In the valueMap I don't supply a value for this element and therefore it
is not created. The 'rmobj' instance is created as expected.
At some later stage, I want to record a value against ELEMENT[at0004].
Do I need to manipulate the 'rmobj directly as shown below
Account account = (Account)rmobj;
Element element = new Element("isDebitAccount",
new DvText("isDebitAccount"), isDebitAccount);
account.getDetails().items().add(element);
or can I create it using a path expression?
Question 2
==========
Is there a programmatic way to validate that an object conforms to the
constraints of an archetype?
Question 3
==========
This relates to an earlier question. Can you explain the how "|" works
in a path expression?
-
If you have any questions about using this list,
please send a message to d.lloyd at openehr.org