Coverage for /home/martinb/workspace/client-py/fhirclient/models/timing.py : 36%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3#
4# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Timing) on 2021-05-18.
5# 2021, SMART Health IT.
8from . import backboneelement
10class Timing(backboneelement.BackboneElement):
11 """ A timing schedule that specifies an event that may occur multiple times.
13 Specifies an event that may occur multiple times. Timing schedules are used
14 to record when things are planned, expected or requested to occur. The most
15 common usage is in dosage instructions for medications. They are also used
16 when planning care of various kinds, and may be used for reporting the
17 schedule to which past regular activities were carried out.
18 """
20 resource_type = "Timing"
22 def __init__(self, jsondict=None, strict=True):
23 """ Initialize all valid properties.
25 :raises: FHIRValidationError on validation errors, unless strict is False
26 :param dict jsondict: A JSON dictionary to use for initialization
27 :param bool strict: If True (the default), invalid variables will raise a TypeError
28 """
30 self.code = None
31 """ BID | TID | QID | AM | PM | QD | QOD | +.
32 Type `CodeableConcept` (represented as `dict` in JSON). """
34 self.event = None
35 """ When the event occurs.
36 List of `FHIRDate` items (represented as `str` in JSON). """
38 self.repeat = None
39 """ When the event is to occur.
40 Type `TimingRepeat` (represented as `dict` in JSON). """
42 super(Timing, self).__init__(jsondict=jsondict, strict=strict)
44 def elementProperties(self):
45 js = super(Timing, self).elementProperties()
46 js.extend([
47 ("code", "code", codeableconcept.CodeableConcept, False, None, False),
48 ("event", "event", fhirdate.FHIRDate, True, None, False),
49 ("repeat", "repeat", TimingRepeat, False, None, False),
50 ])
51 return js
54from . import element
56class TimingRepeat(element.Element):
57 """ When the event is to occur.
59 A set of rules that describe when the event is scheduled.
60 """
62 resource_type = "TimingRepeat"
64 def __init__(self, jsondict=None, strict=True):
65 """ Initialize all valid properties.
67 :raises: FHIRValidationError on validation errors, unless strict is False
68 :param dict jsondict: A JSON dictionary to use for initialization
69 :param bool strict: If True (the default), invalid variables will raise a TypeError
70 """
72 self.boundsDuration = None
73 """ Length/Range of lengths, or (Start and/or end) limits.
74 Type `Duration` (represented as `dict` in JSON). """
76 self.boundsPeriod = None
77 """ Length/Range of lengths, or (Start and/or end) limits.
78 Type `Period` (represented as `dict` in JSON). """
80 self.boundsRange = None
81 """ Length/Range of lengths, or (Start and/or end) limits.
82 Type `Range` (represented as `dict` in JSON). """
84 self.count = None
85 """ Number of times to repeat.
86 Type `int`. """
88 self.countMax = None
89 """ Maximum number of times to repeat.
90 Type `int`. """
92 self.dayOfWeek = None
93 """ mon | tue | wed | thu | fri | sat | sun.
94 List of `str` items. """
96 self.duration = None
97 """ How long when it happens.
98 Type `float`. """
100 self.durationMax = None
101 """ How long when it happens (Max).
102 Type `float`. """
104 self.durationUnit = None
105 """ s | min | h | d | wk | mo | a - unit of time (UCUM).
106 Type `str`. """
108 self.frequency = None
109 """ Event occurs frequency times per period.
110 Type `int`. """
112 self.frequencyMax = None
113 """ Event occurs up to frequencyMax times per period.
114 Type `int`. """
116 self.offset = None
117 """ Minutes from event (before or after).
118 Type `int`. """
120 self.period = None
121 """ Event occurs frequency times per period.
122 Type `float`. """
124 self.periodMax = None
125 """ Upper limit of period (3-4 hours).
126 Type `float`. """
128 self.periodUnit = None
129 """ s | min | h | d | wk | mo | a - unit of time (UCUM).
130 Type `str`. """
132 self.timeOfDay = None
133 """ Time of day for action.
134 List of `FHIRDate` items (represented as `str` in JSON). """
136 self.when = None
137 """ Code for time period of occurrence.
138 List of `str` items. """
140 super(TimingRepeat, self).__init__(jsondict=jsondict, strict=strict)
142 def elementProperties(self):
143 js = super(TimingRepeat, self).elementProperties()
144 js.extend([
145 ("boundsDuration", "boundsDuration", duration.Duration, False, "bounds", False),
146 ("boundsPeriod", "boundsPeriod", period.Period, False, "bounds", False),
147 ("boundsRange", "boundsRange", range.Range, False, "bounds", False),
148 ("count", "count", int, False, None, False),
149 ("countMax", "countMax", int, False, None, False),
150 ("dayOfWeek", "dayOfWeek", str, True, None, False),
151 ("duration", "duration", float, False, None, False),
152 ("durationMax", "durationMax", float, False, None, False),
153 ("durationUnit", "durationUnit", str, False, None, False),
154 ("frequency", "frequency", int, False, None, False),
155 ("frequencyMax", "frequencyMax", int, False, None, False),
156 ("offset", "offset", int, False, None, False),
157 ("period", "period", float, False, None, False),
158 ("periodMax", "periodMax", float, False, None, False),
159 ("periodUnit", "periodUnit", str, False, None, False),
160 ("timeOfDay", "timeOfDay", fhirdate.FHIRDate, True, None, False),
161 ("when", "when", str, True, None, False),
162 ])
163 return js
166import sys
167try:
168 from . import codeableconcept
169except ImportError:
170 codeableconcept = sys.modules[__package__ + '.codeableconcept']
171try:
172 from . import duration
173except ImportError:
174 duration = sys.modules[__package__ + '.duration']
175try:
176 from . import fhirdate
177except ImportError:
178 fhirdate = sys.modules[__package__ + '.fhirdate']
179try:
180 from . import period
181except ImportError:
182 period = sys.modules[__package__ + '.period']
183try:
184 from . import range
185except ImportError:
186 range = sys.modules[__package__ + '.range']