1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package ca.uhn.fhir.model.dstu.resource;
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40 import java.util.List;
41
42 import ca.uhn.fhir.model.api.BaseIdentifiableElement;
43 import ca.uhn.fhir.model.api.BaseResource;
44 import ca.uhn.fhir.model.api.IElement;
45 import ca.uhn.fhir.model.api.IResource;
46 import ca.uhn.fhir.model.api.IResourceBlock;
47 import ca.uhn.fhir.model.api.annotation.Block;
48 import ca.uhn.fhir.model.api.annotation.Child;
49 import ca.uhn.fhir.model.api.annotation.Description;
50 import ca.uhn.fhir.model.api.annotation.ResourceDef;
51 import ca.uhn.fhir.model.dstu.composite.CodingDt;
52 import ca.uhn.fhir.model.dstu.valueset.IssueSeverityEnum;
53 import ca.uhn.fhir.model.primitive.BoundCodeDt;
54 import ca.uhn.fhir.model.primitive.CodeDt;
55 import ca.uhn.fhir.model.primitive.StringDt;
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78 @ResourceDef(name="OperationOutcome", profile="http://hl7.org/fhir/profiles/OperationOutcome", id="operationoutcome")
79 public class OperationOutcome extends BaseResource implements IResource {
80
81
82 @Child(name="issue", order=0, min=1, max=Child.MAX_UNLIMITED)
83 @Description(
84 shortDefinition="A single issue associated with the action",
85 formalDefinition="An error, warning or information message that results from a system action"
86 )
87 private java.util.List<Issue> myIssue;
88
89
90 @Override
91 public boolean isEmpty() {
92 return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIssue);
93 }
94
95 @Override
96 public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
97 return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIssue);
98 }
99
100
101
102
103
104
105
106
107
108
109
110 public java.util.List<Issue> getIssue() {
111 if (myIssue == null) {
112 myIssue = new java.util.ArrayList<Issue>();
113 }
114 return myIssue;
115 }
116
117
118
119
120
121
122
123
124
125 public OperationOutcome setIssue(java.util.List<Issue> theValue) {
126 myIssue = theValue;
127 return this;
128 }
129
130
131
132
133
134
135
136
137
138 public Issue addIssue() {
139 Issue newType = new Issue();
140 getIssue().add(newType);
141 return newType;
142 }
143
144
145
146
147
148
149
150
151
152
153 public Issue getIssueFirstRep() {
154 if (getIssue().isEmpty()) {
155 return addIssue();
156 }
157 return getIssue().get(0);
158 }
159
160
161
162
163
164
165
166
167
168 @Block()
169 public static class Issue extends BaseIdentifiableElement implements IResourceBlock {
170
171 @Child(name="severity", type=CodeDt.class, order=0, min=1, max=1)
172 @Description(
173 shortDefinition="fatal | error | warning | information",
174 formalDefinition="Indicates whether the issue indicates a variation from successful processing"
175 )
176 private BoundCodeDt<IssueSeverityEnum> mySeverity;
177
178 @Child(name="type", type=CodingDt.class, order=1, min=0, max=1)
179 @Description(
180 shortDefinition="Error or warning code",
181 formalDefinition="A code indicating the type of error, warning or information message."
182 )
183 private CodingDt myType;
184
185 @Child(name="details", type=StringDt.class, order=2, min=0, max=1)
186 @Description(
187 shortDefinition="Additional description of the issue",
188 formalDefinition="Additional description of the issue"
189 )
190 private StringDt myDetails;
191
192 @Child(name="location", type=StringDt.class, order=3, min=0, max=Child.MAX_UNLIMITED)
193 @Description(
194 shortDefinition="XPath of element(s) related to issue",
195 formalDefinition="A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised."
196 )
197 private java.util.List<StringDt> myLocation;
198
199
200 @Override
201 public boolean isEmpty() {
202 return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySeverity, myType, myDetails, myLocation);
203 }
204
205 @Override
206 public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
207 return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySeverity, myType, myDetails, myLocation);
208 }
209
210
211
212
213
214
215
216
217
218
219
220 public BoundCodeDt<IssueSeverityEnum> getSeverity() {
221 if (mySeverity == null) {
222 mySeverity = new BoundCodeDt<IssueSeverityEnum>(IssueSeverityEnum.VALUESET_BINDER);
223 }
224 return mySeverity;
225 }
226
227
228
229
230
231
232
233
234
235 public Issue setSeverity(BoundCodeDt<IssueSeverityEnum> theValue) {
236 mySeverity = theValue;
237 return this;
238 }
239
240
241
242
243
244
245
246
247
248 public Issue setSeverity(IssueSeverityEnum theValue) {
249 getSeverity().setValueAsEnum(theValue);
250 return this;
251 }
252
253
254
255
256
257
258
259
260
261
262
263
264 public CodingDt getType() {
265 if (myType == null) {
266 myType = new CodingDt();
267 }
268 return myType;
269 }
270
271
272
273
274
275
276
277
278
279 public Issue setType(CodingDt theValue) {
280 myType = theValue;
281 return this;
282 }
283
284
285
286
287
288
289
290
291
292
293
294
295 public StringDt getDetails() {
296 if (myDetails == null) {
297 myDetails = new StringDt();
298 }
299 return myDetails;
300 }
301
302
303
304
305
306
307
308
309
310 public Issue setDetails(StringDt theValue) {
311 myDetails = theValue;
312 return this;
313 }
314
315
316
317
318
319
320
321
322
323 public Issue setDetails( String theString) {
324 myDetails = new StringDt(theString);
325 return this;
326 }
327
328
329
330
331
332
333
334
335
336
337
338
339 public java.util.List<StringDt> getLocation() {
340 if (myLocation == null) {
341 myLocation = new java.util.ArrayList<StringDt>();
342 }
343 return myLocation;
344 }
345
346
347
348
349
350
351
352
353
354 public Issue setLocation(java.util.List<StringDt> theValue) {
355 myLocation = theValue;
356 return this;
357 }
358
359
360
361
362
363
364
365
366
367 public StringDt addLocation() {
368 StringDt newType = new StringDt();
369 getLocation().add(newType);
370 return newType;
371 }
372
373
374
375
376
377
378
379
380
381
382 public StringDt getLocationFirstRep() {
383 if (getLocation().isEmpty()) {
384 return addLocation();
385 }
386 return getLocation().get(0);
387 }
388
389
390
391
392
393
394
395
396
397
398 public Issue addLocation( String theString) {
399 if (myLocation == null) {
400 myLocation = new java.util.ArrayList<StringDt>();
401 }
402 myLocation.add(new StringDt(theString));
403 return this;
404 }
405
406
407
408 }
409
410
411
412
413 }