Current section
Files
Jump to
Current section
Files
priv/schema/Timing.schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://hl7.erp.uno/priv/schema/Timing.schema.json",
"$ref": "#/definitions/Timing",
"description": "see https://hl7.org/fhir/R5/json.html for information about the FHIR Json Schemas",
"definitions": {
"Period": {
"allOf": [
{
"description": "A time period defined by a start and end date and optionally time.",
"properties": {
"start": {
"description": "The start of the period. The boundary is inclusive.",
"type": "string",
"pattern": "-?[0-9]{4}(-(0[1-9]|1[0-2])(-(0[0-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\\.[0-9]+)?(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?"
},
"end": {
"description": "The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time.",
"type": "string",
"pattern": "-?[0-9]{4}(-(0[1-9]|1[0-2])(-(0[0-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\\.[0-9]+)?(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?"
}
}
}
]
},
"Timing": {
"allOf": [
{
"description": "Specifies an event that may occur multiple times. Timing schedules are used to record when things are planned, expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds, and may be used for reporting the schedule to which past regular activities were carried out.",
"properties": {
"event": {
"description": "Identifies specific times when the event occurs.",
"type": "array",
"items": {
"type": "string",
"pattern": "-?[0-9]{4}(-(0[1-9]|1[0-2])(-(0[0-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\\.[0-9]+)?(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?"
}
},
"repeat": {
"description": "A set of rules that describe when the event is scheduled.",
"$ref": "#/definitions/Timing_Repeat"
},
"code": {
"description": "A code for the timing schedule. Some codes such as BID are ubiquitous, but many institutions define their own additional codes. If a code is provided, the code is understood to be a complete statement of whatever is specified in the structured timing data, and either the code or the data may be used to interpret the Timing, with the exception that .repeat.bounds still applies over the code (and is not contained in the code).",
"$ref": "CodeableConcept.schema.json#/definitions/CodeableConcept"
}
}
}
]
},
"Timing_Repeat": {
"allOf": [
{
"description": "Specifies an event that may occur multiple times. Timing schedules are used to record when things are planned, expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds, and may be used for reporting the schedule to which past regular activities were carried out.",
"properties": {
"boundsDuration": {
"description": "Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule.",
"$ref": "Duration.schema.json#/definitions/Duration"
},
"boundsRange": {
"description": "Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule.",
"$ref": "Range.schema.json#/definitions/Range"
},
"boundsPeriod": {
"description": "Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule.",
"$ref": "#/definitions/Period"
},
"count": {
"description": "A total count of the desired number of repetitions.",
"type": "number",
"pattern": "-?([0]|([1-9][0-9]*))"
},
"countMax": {
"description": "A maximum value for the count of the desired repetitions (e.g. do something 6-8 times).",
"type": "number",
"pattern": "-?([0]|([1-9][0-9]*))"
},
"duration": {
"description": "How long this thing happens for when it happens.",
"type": "number",
"pattern": "-?([0]|([1-9][0-9]*))(\\.[0-9]+)?"
},
"durationMax": {
"description": "The upper limit of how long this thing happens for when it happens.",
"type": "number",
"pattern": "-?([0]|([1-9][0-9]*))(\\.[0-9]+)?"
},
"durationUnit": {
"description": "The units of time for the duration, in UCUM units.",
"enum": ["s", "min", "h", "d", "wk", "mo", "a"],
"type": "string"
},
"frequency": {
"description": "The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided).",
"type": "number",
"pattern": "-?([0]|([1-9][0-9]*))"
},
"frequencyMax": {
"description": "If present, indicates that the frequency is a range - so to repeat between [frequency] and [frequencyMax] times within the period or period range.",
"type": "number",
"pattern": "-?([0]|([1-9][0-9]*))"
},
"period": {
"description": "Indicates the duration of time over which repetitions are to occur; e.g. to express \"3 times per day\", 3 would be the frequency and \"1 day\" would be the period.",
"type": "number",
"pattern": "-?([0]|([1-9][0-9]*))(\\.[0-9]+)?"
},
"periodMax": {
"description": "If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as \"do this once every 3-5 days.",
"type": "number",
"pattern": "-?([0]|([1-9][0-9]*))(\\.[0-9]+)?"
},
"periodUnit": {
"description": "The units of time for the period in UCUM units.",
"enum": ["s", "min", "h", "d", "wk", "mo", "a"],
"type": "string"
},
"dayOfWeek": {
"description": "If one or more days of week is provided, then the action happens only on the specified day(s).",
"type": "array",
"items": {
"type": "string",
"pattern": "[^\\s]+([\\s]?[^\\s]+)*"
}
},
"timeOfDay": {
"description": "Specified time of day for action to take place.",
"type": "array",
"items": {
"type": "string",
"pattern": "([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\\.[0-9]+)?"
}
},
"when": {
"description": "Real world events that the occurrence of the event should be tied to.",
"enum": [
"MORN",
"AFT",
"EVE",
"NIGHT",
"PHS",
"HS",
"WAKE",
"C",
"CM",
"CD",
"CV",
"AC",
"ACM",
"ACD",
"ACV",
"PC",
"PCM",
"PCD",
"PCV"
],
"type": "array",
"items": {
"type": "string"
}
},
"offset": {
"description": "The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event.",
"type": "number",
"pattern": "[0]|([1-9][0-9]*)"
}
}
}
]
}
}
}