Medication IG DE
2.0.0-ballot - ballot

Medication IG DE, published by HL7 Deutschland e.V.. This guide is not an authorized publication; it is the continuous build for version 2.0.0-ballot built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/hl7germany/medication-ig-de-r4/ and changes regularly. See the Directory of published versions

Data Type Profile: Timing dgMP

Official URL: http://ig.fhir.de/igs/medication/StructureDefinition/TimingDgMP Version: 2.0.0-ballot
Active as of 2026-08-30 Computable Name: TimingDgMP

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.

Hinweise zur Verwendung

Legacy-Angaben

In früheren Fassungen dieses Guide waren frequency, period und periodUnit in allen Dosierschemata verpflichtend — auch dort, wo sie nur wiederholen, was Wochentage, Tagesabschnitte oder Uhrzeiten bereits ausdrücken. Sie sind heute nur noch dort erforderlich, wo sie tatsächlich ein Intervall beschreiben.

Damit bestehende Verordnungsdaten gültig bleiben, sind diese Angaben als Legacy-Angaben weiterhin zulässig, sofern sie dem jeweiligen Schema nicht widersprechen. Sie begründen kein zusätzliches Intervallschema und verändern den erzeugten Dosierungstext nicht: Eine Verordnung mit und eine ohne diese Felder erzeugen denselben Text.

Welche Kombination im einzelnen Schema zulässig ist, beschreibt die jeweilige Seite im Abschnitt „Dosierschemata"; durchgesetzt wird es über die Invarianten TimingOnlyOneType und TimingPeriodUnit.

Invariante: tim-9
Die Invariante tim-9 enthält einen bekannten Fehler. Dieser wurde in einigen Validatoren bereits behoben. Sollte ein Validator ohne den entsprechenden Fix verwendet werden, ist die tim-9-Definition aus FHIR R5 zu verwenden:
offset.empty() or (when.exists() and when.select($this in ('C' | 'CM' | 'CD' | 'CV')).allFalse())
Siehe auch die entsprechende Beschreibung in FHIR R5 (Timing).

Usages:

You can also check for usages in the FHIR IG Statistics

Formal Views of Profile Content

Description of Profiles, Differentials, Snapshots and how the different presentations work.

NameFlagsCard.TypeDescription & Constraints    Filter: Filtersdoco
.. Timing C 0..* TimingDE A timing schedule that specifies an event that may occur multiple times
Constraints: TimingOnlyOnePeriodForDayOfWeek
... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored even if unrecognized
... repeat SΣC 1..1 Element Wann das Ereignis stattfinden soll
Constraints: tim-1, tim-2, tim-4, tim-5, tim-6, tim-7, tim-8, tim-9, tim-10, TimingSingleDosageForTimeOfDayWarning, TimingSingleDosageForWhenWarning, TimingBoundsUnitMatchesCodeWarning, TimingFreqOrPeriodGtOneWarning, TimingOnlyOneType, TimingIntervalOnlyOneFrequency, TimingOnlyOneWhen, TimingOnlyWhenOrTimeOfDay, TimingOnlyOneTimeOfDay, TimingOnlyOneDayOfWeek, TimingOnlyOneTimeForInterval, TimingOnlyOneBounds, TimingFrequencyCount, TimingPeriodUnit, TimingPeriodOnlyWholeNumber, TimingBoundsDurationOnlyWholeNumber, TimingFreqOrPeriodGtOne, TimingVarFreqGtMin, TimingVarPeriodGtMin, TimingSingleDosageForTimeOfDay, TimingSingleDosageForWhen, TimingBoundsUnitMatchesCode
.... Slices for bounds[x] SΣ 0..1 Länge/Bereich der Längen oder (Start- und/oder End-)Grenzen
Slice: Unordered, Closed by type:$this
..... boundsDuration Duration
..... boundsPeriod Period
..... bounds[x]:boundsDuration SΣ 0..1 Duration Dauer der Dosieranweisung ausgedrückt in UCUM-Einheiten
...... value SΣ 1..1 decimal Numerical value (with implicit precision)
...... unit SΣ 1..1 string Unit representation
...... system SΣC 1..1 uri UCUM-Einheit für die Dauer
Fixed Value: http://unitsofmeasure.org
...... code SΣ 1..1 code Coded form of the unit
Binding: Duration UnitsOfTime dgMP ValueSet (required)
..... bounds[x]:boundsPeriod SΣ 0..1 Period Start- und Endzeitpunkt der Dosieranweisung.
...... start SΣC 0..1 dateTime Startdatum mit optionaler Uhrzeit und Zeitzone
...... end SΣC 0..1 dateTime Enddatum mit optionaler Uhrzeit und Zeitzone
.... frequency SΣ 0..1 positiveInt Ereignis tritt frequency-mal pro Zeitraum auf
.... frequencyMax SΣ 0..1 positiveInt Event occurs up to frequencyMax times per period
.... period SΣ 0..1 decimal Ereignis tritt frequency-mal pro Zeitraum auf
.... periodMax SΣ 0..1 decimal Upper limit of period (3-4 hours)
.... periodUnit SΣ 0..1 code min | h | d | wk | mo - Zeiteinheit (UCUM)
Binding: Period UnitsOfTime dgMP ValueSet (required)
.... dayOfWeek SΣ 0..* code mon | tue | wed | thu | fri | sat | sun
Binding: DaysOfWeek (required)
.... timeOfDay SΣ 0..* time Tageszeit für die Aktion
.... when SΣ 0..* code Code für den Zeitraum des Auftretens
Binding: Timing When dgMP (required)

doco Documentation for this format

Terminology Bindings

Path Status Usage ValueSet Version Source
Timing.repeat.bounds[x]:boundsDuration.​code Base required Duration UnitsOfTime dgMP ValueSet 📦2.0.0-ballot This IG
Timing.repeat.periodUnit Base required Period UnitsOfTime dgMP ValueSet 📦2.0.0-ballot This IG
Timing.repeat.dayOfWeek Base required DaysOfWeek 📍4.0.1 FHIR Std.
Timing.repeat.when Base required Timing When dgMP 📦2.0.0-ballot This IG

Constraints

Id Grade Path(s) Description Expression
TimingBoundsDurationOnlyWholeNumber error Timing.repeat boundsDuration.value must be a whole number; decimal values are not allowed. bounds.ofType(Duration).value.empty() or bounds.ofType(Duration).value mod 1 = 0
TimingBoundsUnitMatchesCode error Timing.repeat boundsDuration.unit must match the UCUM boundsDuration.code (e.g. 'Woche(n)' only with code='wk'). bounds.ofType(Duration).exists().not() or ( ( bounds.ofType(Duration).code = 'd' implies ( bounds.ofType(Duration).unit = 'Tag(e)' or bounds.ofType(Duration).unit = 'Tag' or bounds.ofType(Duration).unit = 'Tage' ) ) and ( bounds.ofType(Duration).code = 'wk' implies ( bounds.ofType(Duration).unit = 'Woche(n)' or bounds.ofType(Duration).unit = 'Woche' or bounds.ofType(Duration).unit = 'Wochen' ) ) and ( bounds.ofType(Duration).code = 'mo' implies ( bounds.ofType(Duration).unit = 'Monat(e)' or bounds.ofType(Duration).unit = 'Monat' or bounds.ofType(Duration).unit = 'Monate' ) ) and ( bounds.ofType(Duration).code = 'a' implies ( bounds.ofType(Duration).unit = 'Jahr(e)' or bounds.ofType(Duration).unit = 'Jahr' or bounds.ofType(Duration).unit = 'Jahre' ) ) )
TimingBoundsUnitMatchesCodeWarning warning Timing.repeat boundsDuration.unit must match the UCUM boundsDuration.code (e.g. 'Woche(n)' only with code='wk'). bounds.ofType(Duration).exists().not() or ( ( bounds.ofType(Duration).code = 'd' implies ( bounds.ofType(Duration).unit = 'Tag(e)' or bounds.ofType(Duration).unit = 'Tag' or bounds.ofType(Duration).unit = 'Tage' ) ) and ( bounds.ofType(Duration).code = 'wk' implies ( bounds.ofType(Duration).unit = 'Woche(n)' or bounds.ofType(Duration).unit = 'Woche' or bounds.ofType(Duration).unit = 'Wochen' ) ) and ( bounds.ofType(Duration).code = 'mo' implies ( bounds.ofType(Duration).unit = 'Monat(e)' or bounds.ofType(Duration).unit = 'Monat' or bounds.ofType(Duration).unit = 'Monate' ) ) and ( bounds.ofType(Duration).code = 'a' implies ( bounds.ofType(Duration).unit = 'Jahr(e)' or bounds.ofType(Duration).unit = 'Jahr' or bounds.ofType(Duration).unit = 'Jahre' ) ) )
TimingFreqOrPeriodGtOne error Timing.repeat 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'. /* 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) ) ) )
TimingFreqOrPeriodGtOneWarning warning Timing.repeat 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'. /* 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) ) ) )
TimingFrequencyCount error Timing.repeat If frequency is given together with when, timeOfDay or dayOfWeek, its value must match the number of concrete administrations. (when.exists() and dayOfWeek.empty() and frequency.exists() implies when.count() = frequency) and (when.exists() and dayOfWeek.exists() and frequency.exists() implies (when.count() * dayOfWeek.count()) = frequency) and (timeOfDay.exists() and dayOfWeek.empty() and frequency.exists() implies timeOfDay.count() = frequency) and (timeOfDay.exists() and dayOfWeek.exists() and frequency.exists() implies (timeOfDay.count() * dayOfWeek.count()) = frequency) and (dayOfWeek.exists() and timeOfDay.empty() and when.empty() and frequency.exists() implies dayOfWeek.count() = frequency)
TimingIntervalOnlyOneFrequency error Timing.repeat If a dosage is defined by a pure interval, only one Dosage element is allowed in the resource. ( /* 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 ) ) )
TimingOnlyOneBounds error Timing.repeat All Dosage elements of a resource must state the same bounds (Duration or Period), and either all of them carry a bounds or none. ( %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) ) ) and ( /* boundsPeriod: Start und Ende müssen ebenfalls über alle Dosierungen gleich sein. Die Textgenerierung liest den Zeitrahmen nur aus dem ersten Dosage-Element. */ (%resource.ofType(MedicationRequest).exists() or %resource.ofType(MedicationDispense).exists()) implies %resource.dosageInstruction.timing.repeat.bounds.ofType(Period).exists().not() or ( (%resource.dosageInstruction.timing.repeat.bounds.ofType(Period).start.distinct().count() <= 1) and (%resource.dosageInstruction.timing.repeat.bounds.ofType(Period).end.distinct().count() <= 1) ) ) and ( %resource.ofType(MedicationStatement).exists() implies %resource.dosage.timing.repeat.bounds.ofType(Period).exists().not() or ( (%resource.dosage.timing.repeat.bounds.ofType(Period).start.distinct().count() <= 1) and (%resource.dosage.timing.repeat.bounds.ofType(Period).end.distinct().count() <= 1) ) ) ) and ( /* Entweder alle Dosage-Elemente tragen einen Zeitrahmen oder keines. Die Textgenerierung liest ihn nur aus dem ersten Element; ein Element ohne Zeitrahmen wuerde sonst stillschweigend als begrenzt dargestellt. */ ( ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).timing.repeat.bounds.exists() ) implies ( ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all(timing.repeat.bounds.exists()) ) ) )
TimingOnlyOneDayOfWeek error Timing.repeat In a schema that uses only dayOfWeek, no weekday may occur in more than one Dosage element of a resource. ( /* Detect DayOfWeek */ %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( ( timing.repeat.dayOfWeek.exists() and timing.repeat.when.empty() and timing.repeat.timeOfDay.empty() ) implies ( ( (%resource.ofType(MedicationRequest).exists() or %resource.ofType(MedicationDispense).exists()) implies (%resource.dosageInstruction.timing.repeat.dayOfWeek.distinct().count() = %resource.dosageInstruction.timing.repeat.dayOfWeek.count()) ) and ( %resource.ofType(MedicationStatement).exists() implies (%resource.dosage.timing.repeat.dayOfWeek.distinct().count() = %resource.dosage.timing.repeat.dayOfWeek.count()) ) ) )
TimingOnlyOnePeriodForDayOfWeek error Timing In a schema that combines dayOfWeek with either timeOfDay or when, each combination of weekday and time must be unique across all Dosage elements of a resource. ( /* Detect DayOfWeek and Time/4-Schema */ %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( ( timing.repeat.dayOfWeek.exists() 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 ( /* For each day of week */ /* if Mon occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'mon').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).timeOfDay.count()) )) and /* if tue occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'tue').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).timeOfDay.count()) )) and /* if wed occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'wed').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).timeOfDay.count()) )) and /* if thu occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'thu').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).timeOfDay.count()) )) and /* if fri occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'fri').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).timeOfDay.count()) )) and /* if sat occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'sat').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).timeOfDay.count()) )) and /* if sun occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'sun').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).timeOfDay.count()) )) ) ) and ( %resource.ofType(MedicationStatement).exists() implies ( /* For each day of week */ /* if Mon occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'mon').count() > 1) implies ( (%resource.dosage.timing.repeat.where('mon' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('mon' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('mon' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('mon' in dayOfWeek).timeOfDay.count()) )) and /* if tue occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'tue').count() > 1) implies ( (%resource.dosage.timing.repeat.where('tue' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('tue' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('tue' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('tue' in dayOfWeek).timeOfDay.count()) )) and /* if wed occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'wed').count() > 1) implies ( (%resource.dosage.timing.repeat.where('wed' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('wed' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('wed' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('wed' in dayOfWeek).timeOfDay.count()) )) and /* if thu occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'thu').count() > 1) implies ( (%resource.dosage.timing.repeat.where('thu' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('thu' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('thu' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('thu' in dayOfWeek).timeOfDay.count()) )) and /* if fri occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'fri').count() > 1) implies ( (%resource.dosage.timing.repeat.where('fri' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('fri' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('fri' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('fri' in dayOfWeek).timeOfDay.count()) )) and /* if sat occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'sat').count() > 1) implies ( (%resource.dosage.timing.repeat.where('sat' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('sat' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('sat' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('sat' in dayOfWeek).timeOfDay.count()) )) and /* if sun occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'sun').count() > 1) implies ( (%resource.dosage.timing.repeat.where('sun' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('sun' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('sun' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('sun' in dayOfWeek).timeOfDay.count()) )) ) ) ) )
TimingOnlyOneTimeForInterval error Timing.repeat In a schema that combines an interval with timeOfDay or when, all Dosage elements of a resource must use the same period and periodUnit, and each timeOfDay or when value must be unique across them. /* Detect Interval and Time/4-Schema */ ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ) .all( ( 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.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()) ) ) ) )
TimingOnlyOneTimeOfDay error Timing.repeat In a schema that uses only timeOfDay, no time of day may occur in more than one Dosage element of a resource. ( /* Detect TimeOfDay */ %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).exists() or %resource.ofType(MedicationDispense).exists()) implies (%resource.dosageInstruction.timing.repeat.timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.timeOfDay.count()) ) and ( %resource.ofType(MedicationStatement).exists() implies (%resource.dosage.timing.repeat.timeOfDay.distinct().count() = %resource.dosage.timing.repeat.timeOfDay.count()) ) ) )
TimingOnlyOneType error Timing.repeat Exactly one of the supported timing schemas is allowed. With dayOfWeek, frequency and the pair period = 1 and periodUnit = wk are optional redundant legacy statements; they do not constitute an interval schema. With when or timeOfDay, frequency is optional; a non-daily period distinguishes the daily schema from a time interval combined with a time-of-day or clock-time reference. A variable frequency (frequencyMax) is reserved for the pure interval, because concrete times or weekdays already determine the number of administrations. /* DayOfWeek only; legacy frequency and the exact 1 wk pair are optional */ ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( timing.repeat.dayOfWeek.exists() and timing.repeat.when.empty() and timing.repeat.timeOfDay.empty() and timing.repeat.frequencyMax.empty() and timing.repeat.periodMax.empty() and ( (timing.repeat.period.empty() and timing.repeat.periodUnit.empty()) or (timing.repeat.period = 1 and timing.repeat.periodUnit = 'wk') ) ) or /* Interval only (frequency + period + periodUnit, no when/timeOfDay/dayOfWeek) */ ( %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() ) or /* DayOfWeek and Time/4-Schema; legacy frequency and the exact 1 wk pair are optional */ ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( timing.repeat.dayOfWeek.exists() and ( (timing.repeat.timeOfDay.exists() and timing.repeat.when.empty()) or (timing.repeat.when.exists() and timing.repeat.timeOfDay.empty()) ) and timing.repeat.frequencyMax.empty() and timing.repeat.periodMax.empty() and ( (timing.repeat.period.empty() and timing.repeat.periodUnit.empty()) or (timing.repeat.period = 1 and timing.repeat.periodUnit = 'wk') ) ) or /* Daily When or TimeOfDay; frequency is optional, a variable frequency is not */ ( %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()) or (timing.repeat.when.exists() and timing.repeat.timeOfDay.empty()) ) and timing.repeat.frequencyMax.empty() and timing.repeat.periodMax.empty() and ( (timing.repeat.period.empty() and timing.repeat.periodUnit.empty()) or (timing.repeat.period = 1 and timing.repeat.periodUnit = 'd') ) ) or /* Non-daily interval combined with When or TimeOfDay; frequency is optional, a variable frequency is not */ ( %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()) or (timing.repeat.when.exists() and timing.repeat.timeOfDay.empty()) ) and timing.repeat.frequencyMax.empty() and timing.repeat.period.exists() and timing.repeat.periodUnit.exists() and (timing.repeat.periodUnit = 'd' or timing.repeat.periodUnit = 'wk' or timing.repeat.periodUnit = 'mo') and ( timing.repeat.periodUnit != 'd' or timing.repeat.period != 1 or timing.repeat.periodMax.exists() ) )
TimingOnlyOneWhen error Timing.repeat In a schema that uses only when, no part of the day may occur in more than one Dosage element of a resource. ( /* Detect when-based schema */ %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).exists() or %resource.ofType(MedicationDispense).exists()) implies (%resource.dosageInstruction.timing.repeat.when.distinct().count() = %resource.dosageInstruction.timing.repeat.when.count()) ) and ( %resource.ofType(MedicationStatement).exists() implies (%resource.dosage.timing.repeat.when.distinct().count() = %resource.dosage.timing.repeat.when.count()) ) ) )
TimingOnlyWhenOrTimeOfDay error Timing.repeat The Dosage elements of a resource must not mix a time of day (timeOfDay) and a part of the day (when). ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( (timing.repeat.when.exists() or timing.repeat.timeOfDay.exists()) implies ( ( (%resource.ofType(MedicationRequest).exists() or %resource.ofType(MedicationDispense).exists()) implies (%resource.dosageInstruction.timing.repeat.when.exists() xor %resource.dosageInstruction.timing.repeat.timeOfDay.exists()) ) and ( %resource.ofType(MedicationStatement).exists() implies (%resource.dosage.timing.repeat.when.exists() xor %resource.dosage.timing.repeat.timeOfDay.exists()) ) ) )
TimingPeriodOnlyWholeNumber error Timing.repeat period and periodMax must be whole numbers; decimal values are not allowed. (period.exists() implies period mod 1 = 0) and (periodMax.exists() implies periodMax mod 1 = 0)
TimingPeriodUnit error Timing.repeat periodUnit may only be given together with period. With dayOfWeek, only the redundant weekly statement is allowed; with when or timeOfDay without dayOfWeek, days, weeks or months are allowed. periodUnit.empty() or ( period.exists() and ( (dayOfWeek.exists() and periodUnit = 'wk') or ( dayOfWeek.empty() and ( (when.empty() and timeOfDay.empty()) or periodUnit = 'd' or periodUnit = 'wk' or periodUnit = 'mo' ) ) ) )
TimingSingleDosageForTimeOfDay error Timing.repeat 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. ( %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() ) ) )
TimingSingleDosageForTimeOfDayWarning warning Timing.repeat 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. ( %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() ) ) )
TimingSingleDosageForWhen error Timing.repeat 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. ( %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() ) ) )
TimingSingleDosageForWhenWarning warning Timing.repeat 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. ( %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() ) ) )
TimingVarFreqGtMin error Timing.repeat For a variable frequency, the maximum frequency must be greater than the minimum frequency. frequencyMax.empty() or frequency.empty() or frequency.value.toInteger() < frequencyMax.value.toInteger()
TimingVarPeriodGtMin error Timing.repeat For a variable period, the maximum period must be greater than the minimum period. periodMax.empty() or period.empty() or period < periodMax
ele-1 error **ALL** elements All FHIR elements must have a @value or children hasValue() or (children().count() > id.count())
ext-1 error **ALL** extensions Must have either extensions or value[x], not both extension.exists() != value.exists()
tim-1 error Timing.repeat if there's a duration, there needs to be duration units duration.empty() or durationUnit.exists()
tim-2 error Timing.repeat if there's a period, there needs to be period units period.empty() or periodUnit.exists()
tim-4 error Timing.repeat duration SHALL be a non-negative value duration.exists() implies duration >= 0
tim-5 error Timing.repeat period SHALL be a non-negative value period.exists() implies period >= 0
tim-6 error Timing.repeat If there's a periodMax, there must be a period periodMax.empty() or period.exists()
tim-7 error Timing.repeat If there's a durationMax, there must be a duration durationMax.empty() or duration.exists()
tim-8 error Timing.repeat If there's a countMax, there must be a count countMax.empty() or count.exists()
tim-9 error Timing.repeat If there's an offset, there must be a when (and not C, CM, CD, CV) offset.empty() or (when.exists() and ((when in ('C' | 'CM' | 'CD' | 'CV')).not()))
tim-10 error Timing.repeat If there's a timeOfDay, there cannot be a when, or vice versa timeOfDay.empty() or when.empty()

