-
Notifications
You must be signed in to change notification settings - Fork 14
Description
The prescription operational template distributed with the installation of EtherCIS has a modified cardinality of 2..* for the following path:
/content[openEHR-EHR-SECTION.medications.v1]/items[openEHR-EHR-INSTRUCTION.medication.v1]/activities[at0001]/description[openEHR-EHR-ITEM_TREE.medication_mod.v1]/items
This requires test code to add two items under description but the syntax for doing this is not clear. Based on the examples here I tried:
kvPairs.put("/content[openEHR-EHR-SECTION.medications.v1]/items[openEHR-EHR-INSTRUCTION.medication.v1]/activities[at0001]" +
"/description[openEHR-EHR-ITEM_TREE.medication_mod.v1]/items[at0001]:0", "aspirin");
kvPairs.put("/content[openEHR-EHR-SECTION.medications.v1]/items[openEHR-EHR-INSTRUCTION.medication.v1]/activities[at0001]" +
"/description[openEHR-EHR-ITEM_TREE.medication_mod.v1]/items[at0001]:1", "aspirin");
But this does not work because current code tries to use items[at0001]:0 as the path. If I do:
kvPairs.put("/content[openEHR-EHR-SECTION.medications.v1]/items[openEHR-EHR-INSTRUCTION.medication.v1]/activities[at0001]" +
"/description[openEHR-EHR-ITEM_TREE.medication_mod.v1]/items[at0002]", "aspirin1");
Then insertion works but retrieval fails with 'invalid db state' or a similar error which is low level (jooq).
I had to modify the prescription opt to set a cardinality of 1..* to work around this issue and get a test scenario working but I'm unclear about what the correct syntax should be for adding > 1 items under an item tree, which is what the description[...] above is.
A working example of ECISFLAT representation that satisfies the criteria above (cardinality >= 2 for description) would really help. Otherwise, it is really hard to figure this out by reading code.