Generate mapping tree for dse
juliangruendner opened this issue · 0 comments
The dataselection and extraction (dse) is different from the cohort selection in so far as filters for the dse are based on code systems directly and not on a combination of code system and context.
In order to resolve parent child relationships for dse a mapping_tree for dse needs to be created, which can be used by torch to resolve the children concepts, analogous to how it is done in sq2cql and flare for criteria.
The mapping_tree should however only be based on the code system.
Example mapping tree for the cohort selection - (only for person):
[
{
"entries": [
{
"key": "67162-8",
"parents": [],
"children": []
}
],
"context": {
"system": "fdpg.mii.cds",
"code": "Vitalstatus",
"display": "Vitalstatus",
"version": "1.0.0"
},
"system": "http://loinc.org"
},
{
"entries": [
{
"key": "424144002",
"parents": [],
"children": []
}
],
"context": {
"system": "fdpg.mii.cds",
"code": "Patient",
"display": "Patient",
"version": "1.0.0"
},
"system": "http://snomed.info/sct"
},
{
"entries": [
{
"key": "263495000",
"parents": [],
"children": []
}
],
"context": {
"system": "fdpg.mii.cds",
"code": "Patient",
"display": "Patient",
"version": "1.0.0"
},
"system": "http://snomed.info/sct"
}
]
For the dataselection it should look like this, and contain all code systems of all value sets used by the dse.
[
{
"entries": [
{
"key": "67162-8",
"parents": [],
"children": []
}
],
"system": "http://loinc.org"
}
]
Unlike the cohort selection mapping tree, it is only based on the code system and should be generated for each.
Finally it will require a similar call to
https://github.com/medizininformatik-initiative/fhir-ontology-generator/blob/develop/TerminologService/valueSetToRoots.py#L116