This structure is derived from TimingDE

NameFlagsCard.TypeDescription & Constraints    Filter: Filtersdoco
.. Timing C 0..* TimingDE A timing schedule that specifies an event that may occur multiple times
Constraints: TimingOnlyOnePeriodForDayOfWeek
... event 0..0 When the event occurs
... repeat C 1..1 Element Wann das Ereignis stattfinden soll
Constraints: TimingOnlyOneType, TimingIntervalOnlyOneFrequency, TimingOnlyOneWhen, TimingOnlyWhenOrTimeOfDay, TimingOnlyOneTimeOfDay, TimingOnlyOneDayOfWeek, TimingOnlyOneTimeForInterval, TimingOnlyOneBounds, TimingFrequencyCount, TimingPeriodUnit, TimingPeriodOnlyWholeNumber, TimingBoundsDurationOnlyWholeNumber, TimingFreqOrPeriodGtOne, TimingVarFreqGtMin, TimingVarPeriodGtMin, TimingSingleDosageForTimeOfDay, TimingSingleDosageForWhen, TimingBoundsUnitMatchesCode
.... bounds[x] 0..1 Länge/Bereich der Längen oder (Start- und/oder End-)Grenzen
..... boundsDuration Duration
..... boundsPeriod Period
.... Slices for bounds[x] Content/Rules for all slices
..... bounds[x]:boundsDuration 0..1 Duration Dauer der Dosieranweisung ausgedrückt in UCUM-Einheiten
...... value 1..1 decimal Numerical value (with implicit precision)
...... comparator 0..0 < | <= | >= | > - how to understand the value
...... unit 1..1 string Unit representation
...... system 1..1 uri UCUM-Einheit für die Dauer
...... code 1..1 code Coded form of the unit
Binding: Duration UnitsOfTime dgMP ValueSet (required)
..... bounds[x]:boundsPeriod 0..1 Period Start- und Endzeitpunkt der Dosieranweisung.
...... start 0..1 dateTime Startdatum mit optionaler Uhrzeit und Zeitzone
...... end 0..1 dateTime Enddatum mit optionaler Uhrzeit und Zeitzone
.... count 0..0 Number of times to repeat
.... countMax 0..0 Maximum number of times to repeat
.... duration 0..0 How long when it happens
.... durationMax 0..0 How long when it happens (Max)
.... durationUnit 0..0 s | min | h | d | wk | mo | a - unit of time (UCUM)
.... periodUnit 0..1 code min | h | d | wk | mo - Zeiteinheit (UCUM)
Binding: Period UnitsOfTime dgMP ValueSet (required)
.... when 0..* code Code für den Zeitraum des Auftretens
Binding: Timing When dgMP (required)
.... offset 0..0 Zeitversatz
... code 0..0 BID | TID | QID | AM | PM | QD | QOD | +

doco Documentation for this format

Terminology Bindings (Differential)

Path Status Usage ValueSet Version Source
Timing.repeat.bounds[x]:boundsDuration.​code Base required Duration UnitsOfTime dgMP ValueSet 📦2.0.0-ballot This IG
Timing.repeat.periodUnit Base required Period UnitsOfTime dgMP ValueSet 📦2.0.0-ballot This IG
Timing.repeat.when Base required Timing When dgMP 📦2.0.0-ballot This IG

Constraints

