medizininformatik-initiative / sq2cql

1 stars 1 forks source link

Do not expand Abstract Term Code Tree Nodes #7

Open geloro94 opened 1 year ago

geloro94 commented 1 year ago

Querying ICD-10 Codes that are not terminal i.e. C50-C50 results in querying the code itself and all subconcepts. As sites are only allowed to document terminal ICD-10 Codes we should only query terminal ICD-10 Codes to improve the performance:

library Retrieve
using FHIR version '4.0.0'
include FHIRHelpers version '4.0.0'

codesystem icd10: 'http://fhir.de/CodeSystem/bfarm/icd-10-gm'

context Patient

define InInitialPopulation:
  exists [Condition: Code 'C50-C50' from icd10] or
  exists [Condition: Code 'C50' from icd10] or
  exists [Condition: Code 'C50.8' from icd10] or
  exists [Condition: Code 'C50.9' from icd10] or
  exists [Condition: Code 'C50.0' from icd10] or
  exists [Condition: Code 'C50.2' from icd10] or
  exists [Condition: Code 'C50.4' from icd10] or
  exists [Condition: Code 'C50.6' from icd10] or
  exists [Condition: Code 'C50.3' from icd10] or
  exists [Condition: Code 'C50.5' from icd10] or
  exists [Condition: Code 'C50.1' from icd10]

should be:

library Retrieve
using FHIR version '4.0.0'
include FHIRHelpers version '4.0.0'

codesystem icd10: 'http://fhir.de/CodeSystem/bfarm/icd-10-gm'

context Patient

define InInitialPopulation:
  exists [Condition: Code 'C50.8' from icd10] or
  exists [Condition: Code 'C50.9' from icd10] or
  exists [Condition: Code 'C50.0' from icd10] or
  exists [Condition: Code 'C50.2' from icd10] or
  exists [Condition: Code 'C50.4' from icd10] or
  exists [Condition: Code 'C50.6' from icd10] or
  exists [Condition: Code 'C50.3' from icd10] or
  exists [Condition: Code 'C50.5' from icd10] or
  exists [Condition: Code 'C50.1' from icd10]