Support of multilingual annotations

While using Annotations in the Archetype Designer I noticed two problems.

  • When adding a new annotation, both in an archetype or in a template, it is not copied to the other languages, in contrast with other texts (atNNNN) that are copied to all languages and marked for revision with an asterisk.
    The AOM2 specification mentions that annotations have to be properly translated, so this replication by default sounds logical.
    Archetype Object Model 2 (AOM2)

  • When exporting annotations in OPT, only the one from the primary language is included. In the native format of the template, each annotation is associated with is language, so they are all included. But in OPT the annotations are a separated section with no information of the language. I guess this is a problem of the OPT XML Schema, it is not the first time we talk about its drawbacks.

    <annotations path="[openEHR-EHR-COMPOSITION.report.v1]/content[openEHR-EHR-ACTION.transfusion.v0]/description[at0001]/items[at0014]">
        <items id="test">ES annotation</items>
    </annotations>

We need to use and export annotations both in Spanish and Catalan. The second problem is especially a big limitation.

4 Likes

Just out of curiosity, what’s an example of an annotation that needs to be translated? :smile:

In this case we are adding terminology mappings suggestions.

1 Like

We are currently not using the annotation. But I am sure there are lots of possibilities to add directives to automatic documentation generators like @ian.mcnicoll has looked into.

There could also be directives to end-user applications and also some tooling for ETL extracts.

Some of these might need translations.

Lot’s of opportunities and also lots of complexity to be added :wink:

