Hi everyone, we’re currently running a scenario here in Brazil in which modelers create the COMPOSITION in Ocean’s Template Designer, export the OPT and TDS and deploy them to be distributed to external/public implementers. Since most of them have zero to little knowledge about openEHR, they use the TDS to create TDDs, and internally we have some transformation logic to turn them into canonical XML instances and commit (we’re refactoring from EtherCIS to EHRbase).
A major issue we’re dealing with is how to address siblings that are instances of the same archetype (e.g. happen at the same lavel with the same archetype_node_id). Currently we’re facing errors such as:
<Map> <error>Internal Server Error: org.ehrbase.validation.constraints.wrappers.ValidationException: :Validation error at /content[openEHR-EHR-SECTION.problem_list.v1]/items[openEHR-EHR-ACTION.procedure-HAOC.v1]/description[at0001]/items[at0060], Mandatory element missing, expected:[1..1] Validation error at /content[openEHR-EHR-SECTION.problem_list.v1]/items[openEHR-EHR-ACTION.procedure-HAOC.v1]/description[at0001]/items[at0.74], Mandatory element missing, expected:[1..1] Validation error at /content[openEHR-EHR-SECTION.problem_list.v1]/items[openEHR-EHR-ACTION.procedure-HAOC.v1]/description[at0001]/items[at0.70], Mandatory element missing, expected:[1..1] Validation error at /content[openEHR-EHR-SECTION.problem_list.v1]/items[openEHR-EHR-ACTION.procedure-HAOC.v1]/description[at0001]/items[at0002.1], Mandatory element missing, expected:[1..1] Validation error at /content[openEHR-EHR-SECTION.problem_list.v1]/items[openEHR-EHR-EVALUATION.problem_diagnosis-ms_br.v1]/data[at0001]/items[at0002.1], Mandatory element missing, expected:[1..1] </error> <status>Internal Server Error</status> </Map>
By inspecting the composition, we can see the data points are there, but I believe the server might be validating against the wrong definition because there are multiple /content[openEHR-EHR-SECTION.problem_list.v1] siblings with different restrictions created from a more generic archetype. What is the proper way to reference them (not only for server validation, but also for app controls, such as AQL)? Since they are optional, we cannot rely on index. It could also happen on a deeper level in the COMPOSITION. I think I’ve seen some EtherCIS code using the name attribute to reference them, but this could lead to unexpected behaviors due to relying on localized text such as mishandled languages/translations. What about archetyped text codes/definitions?
I’ve uploaded the OPT, TDS, TDD and composition files at https://gist.github.com/ricardofago/7446ea8f8611add03faa14afe35603d1.