medizininformatik-initiative / kerndatensatzmodul-mikrobiologie

1 stars 0 forks source link

Intensional LOINC VS don't expand #15

Open jpwiedekopf opened 6 months ago

jpwiedekopf commented 6 months ago

@schwzr reported to me that the ValueSet https://www.medizininformatik-initiative.de/fhir/modul-mikrobio/ValueSet/mii-vs-mikrobio-empfindlichkeit-genotyp-loinc (Simplifier) is unable to expand using the SU-TermServ Ontoserver.

Looking at the ValueSet, the filters are not correctly formulated. This (and other) ValueSets referencing LOINC are not including the correct value for the constraints, and are not referencing the correct properties even:

{
  "compose": {
    "include": [
      {
        "filter": [
          {
            "property": "class",
            "op": "=",
            "value": "ABXBACT"
          },
          {
            "property": "property",
            "value": "susc",
            "op": "="
          },
          {
            "property": "method",
            "value": "Genotyping",
            "op": "="
          }
        ],
        "system": "http://loinc.org"
      }
    ]
  }
}

is written in the ValueSet. First, the properties are not correctly referenced. https://github.com/loinc/loinc-fhir-codesystem/blob/master/loinc.xml states the property codes required for exposing LOINC via the FHIR API, and requires the codes CLASS rather than class, PROPERTY instead of property and METHOD_TYP instead of method.

When I change the ValueSet accordingly, Ontoserver at least gives an empty expansion. However, the value for the property filters is also not correct. Instead of the short display string of the respective LOINC Part, the code has to provided instead (except for CLASS, this seems to be a plain string). For the referenced VS, this becomes:

{
  "compose": {
    "include": [
      {
        "system": "http://loinc.org",
        "filter": [
          {
            "property": "CLASS",
            "op": "=",
            "value": "ABXBACT"
          },
          {
            "property": "PROPERTY",
            "op": "=",
            "value": "LP6870-2"
          },
          {
            "property": "METHOD_TYP",
            "op": "=",
            "value": "LP28723-2"
          }
        ]
      }
    ]
  }
}

With this change, expansion against LOINC 2.77 on my local machine returns an expansion with 98 concepts, of which 2 are inactive, which is consistent with a search query for the same parameters in SearchLOINC.

This issue seems to affect multiple ValueSets in the KDS package, and warrant a new package release. I will try to fix the ValueSets that I've identified momentarily.

jpwiedekopf commented 6 months ago
Canonical Simplifier link Equivalent search Consistent counts?
https://www.medizininformatik-initiative.de/fhir/modul-mikrobio/ValueSet/mii-vs-mikrobio-empfindlichkeit Simplifier 98 concepts yes
https://www.medizininformatik-initiative.de/fhir/modul-mikrobio/ValueSet/mii-vs-mikrobio-empfindlichkeit-phenotyp-loinc Simplifier 1389 concepts without the exclusion, which can't be translated to LOINC search yes, if I take out the exclude from the FHIR VS

Fixed files:


Verification by @schwzr:

rinaldie commented 6 months ago

@schwzr, @jpwiedekopf thank you for your precious contribution. it´s now been corrected

jpwiedekopf commented 6 months ago

A new package needs to be released to ensure fixes reach all users :)