We see a need for both

  1. Unilingual annotations for more technical items
  2. Multilingual annotations for e.g. local Markup/ directives (potentially for things like PROMS UI directives

ADL1.4 and .oet/.opt actually support both but the tooling chin is a bit inconsistent oh how it is handled

You can extend the Term definitions in ADL1.4, which are multi-lingual

 ["at4000"] = <
        text = <"plan">
        description = <"The clinician's professional advice">
        provenance = <"ACME_terminology(v3.9a)">
    >

and ‘comments’ is actually one of those extensions, just agreed by convention to be supported in tooling. Only text and description are formally defined.

and .oet/.opt template-level annotations are unilingual, which is helpful for e.g UI hinting,

Unfotunately AD-> .opt conflates the additional term definitions and annotations and treats them all as unilingual template-style annotations.

That is probably fixable, and at least in theory it should be possible to add these term-definition extensions at template-level.

Going into ADL2, template-style unilingual annotations can be added to archetypes as well as templates.

So we should be able to do something now which meets the immediate issue.

5 Likes

We’ve just explored the possibilities in Annotations in the EPIC (the prostate cancer questionnaire, not the product :slight_smile: ) archetype: Observation Archetype: Expanded Prostate cancer Index Composite (EPIC) [openEHR Clinical Knowledge Manager]. In it’s original language it’s displayed in the CKM as this:

image

And using it in this template, Archetype Designer, we realised the Annotations don’t follow to all Events in AD. Better will have a look at it, hopefully fix it. Also CKM doesn’t show the Annotations in translations.

In our case, the Annotations are merely instructions to the implementers to differentiate the full EPIC questionnaire from the EPIC Short Form, in addition to help the consumers of the data to make various subscores based on the data. In our case there is no need to translate, but I see @damoca’s point.

We can use the Description and Comment to each element, for example to instruct implementers to show certain parts of the questions in bold , CAPITALISED or in italics. Some copyright holders are obsessed with that. But in the CKM, to the reviewers, clinicians and most users, this information is only visual noise. Another thing is that if the information in Annotations or other instructions or hints are changing often, then I really, really don’t want to update the archetype each time.

What we need is a “geek layer” associated with the archetype, not directly part of it, but still available in the tools. For every language and all Events. Can we all add that to our wish list to Santa Claus, please? :christmas_tree:

Technically these are not annotations (at least not the same as template annotations, they are just extra ‘term definitions’.

ADL1.4 says that ‘name’ and ‘description’ must be present but other terms can be added. ‘comments’ is one of those which is just supported by common practice. They are extra fields added to the ontology section in the archetype, and therefore should be translatable, just like comments. I think this is a good approach and one that we can exploit more, especially where PROMS demand.

The problem seems to be that although AD treats ‘comments’ correctly, it treats any other additional ontology items as if they were unilingual template -level annotations., and munges them together.

@varntzen - when you mentioned Events did you mean Observation Events or something else?

I am more comfortable with allowing a limited set of markdown-based markup, as FHIR does, although I agree an ability to package other documentation to a separate layer would also be helpful.

1 Like

The Events in OBSERVATION class archetypes. :smiley:

1 Like

How do I add them in the tools?

I believe (as a way forward) to think about “models” as a base to which you can append several “layers” which augment base model with additional specifics.

Analog to Photoshop (PSP) and image editing. You have a base image, but you can augment base image adding vector graphics, special effects, … , performing non-destructive editing on top of base image.

In context of archetypes. You have a base model, and you can add integration layer, terminology layer, presentation layer, … special fx layer :wink: , … Of course each layer can interact with base model (reference nodeIDs, …) and possibly adding its own semantics to their layer.

Any likes? :wink:

4 Likes

PART I - The Archetype :wink:

When we deal with ADL 1.4 archetype, … annotations are added as entries to ontology/term_definition/item.

Which also means they can be multi-lingual. On archetype level.

Is it correct or not, … it was discussed, some agreed, the solution is coherent with the spec. However I don’t think it is specifically addressed in the spec.

2 Likes

In AD, you can select the node, switch to the Annotation tab on the right.
here you can add keys and values to get the ADL @borut.fabjan describes.
Value e.g. in English first, the n switch language at the top to e.g. Norwegian and do the same again, only this time the value is in Norway, whereas the key is the same.

You can upload this ADL to CKM and I believe this will be fully supported, including translation support.

Regarding how this should look in ADL, the only discussion I can remember is whether these should be full keys
Subscale = <"subscale value">
or if they should rather be expressed as other_details with key, value pairs if it is not text or description.

From memory the spec on how to serialise such keys to ADL is a bit ambiguous - but it has always been done in the way @borut.fabjan describes (using full keys), and that is what is supported in tooling, whereas I have never seen the other_details variant in practice…

PART II - The template

When we deal with template things become complicated. There’s legacy .OET format and .OPT format. This formats bring along some limitations. Specially around support for multi-language, or multiple use of the same archetypeID were each instance is named differently.

Support for annotations in .OPT is implemented as extra compartment …. However I don’t think originally anyone thought annotations would be something language dependant, and therefore there’s no reference for language.

Correct, not correct - who knows. :wink: There was much effort put into ADL2, but here we are, hacking .OPT :wink:

Bottom line. In order to support this, it would require some small changes in the format. Making sure we don’t break too much of the tool chain.

However, I think we are patching symptoms, but would probably need to address the real issue - how to support augmentation. Layers? :wink:

4 Likes

Yep, this is what @damoca and myself has done.

Unfortunately not, as @damoca pointed to originally in this thread. Annotations don’t follow through to other languages, the keys have to be manually duplicated.

I guess you’re right. I don’t know how though.

1 Like

Yep, manual only. When translating an archetype in CKM, we offer it, but would also not add a non-translated marker for these. That would be easy but more likely than not it is an annotation that doesn’t have to be translated such as a mapping, gui hint or whatever else this has been used over the years or it is one that could be translated but doesn’t need or should not be translated - maybe an original text from a score that only exists in - say - English…

To add to the confusion, the monolingual template annotations are for a complete path, whereas the adl1.4 archetype “annotations” aka term_definition key value pairs are for an at-code, not a complete path.

Yes, they are language-dependent by adl 1.4 design, they could be “translated” in CKM as per the screenshot, but of course it is annoying to “translate” a “24” as in the example…

We could come up with a convention of what is a language-specific key and what is a general one for all languages, but all in all, I kinda agree with @borut.fabjan 's comment that there is too much hackery here to ever get this right. More layers make my head spin though.

In essence, “annotations” whether in an archetype or template should apply to

  • either a path or an at-code and (orthogonal to this)
  • either a specific language or all available languages
1 Like

Exactly. Unfortunately OPT is legacy but still the main driver for templates. Internally the AD works perfectly, the annotations are kept in place for every language and also included when exporting the template in the native format.

I have the same feeling that the annotations were included to the OPT XML Schema as a patch, without considering all the use cases.

1 Like

@sebastian.garde, slight side-bar, but is the annotations reordering the CKM does when uploading archetypes a feature or a bug? I tried alphabetising them, but the CKM had other ideas :sweat_smile:

@siljelb It always puts text and description first and then comment.
As for the rest, they seem to have developed a life of their own.

(Also, I definitely did not get an email notification for this although I was mentioned, hope the email issue is not back @marcusbaw ?)

1 Like

I was able to have a more detailed look at this today.

They are stored in the correct order, but during serialisation when showing it to you in the CKM frontend this order isn’t honoured.

So, don’t worry about correcting the order for the moment as long as you have uploaded it ok: It won’t change anything + we can and will make sure that they will be listed in their intended order.

2 Likes

Dear @siljelb and all, we have provided a (backend-only) hotfix for this issue.
Anything after text,description,comment will retain their original order again now.

Kind regards,
Sebastian

2 Likes