Id Grade Path(s) Description Expression
TimingBoundsDurationOnlyWholeNumber error Timing.repeat boundsDuration.value must be a whole number; decimal values are not allowed. bounds.ofType(Duration).value.empty() or bounds.ofType(Duration).value mod 1 = 0
TimingBoundsUnitMatchesCode error Timing.repeat boundsDuration.unit must match the UCUM boundsDuration.code (e.g. 'Woche(n)' only with code='wk'). bounds.ofType(Duration).exists().not() or ( ( bounds.ofType(Duration).code = 'd' implies ( bounds.ofType(Duration).unit = 'Tag(e)' or bounds.ofType(Duration).unit = 'Tag' or bounds.ofType(Duration).unit = 'Tage' ) ) and ( bounds.ofType(Duration).code = 'wk' implies ( bounds.ofType(Duration).unit = 'Woche(n)' or bounds.ofType(Duration).unit = 'Woche' or bounds.ofType(Duration).unit = 'Wochen' ) ) and ( bounds.ofType(Duration).code = 'mo' implies ( bounds.ofType(Duration).unit = 'Monat(e)' or bounds.ofType(Duration).unit = 'Monat' or bounds.ofType(Duration).unit = 'Monate' ) ) and ( bounds.ofType(Duration).code = 'a' implies ( bounds.ofType(Duration).unit = 'Jahr(e)' or bounds.ofType(Duration).unit = 'Jahr' or bounds.ofType(Duration).unit = 'Jahre' ) ) )
TimingFreqOrPeriodGtOne error Timing.repeat 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'. /* 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) ) ) )
TimingFrequencyCount error Timing.repeat If frequency is given together with when, timeOfDay or dayOfWeek, its value must match the number of concrete administrations. (when.exists() and dayOfWeek.empty() and frequency.exists() implies when.count() = frequency) and (when.exists() and dayOfWeek.exists() and frequency.exists() implies (when.count() * dayOfWeek.count()) = frequency) and (timeOfDay.exists() and dayOfWeek.empty() and frequency.exists() implies timeOfDay.count() = frequency) and (timeOfDay.exists() and dayOfWeek.exists() and frequency.exists() implies (timeOfDay.count() * dayOfWeek.count()) = frequency) and (dayOfWeek.exists() and timeOfDay.empty() and when.empty() and frequency.exists() implies dayOfWeek.count() = frequency)
TimingIntervalOnlyOneFrequency error Timing.repeat If a dosage is defined by a pure interval, only one Dosage element is allowed in the resource. ( /* 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 ) ) )
TimingOnlyOneBounds error Timing.repeat All Dosage elements of a resource must state the same bounds (Duration or Period), and either all of them carry a bounds or none. ( %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) ) ) and ( /* boundsPeriod: Start und Ende müssen ebenfalls über alle Dosierungen gleich sein. Die Textgenerierung liest den Zeitrahmen nur aus dem ersten Dosage-Element. */ (%resource.ofType(MedicationRequest).exists() or %resource.ofType(MedicationDispense).exists()) implies %resource.dosageInstruction.timing.repeat.bounds.ofType(Period).exists().not() or ( (%resource.dosageInstruction.timing.repeat.bounds.ofType(Period).start.distinct().count() <= 1) and (%resource.dosageInstruction.timing.repeat.bounds.ofType(Period).end.distinct().count() <= 1) ) ) and ( %resource.ofType(MedicationStatement).exists() implies %resource.dosage.timing.repeat.bounds.ofType(Period).exists().not() or ( (%resource.dosage.timing.repeat.bounds.ofType(Period).start.distinct().count() <= 1) and (%resource.dosage.timing.repeat.bounds.ofType(Period).end.distinct().count() <= 1) ) ) ) and ( /* Entweder alle Dosage-Elemente tragen einen Zeitrahmen oder keines. Die Textgenerierung liest ihn nur aus dem ersten Element; ein Element ohne Zeitrahmen wuerde sonst stillschweigend als begrenzt dargestellt. */ ( ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).timing.repeat.bounds.exists() ) implies ( ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all(timing.repeat.bounds.exists()) ) ) )
TimingOnlyOneDayOfWeek error Timing.repeat In a schema that uses only dayOfWeek, no weekday may occur in more than one Dosage element of a resource. ( /* Detect DayOfWeek */ %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( ( timing.repeat.dayOfWeek.exists() and timing.repeat.when.empty() and timing.repeat.timeOfDay.empty() ) implies ( ( (%resource.ofType(MedicationRequest).exists() or %resource.ofType(MedicationDispense).exists()) implies (%resource.dosageInstruction.timing.repeat.dayOfWeek.distinct().count() = %resource.dosageInstruction.timing.repeat.dayOfWeek.count()) ) and ( %resource.ofType(MedicationStatement).exists() implies (%resource.dosage.timing.repeat.dayOfWeek.distinct().count() = %resource.dosage.timing.repeat.dayOfWeek.count()) ) ) )
TimingOnlyOnePeriodForDayOfWeek error Timing In a schema that combines dayOfWeek with either timeOfDay or when, each combination of weekday and time must be unique across all Dosage elements of a resource. ( /* Detect DayOfWeek and Time/4-Schema */ %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( ( timing.repeat.dayOfWeek.exists() 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 ( /* For each day of week */ /* if Mon occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'mon').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).timeOfDay.count()) )) and /* if tue occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'tue').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).timeOfDay.count()) )) and /* if wed occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'wed').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).timeOfDay.count()) )) and /* if thu occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'thu').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).timeOfDay.count()) )) and /* if fri occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'fri').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).timeOfDay.count()) )) and /* if sat occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'sat').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).timeOfDay.count()) )) and /* if sun occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'sun').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).timeOfDay.count()) )) ) ) and ( %resource.ofType(MedicationStatement).exists() implies ( /* For each day of week */ /* if Mon occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'mon').count() > 1) implies ( (%resource.dosage.timing.repeat.where('mon' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('mon' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('mon' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('mon' in dayOfWeek).timeOfDay.count()) )) and /* if tue occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'tue').count() > 1) implies ( (%resource.dosage.timing.repeat.where('tue' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('tue' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('tue' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('tue' in dayOfWeek).timeOfDay.count()) )) and /* if wed occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'wed').count() > 1) implies ( (%resource.dosage.timing.repeat.where('wed' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('wed' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('wed' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('wed' in dayOfWeek).timeOfDay.count()) )) and /* if thu occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'thu').count() > 1) implies ( (%resource.dosage.timing.repeat.where('thu' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('thu' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('thu' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('thu' in dayOfWeek).timeOfDay.count()) )) and /* if fri occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'fri').count() > 1) implies ( (%resource.dosage.timing.repeat.where('fri' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('fri' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('fri' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('fri' in dayOfWeek).timeOfDay.count()) )) and /* if sat occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'sat').count() > 1) implies ( (%resource.dosage.timing.repeat.where('sat' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('sat' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('sat' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('sat' in dayOfWeek).timeOfDay.count()) )) and /* if sun occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'sun').count() > 1) implies ( (%resource.dosage.timing.repeat.where('sun' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('sun' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('sun' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('sun' in dayOfWeek).timeOfDay.count()) )) ) ) ) )
TimingOnlyOneTimeForInterval error Timing.repeat In a schema that combines an interval with timeOfDay or when, all Dosage elements of a resource must use the same period and periodUnit, and each timeOfDay or when value must be unique across them. /* Detect Interval and Time/4-Schema */ ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ) .all( ( 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.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()) ) ) ) )
TimingOnlyOneTimeOfDay error Timing.repeat In a schema that uses only timeOfDay, no time of day may occur in more than one Dosage element of a resource. ( /* Detect TimeOfDay */ %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).exists() or %resource.ofType(MedicationDispense).exists()) implies (%resource.dosageInstruction.timing.repeat.timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.timeOfDay.count()) ) and ( %resource.ofType(MedicationStatement).exists() implies (%resource.dosage.timing.repeat.timeOfDay.distinct().count() = %resource.dosage.timing.repeat.timeOfDay.count()) ) ) )
TimingOnlyOneType error Timing.repeat Exactly one of the supported timing schemas is allowed. With dayOfWeek, frequency and the pair period = 1 and periodUnit = wk are optional redundant legacy statements; they do not constitute an interval schema. With when or timeOfDay, frequency is optional; a non-daily period distinguishes the daily schema from a time interval combined with a time-of-day or clock-time reference. A variable frequency (frequencyMax) is reserved for the pure interval, because concrete times or weekdays already determine the number of administrations. /* DayOfWeek only; legacy frequency and the exact 1 wk pair are optional */ ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( timing.repeat.dayOfWeek.exists() and timing.repeat.when.empty() and timing.repeat.timeOfDay.empty() and timing.repeat.frequencyMax.empty() and timing.repeat.periodMax.empty() and ( (timing.repeat.period.empty() and timing.repeat.periodUnit.empty()) or (timing.repeat.period = 1 and timing.repeat.periodUnit = 'wk') ) ) or /* Interval only (frequency + period + periodUnit, no when/timeOfDay/dayOfWeek) */ ( %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() ) or /* DayOfWeek and Time/4-Schema; legacy frequency and the exact 1 wk pair are optional */ ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( timing.repeat.dayOfWeek.exists() and ( (timing.repeat.timeOfDay.exists() and timing.repeat.when.empty()) or (timing.repeat.when.exists() and timing.repeat.timeOfDay.empty()) ) and timing.repeat.frequencyMax.empty() and timing.repeat.periodMax.empty() and ( (timing.repeat.period.empty() and timing.repeat.periodUnit.empty()) or (timing.repeat.period = 1 and timing.repeat.periodUnit = 'wk') ) ) or /* Daily When or TimeOfDay; frequency is optional, a variable frequency is not */ ( %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()) or (timing.repeat.when.exists() and timing.repeat.timeOfDay.empty()) ) and timing.repeat.frequencyMax.empty() and timing.repeat.periodMax.empty() and ( (timing.repeat.period.empty() and timing.repeat.periodUnit.empty()) or (timing.repeat.period = 1 and timing.repeat.periodUnit = 'd') ) ) or /* Non-daily interval combined with When or TimeOfDay; frequency is optional, a variable frequency is not */ ( %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()) or (timing.repeat.when.exists() and timing.repeat.timeOfDay.empty()) ) and timing.repeat.frequencyMax.empty() and timing.repeat.period.exists() and timing.repeat.periodUnit.exists() and (timing.repeat.periodUnit = 'd' or timing.repeat.periodUnit = 'wk' or timing.repeat.periodUnit = 'mo') and ( timing.repeat.periodUnit != 'd' or timing.repeat.period != 1 or timing.repeat.periodMax.exists() ) )
TimingOnlyOneWhen error Timing.repeat In a schema that uses only when, no part of the day may occur in more than one Dosage element of a resource. ( /* Detect when-based schema */ %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).exists() or %resource.ofType(MedicationDispense).exists()) implies (%resource.dosageInstruction.timing.repeat.when.distinct().count() = %resource.dosageInstruction.timing.repeat.when.count()) ) and ( %resource.ofType(MedicationStatement).exists() implies (%resource.dosage.timing.repeat.when.distinct().count() = %resource.dosage.timing.repeat.when.count()) ) ) )
TimingOnlyWhenOrTimeOfDay error Timing.repeat The Dosage elements of a resource must not mix a time of day (timeOfDay) and a part of the day (when). ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( (timing.repeat.when.exists() or timing.repeat.timeOfDay.exists()) implies ( ( (%resource.ofType(MedicationRequest).exists() or %resource.ofType(MedicationDispense).exists()) implies (%resource.dosageInstruction.timing.repeat.when.exists() xor %resource.dosageInstruction.timing.repeat.timeOfDay.exists()) ) and ( %resource.ofType(MedicationStatement).exists() implies (%resource.dosage.timing.repeat.when.exists() xor %resource.dosage.timing.repeat.timeOfDay.exists()) ) ) )
TimingPeriodOnlyWholeNumber error Timing.repeat period and periodMax must be whole numbers; decimal values are not allowed. (period.exists() implies period mod 1 = 0) and (periodMax.exists() implies periodMax mod 1 = 0)
TimingPeriodUnit error Timing.repeat periodUnit may only be given together with period. With dayOfWeek, only the redundant weekly statement is allowed; with when or timeOfDay without dayOfWeek, days, weeks or months are allowed. periodUnit.empty() or ( period.exists() and ( (dayOfWeek.exists() and periodUnit = 'wk') or ( dayOfWeek.empty() and ( (when.empty() and timeOfDay.empty()) or periodUnit = 'd' or periodUnit = 'wk' or periodUnit = 'mo' ) ) ) )
TimingSingleDosageForTimeOfDay error Timing.repeat 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. ( %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() ) ) )
TimingSingleDosageForWhen error Timing.repeat 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. ( %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() ) ) )
TimingVarFreqGtMin error Timing.repeat For a variable frequency, the maximum frequency must be greater than the minimum frequency. frequencyMax.empty() or frequency.empty() or frequency.value.toInteger() < frequencyMax.value.toInteger()
TimingVarPeriodGtMin error Timing.repeat For a variable period, the maximum period must be greater than the minimum period. periodMax.empty() or period.empty() or period < periodMax
NameFlagsCard.TypeDescription & Constraints    Filter: Filtersdoco
.. Timing C 0..* TimingDE A timing schedule that specifies an event that may occur multiple times
Constraints: TimingOnlyOnePeriodForDayOfWeek
... id 0..1 string Unique id for inter-element referencing
... extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored even if unrecognized
.... id 0..1 string Unique id for inter-element referencing
.... extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
.... Slices for bounds[x] SΣ 0..1 Länge/Bereich der Längen oder (Start- und/oder End-)Grenzen
Slice: Unordered, Closed by type:$this
..... boundsDuration Duration
..... boundsPeriod Period
..... bounds[x]:boundsDuration SΣ 0..1 Duration Dauer der Dosieranweisung ausgedrückt in UCUM-Einheiten
...... id 0..1 string Unique id for inter-element referencing
...... extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
...... value SΣ 1..1 decimal Numerical value (with implicit precision)
...... unit SΣ 1..1 string Unit representation
...... system SΣC 1..1 uri UCUM-Einheit für die Dauer
Fixed Value: http://unitsofmeasure.org
...... code SΣ 1..1 code Coded form of the unit
Binding: Duration UnitsOfTime dgMP ValueSet (required)
..... bounds[x]:boundsPeriod SΣ 0..1 Period Start- und Endzeitpunkt der Dosieranweisung.
...... id 0..1 string Unique id for inter-element referencing
...... extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
...... start SΣC 0..1 dateTime Startdatum mit optionaler Uhrzeit und Zeitzone
...... end SΣC 0..1 dateTime Enddatum mit optionaler Uhrzeit und Zeitzone
.... frequency SΣ 0..1 positiveInt Ereignis tritt frequency-mal pro Zeitraum auf
.... frequencyMax SΣ 0..1 positiveInt Event occurs up to frequencyMax times per period
.... period SΣ 0..1 decimal Ereignis tritt frequency-mal pro Zeitraum auf
.... periodMax SΣ 0..1 decimal Upper limit of period (3-4 hours)
.... periodUnit SΣ 0..1 code min | h | d | wk | mo - Zeiteinheit (UCUM)
Binding: Period UnitsOfTime dgMP ValueSet (required)
.... dayOfWeek SΣ 0..* code mon | tue | wed | thu | fri | sat | sun
Binding: DaysOfWeek (required)
.... timeOfDay SΣ 0..* time Tageszeit für die Aktion
.... when SΣ 0..* code Code für den Zeitraum des Auftretens
Binding: Timing When dgMP (required)

doco Documentation for this format

Terminology Bindings

Path Status Usage ValueSet Version Source
Timing.repeat.bounds[x]:boundsDuration.​code Base required Duration UnitsOfTime dgMP ValueSet 📦2.0.0-ballot This IG
Timing.repeat.periodUnit Base required Period UnitsOfTime dgMP ValueSet 📦2.0.0-ballot This IG
Timing.repeat.dayOfWeek Base required DaysOfWeek 📍4.0.1 FHIR Std.
Timing.repeat.when Base required Timing When dgMP 📦2.0.0-ballot This IG

Constraints

