Node name mappings in EHRBase

Hello!

Following this discussion I tried to add a mapping to a node name in a composition and post it to EHRbase (the “archetype_node_id”: “at0019” in the snippet below). I had no errors in the upload, but after retrieving the composition through a GET call this part disappeared and it is unreachable even using specific queries. Does EHRBase support TERM_MAPPINGS or am I missing something? If not, is it planned to support this requirement?

Thanks!

[...]
 "archetype_node_id": "openEHR-EHR-EVALUATION.gender.v1",
                    "language": {...},
                    "encoding": {...},
                    "subject": {...},
                    "data": {
                        "_type": "ITEM_TREE",
                        "name": {
                            "_type": "DV_TEXT",
                            "value": "Tree"
                        },
                        "archetype_node_id": "at0002",
                        "items": [
                            {
                                "_type": "ELEMENT",
                                "name": {
                                    "_type": "DV_TEXT",
                                    "value": "Biological sex",
                                    "mappings": [
                                    {
                                       "_type": "TERM_MAPPING",
                                       "match":"=",
                                       "target":{
                                           "_type":"CODE_PHRASE",
                                           "terminology_id":{
                                               "_type":"TERMINOLOGY_ID",
                                               "value":"OMOP"
                                           },
                                           "code_string":"37116947"
                                       }                                    
                                    }
                                ]
                                },
                                "archetype_node_id": "at0019",
                                "value": {
                                    "_type": "DV_TEXT",
                                    "value": "male"
                                }
                            }
                        ]
                    }
                },
[...]

Hi @ce.mascia,

TERM_MAPPING is supported. What version of EHRbase are you using? Feel free to create a ticket in our issue tracker and we take a look at it.

You put mappings on the ELEMENT level. But that is not a property of ELEMENT, it is a property of DV_TEXT. So change the JSON for the Element part to the following and it should work:

{
    "_type": "ELEMENT",
    "name": {
        "_type": "DV_TEXT",
        "value": "Biological sex"                                    
    },
    "archetype_node_id": "at0019",
    "value": {
        "_type": "DV_TEXT",
        "value": "male",
        "mappings": [
            {
            "_type": "TERM_MAPPING",
            "match":"=",
            "target":{
                "_type":"CODE_PHRASE",
                "terminology_id":{
                    "_type":"TERMINOLOGY_ID",
                    "value":"OMOP"
                },
                "code_string":"37116947"
            }                                    
            }
        ]
    }
}

1 Like

Hi,

thanks @birger.haarbrandt, okay then I might add the request on GitHub too. Anyway, the version I’m using should be the latest, the 0.17.2.

@pieterbos thanks for your suggestion, that actually works correctly in EHRbase, but what I’m trying to do is a different thing: I don’t want to map the “value” of the element but the “name”. Since this is a DV_TEXT as well, I thought it would work the same way, am I wrong?

Ah right. Sorry about that, that is indeed what you posted, and your json is correct and parses with Archie - I misread it!