medizininformatik-initiative / kerndatensatzmodul-mikrobiologie

1 stars 0 forks source link

Intensional SNOMED CT don't expand #16

Open jpwiedekopf opened 3 months ago

jpwiedekopf commented 3 months ago

Also via @schwzr, one intensional SCT ValueSets doesn't expand using Ontoserver: https://www.medizininformatik-initiative.de/fhir/modul-mikrobio/ValueSet/mii-vs-mikrobio-mre-klasse-snomedct; Simplifier.

The ValueSet uses the filter concept EQUAL 409795000 (which Ontoserver doesn't define), and concept descendent-of 409795000. This means that all concepts that are below 409795000, and the concept 409795000 itself, should be included in the ValueSet. This is equivalent to concept is-a 409795000. The same filters could also be expressed using ECL: concept is-a 123 is equivalent to constraint = "<< 123", and concept descendent-of 123 would be constraint = "< 123".

By changing this over to concept is-a 123, the ValueSet also becomes compatible with Snowstorm, which doesn't support the descendent-of filter, while Ontoserver does. The ECL expression is also compatible with Snowstorm, but since the descendent-of semantic is not needed here, I see no need to use ECL when is-a suffices.

For clarification: descendent-of doesn't include the focus concept, is-a does, since it holds that 123 is-a 123, but since 123 is not a child of itself, it isn't returned using the descendent-of semantic. The current formulation of the ValueSet makes it very clear that the is-a semantic is intended by including the focus concept explicitly. However, the way the focus concepts is included is syntactically incorrect and semantically unneeded. The syntactically correct way of including concepts by code would simply be:

{
  "compose": {
    "include": [
      {
        "concept": [
          {
            "code": "409795000"
          },
          {
            "code": "409794001"
          },
          {
            "code": "409793007"
          }
        ],
        "system": "http://snomed.info/sct"
      },
      {
        "filter": [
          {
            "property": "concept",
            "op": "is-a",
            "value": "409794001"
          }
        ],
        "system": "http://snomed.info/sct"
      },
      {
        "filter": "..."
      }
    ]
  }
}

I've attached a fixed version of the ValueSet: VS_Mikrobio_MRE_Klasse_SNOMEDCT.json

rinaldie commented 3 months ago

Very clear and helpful, thanks! VS corrected

jpwiedekopf commented 3 months ago

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