medizininformatik-initiative / fhir-data-evaluator

1 stars 0 forks source link

Add Context to crtieria group in Measure MeasureReport #13

Open juliangruendner opened 6 months ago

juliangruendner commented 6 months ago

When loading data into the elastic search (https://github.com/medizininformatik-initiative/feasibility-ontology-elasticsearch) used for the ontology in FDPG+ to add the availability for each criterion the context of each criterion has to be considered.

Example entry in elastic search for a criterion

{
  "name": "Diabetes Mellitus",
  "contextualized-termcode-hash": "203e04cd-4f0a-321b-b1ad-9ec6d211e0a8",
  "availability": "96",
  "context": "Diagnosis",
  "terminology": "icd-10",
  "termcode": "E10-E14",
  "kds-module": "Condition",
  "translations" : [
    {
      "lang": "de",
      "value": "Diabetes Mellitus"
    },
    {
      "lang": "en-UK",
      "value": "Diabetes Mellitus"
    }
  ],
  "parents" : [
    {
      "name": "Endokrine, Ernährungs- und Stoffwechselerkrankungen",
      "contextualized-termcode-hash": "c55d0d62-6c47-30b0-94b2-afa383ce35f7"
    }
  ],
  "children": [
    {
      "name": "Diabetes Mellitus, Typ 1",
      "contextualized-termcode-hash": "b303cc1c-0776-3d78-9f18-98847173a73d"
    },
    {
      "name": "Diabetes Mellitus, Typ 2",
      "contextualized-termcode-hash": "29451c0c-e26d-3d43-9b74-6e43230ac9f5"
    }
  ],
  "relatedTerms": [
    {
      "name": "foo",
      "contextualized-termcode-hash": "81e98694-bb61-4e1f-844e-399806b67b08"
    },
    {
      "name": "bar",
      "contextualized-termcode-hash": "644de523-636a-4afe-9ade-997db8487f81"
    }
  ]
}

This uses the context to calculate the contextualized-termcode-hash, which is used to identify the criterion. Example of a criterion in the ui_tree which the availability has to be matched to

{
  "context": {
      "code": "Diagnose",
      "display": "Diagnose",
      "system": "fdpg.mii.cds",
      "version": "1.0.0"
  },
  "display": "Sonstiger n\u00e4her bezeichneter Diabetes mellitus : Ohne Komplikationen : Nicht als entgleist bezeichnet",
  "id": "4e22b2a0-6ce6-b015-0eba-948836f0d6f7",
  "leaf": true,
  "selectable": true,
  "termCodes": [
      {
          "code": "E13.90",
          "display": "Sonstiger n\u00e4her bezeichneter Diabetes mellitus : Ohne Komplikationen : Nicht als entgleist bezeichnet",
          "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
          "version": "2023"
      }
  ]
}

Therefore it should be possible to add the context to each group of a measure, which then has to be available in the MeasureReport.

so that a MeasureReport with a stratifier would contain a coding for the context

{
               {
          "code": [
            {
              "coding": [
                {
                  "system": "http://fhir-evaluator/strat/system",
                  "code": "condition-icd10-code"
                }
              ]
            }
          ],
          "stratum": [
            {
              "value": {
                "coding": [
                  {
                    "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
                    "code": "I95.0"
                  }
                ]
              },
              "population": [
                {
                  "code": {
                    "coding": [
                      {
                        "system": "http://terminology.hl7.org/CodeSystem/measure-population",
                        "code": "initial-population",
                        "display": "display"
                      }
                    ]
                  },
                  "count": 10804
                }
              ]
            }
juliangruendner commented 6 months ago

@bastianschaffer , @alexanderkiel we should discuss how best to transport the information for the context. The information is already already indirectly provided in the measure in form of the criteria expression - as the profile can map to the context for our criteria.

I personally would tconsider adding another coding to the stratifier, for example

{
               {
          "code": [
            {
              "coding": [
                {
                  "system": "http://fhir-evaluator/strat/system",
                  "code": "condition-icd10-code"
                },
               {
                  "system": "http://fdpg-plus/context/system",
                  "code": "Diagnose"
                }
              ]
            }
          ],
          "stratum": [
            {
              "value": {
                "coding": [
                  {
                    "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
                    "code": "I95.0"
                  }
                ]
              },
              "population": [
                {
                  "code": {
                    "coding": [
                      {
                        "system": "http://terminology.hl7.org/CodeSystem/measure-population",
                        "code": "initial-population",
                        "display": "display"
                      }
                    ]
                  },
                  "count": 10804
                }
              ]
            }