Id Grade Path(s) Description Expression
TimingBoundsDurationOnlyWholeNumber error Timing.repeat boundsDuration.value must be a whole number; decimal values are not allowed. bounds.ofType(Duration).value.empty() or bounds.ofType(Duration).value mod 1 = 0
TimingBoundsUnitMatchesCode error Timing.repeat boundsDuration.unit must match the UCUM boundsDuration.code (e.g. 'Woche(n)' only with code='wk'). bounds.ofType(Duration).exists().not() or ( ( bounds.ofType(Duration).code = 'd' implies ( bounds.ofType(Duration).unit = 'Tag(e)' or bounds.ofType(Duration).unit = 'Tag' or bounds.ofType(Duration).unit = 'Tage' ) ) and ( bounds.ofType(Duration).code = 'wk' implies ( bounds.ofType(Duration).unit = 'Woche(n)' or bounds.ofType(Duration).unit = 'Woche' or bounds.ofType(Duration).unit = 'Wochen' ) ) and ( bounds.ofType(Duration).code = 'mo' implies ( bounds.ofType(Duration).unit = 'Monat(e)' or bounds.ofType(Duration).unit = 'Monat' or bounds.ofType(Duration).unit = 'Monate' ) ) and ( bounds.ofType(Duration).code = 'a' implies ( bounds.ofType(Duration).unit = 'Jahr(e)' or bounds.ofType(Duration).unit = 'Jahr' or bounds.ofType(Duration).unit = 'Jahre' ) ) )
TimingBoundsUnitMatchesCodeWarning warning Timing.repeat boundsDuration.unit must match the UCUM boundsDuration.code (e.g. 'Woche(n)' only with code='wk'). bounds.ofType(Duration).exists().not() or ( ( bounds.ofType(Duration).code = 'd' implies ( bounds.ofType(Duration).unit = 'Tag(e)' or bounds.ofType(Duration).unit = 'Tag' or bounds.ofType(Duration).unit = 'Tage' ) ) and ( bounds.ofType(Duration).code = 'wk' implies ( bounds.ofType(Duration).unit = 'Woche(n)' or bounds.ofType(Duration).unit = 'Woche' or bounds.ofType(Duration).unit = 'Wochen' ) ) and ( bounds.ofType(Duration).code = 'mo' implies ( bounds.ofType(Duration).unit = 'Monat(e)' or bounds.ofType(Duration).unit = 'Monat' or bounds.ofType(Duration).unit = 'Monate' ) ) and ( bounds.ofType(Duration).code = 'a' implies ( bounds.ofType(Duration).unit = 'Jahr(e)' or bounds.ofType(Duration).unit = 'Jahr' or bounds.ofType(Duration).unit = 'Jahre' ) ) )
TimingFreqOrPeriodGtOne error Timing.repeat 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'. /* 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) ) ) )
TimingFreqOrPeriodGtOneWarning warning Timing.repeat 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'. /* 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) ) ) )
TimingFrequencyCount error Timing.repeat If frequency is given together with when, timeOfDay or dayOfWeek, its value must match the number of concrete administrations. (when.exists() and dayOfWeek.empty() and frequency.exists() implies when.count() = frequency) and (when.exists() and dayOfWeek.exists() and frequency.exists() implies (when.count() * dayOfWeek.count()) = frequency) and (timeOfDay.exists() and dayOfWeek.empty() and frequency.exists() implies timeOfDay.count() = frequency) and (timeOfDay.exists() and dayOfWeek.exists() and frequency.exists() implies (timeOfDay.count() * dayOfWeek.count()) = frequency) and (dayOfWeek.exists() and timeOfDay.empty() and when.empty() and frequency.exists() implies dayOfWeek.count() = frequency)
TimingIntervalOnlyOneFrequency error Timing.repeat If a dosage is defined by a pure interval, only one Dosage element is allowed in the resource. ( /* 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 ) ) )
TimingOnlyOneBounds error Timing.repeat All Dosage elements of a resource must state the same bounds (Duration or Period), and either all of them carry a bounds or none. ( %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) ) ) and ( /* boundsPeriod: Start und Ende müssen ebenfalls über alle Dosierungen gleich sein. Die Textgenerierung liest den Zeitrahmen nur aus dem ersten Dosage-Element. */ (%resource.ofType(MedicationRequest).exists() or %resource.ofType(MedicationDispense).exists()) implies %resource.dosageInstruction.timing.repeat.bounds.ofType(Period).exists().not() or ( (%resource.dosageInstruction.timing.repeat.bounds.ofType(Period).start.distinct().count() <= 1) and (%resource.dosageInstruction.timing.repeat.bounds.ofType(Period).end.distinct().count() <= 1) ) ) and ( %resource.ofType(MedicationStatement).exists() implies %resource.dosage.timing.repeat.bounds.ofType(Period).exists().not() or ( (%resource.dosage.timing.repeat.bounds.ofType(Period).start.distinct().count() <= 1) and (%resource.dosage.timing.repeat.bounds.ofType(Period).end.distinct().count() <= 1) ) ) ) and ( /* Entweder alle Dosage-Elemente tragen einen Zeitrahmen oder keines. Die Textgenerierung liest ihn nur aus dem ersten Element; ein Element ohne Zeitrahmen wuerde sonst stillschweigend als begrenzt dargestellt. */ ( ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).timing.repeat.bounds.exists() ) implies ( ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all(timing.repeat.bounds.exists()) ) ) )
TimingOnlyOneDayOfWeek error Timing.repeat In a schema that uses only dayOfWeek, no weekday may occur in more than one Dosage element of a resource. ( /* Detect DayOfWeek */ %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( ( timing.repeat.dayOfWeek.exists() and timing.repeat.when.empty() and timing.repeat.timeOfDay.empty() ) implies ( ( (%resource.ofType(MedicationRequest).exists() or %resource.ofType(MedicationDispense).exists()) implies (%resource.dosageInstruction.timing.repeat.dayOfWeek.distinct().count() = %resource.dosageInstruction.timing.repeat.dayOfWeek.count()) ) and ( %resource.ofType(MedicationStatement).exists() implies (%resource.dosage.timing.repeat.dayOfWeek.distinct().count() = %resource.dosage.timing.repeat.dayOfWeek.count()) ) ) )
TimingOnlyOnePeriodForDayOfWeek error Timing In a schema that combines dayOfWeek with either timeOfDay or when, each combination of weekday and time must be unique across all Dosage elements of a resource. ( /* Detect DayOfWeek and Time/4-Schema */ %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( ( timing.repeat.dayOfWeek.exists() 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 ( /* For each day of week */ /* if Mon occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'mon').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).timeOfDay.count()) )) and /* if tue occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'tue').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).timeOfDay.count()) )) and /* if wed occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'wed').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).timeOfDay.count()) )) and /* if thu occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'thu').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).timeOfDay.count()) )) and /* if fri occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'fri').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).timeOfDay.count()) )) and /* if sat occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'sat').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).timeOfDay.count()) )) and /* if sun occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'sun').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).timeOfDay.count()) )) ) ) and ( %resource.ofType(MedicationStatement).exists() implies ( /* For each day of week */ /* if Mon occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'mon').count() > 1) implies ( (%resource.dosage.timing.repeat.where('mon' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('mon' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('mon' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('mon' in dayOfWeek).timeOfDay.count()) )) and /* if tue occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'tue').count() > 1) implies ( (%resource.dosage.timing.repeat.where('tue' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('tue' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('tue' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('tue' in dayOfWeek).timeOfDay.count()) )) and /* if wed occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'wed').count() > 1) implies ( (%resource.dosage.timing.repeat.where('wed' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('wed' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('wed' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('wed' in dayOfWeek).timeOfDay.count()) )) and /* if thu occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'thu').count() > 1) implies ( (%resource.dosage.timing.repeat.where('thu' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('thu' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('thu' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('thu' in dayOfWeek).timeOfDay.count()) )) and /* if fri occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'fri').count() > 1) implies ( (%resource.dosage.timing.repeat.where('fri' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('fri' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('fri' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('fri' in dayOfWeek).timeOfDay.count()) )) and /* if sat occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'sat').count() > 1) implies ( (%resource.dosage.timing.repeat.where('sat' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('sat' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('sat' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('sat' in dayOfWeek).timeOfDay.count()) )) and /* if sun occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'sun').count() > 1) implies ( (%resource.dosage.timing.repeat.where('sun' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('sun' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('sun' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('sun' in dayOfWeek).timeOfDay.count()) )) ) ) ) )
TimingOnlyOneTimeForInterval error Timing.repeat In a schema that combines an interval with timeOfDay or when, all Dosage elements of a resource must use the same period and periodUnit, and each timeOfDay or when value must be unique across them. /* Detect Interval and Time/4-Schema */ ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ) .all( ( 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.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()) ) ) ) )
TimingOnlyOneTimeOfDay error Timing.repeat In a schema that uses only timeOfDay, no time of day may occur in more than one Dosage element of a resource. ( /* Detect TimeOfDay */ %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).exists() or %resource.ofType(MedicationDispense).exists()) implies (%resource.dosageInstruction.timing.repeat.timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.timeOfDay.count()) ) and ( %resource.ofType(MedicationStatement).exists() implies (%resource.dosage.timing.repeat.timeOfDay.distinct().count() = %resource.dosage.timing.repeat.timeOfDay.count()) ) ) )
TimingOnlyOneType error Timing.repeat Exactly one of the supported timing schemas is allowed. With dayOfWeek, frequency and the pair period = 1 and periodUnit = wk are optional redundant legacy statements; they do not constitute an interval schema. With when or timeOfDay, frequency is optional; a non-daily period distinguishes the daily schema from a time interval combined with a time-of-day or clock-time reference. A variable frequency (frequencyMax) is reserved for the pure interval, because concrete times or weekdays already determine the number of administrations. /* DayOfWeek only; legacy frequency and the exact 1 wk pair are optional */ ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( timing.repeat.dayOfWeek.exists() and timing.repeat.when.empty() and timing.repeat.timeOfDay.empty() and timing.repeat.frequencyMax.empty() and timing.repeat.periodMax.empty() and ( (timing.repeat.period.empty() and timing.repeat.periodUnit.empty()) or (timing.repeat.period = 1 and timing.repeat.periodUnit = 'wk') ) ) or /* Interval only (frequency + period + periodUnit, no when/timeOfDay/dayOfWeek) */ ( %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() ) or /* DayOfWeek and Time/4-Schema; legacy frequency and the exact 1 wk pair are optional */ ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( timing.repeat.dayOfWeek.exists() and ( (timing.repeat.timeOfDay.exists() and timing.repeat.when.empty()) or (timing.repeat.when.exists() and timing.repeat.timeOfDay.empty()) ) and timing.repeat.frequencyMax.empty() and timing.repeat.periodMax.empty() and ( (timing.repeat.period.empty() and timing.repeat.periodUnit.empty()) or (timing.repeat.period = 1 and timing.repeat.periodUnit = 'wk') ) ) or /* Daily When or TimeOfDay; frequency is optional, a variable frequency is not */ ( %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()) or (timing.repeat.when.exists() and timing.repeat.timeOfDay.empty()) ) and timing.repeat.frequencyMax.empty() and timing.repeat.periodMax.empty() and ( (timing.repeat.period.empty() and timing.repeat.periodUnit.empty()) or (timing.repeat.period = 1 and timing.repeat.periodUnit = 'd') ) ) or /* Non-daily interval combined with When or TimeOfDay; frequency is optional, a variable frequency is not */ ( %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()) or (timing.repeat.when.exists() and timing.repeat.timeOfDay.empty()) ) and timing.repeat.frequencyMax.empty() and timing.repeat.period.exists() and timing.repeat.periodUnit.exists() and (timing.repeat.periodUnit = 'd' or timing.repeat.periodUnit = 'wk' or timing.repeat.periodUnit = 'mo') and ( timing.repeat.periodUnit != 'd' or timing.repeat.period != 1 or timing.repeat.periodMax.exists() ) )
TimingOnlyOneWhen error Timing.repeat In a schema that uses only when, no part of the day may occur in more than one Dosage element of a resource. ( /* Detect when-based schema */ %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).exists() or %resource.ofType(MedicationDispense).exists()) implies (%resource.dosageInstruction.timing.repeat.when.distinct().count() = %resource.dosageInstruction.timing.repeat.when.count()) ) and ( %resource.ofType(MedicationStatement).exists() implies (%resource.dosage.timing.repeat.when.distinct().count() = %resource.dosage.timing.repeat.when.count()) ) ) )
TimingOnlyWhenOrTimeOfDay error Timing.repeat The Dosage elements of a resource must not mix a time of day (timeOfDay) and a part of the day (when). ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( (timing.repeat.when.exists() or timing.repeat.timeOfDay.exists()) implies ( ( (%resource.ofType(MedicationRequest).exists() or %resource.ofType(MedicationDispense).exists()) implies (%resource.dosageInstruction.timing.repeat.when.exists() xor %resource.dosageInstruction.timing.repeat.timeOfDay.exists()) ) and ( %resource.ofType(MedicationStatement).exists() implies (%resource.dosage.timing.repeat.when.exists() xor %resource.dosage.timing.repeat.timeOfDay.exists()) ) ) )
TimingPeriodOnlyWholeNumber error Timing.repeat period and periodMax must be whole numbers; decimal values are not allowed. (period.exists() implies period mod 1 = 0) and (periodMax.exists() implies periodMax mod 1 = 0)
TimingPeriodUnit error Timing.repeat periodUnit may only be given together with period. With dayOfWeek, only the redundant weekly statement is allowed; with when or timeOfDay without dayOfWeek, days, weeks or months are allowed. periodUnit.empty() or ( period.exists() and ( (dayOfWeek.exists() and periodUnit = 'wk') or ( dayOfWeek.empty() and ( (when.empty() and timeOfDay.empty()) or periodUnit = 'd' or periodUnit = 'wk' or periodUnit = 'mo' ) ) ) )
TimingSingleDosageForTimeOfDay error Timing.repeat 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. ( %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() ) ) )
TimingSingleDosageForTimeOfDayWarning warning Timing.repeat 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. ( %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() ) ) )
TimingSingleDosageForWhen error Timing.repeat 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. ( %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() ) ) )
TimingSingleDosageForWhenWarning warning Timing.repeat 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. ( %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() ) ) )
TimingVarFreqGtMin error Timing.repeat For a variable frequency, the maximum frequency must be greater than the minimum frequency. frequencyMax.empty() or frequency.empty() or frequency.value.toInteger() < frequencyMax.value.toInteger()
TimingVarPeriodGtMin error Timing.repeat For a variable period, the maximum period must be greater than the minimum period. periodMax.empty() or period.empty() or period < periodMax
ele-1 error **ALL** elements All FHIR elements must have a @value or children hasValue() or (children().count() > id.count())
ext-1 error **ALL** extensions Must have either extensions or value[x], not both extension.exists() != value.exists()
tim-1 error Timing.repeat if there's a duration, there needs to be duration units duration.empty() or durationUnit.exists()
tim-2 error Timing.repeat if there's a period, there needs to be period units period.empty() or periodUnit.exists()
tim-4 error Timing.repeat duration SHALL be a non-negative value duration.exists() implies duration >= 0
tim-5 error Timing.repeat period SHALL be a non-negative value period.exists() implies period >= 0
tim-6 error Timing.repeat If there's a periodMax, there must be a period periodMax.empty() or period.exists()
tim-7 error Timing.repeat If there's a durationMax, there must be a duration durationMax.empty() or duration.exists()
tim-8 error Timing.repeat If there's a countMax, there must be a count countMax.empty() or count.exists()
tim-9 error Timing.repeat If there's an offset, there must be a when (and not C, CM, CD, CV) offset.empty() or (when.exists() and ((when in ('C' | 'CM' | 'CD' | 'CV')).not()))
tim-10 error Timing.repeat If there's a timeOfDay, there cannot be a when, or vice versa timeOfDay.empty() or when.empty()

