BBMRI.de/GBA Implementation Guide
1.2.0 - CI Build

BBMRI.de/GBA Implementation Guide - Local Development build (v1.2.0). See the Directory of published versions

Library: Specimen Quality Reports

Official URL: https://fhir.bbmri.de/Library/SpecimenQualityReports Version: 1.2.0
Active as of 2023-09-01 Computable Name: SpecimenQualityReports

This library contains various expressions used in different specimen related quality reports.

Related Artifacts

depends-onhttp://hl7.org/fhir/Library/FHIR-ModelInfo|4.0.0
depends-onhttp://hl7.org/fhir/Library/FHIRHelpers|4.0.0

Parameters

Specimenout01Specimen
InInitialPopulationout01boolean
FirstSampleMaterialTypeout01code
NumberOfSampleMaterialTypesout01integer
CollectedYearout01integer
CollectedMonthout01integer
CollectedDayout01integer
CollectedHourout01integer
StorageTemperatureCodingsout0*Coding
StorageTemperatureCodesout01string
NumberOfStorageTemperatureCodesout01integer
SampleDiagnosisCodingsout0*Coding
SampleDiagnosisICD10Codesout01string
NumberOfSampleDiagnosesICD10Codesout01integer
SampleDiagnosisICD10GMCodesout01string
NumberOfSampleDiagnosesICD10GMCodesout01integer
BodySiteCodesout01string
NumberOfBodySiteCodesout01integer

Contents

text/cql

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

context Specimen

define InInitialPopulation:
  true

define FirstSampleMaterialType:
  First(from Specimen.type.coding C
    where C.system = 'https://fhir.bbmri.de/CodeSystem/SampleMaterialType'
    return C.code)

define NumberOfSampleMaterialTypes:
  Count(from Specimen.type.coding C
    where C.system = 'https://fhir.bbmri.de/CodeSystem/SampleMaterialType'
    return C.code)

define CollectedYear:
  year from FHIRHelpers.ToDateTime(Specimen.collection.collected)

define CollectedMonth:
  month from FHIRHelpers.ToDateTime(Specimen.collection.collected)

define CollectedDay:
  day from FHIRHelpers.ToDateTime(Specimen.collection.collected)

define CollectedHour:
  hour from FHIRHelpers.ToDateTime(Specimen.collection.collected)

define StorageTemperatureCodings:
  flatten
    from Specimen.extension E
      where E.url = 'https://fhir.bbmri.de/StructureDefinition/StorageTemperature'
      return E.value.coding

define StorageTemperatureCodes:
  Combine(from StorageTemperatureCodings C
    where C.system = 'https://fhir.bbmri.de/CodeSystem/StorageTemperature'
    return C.code, ', ')

define NumberOfStorageTemperatureCodes:
  Count(from StorageTemperatureCodings C
    where C.system = 'https://fhir.bbmri.de/CodeSystem/StorageTemperature')

define SampleDiagnosisCodings:
  flatten
    from Specimen.extension E
    where E.url = 'https://fhir.bbmri.de/StructureDefinition/SampleDiagnosis'
    return E.value.coding

define SampleDiagnosisICD10Codes:
  Combine(from SampleDiagnosisCodings C
    where C.system = 'http://hl7.org/fhir/sid/icd-10'
    return C.code, ', ')

define NumberOfSampleDiagnosesICD10Codes:
  Count(from SampleDiagnosisCodings C
    where C.system = 'http://hl7.org/fhir/sid/icd-10')

define SampleDiagnosisICD10GMCodes:
  Combine(from SampleDiagnosisCodings C
    where C.system = 'http://fhir.de/CodeSystem/dimdi/icd-10-gm'
    return C.code, ', ')

define NumberOfSampleDiagnosesICD10GMCodes:
  Count(from SampleDiagnosisCodings C
    where C.system = 'http://fhir.de/CodeSystem/dimdi/icd-10-gm')

define BodySiteCodes:
  Combine(from Specimen.collection.bodySite.coding C
    where C.system = 'urn:oid:1.3.6.1.4.1.19376.1.3.11.36'
    return C.code, ', ')

define NumberOfBodySiteCodes:
  Count(from Specimen.collection.bodySite.coding C
    where C.system = 'urn:oid:1.3.6.1.4.1.19376.1.3.11.36')

Content not shown - (application/elm+xml, size = 50Kb)