P.S. simply use the RM paths in EHRbase for (partial) querying:
{
"q":"select
c/content[openEHR-EHR-OBSERVATION.laboratory_test_result.v1]/data[at0001]/events[at0002]/data[at0003]/items[openEHR-EHR-CLUSTER.specimen.v1]/items[at0029]/value/mappings/target/code_string
from EHR e
contains COMPOSITION c
"
}
Now I’m confused I tried to answer @sangeeta.nbose 's question, then implicitly asked if my answer was correct. I’ll stop here before go into an infinite loop
Thank you so much @birger.haarbrandt . The code helped… we have this working now. Just one last question… For storing multiple mappings… I would need to make this a list with multiple mappings. Would this be right.?
“mappings”: [
{
“_type”: “TERM_MAPPING”,
“match”: “=”,
“target”: {
“terminology_id”: {
“value”: “SNOMED-CT”
},
“code_string”: “345356676789”
}
}
{
“_type”: “TERM_MAPPING”,
“match”: “=”,
“target”: {
“terminology_id”: {
“value”: “UMLS”
},
“code_string”: “1234”
}
}
]
If so, how would the RM path work out for accessing the individual item in the list ? Thanks for all your help.
Hi… I. have another question too… Can I use the ‘match’ field to store an accuracy number. It would be my information on the accuracy of the mapping of the source value with the target code. ‘Match’ is a char, so i would be able to store the number… but just checking if there are are guidelines against it.
Hi Sangeeta, I think technically you can use any character, other should confirm this. But only 4 characters are specified in the TERM_MAPPING class to have meaning. I rencentlh proposed to add ~ as a fifth option to indicate a somewhat match (e.g. machine learning suggestion). Is this also your usecase?
Yes @joostholslag my use case would be a machine learning suggestion… but I do have a confidence number… Hence was looking at using ‘match’ for storing the number.
for e.g. trying to find out how to traverse the list and get the code_string for ‘snomed-ct’ (This is an addition to my post showing the mappings as a list)
I’m a bit wary of the value of even the broad match categories. the degree of ‘match’ is highly contextual and not solely a function of the codes themselves but of the direct downstream usage of the codes.
Right - but you can’t outguess every subsequent use, and we also have to let openEHR users work such things out for themselves. We are not the terminology-matching police after all
Hi… Just updating that I couldnt use the ‘match’ for storing a number, The field accepts only a single character. Will figure out some other attributes. Do share, if any recommendations.
You are right @Seref - and I have recently come across the need to set this constraint at design time.
In our system we can query a terminology service and get back the terminology with mappings. But for some use-cases I want to add the terminology as local to the archetype or template with bindings. This will be useful for self-contained deployment of an OPT with some UI or integration resources without the need for a specific terminology service.
I would love to see a solution for this in the modelling domain.
I think this probably needs some extra thinking at SEC, as this is different from setting bindings. I’m not clear how it would be supported in ADL/ADL2 right now.
Coming back to this topic, let me see if i understood correctly:
The use case that I am trying to express is the CODED_TEXT validation that happens when storing a code_string into the CDR and terminology_id is checked to see if it contains the code_string.
Having a term (codi_string) that for different reasons may have seen its term set (terminology_id) modified over time, in order to capture all possibilities in the design time, using AD it is necessary to add as many CODED_TEXT as terminology_id for that term?
I will make the assumption that when you say “terminology_id is checked to see if it contains the code_string”, you are literally saying that you want to check if the code comes from the terminology, and not checking if the code is part of a specific subset or reference set.
If it was the latter case, there is no mystery: just add as many terminology binding in the archetype as you need for every subset you have. And then you could check if the code is part of any of them.
But, following the initial assumption, you are saying that the terminology_id is modified over time. So, for example, you have a terminology identified as “MY_TERMINOLOGY_ORIGINAL_NAME” that at some point was renamed as “MY_TERMINOLOGY_NEW_NAME”. So, in the data instances you might have stored values as CODE_X::MY_TERMINOLOGY_ORIGINAL_NAME or as CODE_X::MY_TERMINOLOGY_NEW_NAME
To represent that, one option is what you said, add as many DV_CODED_TEXT as you need, one for each terminology_id. Bear in mind that you would also need to constrain the parent items attribute cardinality to 0…1 so that this is interpreted as alternative DV_CODED_TEXT and not as multiple instances.
Another option would be to just add one DV_CODED_TEXT and specify multiple terminologies for it. I have never done this with the Archetype Designer, but I think it is something like this:
This is what the OPT for that template says - it does not mention catalog_2.
In the use case of having to check one code in more than one value set (in my screenshot “catalog_1” and “catalog_2”), are we back to having to implement as many CODED_TEXT as terminology_id?
You are right, I just did it myself and it seems that the AD don’t like to leave open alternatives in templates. I can’t remember if that is explicitly forbidden in the specifications. Anyone has a clue?