PackagesCanonicalsLogsProblems
    Packages
    de.fhir.medication@2.0.0-ballot
    http://ig.fhir.de/igs/medication/StructureDefinition/TimingDE
description: Beschreibt ein Ereignis, das mehrfach auftreten kann. Zeitpläne werden verwendet, um festzuhalten, wann etwas geplant, erwartet oder angefordert ist. Die häufigste Anwendung ist in Dosierungsanweisungen für Medikamente. Sie werden aber auch für die Planung verschiedener Versorgungsleistungen genutzt und können zur Dokumentation von bereits erfolgten oder laufenden Aktivitäten verwendet werden.
package_name: de.fhir.medication
derivation: constraint
name: TimingDE
type: Timing
elements:
  repeat:
    short: Wann das Ereignis stattfinden soll
    constraint:
      TimingSingleDosageForTimeOfDayWarning:
        human: If only timeOfDay is used and dosing is daily, the times must be modelled in a single Dosage element. Multiple Dosage elements are only allowed if every element carries a distinct dose, including its data type.
        source: http://ig.fhir.de/igs/medication/StructureDefinition/TimingDE
        severity: warning
        expression: |-
          (
            %resource.ofType(MedicationRequest).dosageInstruction
            | %resource.ofType(MedicationDispense).dosageInstruction
            | %resource.ofType(MedicationStatement).dosage
          ).all(
            (
              timing.repeat.dayOfWeek.empty() and
              timing.repeat.timeOfDay.exists() and
              timing.repeat.when.empty()
            )
            implies
            (
              (
                (
                  %resource.ofType(MedicationRequest).dosageInstruction
                  | %resource.ofType(MedicationDispense).dosageInstruction
                  | %resource.ofType(MedicationStatement).dosage
                ).where(
                  timing.repeat.dayOfWeek.empty() and timing.repeat.timeOfDay.exists() and timing.repeat.when.empty()
                ).count() = 1
              )
              or
              (
                (
                  %resource.ofType(MedicationRequest).dosageInstruction
                  | %resource.ofType(MedicationDispense).dosageInstruction
                  | %resource.ofType(MedicationStatement).dosage
                ).where(
                  timing.repeat.dayOfWeek.empty() and timing.repeat.timeOfDay.exists() and timing.repeat.when.empty()
                ).doseAndRate.dose.distinct().count()
                =
                (
                  %resource.ofType(MedicationRequest).dosageInstruction
                  | %resource.ofType(MedicationDispense).dosageInstruction
                  | %resource.ofType(MedicationStatement).dosage
                ).where(
                  timing.repeat.dayOfWeek.empty() and timing.repeat.timeOfDay.exists() and timing.repeat.when.empty()
                ).count()
              )
            )
          )
      TimingSingleDosageForWhenWarning:
        human: If only when is used and dosing is daily, the times of day must be modelled in a single Dosage element. Multiple Dosage elements are only allowed if every element carries a distinct dose, including its data type.
        source: http://ig.fhir.de/igs/medication/StructureDefinition/TimingDE
        severity: warning
        expression: |-
          (
            %resource.ofType(MedicationRequest).dosageInstruction
            | %resource.ofType(MedicationDispense).dosageInstruction
            | %resource.ofType(MedicationStatement).dosage
          ).all(
            (
              timing.repeat.dayOfWeek.empty() and
              timing.repeat.when.exists() and
              timing.repeat.timeOfDay.empty()
            )
            implies
            (
              (
                (
                  %resource.ofType(MedicationRequest).dosageInstruction
                  | %resource.ofType(MedicationDispense).dosageInstruction
                  | %resource.ofType(MedicationStatement).dosage
                ).where(
                  timing.repeat.dayOfWeek.empty() and timing.repeat.when.exists() and timing.repeat.timeOfDay.empty()
                ).count() = 1
              )
              or
              (
                (
                  %resource.ofType(MedicationRequest).dosageInstruction
                  | %resource.ofType(MedicationDispense).dosageInstruction
                  | %resource.ofType(MedicationStatement).dosage
                ).where(
                  timing.repeat.dayOfWeek.empty() and timing.repeat.when.exists() and timing.repeat.timeOfDay.empty()
                ).doseAndRate.dose.distinct().count()
                =
                (
                  %resource.ofType(MedicationRequest).dosageInstruction
                  | %resource.ofType(MedicationDispense).dosageInstruction
                  | %resource.ofType(MedicationStatement).dosage
                ).where(
                  timing.repeat.dayOfWeek.empty() and timing.repeat.when.exists() and timing.repeat.timeOfDay.empty()
                ).count()
              )
            )
          )
      TimingBoundsUnitMatchesCodeWarning:
        human: boundsDuration.unit must match the UCUM boundsDuration.code (e.g. 'Woche(n)' only with code='wk').
        source: http://ig.fhir.de/igs/medication/StructureDefinition/TimingDE
        severity: warning
        expression: "bounds.ofType(Duration).exists().not() or (\n  (\n    bounds.ofType(Duration).code = 'd'\n    implies \n    (\n      bounds.ofType(Duration).unit = 'Tag(e)' or\n      bounds.ofType(Duration).unit = 'Tag' or\n      bounds.ofType(Duration).unit = 'Tage'\n    )\n  ) and (\n    bounds.ofType(Duration).code = 'wk'\n    implies \n    (\n      bounds.ofType(Duration).unit = 'Woche(n)' or\n      bounds.ofType(Duration).unit = 'Woche' or\n      bounds.ofType(Duration).unit = 'Wochen'\n    )\n  ) and (\n    bounds.ofType(Duration).code = 'mo'\n    implies \n    (\n      bounds.ofType(Duration).unit = 'Monat(e)' or\n      bounds.ofType(Duration).unit = 'Monat' or\n      bounds.ofType(Duration).unit = 'Monate'\n    )\n  ) and (\n    bounds.ofType(Duration).code = 'a'\n    implies \n    (\n      bounds.ofType(Duration).unit = 'Jahr(e)' or\n      bounds.ofType(Duration).unit = 'Jahr' or\n      bounds.ofType(Duration).unit = 'Jahre'\n    )\n  )\n)"
      TimingFreqOrPeriodGtOneWarning:
        human: 'If frequency and period are given together, only one of them may exceed 1 - either the frequency including frequencyMax or the period including periodMax. A statement in which both exceed 1, such as ''six times within three hours'', is hard to express in language and is not needed: the same meaning can be conveyed by adapting the period, e.g. ''every 30 minutes''.'
        source: http://ig.fhir.de/igs/medication/StructureDefinition/TimingDE
        severity: warning
        expression: |-
          /* Detect Interval only */
          (
            timeOfDay.empty() and
            when.empty() and
            dayOfWeek.empty() and
            frequency.exists() and
            period.exists()
          ) implies
          (
            (
              (frequency > 1 or (frequencyMax.exists() and frequencyMax > 1))
              implies
              (
                period = 1 and
                (periodMax.empty() or periodMax = 1)
              )
            )
            and
            (
              (period > 1 or (periodMax.exists() and periodMax > 1))
              implies
              (
                frequency = 1 and
                (frequencyMax.empty() or frequencyMax = 1)
              )
            )
          )
    mustSupport: true
    index: 0
    elements:
      frequencyMax: {mustSupport: true, index: 16}
      boundsPeriod:
        short: Start und Enddatum der Dosieranweisung ausgedrückt in Datum mit optional Uhrzeit.
        type: Period
        mustSupport: true
        choiceOf: bounds
        index: 12
        slicing:
          slices:
            boundsPeriod:
              match: {}
              schema: {short: Start und Enddatum der Dosieranweisung ausgedrückt in Datum mit optional Uhrzeit., type: Period, mustSupport: true, choiceOf: bounds, index: 12}
              min: 0
              max: 1
      when: {short: Code für den Zeitraum des Auftretens, mustSupport: true, index: 22}
      periodUnit: {short: s | min | h | d | wk | mo | a - Zeiteinheit (UCUM), mustSupport: true, index: 19}
      frequency: {short: Ereignis tritt frequency-mal pro Zeitraum auf, mustSupport: true, index: 15}
      bounds:
        short: Start und Enddatum der Dosieranweisung ausgedrückt in Datum mit optional Uhrzeit.
        mustSupport: true
        choices: [boundsPeriod]
        index: 11
        slicing:
          slices:
            boundsPeriod:
              match: {}
              schema:
                short: Start und Enddatum der Dosieranweisung ausgedrückt in Datum mit optional Uhrzeit.
                mustSupport: true
                choices: [boundsPeriod]
                index: 11
              min: 0
              max: 1
      boundsDuration:
        short: Dauer der Dosieranweisung ausgedrückt in UCUM-Einheiten
        type: Duration
        mustSupport: true
        choiceOf: bounds
        index: 5
        slicing:
          slices:
            boundsDuration:
              match: {}
              schema: {short: Dauer der Dosieranweisung ausgedrückt in UCUM-Einheiten, type: Duration, mustSupport: true, choiceOf: bounds, index: 5}
              min: 0
              max: 1
      dayOfWeek: {mustSupport: true, index: 20}
      bounds[x]:
        elements:
          start: {mustSupport: true, index: 13}
          end: {mustSupport: true, index: 14}
      periodMax: {mustSupport: true, index: 18}
      period: {short: Ereignis tritt frequency-mal pro Zeitraum auf, mustSupport: true, index: 17}
      timeOfDay: {short: Tageszeit für die Aktion, mustSupport: true, index: 21}
package_version: 2.0.0-ballot
class: complex-type
kind: complex-type
url: http://ig.fhir.de/igs/medication/StructureDefinition/TimingDE
base: http://hl7.org/fhir/StructureDefinition/Timing
version: 2.0.0-ballot