PackagesCanonicalsLogsProblems
    Packages
    de.fhir.medication@1.0.0
    http://ig.fhir.de/igs/medication/StructureDefinition/TimingDgMP
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: TimingDgMP
type: Timing
elements:
  event: {index: 0}
  repeat:
    constraint:
      TimingOnlyOneDayOfWeek:
        human: Dosages Timings must not state the same day across multiple dosage instances
        source: http://ig.fhir.de/igs/medication/StructureDefinition/TimingDgMP
        severity: error
        expression: "( /* Detect DayOfWeek */\n  %resource.ofType(MedicationRequest).dosageInstruction\n  | %resource.ofType(MedicationDispense).dosageInstruction\n  | %resource.ofType(MedicationStatement).dosage\n).all(\n  (\n    timing.repeat.frequency.exists() and\n    timing.repeat.period.exists() and\n    timing.repeat.periodUnit.exists() and\n    timing.repeat.dayOfWeek.exists() and\n    timing.repeat.when.empty() and \n    timing.repeat.timeOfDay.empty()\n  )\n  implies\n  (\n    (\n      (%resource.ofType(MedicationRequest).exists() or %resource.ofType(MedicationDispense).exists())\n      implies\n      (%resource.dosageInstruction.timing.repeat.dayOfWeek.distinct().count() = %resource.dosageInstruction.timing.repeat.dayOfWeek.count())\n    )\n    and\n    (\n      %resource.ofType(MedicationStatement).exists()\n      implies\n      (%resource.dosage.timing.repeat.dayOfWeek.distinct().count() = %resource.dosage.timing.repeat.dayOfWeek.count())\n    )\n  )\n)"
      TimingFrequencyCount:
        human: The frequency of the timing needs to reflect the count of timeOfDay or when
        source: http://ig.fhir.de/igs/medication/StructureDefinition/TimingDgMP
        severity: error
        expression: |-
          (when.exists() and dayOfWeek.empty() implies when.count() = frequency)
          and
          (when.exists() and dayOfWeek.exists() implies (when.count() * dayOfWeek.count()) = frequency)
          and
          (timeOfDay.exists() and dayOfWeek.empty() implies timeOfDay.count() = frequency)
          and
          (timeOfDay.exists() and dayOfWeek.exists() implies (timeOfDay.count() * dayOfWeek.count()) = frequency)
          and
          (dayOfWeek.exists() and timeOfDay.empty() and when.empty() implies dayOfWeek.count() = frequency)
      TimingOnlyOneTimeOfDay:
        human: Dosages Timings must not state the same time of day across multiple dosage instances
        source: http://ig.fhir.de/igs/medication/StructureDefinition/TimingDgMP
        severity: error
        expression: "( /* Detect TimeOfDay */\n  %resource.ofType(MedicationRequest).dosageInstruction\n  | %resource.ofType(MedicationDispense).dosageInstruction\n  | %resource.ofType(MedicationStatement).dosage\n).all(\n  (\n    timing.repeat.frequency.exists() and\n    timing.repeat.period.exists() and\n    timing.repeat.periodUnit.exists() and\n    timing.repeat.dayOfWeek.empty() and\n    timing.repeat.timeOfDay.exists() and\n    timing.repeat.when.empty() \n  )\n  implies\n  (\n    (\n      (%resource.ofType(MedicationRequest).exists() or %resource.ofType(MedicationDispense).exists())\n      implies\n      (%resource.dosageInstruction.timing.repeat.timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.timeOfDay.count())\n    )\n    and\n    (\n      %resource.ofType(MedicationStatement).exists()\n      implies\n      (%resource.dosage.timing.repeat.timeOfDay.distinct().count() = %resource.dosage.timing.repeat.timeOfDay.count())\n    )\n  )\n)"
      TimingOnlyOneTimeForInterval:
        human: Dosage Interval Timings must not state the same time of day across multiple dosage instances
        source: http://ig.fhir.de/igs/medication/StructureDefinition/TimingDgMP
        severity: error
        expression: |
          /* Detect Interval and Time/4-Schema */
          (
            %resource.ofType(MedicationRequest).dosageInstruction
            | %resource.ofType(MedicationDispense).dosageInstruction
            | %resource.ofType(MedicationStatement).dosage
          )
          .all(
            (
              timing.repeat.frequency.exists() and
              timing.repeat.period.exists() and
              timing.repeat.periodUnit.exists() and
              timing.repeat.dayOfWeek.empty() and
              (
                (timing.repeat.timeOfDay.exists() and timing.repeat.when.empty()) or
                (timing.repeat.when.exists() and timing.repeat.timeOfDay.empty())
              )
            )
            implies
            (
              (
                %resource.ofType(MedicationRequest).exists()
                or %resource.ofType(MedicationDispense).exists()
              )
              implies
              (
                %resource.dosageInstruction.timing.repeat.period.distinct().count() = 1
                and %resource.dosageInstruction.timing.repeat.periodUnit.distinct().count() = 1
              )
              and
              (
                (%resource.dosageInstruction.timing.repeat.timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.timeOfDay.count())
                and
                (%resource.dosageInstruction.timing.repeat.when.distinct().count() = %resource.dosageInstruction.timing.repeat.when.count())
              )
            )
            and
            (
              %resource.ofType(MedicationStatement).exists()
              implies
              (
                (
                  %resource.ofType(MedicationRequest).exists()
                  or %resource.ofType(MedicationDispense).exists()
                )
                implies
                (
                  %resource.dosage.timing.repeat.period.distinct().count() = 1
                  and %resource.dosage.timing.repeat.periodUnit.distinct().count() = 1
                )
                and
                (
                  (%resource.dosage.timing.repeat.timeOfDay.distinct().count() = %resource.dosage.timing.repeat.timeOfDay.count())
                  and
                  (%resource.dosage.timing.repeat.when.distinct().count() = %resource.dosage.timing.repeat.when.count())
                )
              )
            )
          )
      TimingIntervalOnlyOneFrequency:
        human: If a dosage is defined by a pure interval, then only one dosage is allowed in the resource.
        source: http://ig.fhir.de/igs/medication/StructureDefinition/TimingDgMP
        severity: error
        expression: |
          ( /* Detect Interval */
            %resource.ofType(MedicationRequest).dosageInstruction
            | %resource.ofType(MedicationDispense).dosageInstruction
            | %resource.ofType(MedicationStatement).dosage
          )
          .all(
            (
              timing.repeat.frequency.exists()
              and timing.repeat.period.exists()
              and timing.repeat.periodUnit.exists()
              and timing.repeat.when.empty()
              and timing.repeat.timeOfDay.empty()
              and timing.repeat.dayOfWeek.empty()
            )
            /* Only One Dosage allowed for Interval */
            implies
            (
              (
                (
                  %resource.ofType(MedicationRequest).exists()
                  or %resource.ofType(MedicationDispense).exists()
                )
                implies (
                  %resource.dosageInstruction.count() = 1
                )
              )
              and
              (
                %resource.ofType(MedicationStatement).exists()
                implies
                %resource.dosage.count() = 1
              )
            )
          )
      TimingOnlyWhenOrTimeOfDay:
        human: Dosages Timings must not state a time of day and period of day across multiple dosage instances
        source: http://ig.fhir.de/igs/medication/StructureDefinition/TimingDgMP
        severity: error
        expression: "(\n  %resource.ofType(MedicationRequest).dosageInstruction\n  | %resource.ofType(MedicationDispense).dosageInstruction\n  | %resource.ofType(MedicationStatement).dosage\n).all(\n    timing.repeat.frequency.exists() and\n    timing.repeat.period.exists() and\n    timing.repeat.periodUnit.exists() and\n    timing.repeat.dayOfWeek.empty() and\n    (timing.repeat.when.exists() or \n    timing.repeat.timeOfDay.exists())\n  implies\n  (\n    (\n      (%resource.ofType(MedicationRequest).exists() or %resource.ofType(MedicationDispense).exists())\n      implies\n      (%resource.dosageInstruction.timing.repeat.when.exists() xor %resource.dosageInstruction.timing.repeat.timeOfDay.exists())\n    )\n    and\n    (\n      %resource.ofType(MedicationStatement).exists()\n      implies\n      (%resource.dosage.timing.repeat.when.exists() xor %resource.dosage.timing.repeat.timeOfDay.exists())\n    )\n  )\n)\n"
      TimingPeriodUnit:
        human: If weekdays are given the periodUnit must be week, otherwise day
        source: http://ig.fhir.de/igs/medication/StructureDefinition/TimingDgMP
        severity: error
        expression: |-
          (dayOfWeek.exists() implies periodUnit = 'wk')
          and
          ((dayOfWeek.empty() and (when.exists() or timeOfDay.exists())) implies periodUnit = 'd')
      TimingOnlyOneBounds:
        human: Dosages Timings must state the same bounds duration across multiple dosage instances
        source: http://ig.fhir.de/igs/medication/StructureDefinition/TimingDgMP
        severity: error
        expression: |-
          (
            %resource.ofType(MedicationRequest).dosageInstruction
            | %resource.ofType(MedicationDispense).dosageInstruction
            | %resource.ofType(MedicationStatement).dosage
          ).all(
            (
              ( /* only one different value and code are allowed*/
                (%resource.ofType(MedicationRequest).exists() or %resource.ofType(MedicationDispense).exists())
                implies
                %resource.dosageInstruction.timing.repeat.bounds.ofType(Duration).exists().not() or
                (
                  (%resource.dosageInstruction.timing.repeat.bounds.ofType(Duration).value.distinct().count() = 1)
                  and
                  (%resource.dosageInstruction.timing.repeat.bounds.ofType(Duration).code.distinct().count() = 1)
                )
              )
              and
              (
                %resource.ofType(MedicationStatement).exists()
                implies
                %resource.dosage.timing.repeat.bounds.ofType(Duration).exists().not() or
                (
                  (%resource.dosage.timing.repeat.bounds.ofType(Duration).value.distinct().count() = 1)
                  and
                  (%resource.dosage.timing.repeat.bounds.ofType(Duration).code.distinct().count() = 1)
                )
              )
            )
          )
      TimingOnlyOnePeriodForDayOfWeek:
        human: For schedules using only dayOfWeek with either timeOfDay or when, each (day + period of day/time) combination must be unique across all dosage instructions.
        source: http://ig.fhir.de/igs/medication/StructureDefinition/TimingDgMP
        severity: error
        expression: "( /* Detect DayOfWeek and Time/4-Schema */\n  %resource.ofType(MedicationRequest).dosageInstruction\n  | %resource.ofType(MedicationDispense).dosageInstruction\n  | %resource.ofType(MedicationStatement).dosage\n).all(\n  (\n    timing.repeat.dayOfWeek.exists() and\n    timing.repeat.frequency.exists() and\n    timing.repeat.period.exists() and\n    timing.repeat.periodUnit.exists() and\n      (\n        (timing.repeat.timeOfDay.exists() and timing.repeat.when.empty()) or\n        (timing.repeat.when.exists() and timing.repeat.timeOfDay.empty())\n      )\n  )\n  implies\n  (\n    (\n      (%resource.ofType(MedicationRequest).exists() or %resource.ofType(MedicationDispense).exists())\n      implies\n      (\n        /* For each day of week */\n        /* if Mon occurs multiple times */\n        ((\n          %resource.dosageInstruction.timing.repeat.dayOfWeek\n          .where($this = 'mon')\n          .where(%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'mon').count() > 1)\n          .distinct()\n        ) implies \n        (\n          (%resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).when.count()) and\n          (%resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).timeOfDay.count())\n        )) and\n        \n        /* if tue occurs multiple times */\n        ((\n          %resource.dosageInstruction.timing.repeat.dayOfWeek\n          .where($this = 'tue')\n          .where(%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'tue').count() > 1)\n          .distinct()\n        ) implies \n        (\n          (%resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).when.count()) and\n          (%resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).timeOfDay.count())\n        )) and\n        /* if wed occurs multiple times */\n        ((\n          %resource.dosageInstruction.timing.repeat.dayOfWeek\n          .where($this = 'wed')\n          .where(%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'wed').count() > 1)\n          .distinct()\n        ) implies \n        (\n          (%resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).when.count()) and\n          (%resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).timeOfDay.count())\n        )) and\n        /* if thu occurs multiple times */\n        ((\n          %resource.dosageInstruction.timing.repeat.dayOfWeek\n          .where($this = 'thu')\n          .where(%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'thu').count() > 1)\n          .distinct()\n        ) implies \n        (\n          (%resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).when.count()) and\n          (%resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).timeOfDay.count())\n        )) and\n        /* if fri occurs multiple times */\n        ((\n          %resource.dosageInstruction.timing.repeat.dayOfWeek\n          .where($this = 'fri')\n          .where(%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'fri').count() > 1)\n          .distinct()\n        ) implies \n        (\n          (%resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).when.count()) and\n          (%resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).timeOfDay.count())\n        )) and\n        /* if sat occurs multiple times */\n        ((\n          %resource.dosageInstruction.timing.repeat.dayOfWeek\n          .where($this = 'sat')\n          .where(%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'sat').count() > 1)\n          .distinct()\n        ) implies \n        (\n          (%resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).when.count()) and\n          (%resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).timeOfDay.count())\n        )) and\n        \n        /* if sun occurs multiple times */\n        ((\n          %resource.dosageInstruction.timing.repeat.dayOfWeek\n          .where($this = 'sun')\n          .where(%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'sun').count() > 1)\n          .distinct()\n        ) implies \n        (\n          (%resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).when.count()) and\n          (%resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).timeOfDay.count())\n        ))\n      )\n    )\n    and\n    (\n      %resource.ofType(MedicationStatement).exists()\n      implies\n      (\n        /* For each day of week */\n        /* if Mon occurs multiple times */\n        ((\n          %resource.dosage.timing.repeat.dayOfWeek\n          .where($this = 'mon')\n          .where(%resource.dosage.timing.repeat.dayOfWeek.where($this = 'mon').count() > 1)\n          .distinct()\n        ) implies \n        (\n          (%resource.dosage.timing.repeat.where('mon' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('mon' in dayOfWeek).when.count()) and\n          (%resource.dosage.timing.repeat.where('mon' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('mon' in dayOfWeek).timeOfDay.count())\n        )) and\n        \n        /* if tue occurs multiple times */\n        ((\n          %resource.dosage.timing.repeat.dayOfWeek\n          .where($this = 'tue')\n          .where(%resource.dosage.timing.repeat.dayOfWeek.where($this = 'tue').count() > 1)\n          .distinct()\n        ) implies \n        (\n          (%resource.dosage.timing.repeat.where('tue' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('tue' in dayOfWeek).when.count()) and\n          (%resource.dosage.timing.repeat.where('tue' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('tue' in dayOfWeek).timeOfDay.count())\n        )) and\n        /* if wed occurs multiple times */\n        ((\n          %resource.dosage.timing.repeat.dayOfWeek\n          .where($this = 'wed')\n          .where(%resource.dosage.timing.repeat.dayOfWeek.where($this = 'wed').count() > 1)\n          .distinct()\n        ) implies \n        (\n          (%resource.dosage.timing.repeat.where('wed' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('wed' in dayOfWeek).when.count()) and\n          (%resource.dosage.timing.repeat.where('wed' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('wed' in dayOfWeek).timeOfDay.count())\n        )) and\n        /* if thu occurs multiple times */\n        ((\n          %resource.dosage.timing.repeat.dayOfWeek\n          .where($this = 'thu')\n          .where(%resource.dosage.timing.repeat.dayOfWeek.where($this = 'thu').count() > 1)\n          .distinct()\n        ) implies \n        (\n          (%resource.dosage.timing.repeat.where('thu' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('thu' in dayOfWeek).when.count()) and\n          (%resource.dosage.timing.repeat.where('thu' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('thu' in dayOfWeek).timeOfDay.count())\n        )) and\n        /* if fri occurs multiple times */\n        ((\n          %resource.dosage.timing.repeat.dayOfWeek\n          .where($this = 'fri')\n          .where(%resource.dosage.timing.repeat.dayOfWeek.where($this = 'fri').count() > 1)\n          .distinct()\n        ) implies \n        (\n          (%resource.dosage.timing.repeat.where('fri' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('fri' in dayOfWeek).when.count()) and\n          (%resource.dosage.timing.repeat.where('fri' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('fri' in dayOfWeek).timeOfDay.count())\n        )) and\n        /* if sat occurs multiple times */\n        ((\n          %resource.dosage.timing.repeat.dayOfWeek\n          .where($this = 'sat')\n          .where(%resource.dosage.timing.repeat.dayOfWeek.where($this = 'sat').count() > 1)\n          .distinct()\n        ) implies \n        (\n          (%resource.dosage.timing.repeat.where('sat' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('sat' in dayOfWeek).when.count()) and\n          (%resource.dosage.timing.repeat.where('sat' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('sat' in dayOfWeek).timeOfDay.count())\n        )) and\n        \n        /* if sun occurs multiple times */\n        ((\n          %resource.dosage.timing.repeat.dayOfWeek\n          .where($this = 'sun')\n          .where(%resource.dosage.timing.repeat.dayOfWeek.where($this = 'sun').count() > 1)\n          .distinct()\n        ) implies \n        (\n          (%resource.dosage.timing.repeat.where('sun' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('sun' in dayOfWeek).when.count()) and\n          (%resource.dosage.timing.repeat.where('sun' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('sun' in dayOfWeek).timeOfDay.count())\n        ))\n      )\n    )\n  )\n)"
      TimingOnlyOneWhen:
        human: Dosages Timings must not state the same period of day across multiple dosage instances
        source: http://ig.fhir.de/igs/medication/StructureDefinition/TimingDgMP
        severity: error
        expression: "( /* Detect 4-Schema */\n  %resource.ofType(MedicationRequest).dosageInstruction\n  | %resource.ofType(MedicationDispense).dosageInstruction\n  | %resource.ofType(MedicationStatement).dosage\n).all(\n    timing.repeat.frequency.exists() and\n    timing.repeat.period.exists() and\n    timing.repeat.periodUnit.exists() and\n    timing.repeat.dayOfWeek.empty() and\n    timing.repeat.when.exists() and \n    timing.repeat.timeOfDay.empty()\n  implies\n  (\n    (\n      (%resource.ofType(MedicationRequest).exists() or %resource.ofType(MedicationDispense).exists())\n      implies\n      (%resource.dosageInstruction.timing.repeat.when.distinct().count() = %resource.dosageInstruction.timing.repeat.when.count())\n    )\n    and\n    (\n      %resource.ofType(MedicationStatement).exists()\n      implies\n      (%resource.dosage.timing.repeat.when.distinct().count() = %resource.dosage.timing.repeat.when.count())\n    )\n  )\n)\n"
      TimingOnlyOneType:
        human: 'Only one kind of Timing is allowed. Current allowed timings: 4-Scheme, TimeOfDay, DayOfWeek, Interval, DayOfWeek and Time/4-Schema, Interval and Time/4-Schema'
        source: http://ig.fhir.de/igs/medication/StructureDefinition/TimingDgMP
        severity: error
        expression: "/* DayOfWeek */\n(\n  %resource.ofType(MedicationRequest).dosageInstruction | \n  ofType(MedicationDispense).dosageInstruction | \n  ofType(MedicationStatement).dosage\n).all(\n  timing.repeat.dayOfWeek.exists() and\n  timing.repeat.frequency.exists() and\n  (timing.repeat.period.exists() and timing.repeat.period = 1) and\n  (timing.repeat.periodUnit.exists()) and\n  timing.repeat.when.empty() and\n  timing.repeat.timeOfDay.empty()\n) or\n\n/* Interval */\n(\n  %resource.ofType(MedicationRequest).dosageInstruction | \n  ofType(MedicationDispense).dosageInstruction | \n  ofType(MedicationStatement).dosage\n).all(\n  timing.repeat.frequency.exists() and\n  timing.repeat.period.exists() and\n  timing.repeat.periodUnit.exists() and\n  timing.repeat.when.empty() and\n  timing.repeat.timeOfDay.empty() and\n  timing.repeat.dayOfWeek.empty()\n) or\n\n/* DayOfWeek and Time/4-Schema */\n(\n  %resource.ofType(MedicationRequest).dosageInstruction | \n  ofType(MedicationDispense).dosageInstruction | \n  ofType(MedicationStatement).dosage\n).all(\n  timing.repeat.dayOfWeek.exists() and\n  timing.repeat.frequency.exists() and\n  (timing.repeat.period.exists() and timing.repeat.period = 1) and\n  (timing.repeat.periodUnit.exists()) and\n  (\n    (timing.repeat.timeOfDay.exists() and timing.repeat.when.empty()) or\n    (timing.repeat.when.exists() and timing.repeat.timeOfDay.empty())\n  )\n) or\n\n/* Interval and Time/4-Schema */\n(\n  %resource.ofType(MedicationRequest).dosageInstruction | \n  ofType(MedicationDispense).dosageInstruction | \n  ofType(MedicationStatement).dosage\n).all(\n  timing.repeat.frequency.exists() and\n  timing.repeat.period.exists() and\n  timing.repeat.periodUnit.exists() and\n  timing.repeat.dayOfWeek.empty() and\n  (\n    (timing.repeat.timeOfDay.exists() and timing.repeat.when.empty()) or\n    (timing.repeat.when.exists() and timing.repeat.timeOfDay.empty())\n  )\n)\n"
    index: 1
    elements:
      frequencyMax: {index: 19}
      when:
        binding: {strength: required, valueSet: 'http://ig.fhir.de/igs/medication/ValueSet/TimingWhenDgMP'}
        index: 23
      offset: {short: Zeitversatz, index: 24}
      periodUnit:
        binding: {strength: required, valueSet: 'http://ig.fhir.de/igs/medication/ValueSet/PeriodUnitsOfTimeDgMP'}
        index: 22
      frequency: {index: 18}
      durationMax: {index: 16}
      duration: {index: 15}
      bounds:
        choices: [boundsDuration]
        index: 6
        slicing:
          slices:
            boundsDuration:
              match: {}
              schema:
                choices: [boundsDuration]
                index: 6
      boundsDuration:
        type: Duration
        choiceOf: bounds
        index: 7
        slicing:
          slices:
            boundsDuration:
              match: {}
              schema: {type: Duration, choiceOf: bounds, index: 7}
      durationUnit: {index: 17}
      count: {index: 13}
      bounds[x]:
        elements:
          value: {index: 8}
          comparator: {index: 9}
          unit: {index: 10}
          system: {index: 11}
          code:
            binding: {strength: required, valueSet: 'http://ig.fhir.de/igs/medication/ValueSet/DosageUnitsOfTimeDgMP'}
            index: 12
        required: [value, unit, system, code]
      periodMax: {index: 21}
      period: {index: 20}
      countMax: {index: 14}
    required: [periodUnit, period, frequency]
  code: {index: 25}
package_version: 1.0.0
class: complex-type
kind: complex-type
url: http://ig.fhir.de/igs/medication/StructureDefinition/TimingDgMP
base: http://ig.fhir.de/igs/medication/StructureDefinition/TimingDE
version: 1.0.0
required: [repeat]