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-10-16 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: doco
Timing C 0..* TimingDE A timing schedule that specifies an event that may occur multiple times
Constraints: TimingOnlyOnePeriodForDayOfWeek
Timing.modifierExtension This element is a modifier element. This element is included in summaries. 0..* Extension Extensions that cannot be ignored even if unrecognized
Timing.repeat This element must be supported. This element is included in summaries. 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, TimingValuesPositiveWarning, TimingOnlyOneType, TimingIntervalOnlyOneFrequency, TimingOnlyOneWhen, TimingOnlyWhenOrTimeOfDay, TimingOnlyOneTimeOfDay, TimingOnlyOneDayOfWeek, TimingOnlyOneTimeForInterval, TimingOnlyOneBounds, TimingFrequencyCount, TimingPeriodUnit, TimingPeriodOnlyWholeNumber, TimingBoundsDurationOnlyWholeNumber, TimingBoundsPeriodMatchesTime, TimingBoundsPeriodNotForWhen, TimingBoundsPeriodFullDate, TimingValuesPositive, TimingFreqOrPeriodGtOne, TimingVarFreqGtMin, TimingVarPeriodGtMin, TimingSingleDosageForTimeOfDay, TimingSingleDosageForWhen, TimingBoundsUnitMatchesCode
Timing.repeat.Slices for bounds[x] This element must be supported. This element is included in summaries. 0..1 Länge/Bereich der Längen oder (Start- und/oder End-)Grenzen
Slice: Unordered, Closed by type:$this
Slicing Note: The rules on this element (including its children) apply to all the slices, but are not repeated in them
Timing.repeat.Slices for bounds[x].boundsDuration Duration
Timing.repeat.Slices for bounds[x].boundsPeriod Period
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration This element must be supported. This element is included in summaries. 0..1 Duration Dauer der Dosieranweisung ausgedrückt in UCUM-Einheiten
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.value This element must be supported. This element is included in summaries. 1..1 decimal Numerical value (with implicit precision)
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.unit This element must be supported. This element is included in summaries. 1..1 string Unit representation
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.system This element must be supported. This element is included in summaries. C 1..1 uri UCUM-Einheit für die Dauer
Fixed Value: http://unitsofmeasure.org (no extensions allowed)
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.code This element must be supported. This element is included in summaries. 1..1 code Coded form of the unit
Binding: Duration UnitsOfTime dgMP ValueSet (required)
Timing.repeat.Slices for bounds[x].bounds[x]:boundsPeriod This element must be supported. This element is included in summaries. 0..1 Period Start- und Endzeitpunkt der Dosieranweisung.
Timing.repeat.Slices for bounds[x].bounds[x]:boundsPeriod.start This element must be supported. This element is included in summaries. C 0..1 dateTime Startdatum mit optionaler Uhrzeit und Zeitzone
Timing.repeat.Slices for bounds[x].bounds[x]:boundsPeriod.end This element must be supported. This element is included in summaries. C 0..1 dateTime Enddatum mit optionaler Uhrzeit und Zeitzone
Timing.repeat.frequency This element must be supported. This element is included in summaries. 0..1 positiveInt Ereignis tritt frequency-mal pro Zeitraum auf
Timing.repeat.frequencyMax This element must be supported. This element is included in summaries. 0..1 positiveInt Event occurs up to frequencyMax times per period
Timing.repeat.period This element must be supported. This element is included in summaries. 0..1 decimal Ereignis tritt frequency-mal pro Zeitraum auf
Timing.repeat.periodMax This element must be supported. This element is included in summaries. 0..1 decimal Upper limit of period (3-4 hours)
Timing.repeat.periodUnit This element must be supported. This element is included in summaries. 0..1 code min | h | d | wk | mo - Zeiteinheit (UCUM)
Binding: Period UnitsOfTime dgMP ValueSet (required)
Timing.repeat.dayOfWeek This element must be supported. This element is included in summaries. 0..* code mon | tue | wed | thu | fri | sat | sun
Binding: DaysOfWeek (required)
Timing.repeat.timeOfDay This element must be supported. This element is included in summaries. 0..* time Tageszeit für die Aktion
Timing.repeat.when This element must be supported. This element is included in summaries. 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
TimingBoundsPeriodFullDate error Timing.repeat boundsPeriod.start and boundsPeriod.end must state a full calendar date (YYYY-MM-DD, optionally with a time). FHIR dateTime also allows YYYY and YYYY-MM; the dosage text renders dates as DD.MM.YYYY and cannot represent a partial date. (bounds.ofType(Period).start | bounds.ofType(Period).end).all(toString().length() >= 10)
TimingBoundsPeriodMatchesTime error Timing.repeat If timeOfDay is used and boundsPeriod.start or boundsPeriod.end states a time, it denotes the first or last administration and must therefore be one of the timeOfDay values of the resource. The time is compared as stated, so it has to be given in Europe/Berlin local time with the matching offset. Known limitation: this invariant does not validate the offset or convert time zones; applications must check consistency with Europe/Berlin separately. timeOfDay.empty() or (bounds.ofType(Period).start | bounds.ofType(Period).end) .where(toString().length() > 10) .all( toString().substring(11, 8) in ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).timing.repeat.timeOfDay.select(toString().substring(0, 8)) )
TimingBoundsPeriodNotForWhen error Timing.repeat If when is used, or dayOfWeek is used without timeOfDay, boundsPeriod.start and boundsPeriod.end may only state a date, not a time. (when.empty() and (dayOfWeek.empty() or timeOfDay.exists())) or (bounds.ofType(Period).start | bounds.ofType(Period).end).all(toString().length() <= 10)
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'. This also rules out combining a variable frequency with a variable period, such as '1 to 3 times every 2 to 3 days', because frequencyMax and periodMax are then both greater than 1. /* 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'. This also rules out combining a variable frequency with a variable period, such as '1 to 3 times every 2 to 3 days', because frequencyMax and periodMax are then both greater than 1. /* 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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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. /* Alle Dosage-Elemente tragen denselben Zeitrahmen: keines, alle dieselbe Dauer oder alle denselben Zeitraum (Start und Ende jeweils bei allen gleich oder bei allen fehlend). Die Textgenerierung liest den Zeitrahmen nur aus dem ersten Element. */ (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Duration).empty() and timing.repeat.bounds.ofType(Period).empty()) or ( (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Duration).exists()) and (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).timing.repeat.bounds.ofType(Duration).value.distinct().count() = 1 and (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).timing.repeat.bounds.ofType(Duration).code.distinct().count() = 1 ) or ( (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).exists()) and ( (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).start.exists()) or (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).start.empty()) ) and ( (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).end.exists()) or (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).end.empty()) ) and (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).timing.repeat.bounds.ofType(Period).start.distinct().count() <= 1 and (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).timing.repeat.bounds.ofType(Period).end.distinct().count() <= 1 )
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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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, periodMax and periodUnit (periodMax either in all elements or in none), and each timeOfDay or when value must be unique across them. /* Detect Interval and Time/4-Schema */ ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.all(timing.repeat.period.exists() and timing.repeat.periodUnit.exists()) and %resource.dosageInstruction.timing.repeat.period.distinct().count() = 1 and %resource.dosageInstruction.timing.repeat.periodUnit.distinct().count() = 1 and ( %resource.dosageInstruction.all(timing.repeat.periodMax.exists()) or %resource.dosageInstruction.all(timing.repeat.periodMax.empty()) ) and %resource.dosageInstruction.timing.repeat.periodMax.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.all(timing.repeat.period.exists() and timing.repeat.periodUnit.exists()) and %resource.dosage.timing.repeat.period.distinct().count() = 1 and %resource.dosage.timing.repeat.periodUnit.distinct().count() = 1 and ( %resource.dosage.all(timing.repeat.periodMax.exists()) or %resource.dosage.all(timing.repeat.periodMax.empty()) ) and %resource.dosage.timing.repeat.periodMax.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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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' and period = 1) 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 (without dayOfWeek), the times must be modelled in a single Dosage element, both for daily dosing and in an interval combination. Multiple Dosage elements are only allowed if every element carries a distinct dose, including its data type. ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).all( ( timing.repeat.dayOfWeek.empty() and timing.repeat.timeOfDay.exists() and timing.repeat.when.empty() ) implies ( ( ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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 (without dayOfWeek), the times should be modelled in a single Dosage element, both for daily dosing and in an interval combination. Multiple Dosage elements are only allowed if every element carries a distinct dose, including its data type. ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).all( ( timing.repeat.dayOfWeek.empty() and timing.repeat.timeOfDay.exists() and timing.repeat.when.empty() ) implies ( ( ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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 (without dayOfWeek), the times of day must be modelled in a single Dosage element, both for daily dosing and in an interval combination. Multiple Dosage elements are only allowed if every element carries a distinct dose, including its data type. ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).all( ( timing.repeat.dayOfWeek.empty() and timing.repeat.when.exists() and timing.repeat.timeOfDay.empty() ) implies ( ( ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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 (without dayOfWeek), the times of day should be modelled in a single Dosage element, both for daily dosing and in an interval combination. Multiple Dosage elements are only allowed if every element carries a distinct dose, including its data type. ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).all( ( timing.repeat.dayOfWeek.empty() and timing.repeat.when.exists() and timing.repeat.timeOfDay.empty() ) implies ( ( ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).where( timing.repeat.dayOfWeek.empty() and timing.repeat.when.exists() and timing.repeat.timeOfDay.empty() ).count() ) ) )
TimingValuesPositive error Timing.repeat period, periodMax and boundsDuration.value must be greater than 0. (period.exists() implies period > 0) and (periodMax.exists() implies periodMax > 0) and bounds.ofType(Duration).value.all($this > 0)
TimingValuesPositiveWarning warning Timing.repeat period, periodMax, boundsDuration.value and boundsRange.high.value should be greater than 0; boundsRange.low.value should not be negative. (period.exists() implies period > 0) and (periodMax.exists() implies periodMax > 0) and bounds.ofType(Duration).value.all($this > 0) and bounds.ofType(Range).low.value.all($this >= 0) and bounds.ofType(Range).high.value.all($this > 0)
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: doco
Timing C 0..* TimingDE A timing schedule that specifies an event that may occur multiple times
Constraints: TimingOnlyOnePeriodForDayOfWeek
Timing.event 0..0 When the event occurs
Timing.repeat C 1..1 Element Wann das Ereignis stattfinden soll
Constraints: TimingOnlyOneType, TimingIntervalOnlyOneFrequency, TimingOnlyOneWhen, TimingOnlyWhenOrTimeOfDay, TimingOnlyOneTimeOfDay, TimingOnlyOneDayOfWeek, TimingOnlyOneTimeForInterval, TimingOnlyOneBounds, TimingFrequencyCount, TimingPeriodUnit, TimingPeriodOnlyWholeNumber, TimingBoundsDurationOnlyWholeNumber, TimingBoundsPeriodMatchesTime, TimingBoundsPeriodNotForWhen, TimingBoundsPeriodFullDate, TimingValuesPositive, TimingFreqOrPeriodGtOne, TimingVarFreqGtMin, TimingVarPeriodGtMin, TimingSingleDosageForTimeOfDay, TimingSingleDosageForWhen, TimingBoundsUnitMatchesCode
Timing.repeat.bounds[x] 0..1 Länge/Bereich der Längen oder (Start- und/oder End-)Grenzen
Timing.repeat.bounds[x].boundsDuration Duration
Timing.repeat.bounds[x].boundsPeriod Period
Timing.repeat.Slices for bounds[x] Content/Rules for all slices
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration 0..1 Duration Dauer der Dosieranweisung ausgedrückt in UCUM-Einheiten
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.value 1..1 decimal Numerical value (with implicit precision)
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.comparator 0..0 < | <= | >= | > - how to understand the value
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.unit 1..1 string Unit representation
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.system 1..1 uri UCUM-Einheit für die Dauer
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.code 1..1 code Coded form of the unit
Binding: Duration UnitsOfTime dgMP ValueSet (required)
Timing.repeat.Slices for bounds[x].bounds[x]:boundsPeriod 0..1 Period Start- und Endzeitpunkt der Dosieranweisung.
Timing.repeat.Slices for bounds[x].bounds[x]:boundsPeriod.start 0..1 dateTime Startdatum mit optionaler Uhrzeit und Zeitzone
Timing.repeat.Slices for bounds[x].bounds[x]:boundsPeriod.end 0..1 dateTime Enddatum mit optionaler Uhrzeit und Zeitzone
Timing.repeat.count 0..0 Number of times to repeat
Timing.repeat.countMax 0..0 Maximum number of times to repeat
Timing.repeat.duration 0..0 How long when it happens
Timing.repeat.durationMax 0..0 How long when it happens (Max)
Timing.repeat.durationUnit 0..0 s | min | h | d | wk | mo | a - unit of time (UCUM)
Timing.repeat.periodUnit 0..1 code min | h | d | wk | mo - Zeiteinheit (UCUM)
Binding: Period UnitsOfTime dgMP ValueSet (required)
Timing.repeat.when 0..* code Code für den Zeitraum des Auftretens
Binding: Timing When dgMP (required)
Timing.repeat.offset 0..0 Zeitversatz
Timing.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
TimingBoundsPeriodFullDate error Timing.repeat boundsPeriod.start and boundsPeriod.end must state a full calendar date (YYYY-MM-DD, optionally with a time). FHIR dateTime also allows YYYY and YYYY-MM; the dosage text renders dates as DD.MM.YYYY and cannot represent a partial date. (bounds.ofType(Period).start | bounds.ofType(Period).end).all(toString().length() >= 10)
TimingBoundsPeriodMatchesTime error Timing.repeat If timeOfDay is used and boundsPeriod.start or boundsPeriod.end states a time, it denotes the first or last administration and must therefore be one of the timeOfDay values of the resource. The time is compared as stated, so it has to be given in Europe/Berlin local time with the matching offset. Known limitation: this invariant does not validate the offset or convert time zones; applications must check consistency with Europe/Berlin separately. timeOfDay.empty() or (bounds.ofType(Period).start | bounds.ofType(Period).end) .where(toString().length() > 10) .all( toString().substring(11, 8) in ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).timing.repeat.timeOfDay.select(toString().substring(0, 8)) )
TimingBoundsPeriodNotForWhen error Timing.repeat If when is used, or dayOfWeek is used without timeOfDay, boundsPeriod.start and boundsPeriod.end may only state a date, not a time. (when.empty() and (dayOfWeek.empty() or timeOfDay.exists())) or (bounds.ofType(Period).start | bounds.ofType(Period).end).all(toString().length() <= 10)
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'. This also rules out combining a variable frequency with a variable period, such as '1 to 3 times every 2 to 3 days', because frequencyMax and periodMax are then both greater than 1. /* 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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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. /* Alle Dosage-Elemente tragen denselben Zeitrahmen: keines, alle dieselbe Dauer oder alle denselben Zeitraum (Start und Ende jeweils bei allen gleich oder bei allen fehlend). Die Textgenerierung liest den Zeitrahmen nur aus dem ersten Element. */ (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Duration).empty() and timing.repeat.bounds.ofType(Period).empty()) or ( (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Duration).exists()) and (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).timing.repeat.bounds.ofType(Duration).value.distinct().count() = 1 and (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).timing.repeat.bounds.ofType(Duration).code.distinct().count() = 1 ) or ( (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).exists()) and ( (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).start.exists()) or (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).start.empty()) ) and ( (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).end.exists()) or (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).end.empty()) ) and (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).timing.repeat.bounds.ofType(Period).start.distinct().count() <= 1 and (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).timing.repeat.bounds.ofType(Period).end.distinct().count() <= 1 )
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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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, periodMax and periodUnit (periodMax either in all elements or in none), and each timeOfDay or when value must be unique across them. /* Detect Interval and Time/4-Schema */ ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.all(timing.repeat.period.exists() and timing.repeat.periodUnit.exists()) and %resource.dosageInstruction.timing.repeat.period.distinct().count() = 1 and %resource.dosageInstruction.timing.repeat.periodUnit.distinct().count() = 1 and ( %resource.dosageInstruction.all(timing.repeat.periodMax.exists()) or %resource.dosageInstruction.all(timing.repeat.periodMax.empty()) ) and %resource.dosageInstruction.timing.repeat.periodMax.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.all(timing.repeat.period.exists() and timing.repeat.periodUnit.exists()) and %resource.dosage.timing.repeat.period.distinct().count() = 1 and %resource.dosage.timing.repeat.periodUnit.distinct().count() = 1 and ( %resource.dosage.all(timing.repeat.periodMax.exists()) or %resource.dosage.all(timing.repeat.periodMax.empty()) ) and %resource.dosage.timing.repeat.periodMax.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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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' and period = 1) 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 (without dayOfWeek), the times must be modelled in a single Dosage element, both for daily dosing and in an interval combination. Multiple Dosage elements are only allowed if every element carries a distinct dose, including its data type. ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).all( ( timing.repeat.dayOfWeek.empty() and timing.repeat.timeOfDay.exists() and timing.repeat.when.empty() ) implies ( ( ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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 (without dayOfWeek), the times of day must be modelled in a single Dosage element, both for daily dosing and in an interval combination. Multiple Dosage elements are only allowed if every element carries a distinct dose, including its data type. ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).all( ( timing.repeat.dayOfWeek.empty() and timing.repeat.when.exists() and timing.repeat.timeOfDay.empty() ) implies ( ( ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).where( timing.repeat.dayOfWeek.empty() and timing.repeat.when.exists() and timing.repeat.timeOfDay.empty() ).count() ) ) )
TimingValuesPositive error Timing.repeat period, periodMax and boundsDuration.value must be greater than 0. (period.exists() implies period > 0) and (periodMax.exists() implies periodMax > 0) and bounds.ofType(Duration).value.all($this > 0)
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: doco
Timing C 0..* TimingDE A timing schedule that specifies an event that may occur multiple times
Constraints: TimingOnlyOnePeriodForDayOfWeek
Timing.id 0..1 string Unique id for inter-element referencing
Timing.extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
Timing.modifierExtension This element is a modifier element. This element is included in summaries. 0..* Extension Extensions that cannot be ignored even if unrecognized
Timing.repeat This element must be supported. This element is included in summaries. 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, TimingValuesPositiveWarning, TimingOnlyOneType, TimingIntervalOnlyOneFrequency, TimingOnlyOneWhen, TimingOnlyWhenOrTimeOfDay, TimingOnlyOneTimeOfDay, TimingOnlyOneDayOfWeek, TimingOnlyOneTimeForInterval, TimingOnlyOneBounds, TimingFrequencyCount, TimingPeriodUnit, TimingPeriodOnlyWholeNumber, TimingBoundsDurationOnlyWholeNumber, TimingBoundsPeriodMatchesTime, TimingBoundsPeriodNotForWhen, TimingBoundsPeriodFullDate, TimingValuesPositive, TimingFreqOrPeriodGtOne, TimingVarFreqGtMin, TimingVarPeriodGtMin, TimingSingleDosageForTimeOfDay, TimingSingleDosageForWhen, TimingBoundsUnitMatchesCode
Timing.repeat.id 0..1 string Unique id for inter-element referencing
Timing.repeat.extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
Timing.repeat.Slices for bounds[x] This element must be supported. This element is included in summaries. 0..1 Länge/Bereich der Längen oder (Start- und/oder End-)Grenzen
Slice: Unordered, Closed by type:$this
Slicing Note: The rules on this element (including its children) apply to all the slices, but are not repeated in them
Timing.repeat.Slices for bounds[x].boundsDuration Duration
Timing.repeat.Slices for bounds[x].boundsPeriod Period
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration This element must be supported. This element is included in summaries. 0..1 Duration Dauer der Dosieranweisung ausgedrückt in UCUM-Einheiten
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.id 0..1 string Unique id for inter-element referencing
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.value This element must be supported. This element is included in summaries. 1..1 decimal Numerical value (with implicit precision)
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.unit This element must be supported. This element is included in summaries. 1..1 string Unit representation
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.system This element must be supported. This element is included in summaries. C 1..1 uri UCUM-Einheit für die Dauer
Fixed Value: http://unitsofmeasure.org (no extensions allowed)
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.code This element must be supported. This element is included in summaries. 1..1 code Coded form of the unit
Binding: Duration UnitsOfTime dgMP ValueSet (required)
Timing.repeat.Slices for bounds[x].bounds[x]:boundsPeriod This element must be supported. This element is included in summaries. 0..1 Period Start- und Endzeitpunkt der Dosieranweisung.
Timing.repeat.Slices for bounds[x].bounds[x]:boundsPeriod.id 0..1 string Unique id for inter-element referencing
Timing.repeat.Slices for bounds[x].bounds[x]:boundsPeriod.extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
Timing.repeat.Slices for bounds[x].bounds[x]:boundsPeriod.start This element must be supported. This element is included in summaries. C 0..1 dateTime Startdatum mit optionaler Uhrzeit und Zeitzone
Timing.repeat.Slices for bounds[x].bounds[x]:boundsPeriod.end This element must be supported. This element is included in summaries. C 0..1 dateTime Enddatum mit optionaler Uhrzeit und Zeitzone
Timing.repeat.frequency This element must be supported. This element is included in summaries. 0..1 positiveInt Ereignis tritt frequency-mal pro Zeitraum auf
Timing.repeat.frequencyMax This element must be supported. This element is included in summaries. 0..1 positiveInt Event occurs up to frequencyMax times per period
Timing.repeat.period This element must be supported. This element is included in summaries. 0..1 decimal Ereignis tritt frequency-mal pro Zeitraum auf
Timing.repeat.periodMax This element must be supported. This element is included in summaries. 0..1 decimal Upper limit of period (3-4 hours)
Timing.repeat.periodUnit This element must be supported. This element is included in summaries. 0..1 code min | h | d | wk | mo - Zeiteinheit (UCUM)
Binding: Period UnitsOfTime dgMP ValueSet (required)
Timing.repeat.dayOfWeek This element must be supported. This element is included in summaries. 0..* code mon | tue | wed | thu | fri | sat | sun
Binding: DaysOfWeek (required)
Timing.repeat.timeOfDay This element must be supported. This element is included in summaries. 0..* time Tageszeit für die Aktion
Timing.repeat.when This element must be supported. This element is included in summaries. 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
TimingBoundsPeriodFullDate error Timing.repeat boundsPeriod.start and boundsPeriod.end must state a full calendar date (YYYY-MM-DD, optionally with a time). FHIR dateTime also allows YYYY and YYYY-MM; the dosage text renders dates as DD.MM.YYYY and cannot represent a partial date. (bounds.ofType(Period).start | bounds.ofType(Period).end).all(toString().length() >= 10)
TimingBoundsPeriodMatchesTime error Timing.repeat If timeOfDay is used and boundsPeriod.start or boundsPeriod.end states a time, it denotes the first or last administration and must therefore be one of the timeOfDay values of the resource. The time is compared as stated, so it has to be given in Europe/Berlin local time with the matching offset. Known limitation: this invariant does not validate the offset or convert time zones; applications must check consistency with Europe/Berlin separately. timeOfDay.empty() or (bounds.ofType(Period).start | bounds.ofType(Period).end) .where(toString().length() > 10) .all( toString().substring(11, 8) in ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).timing.repeat.timeOfDay.select(toString().substring(0, 8)) )
TimingBoundsPeriodNotForWhen error Timing.repeat If when is used, or dayOfWeek is used without timeOfDay, boundsPeriod.start and boundsPeriod.end may only state a date, not a time. (when.empty() and (dayOfWeek.empty() or timeOfDay.exists())) or (bounds.ofType(Period).start | bounds.ofType(Period).end).all(toString().length() <= 10)
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'. This also rules out combining a variable frequency with a variable period, such as '1 to 3 times every 2 to 3 days', because frequencyMax and periodMax are then both greater than 1. /* 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'. This also rules out combining a variable frequency with a variable period, such as '1 to 3 times every 2 to 3 days', because frequencyMax and periodMax are then both greater than 1. /* 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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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. /* Alle Dosage-Elemente tragen denselben Zeitrahmen: keines, alle dieselbe Dauer oder alle denselben Zeitraum (Start und Ende jeweils bei allen gleich oder bei allen fehlend). Die Textgenerierung liest den Zeitrahmen nur aus dem ersten Element. */ (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Duration).empty() and timing.repeat.bounds.ofType(Period).empty()) or ( (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Duration).exists()) and (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).timing.repeat.bounds.ofType(Duration).value.distinct().count() = 1 and (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).timing.repeat.bounds.ofType(Duration).code.distinct().count() = 1 ) or ( (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).exists()) and ( (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).start.exists()) or (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).start.empty()) ) and ( (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).end.exists()) or (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).end.empty()) ) and (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).timing.repeat.bounds.ofType(Period).start.distinct().count() <= 1 and (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).timing.repeat.bounds.ofType(Period).end.distinct().count() <= 1 )
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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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, periodMax and periodUnit (periodMax either in all elements or in none), and each timeOfDay or when value must be unique across them. /* Detect Interval and Time/4-Schema */ ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.all(timing.repeat.period.exists() and timing.repeat.periodUnit.exists()) and %resource.dosageInstruction.timing.repeat.period.distinct().count() = 1 and %resource.dosageInstruction.timing.repeat.periodUnit.distinct().count() = 1 and ( %resource.dosageInstruction.all(timing.repeat.periodMax.exists()) or %resource.dosageInstruction.all(timing.repeat.periodMax.empty()) ) and %resource.dosageInstruction.timing.repeat.periodMax.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.all(timing.repeat.period.exists() and timing.repeat.periodUnit.exists()) and %resource.dosage.timing.repeat.period.distinct().count() = 1 and %resource.dosage.timing.repeat.periodUnit.distinct().count() = 1 and ( %resource.dosage.all(timing.repeat.periodMax.exists()) or %resource.dosage.all(timing.repeat.periodMax.empty()) ) and %resource.dosage.timing.repeat.periodMax.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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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' and period = 1) 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 (without dayOfWeek), the times must be modelled in a single Dosage element, both for daily dosing and in an interval combination. Multiple Dosage elements are only allowed if every element carries a distinct dose, including its data type. ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).all( ( timing.repeat.dayOfWeek.empty() and timing.repeat.timeOfDay.exists() and timing.repeat.when.empty() ) implies ( ( ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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 (without dayOfWeek), the times should be modelled in a single Dosage element, both for daily dosing and in an interval combination. Multiple Dosage elements are only allowed if every element carries a distinct dose, including its data type. ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).all( ( timing.repeat.dayOfWeek.empty() and timing.repeat.timeOfDay.exists() and timing.repeat.when.empty() ) implies ( ( ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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 (without dayOfWeek), the times of day must be modelled in a single Dosage element, both for daily dosing and in an interval combination. Multiple Dosage elements are only allowed if every element carries a distinct dose, including its data type. ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).all( ( timing.repeat.dayOfWeek.empty() and timing.repeat.when.exists() and timing.repeat.timeOfDay.empty() ) implies ( ( ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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 (without dayOfWeek), the times of day should be modelled in a single Dosage element, both for daily dosing and in an interval combination. Multiple Dosage elements are only allowed if every element carries a distinct dose, including its data type. ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).all( ( timing.repeat.dayOfWeek.empty() and timing.repeat.when.exists() and timing.repeat.timeOfDay.empty() ) implies ( ( ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).where( timing.repeat.dayOfWeek.empty() and timing.repeat.when.exists() and timing.repeat.timeOfDay.empty() ).count() ) ) )
TimingValuesPositive error Timing.repeat period, periodMax and boundsDuration.value must be greater than 0. (period.exists() implies period > 0) and (periodMax.exists() implies periodMax > 0) and bounds.ofType(Duration).value.all($this > 0)
TimingValuesPositiveWarning warning Timing.repeat period, periodMax, boundsDuration.value and boundsRange.high.value should be greater than 0; boundsRange.low.value should not be negative. (period.exists() implies period > 0) and (periodMax.exists() implies periodMax > 0) and bounds.ofType(Duration).value.all($this > 0) and bounds.ofType(Range).low.value.all($this >= 0) and bounds.ofType(Range).high.value.all($this > 0)
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: doco
Timing C 0..* TimingDE A timing schedule that specifies an event that may occur multiple times
Constraints: TimingOnlyOnePeriodForDayOfWeek
Timing.modifierExtension This element is a modifier element. This element is included in summaries. 0..* Extension Extensions that cannot be ignored even if unrecognized
Timing.repeat This element must be supported. This element is included in summaries. 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, TimingValuesPositiveWarning, TimingOnlyOneType, TimingIntervalOnlyOneFrequency, TimingOnlyOneWhen, TimingOnlyWhenOrTimeOfDay, TimingOnlyOneTimeOfDay, TimingOnlyOneDayOfWeek, TimingOnlyOneTimeForInterval, TimingOnlyOneBounds, TimingFrequencyCount, TimingPeriodUnit, TimingPeriodOnlyWholeNumber, TimingBoundsDurationOnlyWholeNumber, TimingBoundsPeriodMatchesTime, TimingBoundsPeriodNotForWhen, TimingBoundsPeriodFullDate, TimingValuesPositive, TimingFreqOrPeriodGtOne, TimingVarFreqGtMin, TimingVarPeriodGtMin, TimingSingleDosageForTimeOfDay, TimingSingleDosageForWhen, TimingBoundsUnitMatchesCode
Timing.repeat.Slices for bounds[x] This element must be supported. This element is included in summaries. 0..1 Länge/Bereich der Längen oder (Start- und/oder End-)Grenzen
Slice: Unordered, Closed by type:$this
Slicing Note: The rules on this element (including its children) apply to all the slices, but are not repeated in them
Timing.repeat.Slices for bounds[x].boundsDuration Duration
Timing.repeat.Slices for bounds[x].boundsPeriod Period
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration This element must be supported. This element is included in summaries. 0..1 Duration Dauer der Dosieranweisung ausgedrückt in UCUM-Einheiten
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.value This element must be supported. This element is included in summaries. 1..1 decimal Numerical value (with implicit precision)
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.unit This element must be supported. This element is included in summaries. 1..1 string Unit representation
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.system This element must be supported. This element is included in summaries. C 1..1 uri UCUM-Einheit für die Dauer
Fixed Value: http://unitsofmeasure.org (no extensions allowed)
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.code This element must be supported. This element is included in summaries. 1..1 code Coded form of the unit
Binding: Duration UnitsOfTime dgMP ValueSet (required)
Timing.repeat.Slices for bounds[x].bounds[x]:boundsPeriod This element must be supported. This element is included in summaries. 0..1 Period Start- und Endzeitpunkt der Dosieranweisung.
Timing.repeat.Slices for bounds[x].bounds[x]:boundsPeriod.start This element must be supported. This element is included in summaries. C 0..1 dateTime Startdatum mit optionaler Uhrzeit und Zeitzone
Timing.repeat.Slices for bounds[x].bounds[x]:boundsPeriod.end This element must be supported. This element is included in summaries. C 0..1 dateTime Enddatum mit optionaler Uhrzeit und Zeitzone
Timing.repeat.frequency This element must be supported. This element is included in summaries. 0..1 positiveInt Ereignis tritt frequency-mal pro Zeitraum auf
Timing.repeat.frequencyMax This element must be supported. This element is included in summaries. 0..1 positiveInt Event occurs up to frequencyMax times per period
Timing.repeat.period This element must be supported. This element is included in summaries. 0..1 decimal Ereignis tritt frequency-mal pro Zeitraum auf
Timing.repeat.periodMax This element must be supported. This element is included in summaries. 0..1 decimal Upper limit of period (3-4 hours)
Timing.repeat.periodUnit This element must be supported. This element is included in summaries. 0..1 code min | h | d | wk | mo - Zeiteinheit (UCUM)
Binding: Period UnitsOfTime dgMP ValueSet (required)
Timing.repeat.dayOfWeek This element must be supported. This element is included in summaries. 0..* code mon | tue | wed | thu | fri | sat | sun
Binding: DaysOfWeek (required)
Timing.repeat.timeOfDay This element must be supported. This element is included in summaries. 0..* time Tageszeit für die Aktion
Timing.repeat.when This element must be supported. This element is included in summaries. 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
TimingBoundsPeriodFullDate error Timing.repeat boundsPeriod.start and boundsPeriod.end must state a full calendar date (YYYY-MM-DD, optionally with a time). FHIR dateTime also allows YYYY and YYYY-MM; the dosage text renders dates as DD.MM.YYYY and cannot represent a partial date. (bounds.ofType(Period).start | bounds.ofType(Period).end).all(toString().length() >= 10)
TimingBoundsPeriodMatchesTime error Timing.repeat If timeOfDay is used and boundsPeriod.start or boundsPeriod.end states a time, it denotes the first or last administration and must therefore be one of the timeOfDay values of the resource. The time is compared as stated, so it has to be given in Europe/Berlin local time with the matching offset. Known limitation: this invariant does not validate the offset or convert time zones; applications must check consistency with Europe/Berlin separately. timeOfDay.empty() or (bounds.ofType(Period).start | bounds.ofType(Period).end) .where(toString().length() > 10) .all( toString().substring(11, 8) in ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).timing.repeat.timeOfDay.select(toString().substring(0, 8)) )
TimingBoundsPeriodNotForWhen error Timing.repeat If when is used, or dayOfWeek is used without timeOfDay, boundsPeriod.start and boundsPeriod.end may only state a date, not a time. (when.empty() and (dayOfWeek.empty() or timeOfDay.exists())) or (bounds.ofType(Period).start | bounds.ofType(Period).end).all(toString().length() <= 10)
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'. This also rules out combining a variable frequency with a variable period, such as '1 to 3 times every 2 to 3 days', because frequencyMax and periodMax are then both greater than 1. /* 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'. This also rules out combining a variable frequency with a variable period, such as '1 to 3 times every 2 to 3 days', because frequencyMax and periodMax are then both greater than 1. /* 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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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. /* Alle Dosage-Elemente tragen denselben Zeitrahmen: keines, alle dieselbe Dauer oder alle denselben Zeitraum (Start und Ende jeweils bei allen gleich oder bei allen fehlend). Die Textgenerierung liest den Zeitrahmen nur aus dem ersten Element. */ (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Duration).empty() and timing.repeat.bounds.ofType(Period).empty()) or ( (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Duration).exists()) and (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).timing.repeat.bounds.ofType(Duration).value.distinct().count() = 1 and (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).timing.repeat.bounds.ofType(Duration).code.distinct().count() = 1 ) or ( (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).exists()) and ( (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).start.exists()) or (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).start.empty()) ) and ( (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).end.exists()) or (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).end.empty()) ) and (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).timing.repeat.bounds.ofType(Period).start.distinct().count() <= 1 and (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).timing.repeat.bounds.ofType(Period).end.distinct().count() <= 1 )
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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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, periodMax and periodUnit (periodMax either in all elements or in none), and each timeOfDay or when value must be unique across them. /* Detect Interval and Time/4-Schema */ ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.all(timing.repeat.period.exists() and timing.repeat.periodUnit.exists()) and %resource.dosageInstruction.timing.repeat.period.distinct().count() = 1 and %resource.dosageInstruction.timing.repeat.periodUnit.distinct().count() = 1 and ( %resource.dosageInstruction.all(timing.repeat.periodMax.exists()) or %resource.dosageInstruction.all(timing.repeat.periodMax.empty()) ) and %resource.dosageInstruction.timing.repeat.periodMax.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.all(timing.repeat.period.exists() and timing.repeat.periodUnit.exists()) and %resource.dosage.timing.repeat.period.distinct().count() = 1 and %resource.dosage.timing.repeat.periodUnit.distinct().count() = 1 and ( %resource.dosage.all(timing.repeat.periodMax.exists()) or %resource.dosage.all(timing.repeat.periodMax.empty()) ) and %resource.dosage.timing.repeat.periodMax.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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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' and period = 1) 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 (without dayOfWeek), the times must be modelled in a single Dosage element, both for daily dosing and in an interval combination. Multiple Dosage elements are only allowed if every element carries a distinct dose, including its data type. ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).all( ( timing.repeat.dayOfWeek.empty() and timing.repeat.timeOfDay.exists() and timing.repeat.when.empty() ) implies ( ( ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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 (without dayOfWeek), the times should be modelled in a single Dosage element, both for daily dosing and in an interval combination. Multiple Dosage elements are only allowed if every element carries a distinct dose, including its data type. ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).all( ( timing.repeat.dayOfWeek.empty() and timing.repeat.timeOfDay.exists() and timing.repeat.when.empty() ) implies ( ( ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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 (without dayOfWeek), the times of day must be modelled in a single Dosage element, both for daily dosing and in an interval combination. Multiple Dosage elements are only allowed if every element carries a distinct dose, including its data type. ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).all( ( timing.repeat.dayOfWeek.empty() and timing.repeat.when.exists() and timing.repeat.timeOfDay.empty() ) implies ( ( ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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 (without dayOfWeek), the times of day should be modelled in a single Dosage element, both for daily dosing and in an interval combination. Multiple Dosage elements are only allowed if every element carries a distinct dose, including its data type. ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).all( ( timing.repeat.dayOfWeek.empty() and timing.repeat.when.exists() and timing.repeat.timeOfDay.empty() ) implies ( ( ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).where( timing.repeat.dayOfWeek.empty() and timing.repeat.when.exists() and timing.repeat.timeOfDay.empty() ).count() ) ) )
TimingValuesPositive error Timing.repeat period, periodMax and boundsDuration.value must be greater than 0. (period.exists() implies period > 0) and (periodMax.exists() implies periodMax > 0) and bounds.ofType(Duration).value.all($this > 0)
TimingValuesPositiveWarning warning Timing.repeat period, periodMax, boundsDuration.value and boundsRange.high.value should be greater than 0; boundsRange.low.value should not be negative. (period.exists() implies period > 0) and (periodMax.exists() implies periodMax > 0) and bounds.ofType(Duration).value.all($this > 0) and bounds.ofType(Range).low.value.all($this >= 0) and bounds.ofType(Range).high.value.all($this > 0)
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: doco
Timing C 0..* TimingDE A timing schedule that specifies an event that may occur multiple times
Constraints: TimingOnlyOnePeriodForDayOfWeek
Timing.event 0..0 When the event occurs
Timing.repeat C 1..1 Element Wann das Ereignis stattfinden soll
Constraints: TimingOnlyOneType, TimingIntervalOnlyOneFrequency, TimingOnlyOneWhen, TimingOnlyWhenOrTimeOfDay, TimingOnlyOneTimeOfDay, TimingOnlyOneDayOfWeek, TimingOnlyOneTimeForInterval, TimingOnlyOneBounds, TimingFrequencyCount, TimingPeriodUnit, TimingPeriodOnlyWholeNumber, TimingBoundsDurationOnlyWholeNumber, TimingBoundsPeriodMatchesTime, TimingBoundsPeriodNotForWhen, TimingBoundsPeriodFullDate, TimingValuesPositive, TimingFreqOrPeriodGtOne, TimingVarFreqGtMin, TimingVarPeriodGtMin, TimingSingleDosageForTimeOfDay, TimingSingleDosageForWhen, TimingBoundsUnitMatchesCode
Timing.repeat.bounds[x] 0..1 Länge/Bereich der Längen oder (Start- und/oder End-)Grenzen
Timing.repeat.bounds[x].boundsDuration Duration
Timing.repeat.bounds[x].boundsPeriod Period
Timing.repeat.Slices for bounds[x] Content/Rules for all slices
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration 0..1 Duration Dauer der Dosieranweisung ausgedrückt in UCUM-Einheiten
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.value 1..1 decimal Numerical value (with implicit precision)
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.comparator 0..0 < | <= | >= | > - how to understand the value
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.unit 1..1 string Unit representation
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.system 1..1 uri UCUM-Einheit für die Dauer
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.code 1..1 code Coded form of the unit
Binding: Duration UnitsOfTime dgMP ValueSet (required)
Timing.repeat.Slices for bounds[x].bounds[x]:boundsPeriod 0..1 Period Start- und Endzeitpunkt der Dosieranweisung.
Timing.repeat.Slices for bounds[x].bounds[x]:boundsPeriod.start 0..1 dateTime Startdatum mit optionaler Uhrzeit und Zeitzone
Timing.repeat.Slices for bounds[x].bounds[x]:boundsPeriod.end 0..1 dateTime Enddatum mit optionaler Uhrzeit und Zeitzone
Timing.repeat.count 0..0 Number of times to repeat
Timing.repeat.countMax 0..0 Maximum number of times to repeat
Timing.repeat.duration 0..0 How long when it happens
Timing.repeat.durationMax 0..0 How long when it happens (Max)
Timing.repeat.durationUnit 0..0 s | min | h | d | wk | mo | a - unit of time (UCUM)
Timing.repeat.periodUnit 0..1 code min | h | d | wk | mo - Zeiteinheit (UCUM)
Binding: Period UnitsOfTime dgMP ValueSet (required)
Timing.repeat.when 0..* code Code für den Zeitraum des Auftretens
Binding: Timing When dgMP (required)
Timing.repeat.offset 0..0 Zeitversatz
Timing.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
TimingBoundsPeriodFullDate error Timing.repeat boundsPeriod.start and boundsPeriod.end must state a full calendar date (YYYY-MM-DD, optionally with a time). FHIR dateTime also allows YYYY and YYYY-MM; the dosage text renders dates as DD.MM.YYYY and cannot represent a partial date. (bounds.ofType(Period).start | bounds.ofType(Period).end).all(toString().length() >= 10)
TimingBoundsPeriodMatchesTime error Timing.repeat If timeOfDay is used and boundsPeriod.start or boundsPeriod.end states a time, it denotes the first or last administration and must therefore be one of the timeOfDay values of the resource. The time is compared as stated, so it has to be given in Europe/Berlin local time with the matching offset. Known limitation: this invariant does not validate the offset or convert time zones; applications must check consistency with Europe/Berlin separately. timeOfDay.empty() or (bounds.ofType(Period).start | bounds.ofType(Period).end) .where(toString().length() > 10) .all( toString().substring(11, 8) in ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).timing.repeat.timeOfDay.select(toString().substring(0, 8)) )
TimingBoundsPeriodNotForWhen error Timing.repeat If when is used, or dayOfWeek is used without timeOfDay, boundsPeriod.start and boundsPeriod.end may only state a date, not a time. (when.empty() and (dayOfWeek.empty() or timeOfDay.exists())) or (bounds.ofType(Period).start | bounds.ofType(Period).end).all(toString().length() <= 10)
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'. This also rules out combining a variable frequency with a variable period, such as '1 to 3 times every 2 to 3 days', because frequencyMax and periodMax are then both greater than 1. /* 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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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. /* Alle Dosage-Elemente tragen denselben Zeitrahmen: keines, alle dieselbe Dauer oder alle denselben Zeitraum (Start und Ende jeweils bei allen gleich oder bei allen fehlend). Die Textgenerierung liest den Zeitrahmen nur aus dem ersten Element. */ (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Duration).empty() and timing.repeat.bounds.ofType(Period).empty()) or ( (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Duration).exists()) and (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).timing.repeat.bounds.ofType(Duration).value.distinct().count() = 1 and (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).timing.repeat.bounds.ofType(Duration).code.distinct().count() = 1 ) or ( (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).exists()) and ( (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).start.exists()) or (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).start.empty()) ) and ( (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).end.exists()) or (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).end.empty()) ) and (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).timing.repeat.bounds.ofType(Period).start.distinct().count() <= 1 and (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).timing.repeat.bounds.ofType(Period).end.distinct().count() <= 1 )
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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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, periodMax and periodUnit (periodMax either in all elements or in none), and each timeOfDay or when value must be unique across them. /* Detect Interval and Time/4-Schema */ ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.all(timing.repeat.period.exists() and timing.repeat.periodUnit.exists()) and %resource.dosageInstruction.timing.repeat.period.distinct().count() = 1 and %resource.dosageInstruction.timing.repeat.periodUnit.distinct().count() = 1 and ( %resource.dosageInstruction.all(timing.repeat.periodMax.exists()) or %resource.dosageInstruction.all(timing.repeat.periodMax.empty()) ) and %resource.dosageInstruction.timing.repeat.periodMax.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.all(timing.repeat.period.exists() and timing.repeat.periodUnit.exists()) and %resource.dosage.timing.repeat.period.distinct().count() = 1 and %resource.dosage.timing.repeat.periodUnit.distinct().count() = 1 and ( %resource.dosage.all(timing.repeat.periodMax.exists()) or %resource.dosage.all(timing.repeat.periodMax.empty()) ) and %resource.dosage.timing.repeat.periodMax.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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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' and period = 1) 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 (without dayOfWeek), the times must be modelled in a single Dosage element, both for daily dosing and in an interval combination. Multiple Dosage elements are only allowed if every element carries a distinct dose, including its data type. ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).all( ( timing.repeat.dayOfWeek.empty() and timing.repeat.timeOfDay.exists() and timing.repeat.when.empty() ) implies ( ( ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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 (without dayOfWeek), the times of day must be modelled in a single Dosage element, both for daily dosing and in an interval combination. Multiple Dosage elements are only allowed if every element carries a distinct dose, including its data type. ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).all( ( timing.repeat.dayOfWeek.empty() and timing.repeat.when.exists() and timing.repeat.timeOfDay.empty() ) implies ( ( ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).where( timing.repeat.dayOfWeek.empty() and timing.repeat.when.exists() and timing.repeat.timeOfDay.empty() ).count() ) ) )
TimingValuesPositive error Timing.repeat period, periodMax and boundsDuration.value must be greater than 0. (period.exists() implies period > 0) and (periodMax.exists() implies periodMax > 0) and bounds.ofType(Duration).value.all($this > 0)
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: doco
Timing C 0..* TimingDE A timing schedule that specifies an event that may occur multiple times
Constraints: TimingOnlyOnePeriodForDayOfWeek
Timing.id 0..1 string Unique id for inter-element referencing
Timing.extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
Timing.modifierExtension This element is a modifier element. This element is included in summaries. 0..* Extension Extensions that cannot be ignored even if unrecognized
Timing.repeat This element must be supported. This element is included in summaries. 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, TimingValuesPositiveWarning, TimingOnlyOneType, TimingIntervalOnlyOneFrequency, TimingOnlyOneWhen, TimingOnlyWhenOrTimeOfDay, TimingOnlyOneTimeOfDay, TimingOnlyOneDayOfWeek, TimingOnlyOneTimeForInterval, TimingOnlyOneBounds, TimingFrequencyCount, TimingPeriodUnit, TimingPeriodOnlyWholeNumber, TimingBoundsDurationOnlyWholeNumber, TimingBoundsPeriodMatchesTime, TimingBoundsPeriodNotForWhen, TimingBoundsPeriodFullDate, TimingValuesPositive, TimingFreqOrPeriodGtOne, TimingVarFreqGtMin, TimingVarPeriodGtMin, TimingSingleDosageForTimeOfDay, TimingSingleDosageForWhen, TimingBoundsUnitMatchesCode
Timing.repeat.id 0..1 string Unique id for inter-element referencing
Timing.repeat.extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
Timing.repeat.Slices for bounds[x] This element must be supported. This element is included in summaries. 0..1 Länge/Bereich der Längen oder (Start- und/oder End-)Grenzen
Slice: Unordered, Closed by type:$this
Slicing Note: The rules on this element (including its children) apply to all the slices, but are not repeated in them
Timing.repeat.Slices for bounds[x].boundsDuration Duration
Timing.repeat.Slices for bounds[x].boundsPeriod Period
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration This element must be supported. This element is included in summaries. 0..1 Duration Dauer der Dosieranweisung ausgedrückt in UCUM-Einheiten
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.id 0..1 string Unique id for inter-element referencing
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.value This element must be supported. This element is included in summaries. 1..1 decimal Numerical value (with implicit precision)
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.unit This element must be supported. This element is included in summaries. 1..1 string Unit representation
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.system This element must be supported. This element is included in summaries. C 1..1 uri UCUM-Einheit für die Dauer
Fixed Value: http://unitsofmeasure.org (no extensions allowed)
Timing.repeat.Slices for bounds[x].bounds[x]:boundsDuration.code This element must be supported. This element is included in summaries. 1..1 code Coded form of the unit
Binding: Duration UnitsOfTime dgMP ValueSet (required)
Timing.repeat.Slices for bounds[x].bounds[x]:boundsPeriod This element must be supported. This element is included in summaries. 0..1 Period Start- und Endzeitpunkt der Dosieranweisung.
Timing.repeat.Slices for bounds[x].bounds[x]:boundsPeriod.id 0..1 string Unique id for inter-element referencing
Timing.repeat.Slices for bounds[x].bounds[x]:boundsPeriod.extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
Timing.repeat.Slices for bounds[x].bounds[x]:boundsPeriod.start This element must be supported. This element is included in summaries. C 0..1 dateTime Startdatum mit optionaler Uhrzeit und Zeitzone
Timing.repeat.Slices for bounds[x].bounds[x]:boundsPeriod.end This element must be supported. This element is included in summaries. C 0..1 dateTime Enddatum mit optionaler Uhrzeit und Zeitzone
Timing.repeat.frequency This element must be supported. This element is included in summaries. 0..1 positiveInt Ereignis tritt frequency-mal pro Zeitraum auf
Timing.repeat.frequencyMax This element must be supported. This element is included in summaries. 0..1 positiveInt Event occurs up to frequencyMax times per period
Timing.repeat.period This element must be supported. This element is included in summaries. 0..1 decimal Ereignis tritt frequency-mal pro Zeitraum auf
Timing.repeat.periodMax This element must be supported. This element is included in summaries. 0..1 decimal Upper limit of period (3-4 hours)
Timing.repeat.periodUnit This element must be supported. This element is included in summaries. 0..1 code min | h | d | wk | mo - Zeiteinheit (UCUM)
Binding: Period UnitsOfTime dgMP ValueSet (required)
Timing.repeat.dayOfWeek This element must be supported. This element is included in summaries. 0..* code mon | tue | wed | thu | fri | sat | sun
Binding: DaysOfWeek (required)
Timing.repeat.timeOfDay This element must be supported. This element is included in summaries. 0..* time Tageszeit für die Aktion
Timing.repeat.when This element must be supported. This element is included in summaries. 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
TimingBoundsPeriodFullDate error Timing.repeat boundsPeriod.start and boundsPeriod.end must state a full calendar date (YYYY-MM-DD, optionally with a time). FHIR dateTime also allows YYYY and YYYY-MM; the dosage text renders dates as DD.MM.YYYY and cannot represent a partial date. (bounds.ofType(Period).start | bounds.ofType(Period).end).all(toString().length() >= 10)
TimingBoundsPeriodMatchesTime error Timing.repeat If timeOfDay is used and boundsPeriod.start or boundsPeriod.end states a time, it denotes the first or last administration and must therefore be one of the timeOfDay values of the resource. The time is compared as stated, so it has to be given in Europe/Berlin local time with the matching offset. Known limitation: this invariant does not validate the offset or convert time zones; applications must check consistency with Europe/Berlin separately. timeOfDay.empty() or (bounds.ofType(Period).start | bounds.ofType(Period).end) .where(toString().length() > 10) .all( toString().substring(11, 8) in ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).timing.repeat.timeOfDay.select(toString().substring(0, 8)) )
TimingBoundsPeriodNotForWhen error Timing.repeat If when is used, or dayOfWeek is used without timeOfDay, boundsPeriod.start and boundsPeriod.end may only state a date, not a time. (when.empty() and (dayOfWeek.empty() or timeOfDay.exists())) or (bounds.ofType(Period).start | bounds.ofType(Period).end).all(toString().length() <= 10)
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'. This also rules out combining a variable frequency with a variable period, such as '1 to 3 times every 2 to 3 days', because frequencyMax and periodMax are then both greater than 1. /* 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'. This also rules out combining a variable frequency with a variable period, such as '1 to 3 times every 2 to 3 days', because frequencyMax and periodMax are then both greater than 1. /* 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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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. /* Alle Dosage-Elemente tragen denselben Zeitrahmen: keines, alle dieselbe Dauer oder alle denselben Zeitraum (Start und Ende jeweils bei allen gleich oder bei allen fehlend). Die Textgenerierung liest den Zeitrahmen nur aus dem ersten Element. */ (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Duration).empty() and timing.repeat.bounds.ofType(Period).empty()) or ( (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Duration).exists()) and (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).timing.repeat.bounds.ofType(Duration).value.distinct().count() = 1 and (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).timing.repeat.bounds.ofType(Duration).code.distinct().count() = 1 ) or ( (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).exists()) and ( (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).start.exists()) or (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).start.empty()) ) and ( (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).end.exists()) or (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).all(timing.repeat.bounds.ofType(Period).end.empty()) ) and (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).timing.repeat.bounds.ofType(Period).start.distinct().count() <= 1 and (%resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage)).timing.repeat.bounds.ofType(Period).end.distinct().count() <= 1 )
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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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, periodMax and periodUnit (periodMax either in all elements or in none), and each timeOfDay or when value must be unique across them. /* Detect Interval and Time/4-Schema */ ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.all(timing.repeat.period.exists() and timing.repeat.periodUnit.exists()) and %resource.dosageInstruction.timing.repeat.period.distinct().count() = 1 and %resource.dosageInstruction.timing.repeat.periodUnit.distinct().count() = 1 and ( %resource.dosageInstruction.all(timing.repeat.periodMax.exists()) or %resource.dosageInstruction.all(timing.repeat.periodMax.empty()) ) and %resource.dosageInstruction.timing.repeat.periodMax.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.all(timing.repeat.period.exists() and timing.repeat.periodUnit.exists()) and %resource.dosage.timing.repeat.period.distinct().count() = 1 and %resource.dosage.timing.repeat.periodUnit.distinct().count() = 1 and ( %resource.dosage.all(timing.repeat.periodMax.exists()) or %resource.dosage.all(timing.repeat.periodMax.empty()) ) and %resource.dosage.timing.repeat.periodMax.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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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' and period = 1) 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 (without dayOfWeek), the times must be modelled in a single Dosage element, both for daily dosing and in an interval combination. Multiple Dosage elements are only allowed if every element carries a distinct dose, including its data type. ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).all( ( timing.repeat.dayOfWeek.empty() and timing.repeat.timeOfDay.exists() and timing.repeat.when.empty() ) implies ( ( ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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 (without dayOfWeek), the times should be modelled in a single Dosage element, both for daily dosing and in an interval combination. Multiple Dosage elements are only allowed if every element carries a distinct dose, including its data type. ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).all( ( timing.repeat.dayOfWeek.empty() and timing.repeat.timeOfDay.exists() and timing.repeat.when.empty() ) implies ( ( ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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 (without dayOfWeek), the times of day must be modelled in a single Dosage element, both for daily dosing and in an interval combination. Multiple Dosage elements are only allowed if every element carries a distinct dose, including its data type. ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).all( ( timing.repeat.dayOfWeek.empty() and timing.repeat.when.exists() and timing.repeat.timeOfDay.empty() ) implies ( ( ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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 (without dayOfWeek), the times of day should be modelled in a single Dosage element, both for daily dosing and in an interval combination. Multiple Dosage elements are only allowed if every element carries a distinct dose, including its data type. ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).all( ( timing.repeat.dayOfWeek.empty() and timing.repeat.when.exists() and timing.repeat.timeOfDay.empty() ) implies ( ( ( %resource.ofType(MedicationRequest).dosageInstruction.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%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.combine(%resource.ofType(MedicationDispense).dosageInstruction).combine(%resource.ofType(MedicationStatement).dosage) ).where( timing.repeat.dayOfWeek.empty() and timing.repeat.when.exists() and timing.repeat.timeOfDay.empty() ).count() ) ) )
TimingValuesPositive error Timing.repeat period, periodMax and boundsDuration.value must be greater than 0. (period.exists() implies period > 0) and (periodMax.exists() implies periodMax > 0) and bounds.ofType(Duration).value.all($this > 0)
TimingValuesPositiveWarning warning Timing.repeat period, periodMax, boundsDuration.value and boundsRange.high.value should be greater than 0; boundsRange.low.value should not be negative. (period.exists() implies period > 0) and (periodMax.exists() implies periodMax > 0) and bounds.ofType(Duration).value.all($this > 0) and bounds.ofType(Range).low.value.all($this >= 0) and bounds.ofType(Range).high.value.all($this > 0)
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