This structure is derived from TimingDE

Summary

Mandatory: 1 element(4 nested mandatory elements)
Prohibited: 9 elements

Key Elements View

NameFlagsCard.TypeDescription & Constraints    Filter: Filtersdoco
.. Timing C 0..* TimingDE A timing schedule that specifies an event that may occur multiple times
Constraints: TimingOnlyOnePeriodForDayOfWeek
... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored even if unrecognized
... repeat SΣC 1..1 Element Wann das Ereignis stattfinden soll
Constraints: tim-1, tim-2, tim-4, tim-5, tim-6, tim-7, tim-8, tim-9, tim-10, TimingSingleDosageForTimeOfDayWarning, TimingSingleDosageForWhenWarning, TimingBoundsUnitMatchesCodeWarning, TimingFreqOrPeriodGtOneWarning, TimingOnlyOneType, TimingIntervalOnlyOneFrequency, TimingOnlyOneWhen, TimingOnlyWhenOrTimeOfDay, TimingOnlyOneTimeOfDay, TimingOnlyOneDayOfWeek, TimingOnlyOneTimeForInterval, TimingOnlyOneBounds, TimingFrequencyCount, TimingPeriodUnit, TimingPeriodOnlyWholeNumber, TimingBoundsDurationOnlyWholeNumber, TimingFreqOrPeriodGtOne, TimingVarFreqGtMin, TimingVarPeriodGtMin, TimingSingleDosageForTimeOfDay, TimingSingleDosageForWhen, TimingBoundsUnitMatchesCode
.... Slices for bounds[x] SΣ 0..1 Länge/Bereich der Längen oder (Start- und/oder End-)Grenzen
Slice: Unordered, Closed by type:$this
..... boundsDuration Duration
..... boundsPeriod Period
..... bounds[x]:boundsDuration SΣ 0..1 Duration Dauer der Dosieranweisung ausgedrückt in UCUM-Einheiten
...... value SΣ 1..1 decimal Numerical value (with implicit precision)
...... unit SΣ 1..1 string Unit representation
...... system SΣC 1..1 uri UCUM-Einheit für die Dauer
Fixed Value: http://unitsofmeasure.org
...... code SΣ 1..1 code Coded form of the unit
Binding: Duration UnitsOfTime dgMP ValueSet (required)
..... bounds[x]:boundsPeriod SΣ 0..1 Period Start- und Endzeitpunkt der Dosieranweisung.
...... start SΣC 0..1 dateTime Startdatum mit optionaler Uhrzeit und Zeitzone
...... end SΣC 0..1 dateTime Enddatum mit optionaler Uhrzeit und Zeitzone
.... frequency SΣ 0..1 positiveInt Ereignis tritt frequency-mal pro Zeitraum auf
.... frequencyMax SΣ 0..1 positiveInt Event occurs up to frequencyMax times per period
.... period SΣ 0..1 decimal Ereignis tritt frequency-mal pro Zeitraum auf
.... periodMax SΣ 0..1 decimal Upper limit of period (3-4 hours)
.... periodUnit SΣ 0..1 code min | h | d | wk | mo - Zeiteinheit (UCUM)
Binding: Period UnitsOfTime dgMP ValueSet (required)
.... dayOfWeek SΣ 0..* code mon | tue | wed | thu | fri | sat | sun
Binding: DaysOfWeek (required)
.... timeOfDay SΣ 0..* time Tageszeit für die Aktion
.... when SΣ 0..* code Code für den Zeitraum des Auftretens
Binding: Timing When dgMP (required)

doco Documentation for this format

Terminology Bindings

Path Status Usage ValueSet Version Source
Timing.repeat.bounds[x]:boundsDuration.​code Base required Duration UnitsOfTime dgMP ValueSet 📦2.0.0-ballot This IG
Timing.repeat.periodUnit Base required Period UnitsOfTime dgMP ValueSet 📦2.0.0-ballot This IG
Timing.repeat.dayOfWeek Base required DaysOfWeek 📍4.0.1 FHIR Std.
Timing.repeat.when Base required Timing When dgMP 📦2.0.0-ballot This IG

Constraints

Id Grade Path(s) Description Expression
TimingBoundsDurationOnlyWholeNumber error Timing.repeat boundsDuration.value must be a whole number; decimal values are not allowed. bounds.ofType(Duration).value.empty() or bounds.ofType(Duration).value mod 1 = 0
TimingBoundsUnitMatchesCode error Timing.repeat boundsDuration.unit must match the UCUM boundsDuration.code (e.g. 'Woche(n)' only with code='wk'). bounds.ofType(Duration).exists().not() or ( ( bounds.ofType(Duration).code = 'd' implies ( bounds.ofType(Duration).unit = 'Tag(e)' or bounds.ofType(Duration).unit = 'Tag' or bounds.ofType(Duration).unit = 'Tage' ) ) and ( bounds.ofType(Duration).code = 'wk' implies ( bounds.ofType(Duration).unit = 'Woche(n)' or bounds.ofType(Duration).unit = 'Woche' or bounds.ofType(Duration).unit = 'Wochen' ) ) and ( bounds.ofType(Duration).code = 'mo' implies ( bounds.ofType(Duration).unit = 'Monat(e)' or bounds.ofType(Duration).unit = 'Monat' or bounds.ofType(Duration).unit = 'Monate' ) ) and ( bounds.ofType(Duration).code = 'a' implies ( bounds.ofType(Duration).unit = 'Jahr(e)' or bounds.ofType(Duration).unit = 'Jahr' or bounds.ofType(Duration).unit = 'Jahre' ) ) )
TimingBoundsUnitMatchesCodeWarning warning Timing.repeat boundsDuration.unit must match the UCUM boundsDuration.code (e.g. 'Woche(n)' only with code='wk'). bounds.ofType(Duration).exists().not() or ( ( bounds.ofType(Duration).code = 'd' implies ( bounds.ofType(Duration).unit = 'Tag(e)' or bounds.ofType(Duration).unit = 'Tag' or bounds.ofType(Duration).unit = 'Tage' ) ) and ( bounds.ofType(Duration).code = 'wk' implies ( bounds.ofType(Duration).unit = 'Woche(n)' or bounds.ofType(Duration).unit = 'Woche' or bounds.ofType(Duration).unit = 'Wochen' ) ) and ( bounds.ofType(Duration).code = 'mo' implies ( bounds.ofType(Duration).unit = 'Monat(e)' or bounds.ofType(Duration).unit = 'Monat' or bounds.ofType(Duration).unit = 'Monate' ) ) and ( bounds.ofType(Duration).code = 'a' implies ( bounds.ofType(Duration).unit = 'Jahr(e)' or bounds.ofType(Duration).unit = 'Jahr' or bounds.ofType(Duration).unit = 'Jahre' ) ) )
TimingFreqOrPeriodGtOne error Timing.repeat 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'. /* 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) ) ) )
TimingFreqOrPeriodGtOneWarning warning Timing.repeat 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'. /* 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) ) ) )
TimingFrequencyCount error Timing.repeat If frequency is given together with when, timeOfDay or dayOfWeek, its value must match the number of concrete administrations. (when.exists() and dayOfWeek.empty() and frequency.exists() implies when.count() = frequency) and (when.exists() and dayOfWeek.exists() and frequency.exists() implies (when.count() * dayOfWeek.count()) = frequency) and (timeOfDay.exists() and dayOfWeek.empty() and frequency.exists() implies timeOfDay.count() = frequency) and (timeOfDay.exists() and dayOfWeek.exists() and frequency.exists() implies (timeOfDay.count() * dayOfWeek.count()) = frequency) and (dayOfWeek.exists() and timeOfDay.empty() and when.empty() and frequency.exists() implies dayOfWeek.count() = frequency)
TimingIntervalOnlyOneFrequency error Timing.repeat If a dosage is defined by a pure interval, only one Dosage element is allowed in the resource. ( /* 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 ) ) )
TimingOnlyOneBounds error Timing.repeat All Dosage elements of a resource must state the same bounds (Duration or Period), and either all of them carry a bounds or none. ( %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) ) ) and ( /* boundsPeriod: Start und Ende müssen ebenfalls über alle Dosierungen gleich sein. Die Textgenerierung liest den Zeitrahmen nur aus dem ersten Dosage-Element. */ (%resource.ofType(MedicationRequest).exists() or %resource.ofType(MedicationDispense).exists()) implies %resource.dosageInstruction.timing.repeat.bounds.ofType(Period).exists().not() or ( (%resource.dosageInstruction.timing.repeat.bounds.ofType(Period).start.distinct().count() <= 1) and (%resource.dosageInstruction.timing.repeat.bounds.ofType(Period).end.distinct().count() <= 1) ) ) and ( %resource.ofType(MedicationStatement).exists() implies %resource.dosage.timing.repeat.bounds.ofType(Period).exists().not() or ( (%resource.dosage.timing.repeat.bounds.ofType(Period).start.distinct().count() <= 1) and (%resource.dosage.timing.repeat.bounds.ofType(Period).end.distinct().count() <= 1) ) ) ) and ( /* Entweder alle Dosage-Elemente tragen einen Zeitrahmen oder keines. Die Textgenerierung liest ihn nur aus dem ersten Element; ein Element ohne Zeitrahmen wuerde sonst stillschweigend als begrenzt dargestellt. */ ( ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).timing.repeat.bounds.exists() ) implies ( ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all(timing.repeat.bounds.exists()) ) ) )
TimingOnlyOneDayOfWeek error Timing.repeat In a schema that uses only dayOfWeek, no weekday may occur in more than one Dosage element of a resource. ( /* Detect DayOfWeek */ %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( ( timing.repeat.dayOfWeek.exists() and timing.repeat.when.empty() and timing.repeat.timeOfDay.empty() ) implies ( ( (%resource.ofType(MedicationRequest).exists() or %resource.ofType(MedicationDispense).exists()) implies (%resource.dosageInstruction.timing.repeat.dayOfWeek.distinct().count() = %resource.dosageInstruction.timing.repeat.dayOfWeek.count()) ) and ( %resource.ofType(MedicationStatement).exists() implies (%resource.dosage.timing.repeat.dayOfWeek.distinct().count() = %resource.dosage.timing.repeat.dayOfWeek.count()) ) ) )
TimingOnlyOnePeriodForDayOfWeek error Timing In a schema that combines dayOfWeek with either timeOfDay or when, each combination of weekday and time must be unique across all Dosage elements of a resource. ( /* Detect DayOfWeek and Time/4-Schema */ %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( ( timing.repeat.dayOfWeek.exists() 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 ( /* For each day of week */ /* if Mon occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'mon').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).timeOfDay.count()) )) and /* if tue occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'tue').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).timeOfDay.count()) )) and /* if wed occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'wed').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).timeOfDay.count()) )) and /* if thu occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'thu').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).timeOfDay.count()) )) and /* if fri occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'fri').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).timeOfDay.count()) )) and /* if sat occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'sat').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).timeOfDay.count()) )) and /* if sun occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'sun').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).timeOfDay.count()) )) ) ) and ( %resource.ofType(MedicationStatement).exists() implies ( /* For each day of week */ /* if Mon occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'mon').count() > 1) implies ( (%resource.dosage.timing.repeat.where('mon' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('mon' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('mon' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('mon' in dayOfWeek).timeOfDay.count()) )) and /* if tue occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'tue').count() > 1) implies ( (%resource.dosage.timing.repeat.where('tue' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('tue' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('tue' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('tue' in dayOfWeek).timeOfDay.count()) )) and /* if wed occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'wed').count() > 1) implies ( (%resource.dosage.timing.repeat.where('wed' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('wed' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('wed' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('wed' in dayOfWeek).timeOfDay.count()) )) and /* if thu occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'thu').count() > 1) implies ( (%resource.dosage.timing.repeat.where('thu' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('thu' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('thu' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('thu' in dayOfWeek).timeOfDay.count()) )) and /* if fri occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'fri').count() > 1) implies ( (%resource.dosage.timing.repeat.where('fri' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('fri' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('fri' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('fri' in dayOfWeek).timeOfDay.count()) )) and /* if sat occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'sat').count() > 1) implies ( (%resource.dosage.timing.repeat.where('sat' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('sat' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('sat' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('sat' in dayOfWeek).timeOfDay.count()) )) and /* if sun occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'sun').count() > 1) implies ( (%resource.dosage.timing.repeat.where('sun' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('sun' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('sun' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('sun' in dayOfWeek).timeOfDay.count()) )) ) ) ) )
TimingOnlyOneTimeForInterval error Timing.repeat In a schema that combines an interval with timeOfDay or when, all Dosage elements of a resource must use the same period and periodUnit, and each timeOfDay or when value must be unique across them. /* Detect Interval and Time/4-Schema */ ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ) .all( ( 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.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()) ) ) ) )
TimingOnlyOneTimeOfDay error Timing.repeat In a schema that uses only timeOfDay, no time of day may occur in more than one Dosage element of a resource. ( /* Detect TimeOfDay */ %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).exists() or %resource.ofType(MedicationDispense).exists()) implies (%resource.dosageInstruction.timing.repeat.timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.timeOfDay.count()) ) and ( %resource.ofType(MedicationStatement).exists() implies (%resource.dosage.timing.repeat.timeOfDay.distinct().count() = %resource.dosage.timing.repeat.timeOfDay.count()) ) ) )
TimingOnlyOneType error Timing.repeat Exactly one of the supported timing schemas is allowed. With dayOfWeek, frequency and the pair period = 1 and periodUnit = wk are optional redundant legacy statements; they do not constitute an interval schema. With when or timeOfDay, frequency is optional; a non-daily period distinguishes the daily schema from a time interval combined with a time-of-day or clock-time reference. A variable frequency (frequencyMax) is reserved for the pure interval, because concrete times or weekdays already determine the number of administrations. /* DayOfWeek only; legacy frequency and the exact 1 wk pair are optional */ ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( timing.repeat.dayOfWeek.exists() and timing.repeat.when.empty() and timing.repeat.timeOfDay.empty() and timing.repeat.frequencyMax.empty() and timing.repeat.periodMax.empty() and ( (timing.repeat.period.empty() and timing.repeat.periodUnit.empty()) or (timing.repeat.period = 1 and timing.repeat.periodUnit = 'wk') ) ) or /* Interval only (frequency + period + periodUnit, no when/timeOfDay/dayOfWeek) */ ( %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() ) or /* DayOfWeek and Time/4-Schema; legacy frequency and the exact 1 wk pair are optional */ ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( timing.repeat.dayOfWeek.exists() and ( (timing.repeat.timeOfDay.exists() and timing.repeat.when.empty()) or (timing.repeat.when.exists() and timing.repeat.timeOfDay.empty()) ) and timing.repeat.frequencyMax.empty() and timing.repeat.periodMax.empty() and ( (timing.repeat.period.empty() and timing.repeat.periodUnit.empty()) or (timing.repeat.period = 1 and timing.repeat.periodUnit = 'wk') ) ) or /* Daily When or TimeOfDay; frequency is optional, a variable frequency is not */ ( %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()) or (timing.repeat.when.exists() and timing.repeat.timeOfDay.empty()) ) and timing.repeat.frequencyMax.empty() and timing.repeat.periodMax.empty() and ( (timing.repeat.period.empty() and timing.repeat.periodUnit.empty()) or (timing.repeat.period = 1 and timing.repeat.periodUnit = 'd') ) ) or /* Non-daily interval combined with When or TimeOfDay; frequency is optional, a variable frequency is not */ ( %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()) or (timing.repeat.when.exists() and timing.repeat.timeOfDay.empty()) ) and timing.repeat.frequencyMax.empty() and timing.repeat.period.exists() and timing.repeat.periodUnit.exists() and (timing.repeat.periodUnit = 'd' or timing.repeat.periodUnit = 'wk' or timing.repeat.periodUnit = 'mo') and ( timing.repeat.periodUnit != 'd' or timing.repeat.period != 1 or timing.repeat.periodMax.exists() ) )
TimingOnlyOneWhen error Timing.repeat In a schema that uses only when, no part of the day may occur in more than one Dosage element of a resource. ( /* Detect when-based schema */ %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).exists() or %resource.ofType(MedicationDispense).exists()) implies (%resource.dosageInstruction.timing.repeat.when.distinct().count() = %resource.dosageInstruction.timing.repeat.when.count()) ) and ( %resource.ofType(MedicationStatement).exists() implies (%resource.dosage.timing.repeat.when.distinct().count() = %resource.dosage.timing.repeat.when.count()) ) ) )
TimingOnlyWhenOrTimeOfDay error Timing.repeat The Dosage elements of a resource must not mix a time of day (timeOfDay) and a part of the day (when). ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( (timing.repeat.when.exists() or timing.repeat.timeOfDay.exists()) implies ( ( (%resource.ofType(MedicationRequest).exists() or %resource.ofType(MedicationDispense).exists()) implies (%resource.dosageInstruction.timing.repeat.when.exists() xor %resource.dosageInstruction.timing.repeat.timeOfDay.exists()) ) and ( %resource.ofType(MedicationStatement).exists() implies (%resource.dosage.timing.repeat.when.exists() xor %resource.dosage.timing.repeat.timeOfDay.exists()) ) ) )
TimingPeriodOnlyWholeNumber error Timing.repeat period and periodMax must be whole numbers; decimal values are not allowed. (period.exists() implies period mod 1 = 0) and (periodMax.exists() implies periodMax mod 1 = 0)
TimingPeriodUnit error Timing.repeat periodUnit may only be given together with period. With dayOfWeek, only the redundant weekly statement is allowed; with when or timeOfDay without dayOfWeek, days, weeks or months are allowed. periodUnit.empty() or ( period.exists() and ( (dayOfWeek.exists() and periodUnit = 'wk') or ( dayOfWeek.empty() and ( (when.empty() and timeOfDay.empty()) or periodUnit = 'd' or periodUnit = 'wk' or periodUnit = 'mo' ) ) ) )
TimingSingleDosageForTimeOfDay error Timing.repeat 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. ( %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() ) ) )
TimingSingleDosageForTimeOfDayWarning warning Timing.repeat 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. ( %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() ) ) )
TimingSingleDosageForWhen error Timing.repeat 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. ( %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() ) ) )
TimingSingleDosageForWhenWarning warning Timing.repeat 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. ( %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() ) ) )
TimingVarFreqGtMin error Timing.repeat For a variable frequency, the maximum frequency must be greater than the minimum frequency. frequencyMax.empty() or frequency.empty() or frequency.value.toInteger() < frequencyMax.value.toInteger()
TimingVarPeriodGtMin error Timing.repeat For a variable period, the maximum period must be greater than the minimum period. periodMax.empty() or period.empty() or period < periodMax
ele-1 error **ALL** elements All FHIR elements must have a @value or children hasValue() or (children().count() > id.count())
ext-1 error **ALL** extensions Must have either extensions or value[x], not both extension.exists() != value.exists()
tim-1 error Timing.repeat if there's a duration, there needs to be duration units duration.empty() or durationUnit.exists()
tim-2 error Timing.repeat if there's a period, there needs to be period units period.empty() or periodUnit.exists()
tim-4 error Timing.repeat duration SHALL be a non-negative value duration.exists() implies duration >= 0
tim-5 error Timing.repeat period SHALL be a non-negative value period.exists() implies period >= 0
tim-6 error Timing.repeat If there's a periodMax, there must be a period periodMax.empty() or period.exists()
tim-7 error Timing.repeat If there's a durationMax, there must be a duration durationMax.empty() or duration.exists()
tim-8 error Timing.repeat If there's a countMax, there must be a count countMax.empty() or count.exists()
tim-9 error Timing.repeat If there's an offset, there must be a when (and not C, CM, CD, CV) offset.empty() or (when.exists() and ((when in ('C' | 'CM' | 'CD' | 'CV')).not()))
tim-10 error Timing.repeat If there's a timeOfDay, there cannot be a when, or vice versa timeOfDay.empty() or when.empty()

