medizininformatik-initiative / sq2cql

1 stars 1 forks source link

Ontology 2.0: Implement Referenced Criteria #49

Closed juliangruendner closed 7 months ago

juliangruendner commented 1 year ago

sq2cql should be extended to support referenced criteria.

These are defined as one criterion referencing another criterion which can include all the elements of a normal criterion except the attribute filter of type "reference". => Only one level of nesting should be supported, so that: A criterion can have an attribute filter of the type "reference" which is a criterion, but the referenced criterion cannot have an attribute filter of the type "reference".

Example: Specimen with diagnosis Assumption: Given the Structured Query (SQ) and mapping below.

Example Structured Query (SQ) with attributeFilter of type 'reference':

{
  "version": "http://to_be_decided.com/draft-1/schema#",
  "display": "",
  "inclusionCriteria": [
    [
      {
        "termCodes": [
          {
            "code": "119364003",
            "system": "http://snomed.info/sct",
            "version": "http://snomed.info/sct/900000000000207008/version/20220930",
            "display": "Serum specimen"
          }
        ],
        "attributeFilters": [
          {
            "type": "reference",
            "criteria": [
              {
                "termCodes": [
                  {
                    "code": "E13.9",
                    "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
                    "version": "2023",
                    "display": "Sonstiger näher bezeichneter Diabetes mellitus : Ohne Komplikationen"
                  }
                ],
                "context": {
                  "code": "Diagnose",
                  "system": "fdpg.mii.cds",
                  "version": "1.0.0",
                  "display": "Diagnose"
                }
              }
            ],
            "attributeCode": {
              "code": "festgestellteDiagnose",
              "display": "Festgestellte Diagnose",
              "system": "http://hl7.org/fhir/StructureDefinition"
            }
          }
        ],
        "context": {
          "code": "Specimen",
          "system": "fdpg.mii.cds",
          "version": "1.0.0",
          "display": "Bioprobe"
        }
      }
    ]
  ]
}

Example Mapping for referenced criterion:

@geloro94 : Add example mapping here