1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package ca.uhn.fhir.model.dstu.composite;
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39 import java.util.List;
40
41 import ca.uhn.fhir.model.api.BaseIdentifiableElement;
42 import ca.uhn.fhir.model.api.ICompositeDatatype;
43 import ca.uhn.fhir.model.api.IElement;
44 import ca.uhn.fhir.model.api.annotation.Child;
45 import ca.uhn.fhir.model.api.annotation.DatatypeDef;
46 import ca.uhn.fhir.model.api.annotation.Description;
47 import ca.uhn.fhir.model.api.annotation.SimpleSetter;
48 import ca.uhn.fhir.model.dstu.valueset.ContactSystemEnum;
49 import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum;
50 import ca.uhn.fhir.model.primitive.BoundCodeDt;
51 import ca.uhn.fhir.model.primitive.CodeDt;
52 import ca.uhn.fhir.model.primitive.StringDt;
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68 @DatatypeDef(name="ContactDt")
69 public class ContactDt
70 extends BaseIdentifiableElement implements ICompositeDatatype
71 {
72
73
74
75
76 public ContactDt() {
77
78 }
79
80
81
82
83 @SimpleSetter
84 public ContactDt(@SimpleSetter.Parameter(name="theValue") String theValue) {
85 setValue(theValue);
86 }
87
88
89
90
91 @SimpleSetter
92 public ContactDt(@SimpleSetter.Parameter(name="theContactUse") ContactUseEnum theContactUse, @SimpleSetter.Parameter(name="theValue") String theValue) {
93 setUse(theContactUse);
94 setValue(theValue);
95 }
96
97 @Child(name="system", type=CodeDt.class, order=0, min=0, max=1)
98 @Description(
99 shortDefinition="phone | fax | email | url",
100 formalDefinition="Telecommunications form for contact - what communications system is required to make use of the contact"
101 )
102 private BoundCodeDt<ContactSystemEnum> mySystem;
103
104 @Child(name="value", type=StringDt.class, order=1, min=0, max=1)
105 @Description(
106 shortDefinition="The actual contact details",
107 formalDefinition="The actual contact details, in a form that is meaningful to the designated communication system (i.e. phone number or email address)."
108 )
109 private StringDt myValue;
110
111 @Child(name="use", type=CodeDt.class, order=2, min=0, max=1)
112 @Description(
113 shortDefinition="home | work | temp | old | mobile - purpose of this address",
114 formalDefinition="Identifies the purpose for the address"
115 )
116 private BoundCodeDt<ContactUseEnum> myUse;
117
118 @Child(name="period", type=PeriodDt.class, order=3, min=0, max=1)
119 @Description(
120 shortDefinition="Time period when the contact was/is in use",
121 formalDefinition="Time period when the contact was/is in use"
122 )
123 private PeriodDt myPeriod;
124
125
126 @Override
127 public boolean isEmpty() {
128 return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySystem, myValue, myUse, myPeriod);
129 }
130
131 @Override
132 public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
133 return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySystem, myValue, myUse, myPeriod);
134 }
135
136
137
138
139
140
141
142
143
144
145
146 public BoundCodeDt<ContactSystemEnum> getSystem() {
147 if (mySystem == null) {
148 mySystem = new BoundCodeDt<ContactSystemEnum>(ContactSystemEnum.VALUESET_BINDER);
149 }
150 return mySystem;
151 }
152
153
154
155
156
157
158
159
160
161 public ContactDt setSystem(BoundCodeDt<ContactSystemEnum> theValue) {
162 mySystem = theValue;
163 return this;
164 }
165
166
167
168
169
170
171
172
173
174 public ContactDt setSystem(ContactSystemEnum theValue) {
175 getSystem().setValueAsEnum(theValue);
176 return this;
177 }
178
179
180
181
182
183
184
185
186
187
188
189
190 public StringDt getValue() {
191 if (myValue == null) {
192 myValue = new StringDt();
193 }
194 return myValue;
195 }
196
197
198
199
200
201
202
203
204
205 public ContactDt setValue(StringDt theValue) {
206 myValue = theValue;
207 return this;
208 }
209
210
211
212
213
214
215
216
217
218 public ContactDt setValue( String theString) {
219 myValue = new StringDt(theString);
220 return this;
221 }
222
223
224
225
226
227
228
229
230
231
232
233
234 public BoundCodeDt<ContactUseEnum> getUse() {
235 if (myUse == null) {
236 myUse = new BoundCodeDt<ContactUseEnum>(ContactUseEnum.VALUESET_BINDER);
237 }
238 return myUse;
239 }
240
241
242
243
244
245
246
247
248
249 public ContactDt setUse(BoundCodeDt<ContactUseEnum> theValue) {
250 myUse = theValue;
251 return this;
252 }
253
254
255
256
257
258
259
260
261
262 public ContactDt setUse(ContactUseEnum theValue) {
263 getUse().setValueAsEnum(theValue);
264 return this;
265 }
266
267
268
269
270
271
272
273
274
275
276
277
278 public PeriodDt getPeriod() {
279 if (myPeriod == null) {
280 myPeriod = new PeriodDt();
281 }
282 return myPeriod;
283 }
284
285
286
287
288
289
290
291
292
293 public ContactDt setPeriod(PeriodDt theValue) {
294 myPeriod = theValue;
295 return this;
296 }
297
298
299
300
301 }