In the Archetype Designer I tried to add two constraint_bindings with the code system URIs, though when exporting the OPT, only one appears, it’s like AD totally ignores the constraints. I’ll test in LinkEHR exports the right constraint in the OPT.
constraint_binding = <
["Otras relaciones de contactos del paciente"] = <
items = <
["ac0001"] = <http://terminology.hl7.org/yyy>
>
>
["Relaciones de contactos del paciente"] = <
items = <
["ac0001"] = <http://terminology.hl7.org/xxx>
>
>
>
No luck with LinkEHR, there are some bugs in the last Linux version that prevent me to even create the archetype with a DV_CODED_TEXT node. @damoca@yampeku
Even with the generic tree editor (non-openEHR specific) is giving you an error?. That’s really weird, happy to create the example or exporting some ADL into OPT
If I create, for instance a PERSON with details > tree > element, there is no option for adding a DV_CODED_TEXT directly, so I added a DV_TEXT and set it to use the subclass DV_CODED_TEXT. Then the editor started to do strange things, like removing items from the ontology.
After that, it didn’t allow me to add constraints.
Then I created an ADMIN_ENTRY with tree > element, there the DV_CODED_TEXT appears as an option. Then in the constraints, I can’t add a constraint_binding (constraint ref), I can’t find an option to do so. I see options to add existing terminologies but not a custom URL like:
terminologies are defined on a file inside linkEHR data folder, you can add them there if needed. In principle you should be able to add acXXXX codes whenever you can define a string constraint (in generic editor) for openEHR specific editor, you should be able to define over “Code” classes too
Thanks @yampeku the only thing I need to to set two FHIR code system URIs as the constraint_bindings for ac000X on a DV_CODED_TEXT, not adding the full terminology.
Can I do that in LinkEHR?
In Archetype Designer I can do it just by setting the constraint of the DV_CODED_TEXT to external terminologies, but the AE removes the second constraint when exporting the OPT.
These would be bound to the same acxxxx code.
You’ll have to add the vocabularies to data/linkEHR/teminology/terminology.xml in order to be able to add them as bindings
I’ll look at that. What’s strange is that in the OPT’s I’ve seen and in the ones exported from the AD, what gets exported is the URI in referenceSetUri, not the ac code in reference.
Which OPT schema is used in LinkEHR? Does it allow both? Can it allow to put multiple referenceSetUri with the URIs? (which is the case I’m trying to model, because once I export the OPT and use it on a system, the system doesn’t have access to the original archetypes, so there is no way to look for those URIs referenced by the ac code).
Should we use the value set URI? Or the many code system URIs associated with the value set ?
I’m not answering the archetype editor question, but from a FHIR point of view, the answer is very clear: you use the code system URI in the DV_CODED_TEXT, not the value set - the value set URI belongs in the constraint. (I think that’s what I see in this thread, so I’m answering the original question)
Thanks @grahamegrieve this is clear for me, I think it was Loyd that help me understand that in the FHIR community chat.
My question is about how to model that in openEHR, since editors don’t seem to handle this case very well, especially when exporting the final template to be used in a CDR, which seems like a problem for current integrations using openEHR and FHIR (as I’m working on at this very moment).
Only in one archetype editor it seems possible to put multiple code system URI constraints on a single DV_CODED_TEXT, in the rest it doesn’t seem possible, but in all the exported template has just one URI.
Maybe that’s an item to consider by the group working in the openEHR+FHIR collaboration agreement: this should be supported by openEHR tools.
ADL2 does handle this a little better but TBH I would just offload the whole responsibility to a FHIR server-based Valueset and Codesystems. I’m not sure I see the need to replicate that functionality in openEHR.
I think formally, all OPTs 1.4 need is to be able to have multiple (1..*) referenceSetUri at the C_CODE_REFERENCE level, which right now is 1..1 (implicit because it doesn’t have minOccurs or maxOccurs):
That will allow multiple terminology_id values allowed for a single DV_CODED_TEXT node.
Though I can update our own XSDs easily, it’s a pain to remember this case on every OPT export from modeling tools and needing to manually add the missing refs, but life isn’t perfect. Another option is to build our own modeling tool to comply with these practical requirements.
Anyway, I’m wondering why this case isn’t more frequent in openEHR modeling, or how modelers workaround this issue, because it seems a pretty common case in the FHIR world.
Again, I think this is something the FHIR-openEHR collaboration group might take into account, though I’m not sure who is in that group from the openEHR side. I would love to help if I knew how to participate in that group.