Creating archetypes with alternatives

Hi,

I’m testing the EHRServer with alternative datatypes for the same ELEMENT.value.

I found the only way of doing that in the Archetype Editor is by setting the node as Any. And there is no way to further constraint the allowed datavalues in the AE.

In the Template Designer I can further constraint that by specifying which specific types can be used, to avoid the possibility of allowing any datavalue to be there. The problem I found is that after setting the allowed datavalues, I can’t set constraints for them, e.g. if I specify Coded Text, I can’t set the code list.

Shouldn’t the datatype constraints be set also on the AE and the constraints per allowed datavalue allowed to be set on the AE and TD?

I’ve seen some ADLs/OPTs from Brazil with alternatives, and I don’t know if they are using another AE/TD or just setting the constraints by hand. For example a problem status archetypes has this which I can’t reproduce in the Ocean’s AE:

ELEMENT[at0082] occurrences matches {0..} matches { – Unspecified
value matches {
DV_TEXT matches {
}
DV_BOOLEAN matches {
value matches {True, False}
}
DV_COUNT matches {*}
}
}

Thanks!

Hi Pablo,

The way to produce the ADL that you’ve posted below is with a “Choice” element.

1. Go to the Archetype Editor’s “Definition” tab.
2. Click the [+] button on the left.
3. From the drop-down list, select “New element” and “Choice”.
4. Over on the right of the screen, you will see two buttons, [+] and [-]. Click the [+] button and select “Text”.
5. Repeatedly click the [+] button to add all of the data types that will be permitted in this element.

Hope that helps,
Peter

Thanks Peter,

The Choice worked as expected in the AE, but there is an issue with the TD.

I was able to set CODED TEXT, COUNT and DATE TIME, and set constraints to them like this:

ELEMENT[at0005] occurrences matches {0..1} matches { – choice
value matches {
DV_CODED_TEXT matches {
defining_code matches {
[local::
at0006, – 11
at0007, – 22
at0008] – 33
}
}
DV_COUNT matches {
magnitude matches {|0..500|}
}
DV_DATE_TIME matches {*}
}
}

The problem is when I export OPTs using that archetype, all the constraints are gone, for example, I created a template that only allows CODED TEXT, and the result is this (no codes in the code list of the CODE_PHRASE):

DV_CODED_TEXT true true false false 1 1 defining_code true true false false 1 1 CODE_PHRASE true true false false 1 1 openehr 433

I copied the wrong CODED TEXT from the OPT, the node that has the code list in the ADL but doesn’t in the OPT, don’t include the CODE PHRASE node:

DV_CODED_TEXT true true false false 1 1