Bug in export of ORDINAL texts defined in templates

Hi!

I have tried but probably not completely succeded to understand the meaning and implications of @borut.fabjan’s response .

I made new tests with an enhanced test file with an extra repetition of the node B: (repeated node is marked BB:) see image below. The test file also has language translations (a proper one to Swedish and a bad incomplete one in German). The file and fileset are available in https://github.com/regionstockholm/background_and_examples/tree/main/AE_ORDINAL_export_bugs

Please confirm/reject and possibly enlighten regarding the following assumptions:

  1. The native format of Archetype Designer (AD) handles and stores (even multilingual) specialisations of ORDINALs at template level. Yes?

  2. Export of ORDINALs defined at template level is supported by AE for openEHR 1.4 .OET template files. (A separate file export per translataion language needed.) The output will be in the by @borut.fabjan above described “1|one” format (hack) for the original language of the template, but does not work for translations (exported file shows the template’s original language in ORDINALs instead).

  3. Export of ORDINALs defined at template level could become supported by AE for Operational Templates .OPT (1.4) files (If you have repeated/redefined nodes, then a separate file export per translataion language is likely needed, and don’t forget the l10n annotation trick for the repeated nodes.) If you select Swedish as primary language when exporing you get a file like test 2 of ordinal selection defentition in template.sv.opt
    BUT there is currently a bug in AE OPT export code for term definitions of template level specialized ORDINALs (no matter if exporting in original language or translated language) so you have to patch the files (manually or via script) to include snippets like <term_definitions code="at0.0.1"> < items id="text">mild B (sv)</items> < items id="description">B1</items> </term_definitions>and then it works like a charm to import the
    manually patched test 2 of ordinal selection defentition in template.sv.opt to form building tools:


    If you do a A diff between the exported and patched file then it shows what’s missing in the current export.

  4. Export of ORDINALs defined at template level could become supported by AE for web templates (.json). The file format can support multilingual such support, but the export code is broken/missing and exported web templates likely need to be patched in adding both a missing “label” node and missing content of “localizedLabels” language specific sub nodes, see diff of started (not yet completed) manual patch to get a hint of the likely pattern (this has not been tested by importing to tools yet).

1 Like