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.ICompositeDatatype;
42 import ca.uhn.fhir.model.api.IElement;
43 import ca.uhn.fhir.model.api.annotation.Child;
44 import ca.uhn.fhir.model.api.annotation.DatatypeDef;
45 import ca.uhn.fhir.model.api.annotation.Description;
46 import ca.uhn.fhir.model.base.composite.BaseCodingDt;
47 import ca.uhn.fhir.model.primitive.BooleanDt;
48 import ca.uhn.fhir.model.primitive.CodeDt;
49 import ca.uhn.fhir.model.primitive.StringDt;
50 import ca.uhn.fhir.model.primitive.UriDt;
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66 @DatatypeDef(name="CodingDt")
67 public class CodingDt
68 extends BaseCodingDt implements ICompositeDatatype
69 {
70
71
72
73
74 public CodingDt() {
75
76 }
77
78
79
80
81 public CodingDt(String theSystem, String theCode) {
82 setSystem(theSystem);
83 setCode(theCode);
84 }
85
86 @Child(name="system", type=UriDt.class, order=0, min=0, max=1)
87 @Description(
88 shortDefinition="Identity of the terminology system",
89 formalDefinition="The identification of the code system that defines the meaning of the symbol in the code."
90 )
91 private UriDt mySystem;
92
93 @Child(name="version", type=StringDt.class, order=1, min=0, max=1)
94 @Description(
95 shortDefinition="Version of the system - if relevant",
96 formalDefinition="The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and When the meaning is not guaranteed to be consistent, the version SHOULD be exchanged"
97 )
98 private StringDt myVersion;
99
100 @Child(name="code", type=CodeDt.class, order=2, min=0, max=1)
101 @Description(
102 shortDefinition="Symbol in syntax defined by the system",
103 formalDefinition="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)"
104 )
105 private CodeDt myCode;
106
107 @Child(name="display", type=StringDt.class, order=3, min=0, max=1)
108 @Description(
109 shortDefinition="Representation defined by the system",
110 formalDefinition="A representation of the meaning of the code in the system, following the rules of the system."
111 )
112 private StringDt myDisplay;
113
114 @Child(name="primary", type=BooleanDt.class, order=4, min=0, max=1)
115 @Description(
116 shortDefinition="If this code was chosen directly by the user",
117 formalDefinition="Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays)"
118 )
119 private BooleanDt myPrimary;
120
121 @Child(name="valueSet", order=5, min=0, max=1, type={
122 ca.uhn.fhir.model.dstu.resource.ValueSet.class })
123 @Description(
124 shortDefinition="Set this coding was chosen from",
125 formalDefinition="The set of possible coded values this coding was chosen from or constrained by"
126 )
127 private ResourceReferenceDt myValueSet;
128
129
130 @Override
131 public boolean isEmpty() {
132 return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySystem, myVersion, myCode, myDisplay, myPrimary, myValueSet);
133 }
134
135 @Override
136 public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
137 return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySystem, myVersion, myCode, myDisplay, myPrimary, myValueSet);
138 }
139
140
141
142
143
144
145
146
147
148
149
150 public UriDt getSystem() {
151 if (mySystem == null) {
152 mySystem = new UriDt();
153 }
154 return mySystem;
155 }
156
157
158
159
160
161
162
163
164
165 public CodingDt setSystem(UriDt theValue) {
166 mySystem = theValue;
167 return this;
168 }
169
170
171
172
173
174
175
176
177
178 public CodingDt setSystem( String theUri) {
179 mySystem = new UriDt(theUri);
180 return this;
181 }
182
183
184
185
186
187
188
189
190
191
192
193
194 public StringDt getVersion() {
195 if (myVersion == null) {
196 myVersion = new StringDt();
197 }
198 return myVersion;
199 }
200
201
202
203
204
205
206
207
208
209 public CodingDt setVersion(StringDt theValue) {
210 myVersion = theValue;
211 return this;
212 }
213
214
215
216
217
218
219
220
221
222 public CodingDt setVersion( String theString) {
223 myVersion = new StringDt(theString);
224 return this;
225 }
226
227
228
229
230
231
232
233
234
235
236
237
238 public CodeDt getCode() {
239 if (myCode == null) {
240 myCode = new CodeDt();
241 }
242 return myCode;
243 }
244
245
246
247
248
249
250
251
252
253 public CodingDt setCode(CodeDt theValue) {
254 myCode = theValue;
255 return this;
256 }
257
258
259
260
261
262
263
264
265
266 public CodingDt setCode( String theCode) {
267 myCode = new CodeDt(theCode);
268 return this;
269 }
270
271
272
273
274
275
276
277
278
279
280
281
282 public StringDt getDisplay() {
283 if (myDisplay == null) {
284 myDisplay = new StringDt();
285 }
286 return myDisplay;
287 }
288
289
290
291
292
293
294
295
296
297 public CodingDt setDisplay(StringDt theValue) {
298 myDisplay = theValue;
299 return this;
300 }
301
302
303
304
305
306
307
308
309
310 public CodingDt setDisplay( String theString) {
311 myDisplay = new StringDt(theString);
312 return this;
313 }
314
315
316
317
318
319
320
321
322
323
324
325
326 public BooleanDt getPrimary() {
327 if (myPrimary == null) {
328 myPrimary = new BooleanDt();
329 }
330 return myPrimary;
331 }
332
333
334
335
336
337
338
339
340
341 public CodingDt setPrimary(BooleanDt theValue) {
342 myPrimary = theValue;
343 return this;
344 }
345
346
347
348
349
350
351
352
353
354 public CodingDt setPrimary( boolean theBoolean) {
355 myPrimary = new BooleanDt(theBoolean);
356 return this;
357 }
358
359
360
361
362
363
364
365
366
367
368
369
370 public ResourceReferenceDt getValueSet() {
371 if (myValueSet == null) {
372 myValueSet = new ResourceReferenceDt();
373 }
374 return myValueSet;
375 }
376
377
378
379
380
381
382
383
384
385 public CodingDt setValueSet(ResourceReferenceDt theValue) {
386 myValueSet = theValue;
387 return this;
388 }
389
390
391
392
393 }