Differential View

This structure is derived from TimingDE

NameFlagsCard.TypeDescription & Constraints    Filter: Filtersdoco
.. Timing C 0..* TimingDE A timing schedule that specifies an event that may occur multiple times
Constraints: TimingOnlyOnePeriodForDayOfWeek
... event 0..0 When the event occurs
... repeat C 1..1 Element Wann das Ereignis stattfinden soll
Constraints: TimingOnlyOneType, TimingIntervalOnlyOneFrequency, TimingOnlyOneWhen, TimingOnlyWhenOrTimeOfDay, TimingOnlyOneTimeOfDay, TimingOnlyOneDayOfWeek, TimingOnlyOneTimeForInterval, TimingOnlyOneBounds, TimingFrequencyCount, TimingPeriodUnit, TimingPeriodOnlyWholeNumber, TimingBoundsDurationOnlyWholeNumber, TimingFreqOrPeriodGtOne, TimingVarFreqGtMin, TimingVarPeriodGtMin, TimingSingleDosageForTimeOfDay, TimingSingleDosageForWhen, TimingBoundsUnitMatchesCode
.... bounds[x] 0..1 Länge/Bereich der Längen oder (Start- und/oder End-)Grenzen
..... boundsDuration Duration
..... boundsPeriod Period
.... Slices for bounds[x] Content/Rules for all slices
..... bounds[x]:boundsDuration 0..1 Duration Dauer der Dosieranweisung ausgedrückt in UCUM-Einheiten
...... value 1..1 decimal Numerical value (with implicit precision)
...... comparator 0..0 < | <= | >= | > - how to understand the value
...... unit 1..1 string Unit representation
...... system 1..1 uri UCUM-Einheit für die Dauer
...... code 1..1 code Coded form of the unit
Binding: Duration UnitsOfTime dgMP ValueSet (required)
..... bounds[x]:boundsPeriod 0..1 Period Start- und Endzeitpunkt der Dosieranweisung.
...... start 0..1 dateTime Startdatum mit optionaler Uhrzeit und Zeitzone
...... end 0..1 dateTime Enddatum mit optionaler Uhrzeit und Zeitzone
.... count 0..0 Number of times to repeat
.... countMax 0..0 Maximum number of times to repeat
.... duration 0..0 How long when it happens
.... durationMax 0..0 How long when it happens (Max)
.... durationUnit 0..0 s | min | h | d | wk | mo | a - unit of time (UCUM)
.... periodUnit 0..1 code min | h | d | wk | mo - Zeiteinheit (UCUM)
Binding: Period UnitsOfTime dgMP ValueSet (required)
.... when 0..* code Code für den Zeitraum des Auftretens
Binding: Timing When dgMP (required)
.... offset 0..0 Zeitversatz
... code 0..0 BID | TID | QID | AM | PM | QD | QOD | +

doco Documentation for this format

Terminology Bindings (Differential)

Path Status Usage ValueSet Version Source
Timing.repeat.bounds[x]:boundsDuration.​code Base required Duration UnitsOfTime dgMP ValueSet 📦2.0.0-ballot This IG
Timing.repeat.periodUnit Base required Period UnitsOfTime dgMP ValueSet 📦2.0.0-ballot This IG
Timing.repeat.when Base required Timing When dgMP 📦2.0.0-ballot This IG

Constraints

