Skip to content

Commit

Permalink
feat: added dhki stratifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
torbrenner committed Sep 5, 2024
1 parent 2e240fb commit 19f5283
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
5 changes: 5 additions & 0 deletions resources/cql/DHKI_STRAT_ENCOUNTER_STRATIFIER
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
define Encounter:
if InInitialPopulation then [Encounter] else {} as List<Encounter>

define function Departments(encounter FHIR.Encounter):
encounter.identifier.where(system = 'http://dktk.dkfz.de/fhir/sid/hki-department').value.first()
5 changes: 5 additions & 0 deletions resources/cql/DHKI_STRAT_MEDICATION_STRATIFIER
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
define MedicationStatement:
if InInitialPopulation then [MedicationStatement] else {} as List <MedicationStatement>

define function AppliedMedications(medication FHIR.MedicationStatement):
medication.medication.coding.code.last()
8 changes: 8 additions & 0 deletions resources/cql/DHKI_STRAT_SPECIMEN_STRATIFIER
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
define Specimen:
if InInitialPopulation then [Specimen] else {} as List<Specimen>

define function SampleType(specimen FHIR.Specimen):
specimen.type.coding.where(system = 'https://fhir.bbmri.de/CodeSystem/SampleMaterialType').code.first()

define function SampleSubtype(specimen FHIR.Specimen):
specimen.type.text.first()
9 changes: 8 additions & 1 deletion resources/cql/DKTK_STRAT_AGE_STRATIFIER
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,12 @@ from [Condition] C
where C.extension.where(url='http://hl7.org/fhir/StructureDefinition/condition-related').empty() and C.onset is not null
sort by date from onset asc)

define FirstDiagnosis:
First(
from [Condition] C
sort by date from onset asc)

define AgeClass:
if (PrimaryDiagnosis.onset is null) then 'unknown' else ToString((AgeInYearsAt(FHIRHelpers.ToDateTime(PrimaryDiagnosis.onset)) div 10) * 10)
if (PrimaryDiagnosis.onset is null)
then ToString((AgeInYearsAt(FHIRHelpers.ToDateTime(FirstDiagnosis.onset)) div 10) * 10)
else ToString((AgeInYearsAt(FHIRHelpers.ToDateTime(PrimaryDiagnosis.onset)) div 10) * 10)

0 comments on commit 19f5283

Please sign in to comment.