Id Grade Path(s) Description Expression
TimingBoundsDurationOnlyWholeNumber error Timing.repeat boundsDuration.value must be a whole number; decimal values are not allowed. bounds.ofType(Duration).value.empty() or bounds.ofType(Duration).value mod 1 = 0
TimingBoundsUnitMatchesCode error Timing.repeat boundsDuration.unit must match the UCUM boundsDuration.code (e.g. 'Woche(n)' only with code='wk'). bounds.ofType(Duration).exists().not() or ( ( bounds.ofType(Duration).code = 'd' implies ( bounds.ofType(Duration).unit = 'Tag(e)' or bounds.ofType(Duration).unit = 'Tag' or bounds.ofType(Duration).unit = 'Tage' ) ) and ( bounds.ofType(Duration).code = 'wk' implies ( bounds.ofType(Duration).unit = 'Woche(n)' or bounds.ofType(Duration).unit = 'Woche' or bounds.ofType(Duration).unit = 'Wochen' ) ) and ( bounds.ofType(Duration).code = 'mo' implies ( bounds.ofType(Duration).unit = 'Monat(e)' or bounds.ofType(Duration).unit = 'Monat' or bounds.ofType(Duration).unit = 'Monate' ) ) and ( bounds.ofType(Duration).code = 'a' implies ( bounds.ofType(Duration).unit = 'Jahr(e)' or bounds.ofType(Duration).unit = 'Jahr' or bounds.ofType(Duration).unit = 'Jahre' ) ) )
TimingFreqOrPeriodGtOne error Timing.repeat 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'. /* 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) ) ) )
TimingFrequencyCount error Timing.repeat If frequency is given together with when, timeOfDay or dayOfWeek, its value must match the number of concrete administrations. (when.exists() and dayOfWeek.empty() and frequency.exists() implies when.count() = frequency) and (when.exists() and dayOfWeek.exists() and frequency.exists() implies (when.count() * dayOfWeek.count()) = frequency) and (timeOfDay.exists() and dayOfWeek.empty() and frequency.exists() implies timeOfDay.count() = frequency) and (timeOfDay.exists() and dayOfWeek.exists() and frequency.exists() implies (timeOfDay.count() * dayOfWeek.count()) = frequency) and (dayOfWeek.exists() and timeOfDay.empty() and when.empty() and frequency.exists() implies dayOfWeek.count() = frequency)
TimingIntervalOnlyOneFrequency error Timing.repeat If a dosage is defined by a pure interval, only one Dosage element is allowed in the resource. ( /* 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 ) ) )
TimingOnlyOneBounds error Timing.repeat All Dosage elements of a resource must state the same bounds (Duration or Period), and either all of them carry a bounds or none. ( %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) ) ) and ( /* boundsPeriod: Start und Ende müssen ebenfalls über alle Dosierungen gleich sein. Die Textgenerierung liest den Zeitrahmen nur aus dem ersten Dosage-Element. */ (%resource.ofType(MedicationRequest).exists() or %resource.ofType(MedicationDispense).exists()) implies %resource.dosageInstruction.timing.repeat.bounds.ofType(Period).exists().not() or ( (%resource.dosageInstruction.timing.repeat.bounds.ofType(Period).start.distinct().count() <= 1) and (%resource.dosageInstruction.timing.repeat.bounds.ofType(Period).end.distinct().count() <= 1) ) ) and ( %resource.ofType(MedicationStatement).exists() implies %resource.dosage.timing.repeat.bounds.ofType(Period).exists().not() or ( (%resource.dosage.timing.repeat.bounds.ofType(Period).start.distinct().count() <= 1) and (%resource.dosage.timing.repeat.bounds.ofType(Period).end.distinct().count() <= 1) ) ) ) and ( /* Entweder alle Dosage-Elemente tragen einen Zeitrahmen oder keines. Die Textgenerierung liest ihn nur aus dem ersten Element; ein Element ohne Zeitrahmen wuerde sonst stillschweigend als begrenzt dargestellt. */ ( ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).timing.repeat.bounds.exists() ) implies ( ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all(timing.repeat.bounds.exists()) ) ) )
TimingOnlyOneDayOfWeek error Timing.repeat In a schema that uses only dayOfWeek, no weekday may occur in more than one Dosage element of a resource. ( /* Detect DayOfWeek */ %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( ( timing.repeat.dayOfWeek.exists() and timing.repeat.when.empty() and timing.repeat.timeOfDay.empty() ) implies ( ( (%resource.ofType(MedicationRequest).exists() or %resource.ofType(MedicationDispense).exists()) implies (%resource.dosageInstruction.timing.repeat.dayOfWeek.distinct().count() = %resource.dosageInstruction.timing.repeat.dayOfWeek.count()) ) and ( %resource.ofType(MedicationStatement).exists() implies (%resource.dosage.timing.repeat.dayOfWeek.distinct().count() = %resource.dosage.timing.repeat.dayOfWeek.count()) ) ) )
TimingOnlyOnePeriodForDayOfWeek error Timing In a schema that combines dayOfWeek with either timeOfDay or when, each combination of weekday and time must be unique across all Dosage elements of a resource. ( /* Detect DayOfWeek and Time/4-Schema */ %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( ( timing.repeat.dayOfWeek.exists() 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 ( /* For each day of week */ /* if Mon occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'mon').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).timeOfDay.count()) )) and /* if tue occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'tue').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).timeOfDay.count()) )) and /* if wed occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'wed').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).timeOfDay.count()) )) and /* if thu occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'thu').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).timeOfDay.count()) )) and /* if fri occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'fri').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).timeOfDay.count()) )) and /* if sat occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'sat').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).timeOfDay.count()) )) and /* if sun occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'sun').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).timeOfDay.count()) )) ) ) and ( %resource.ofType(MedicationStatement).exists() implies ( /* For each day of week */ /* if Mon occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'mon').count() > 1) implies ( (%resource.dosage.timing.repeat.where('mon' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('mon' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('mon' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('mon' in dayOfWeek).timeOfDay.count()) )) and /* if tue occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'tue').count() > 1) implies ( (%resource.dosage.timing.repeat.where('tue' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('tue' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('tue' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('tue' in dayOfWeek).timeOfDay.count()) )) and /* if wed occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'wed').count() > 1) implies ( (%resource.dosage.timing.repeat.where('wed' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('wed' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('wed' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('wed' in dayOfWeek).timeOfDay.count()) )) and /* if thu occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'thu').count() > 1) implies ( (%resource.dosage.timing.repeat.where('thu' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('thu' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('thu' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('thu' in dayOfWeek).timeOfDay.count()) )) and /* if fri occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'fri').count() > 1) implies ( (%resource.dosage.timing.repeat.where('fri' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('fri' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('fri' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('fri' in dayOfWeek).timeOfDay.count()) )) and /* if sat occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'sat').count() > 1) implies ( (%resource.dosage.timing.repeat.where('sat' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('sat' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('sat' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('sat' in dayOfWeek).timeOfDay.count()) )) and /* if sun occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'sun').count() > 1) implies ( (%resource.dosage.timing.repeat.where('sun' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('sun' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('sun' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('sun' in dayOfWeek).timeOfDay.count()) )) ) ) ) )
TimingOnlyOneTimeForInterval error Timing.repeat In a schema that combines an interval with timeOfDay or when, all Dosage elements of a resource must use the same period and periodUnit, and each timeOfDay or when value must be unique across them. /* Detect Interval and Time/4-Schema */ ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ) .all( ( 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.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()) ) ) ) )
TimingOnlyOneTimeOfDay error Timing.repeat In a schema that uses only timeOfDay, no time of day may occur in more than one Dosage element of a resource. ( /* Detect TimeOfDay */ %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).exists() or %resource.ofType(MedicationDispense).exists()) implies (%resource.dosageInstruction.timing.repeat.timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.timeOfDay.count()) ) and ( %resource.ofType(MedicationStatement).exists() implies (%resource.dosage.timing.repeat.timeOfDay.distinct().count() = %resource.dosage.timing.repeat.timeOfDay.count()) ) ) )
TimingOnlyOneType error Timing.repeat Exactly one of the supported timing schemas is allowed. With dayOfWeek, frequency and the pair period = 1 and periodUnit = wk are optional redundant legacy statements; they do not constitute an interval schema. With when or timeOfDay, frequency is optional; a non-daily period distinguishes the daily schema from a time interval combined with a time-of-day or clock-time reference. A variable frequency (frequencyMax) is reserved for the pure interval, because concrete times or weekdays already determine the number of administrations. /* DayOfWeek only; legacy frequency and the exact 1 wk pair are optional */ ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( timing.repeat.dayOfWeek.exists() and timing.repeat.when.empty() and timing.repeat.timeOfDay.empty() and timing.repeat.frequencyMax.empty() and timing.repeat.periodMax.empty() and ( (timing.repeat.period.empty() and timing.repeat.periodUnit.empty()) or (timing.repeat.period = 1 and timing.repeat.periodUnit = 'wk') ) ) or /* Interval only (frequency + period + periodUnit, no when/timeOfDay/dayOfWeek) */ ( %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() ) or /* DayOfWeek and Time/4-Schema; legacy frequency and the exact 1 wk pair are optional */ ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( timing.repeat.dayOfWeek.exists() and ( (timing.repeat.timeOfDay.exists() and timing.repeat.when.empty()) or (timing.repeat.when.exists() and timing.repeat.timeOfDay.empty()) ) and timing.repeat.frequencyMax.empty() and timing.repeat.periodMax.empty() and ( (timing.repeat.period.empty() and timing.repeat.periodUnit.empty()) or (timing.repeat.period = 1 and timing.repeat.periodUnit = 'wk') ) ) or /* Daily When or TimeOfDay; frequency is optional, a variable frequency is not */ ( %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()) or (timing.repeat.when.exists() and timing.repeat.timeOfDay.empty()) ) and timing.repeat.frequencyMax.empty() and timing.repeat.periodMax.empty() and ( (timing.repeat.period.empty() and timing.repeat.periodUnit.empty()) or (timing.repeat.period = 1 and timing.repeat.periodUnit = 'd') ) ) or /* Non-daily interval combined with When or TimeOfDay; frequency is optional, a variable frequency is not */ ( %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()) or (timing.repeat.when.exists() and timing.repeat.timeOfDay.empty()) ) and timing.repeat.frequencyMax.empty() and timing.repeat.period.exists() and timing.repeat.periodUnit.exists() and (timing.repeat.periodUnit = 'd' or timing.repeat.periodUnit = 'wk' or timing.repeat.periodUnit = 'mo') and ( timing.repeat.periodUnit != 'd' or timing.repeat.period != 1 or timing.repeat.periodMax.exists() ) )
TimingOnlyOneWhen error Timing.repeat In a schema that uses only when, no part of the day may occur in more than one Dosage element of a resource. ( /* Detect when-based schema */ %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).exists() or %resource.ofType(MedicationDispense).exists()) implies (%resource.dosageInstruction.timing.repeat.when.distinct().count() = %resource.dosageInstruction.timing.repeat.when.count()) ) and ( %resource.ofType(MedicationStatement).exists() implies (%resource.dosage.timing.repeat.when.distinct().count() = %resource.dosage.timing.repeat.when.count()) ) ) )
TimingOnlyWhenOrTimeOfDay error Timing.repeat The Dosage elements of a resource must not mix a time of day (timeOfDay) and a part of the day (when). ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( (timing.repeat.when.exists() or timing.repeat.timeOfDay.exists()) implies ( ( (%resource.ofType(MedicationRequest).exists() or %resource.ofType(MedicationDispense).exists()) implies (%resource.dosageInstruction.timing.repeat.when.exists() xor %resource.dosageInstruction.timing.repeat.timeOfDay.exists()) ) and ( %resource.ofType(MedicationStatement).exists() implies (%resource.dosage.timing.repeat.when.exists() xor %resource.dosage.timing.repeat.timeOfDay.exists()) ) ) )
TimingPeriodOnlyWholeNumber error Timing.repeat period and periodMax must be whole numbers; decimal values are not allowed. (period.exists() implies period mod 1 = 0) and (periodMax.exists() implies periodMax mod 1 = 0)
TimingPeriodUnit error Timing.repeat periodUnit may only be given together with period. With dayOfWeek, only the redundant weekly statement is allowed; with when or timeOfDay without dayOfWeek, days, weeks or months are allowed. periodUnit.empty() or ( period.exists() and ( (dayOfWeek.exists() and periodUnit = 'wk') or ( dayOfWeek.empty() and ( (when.empty() and timeOfDay.empty()) or periodUnit = 'd' or periodUnit = 'wk' or periodUnit = 'mo' ) ) ) )
TimingSingleDosageForTimeOfDay error Timing.repeat 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. ( %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() ) ) )
TimingSingleDosageForWhen error Timing.repeat 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. ( %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() ) ) )
TimingVarFreqGtMin error Timing.repeat For a variable frequency, the maximum frequency must be greater than the minimum frequency. frequencyMax.empty() or frequency.empty() or frequency.value.toInteger() < frequencyMax.value.toInteger()
TimingVarPeriodGtMin error Timing.repeat For a variable period, the maximum period must be greater than the minimum period. periodMax.empty() or period.empty() or period < periodMax

Snapshot View

NameFlagsCard.TypeDescription & Constraints    Filter: Filtersdoco
.. Timing C 0..* TimingDE A timing schedule that specifies an event that may occur multiple times
Constraints: TimingOnlyOnePeriodForDayOfWeek
... id 0..1 string Unique id for inter-element referencing
... extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored even if unrecognized
.... id 0..1 string Unique id for inter-element referencing
.... extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
.... Slices for bounds[x] SΣ 0..1 Länge/Bereich der Längen oder (Start- und/oder End-)Grenzen
Slice: Unordered, Closed by type:$this
..... boundsDuration Duration
..... boundsPeriod Period
..... bounds[x]:boundsDuration SΣ 0..1 Duration Dauer der Dosieranweisung ausgedrückt in UCUM-Einheiten
...... id 0..1 string Unique id for inter-element referencing
...... extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
...... value SΣ 1..1 decimal Numerical value (with implicit precision)
...... unit SΣ 1..1 string Unit representation
...... system SΣC 1..1 uri UCUM-Einheit für die Dauer
Fixed Value: http://unitsofmeasure.org
...... code SΣ 1..1 code Coded form of the unit
Binding: Duration UnitsOfTime dgMP ValueSet (required)
..... bounds[x]:boundsPeriod SΣ 0..1 Period Start- und Endzeitpunkt der Dosieranweisung.
...... id 0..1 string Unique id for inter-element referencing
...... extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
...... start SΣC 0..1 dateTime Startdatum mit optionaler Uhrzeit und Zeitzone
...... end SΣC 0..1 dateTime Enddatum mit optionaler Uhrzeit und Zeitzone
.... frequency SΣ 0..1 positiveInt Ereignis tritt frequency-mal pro Zeitraum auf
.... frequencyMax SΣ 0..1 positiveInt Event occurs up to frequencyMax times per period
.... period SΣ 0..1 decimal Ereignis tritt frequency-mal pro Zeitraum auf
.... periodMax SΣ 0..1 decimal Upper limit of period (3-4 hours)
.... periodUnit SΣ 0..1 code min | h | d | wk | mo - Zeiteinheit (UCUM)
Binding: Period UnitsOfTime dgMP ValueSet (required)
.... dayOfWeek SΣ 0..* code mon | tue | wed | thu | fri | sat | sun
Binding: DaysOfWeek (required)
.... timeOfDay SΣ 0..* time Tageszeit für die Aktion
.... when SΣ 0..* code Code für den Zeitraum des Auftretens
Binding: Timing When dgMP (required)

doco Documentation for this format

Terminology Bindings

Path Status Usage ValueSet Version Source
Timing.repeat.bounds[x]:boundsDuration.​code Base required Duration UnitsOfTime dgMP ValueSet 📦2.0.0-ballot This IG
Timing.repeat.periodUnit Base required Period UnitsOfTime dgMP ValueSet 📦2.0.0-ballot This IG
Timing.repeat.dayOfWeek Base required DaysOfWeek 📍4.0.1 FHIR Std.
Timing.repeat.when Base required Timing When dgMP 📦2.0.0-ballot This IG

Constraints

Id Grade Path(s) Description Expression
TimingBoundsDurationOnlyWholeNumber error Timing.repeat boundsDuration.value must be a whole number; decimal values are not allowed. bounds.ofType(Duration).value.empty() or bounds.ofType(Duration).value mod 1 = 0
TimingBoundsUnitMatchesCode error Timing.repeat boundsDuration.unit must match the UCUM boundsDuration.code (e.g. 'Woche(n)' only with code='wk'). bounds.ofType(Duration).exists().not() or ( ( bounds.ofType(Duration).code = 'd' implies ( bounds.ofType(Duration).unit = 'Tag(e)' or bounds.ofType(Duration).unit = 'Tag' or bounds.ofType(Duration).unit = 'Tage' ) ) and ( bounds.ofType(Duration).code = 'wk' implies ( bounds.ofType(Duration).unit = 'Woche(n)' or bounds.ofType(Duration).unit = 'Woche' or bounds.ofType(Duration).unit = 'Wochen' ) ) and ( bounds.ofType(Duration).code = 'mo' implies ( bounds.ofType(Duration).unit = 'Monat(e)' or bounds.ofType(Duration).unit = 'Monat' or bounds.ofType(Duration).unit = 'Monate' ) ) and ( bounds.ofType(Duration).code = 'a' implies ( bounds.ofType(Duration).unit = 'Jahr(e)' or bounds.ofType(Duration).unit = 'Jahr' or bounds.ofType(Duration).unit = 'Jahre' ) ) )
TimingBoundsUnitMatchesCodeWarning warning Timing.repeat boundsDuration.unit must match the UCUM boundsDuration.code (e.g. 'Woche(n)' only with code='wk'). bounds.ofType(Duration).exists().not() or ( ( bounds.ofType(Duration).code = 'd' implies ( bounds.ofType(Duration).unit = 'Tag(e)' or bounds.ofType(Duration).unit = 'Tag' or bounds.ofType(Duration).unit = 'Tage' ) ) and ( bounds.ofType(Duration).code = 'wk' implies ( bounds.ofType(Duration).unit = 'Woche(n)' or bounds.ofType(Duration).unit = 'Woche' or bounds.ofType(Duration).unit = 'Wochen' ) ) and ( bounds.ofType(Duration).code = 'mo' implies ( bounds.ofType(Duration).unit = 'Monat(e)' or bounds.ofType(Duration).unit = 'Monat' or bounds.ofType(Duration).unit = 'Monate' ) ) and ( bounds.ofType(Duration).code = 'a' implies ( bounds.ofType(Duration).unit = 'Jahr(e)' or bounds.ofType(Duration).unit = 'Jahr' or bounds.ofType(Duration).unit = 'Jahre' ) ) )
TimingFreqOrPeriodGtOne error Timing.repeat 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'. /* 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) ) ) )
TimingFreqOrPeriodGtOneWarning warning Timing.repeat 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'. /* 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) ) ) )
TimingFrequencyCount error Timing.repeat If frequency is given together with when, timeOfDay or dayOfWeek, its value must match the number of concrete administrations. (when.exists() and dayOfWeek.empty() and frequency.exists() implies when.count() = frequency) and (when.exists() and dayOfWeek.exists() and frequency.exists() implies (when.count() * dayOfWeek.count()) = frequency) and (timeOfDay.exists() and dayOfWeek.empty() and frequency.exists() implies timeOfDay.count() = frequency) and (timeOfDay.exists() and dayOfWeek.exists() and frequency.exists() implies (timeOfDay.count() * dayOfWeek.count()) = frequency) and (dayOfWeek.exists() and timeOfDay.empty() and when.empty() and frequency.exists() implies dayOfWeek.count() = frequency)
TimingIntervalOnlyOneFrequency error Timing.repeat If a dosage is defined by a pure interval, only one Dosage element is allowed in the resource. ( /* 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 ) ) )
TimingOnlyOneBounds error Timing.repeat All Dosage elements of a resource must state the same bounds (Duration or Period), and either all of them carry a bounds or none. ( %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) ) ) and ( /* boundsPeriod: Start und Ende müssen ebenfalls über alle Dosierungen gleich sein. Die Textgenerierung liest den Zeitrahmen nur aus dem ersten Dosage-Element. */ (%resource.ofType(MedicationRequest).exists() or %resource.ofType(MedicationDispense).exists()) implies %resource.dosageInstruction.timing.repeat.bounds.ofType(Period).exists().not() or ( (%resource.dosageInstruction.timing.repeat.bounds.ofType(Period).start.distinct().count() <= 1) and (%resource.dosageInstruction.timing.repeat.bounds.ofType(Period).end.distinct().count() <= 1) ) ) and ( %resource.ofType(MedicationStatement).exists() implies %resource.dosage.timing.repeat.bounds.ofType(Period).exists().not() or ( (%resource.dosage.timing.repeat.bounds.ofType(Period).start.distinct().count() <= 1) and (%resource.dosage.timing.repeat.bounds.ofType(Period).end.distinct().count() <= 1) ) ) ) and ( /* Entweder alle Dosage-Elemente tragen einen Zeitrahmen oder keines. Die Textgenerierung liest ihn nur aus dem ersten Element; ein Element ohne Zeitrahmen wuerde sonst stillschweigend als begrenzt dargestellt. */ ( ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).timing.repeat.bounds.exists() ) implies ( ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all(timing.repeat.bounds.exists()) ) ) )
TimingOnlyOneDayOfWeek error Timing.repeat In a schema that uses only dayOfWeek, no weekday may occur in more than one Dosage element of a resource. ( /* Detect DayOfWeek */ %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( ( timing.repeat.dayOfWeek.exists() and timing.repeat.when.empty() and timing.repeat.timeOfDay.empty() ) implies ( ( (%resource.ofType(MedicationRequest).exists() or %resource.ofType(MedicationDispense).exists()) implies (%resource.dosageInstruction.timing.repeat.dayOfWeek.distinct().count() = %resource.dosageInstruction.timing.repeat.dayOfWeek.count()) ) and ( %resource.ofType(MedicationStatement).exists() implies (%resource.dosage.timing.repeat.dayOfWeek.distinct().count() = %resource.dosage.timing.repeat.dayOfWeek.count()) ) ) )
TimingOnlyOnePeriodForDayOfWeek error Timing In a schema that combines dayOfWeek with either timeOfDay or when, each combination of weekday and time must be unique across all Dosage elements of a resource. ( /* Detect DayOfWeek and Time/4-Schema */ %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( ( timing.repeat.dayOfWeek.exists() 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 ( /* For each day of week */ /* if Mon occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'mon').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('mon' in dayOfWeek).timeOfDay.count()) )) and /* if tue occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'tue').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('tue' in dayOfWeek).timeOfDay.count()) )) and /* if wed occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'wed').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('wed' in dayOfWeek).timeOfDay.count()) )) and /* if thu occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'thu').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('thu' in dayOfWeek).timeOfDay.count()) )) and /* if fri occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'fri').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('fri' in dayOfWeek).timeOfDay.count()) )) and /* if sat occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'sat').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sat' in dayOfWeek).timeOfDay.count()) )) and /* if sun occurs multiple times */ ((%resource.dosageInstruction.timing.repeat.dayOfWeek.where($this = 'sun').count() > 1) implies ( (%resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).when.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).when.count()) and (%resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.where('sun' in dayOfWeek).timeOfDay.count()) )) ) ) and ( %resource.ofType(MedicationStatement).exists() implies ( /* For each day of week */ /* if Mon occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'mon').count() > 1) implies ( (%resource.dosage.timing.repeat.where('mon' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('mon' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('mon' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('mon' in dayOfWeek).timeOfDay.count()) )) and /* if tue occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'tue').count() > 1) implies ( (%resource.dosage.timing.repeat.where('tue' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('tue' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('tue' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('tue' in dayOfWeek).timeOfDay.count()) )) and /* if wed occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'wed').count() > 1) implies ( (%resource.dosage.timing.repeat.where('wed' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('wed' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('wed' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('wed' in dayOfWeek).timeOfDay.count()) )) and /* if thu occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'thu').count() > 1) implies ( (%resource.dosage.timing.repeat.where('thu' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('thu' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('thu' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('thu' in dayOfWeek).timeOfDay.count()) )) and /* if fri occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'fri').count() > 1) implies ( (%resource.dosage.timing.repeat.where('fri' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('fri' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('fri' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('fri' in dayOfWeek).timeOfDay.count()) )) and /* if sat occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'sat').count() > 1) implies ( (%resource.dosage.timing.repeat.where('sat' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('sat' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('sat' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('sat' in dayOfWeek).timeOfDay.count()) )) and /* if sun occurs multiple times */ ((%resource.dosage.timing.repeat.dayOfWeek.where($this = 'sun').count() > 1) implies ( (%resource.dosage.timing.repeat.where('sun' in dayOfWeek).when.distinct().count() = %resource.dosage.timing.repeat.where('sun' in dayOfWeek).when.count()) and (%resource.dosage.timing.repeat.where('sun' in dayOfWeek).timeOfDay.distinct().count() = %resource.dosage.timing.repeat.where('sun' in dayOfWeek).timeOfDay.count()) )) ) ) ) )
TimingOnlyOneTimeForInterval error Timing.repeat In a schema that combines an interval with timeOfDay or when, all Dosage elements of a resource must use the same period and periodUnit, and each timeOfDay or when value must be unique across them. /* Detect Interval and Time/4-Schema */ ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ) .all( ( 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.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()) ) ) ) )
TimingOnlyOneTimeOfDay error Timing.repeat In a schema that uses only timeOfDay, no time of day may occur in more than one Dosage element of a resource. ( /* Detect TimeOfDay */ %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).exists() or %resource.ofType(MedicationDispense).exists()) implies (%resource.dosageInstruction.timing.repeat.timeOfDay.distinct().count() = %resource.dosageInstruction.timing.repeat.timeOfDay.count()) ) and ( %resource.ofType(MedicationStatement).exists() implies (%resource.dosage.timing.repeat.timeOfDay.distinct().count() = %resource.dosage.timing.repeat.timeOfDay.count()) ) ) )
TimingOnlyOneType error Timing.repeat Exactly one of the supported timing schemas is allowed. With dayOfWeek, frequency and the pair period = 1 and periodUnit = wk are optional redundant legacy statements; they do not constitute an interval schema. With when or timeOfDay, frequency is optional; a non-daily period distinguishes the daily schema from a time interval combined with a time-of-day or clock-time reference. A variable frequency (frequencyMax) is reserved for the pure interval, because concrete times or weekdays already determine the number of administrations. /* DayOfWeek only; legacy frequency and the exact 1 wk pair are optional */ ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( timing.repeat.dayOfWeek.exists() and timing.repeat.when.empty() and timing.repeat.timeOfDay.empty() and timing.repeat.frequencyMax.empty() and timing.repeat.periodMax.empty() and ( (timing.repeat.period.empty() and timing.repeat.periodUnit.empty()) or (timing.repeat.period = 1 and timing.repeat.periodUnit = 'wk') ) ) or /* Interval only (frequency + period + periodUnit, no when/timeOfDay/dayOfWeek) */ ( %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() ) or /* DayOfWeek and Time/4-Schema; legacy frequency and the exact 1 wk pair are optional */ ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( timing.repeat.dayOfWeek.exists() and ( (timing.repeat.timeOfDay.exists() and timing.repeat.when.empty()) or (timing.repeat.when.exists() and timing.repeat.timeOfDay.empty()) ) and timing.repeat.frequencyMax.empty() and timing.repeat.periodMax.empty() and ( (timing.repeat.period.empty() and timing.repeat.periodUnit.empty()) or (timing.repeat.period = 1 and timing.repeat.periodUnit = 'wk') ) ) or /* Daily When or TimeOfDay; frequency is optional, a variable frequency is not */ ( %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()) or (timing.repeat.when.exists() and timing.repeat.timeOfDay.empty()) ) and timing.repeat.frequencyMax.empty() and timing.repeat.periodMax.empty() and ( (timing.repeat.period.empty() and timing.repeat.periodUnit.empty()) or (timing.repeat.period = 1 and timing.repeat.periodUnit = 'd') ) ) or /* Non-daily interval combined with When or TimeOfDay; frequency is optional, a variable frequency is not */ ( %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()) or (timing.repeat.when.exists() and timing.repeat.timeOfDay.empty()) ) and timing.repeat.frequencyMax.empty() and timing.repeat.period.exists() and timing.repeat.periodUnit.exists() and (timing.repeat.periodUnit = 'd' or timing.repeat.periodUnit = 'wk' or timing.repeat.periodUnit = 'mo') and ( timing.repeat.periodUnit != 'd' or timing.repeat.period != 1 or timing.repeat.periodMax.exists() ) )
TimingOnlyOneWhen error Timing.repeat In a schema that uses only when, no part of the day may occur in more than one Dosage element of a resource. ( /* Detect when-based schema */ %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).exists() or %resource.ofType(MedicationDispense).exists()) implies (%resource.dosageInstruction.timing.repeat.when.distinct().count() = %resource.dosageInstruction.timing.repeat.when.count()) ) and ( %resource.ofType(MedicationStatement).exists() implies (%resource.dosage.timing.repeat.when.distinct().count() = %resource.dosage.timing.repeat.when.count()) ) ) )
TimingOnlyWhenOrTimeOfDay error Timing.repeat The Dosage elements of a resource must not mix a time of day (timeOfDay) and a part of the day (when). ( %resource.ofType(MedicationRequest).dosageInstruction | %resource.ofType(MedicationDispense).dosageInstruction | %resource.ofType(MedicationStatement).dosage ).all( (timing.repeat.when.exists() or timing.repeat.timeOfDay.exists()) implies ( ( (%resource.ofType(MedicationRequest).exists() or %resource.ofType(MedicationDispense).exists()) implies (%resource.dosageInstruction.timing.repeat.when.exists() xor %resource.dosageInstruction.timing.repeat.timeOfDay.exists()) ) and ( %resource.ofType(MedicationStatement).exists() implies (%resource.dosage.timing.repeat.when.exists() xor %resource.dosage.timing.repeat.timeOfDay.exists()) ) ) )
TimingPeriodOnlyWholeNumber error Timing.repeat period and periodMax must be whole numbers; decimal values are not allowed. (period.exists() implies period mod 1 = 0) and (periodMax.exists() implies periodMax mod 1 = 0)
TimingPeriodUnit error Timing.repeat periodUnit may only be given together with period. With dayOfWeek, only the redundant weekly statement is allowed; with when or timeOfDay without dayOfWeek, days, weeks or months are allowed. periodUnit.empty() or ( period.exists() and ( (dayOfWeek.exists() and periodUnit = 'wk') or ( dayOfWeek.empty() and ( (when.empty() and timeOfDay.empty()) or periodUnit = 'd' or periodUnit = 'wk' or periodUnit = 'mo' ) ) ) )
TimingSingleDosageForTimeOfDay error Timing.repeat 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. ( %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() ) ) )
TimingSingleDosageForTimeOfDayWarning warning Timing.repeat 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. ( %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() ) ) )
TimingSingleDosageForWhen error Timing.repeat 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. ( %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() ) ) )
TimingSingleDosageForWhenWarning warning Timing.repeat 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. ( %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() ) ) )
TimingVarFreqGtMin error Timing.repeat For a variable frequency, the maximum frequency must be greater than the minimum frequency. frequencyMax.empty() or frequency.empty() or frequency.value.toInteger() < frequencyMax.value.toInteger()
TimingVarPeriodGtMin error Timing.repeat For a variable period, the maximum period must be greater than the minimum period. periodMax.empty() or period.empty() or period < periodMax
ele-1 error **ALL** elements All FHIR elements must have a @value or children hasValue() or (children().count() > id.count())
ext-1 error **ALL** extensions Must have either extensions or value[x], not both extension.exists() != value.exists()
tim-1 error Timing.repeat if there's a duration, there needs to be duration units duration.empty() or durationUnit.exists()
tim-2 error Timing.repeat if there's a period, there needs to be period units period.empty() or periodUnit.exists()
tim-4 error Timing.repeat duration SHALL be a non-negative value duration.exists() implies duration >= 0
tim-5 error Timing.repeat period SHALL be a non-negative value period.exists() implies period >= 0
tim-6 error Timing.repeat If there's a periodMax, there must be a period periodMax.empty() or period.exists()
tim-7 error Timing.repeat If there's a durationMax, there must be a duration durationMax.empty() or duration.exists()
tim-8 error Timing.repeat If there's a countMax, there must be a count countMax.empty() or count.exists()
tim-9 error Timing.repeat If there's an offset, there must be a when (and not C, CM, CD, CV) offset.empty() or (when.exists() and ((when in ('C' | 'CM' | 'CD' | 'CV')).not()))
tim-10 error Timing.repeat If there's a timeOfDay, there cannot be a when, or vice versa timeOfDay.empty() or when.empty()

This structure is derived from TimingDE

Summary

Mandatory: 1 element(4 nested mandatory elements)
Prohibited: 9 elements

 

Other representations of profile: CSV, Excel, Schematron