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.ExtensionDt;
45 import ca.uhn.fhir.model.api.IElement;
46 import ca.uhn.fhir.model.api.IResource;
47 import ca.uhn.fhir.model.api.IResourceBlock;
48 import ca.uhn.fhir.model.api.annotation.Block;
49 import ca.uhn.fhir.model.api.annotation.Child;
50 import ca.uhn.fhir.model.api.annotation.Description;
51 import ca.uhn.fhir.model.api.annotation.ResourceDef;
52 import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
53 import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt;
54 import ca.uhn.fhir.model.dstu.valueset.QueryOutcomeEnum;
55 import ca.uhn.fhir.model.primitive.BoundCodeDt;
56 import ca.uhn.fhir.model.primitive.CodeDt;
57 import ca.uhn.fhir.model.primitive.IntegerDt;
58 import ca.uhn.fhir.model.primitive.UriDt;
59 import ca.uhn.fhir.rest.gclient.TokenClientParam;
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82 @ResourceDef(name="Query", profile="http://hl7.org/fhir/profiles/Query", id="query")
83 public class Query extends BaseResource implements IResource {
84
85
86
87
88
89
90
91
92
93 @SearchParamDefinition(name="identifier", path="Query.identifier", description="", type="token" )
94 public static final String SP_IDENTIFIER = "identifier";
95
96
97
98
99
100
101
102
103
104 public static final TokenClientParam IDENTIFIER = new TokenClientParam(SP_IDENTIFIER);
105
106
107
108
109
110
111
112
113
114 @SearchParamDefinition(name="response", path="Query.response.identifier", description="", type="token" )
115 public static final String SP_RESPONSE = "response";
116
117
118
119
120
121
122
123
124
125 public static final TokenClientParam RESPONSE = new TokenClientParam(SP_RESPONSE);
126
127
128 @Child(name="identifier", type=UriDt.class, order=0, min=1, max=1)
129 @Description(
130 shortDefinition="Links query and its response(s)",
131 formalDefinition=""
132 )
133 private UriDt myIdentifier;
134
135 @Child(name="parameter", type=ExtensionDt.class, order=1, min=1, max=Child.MAX_UNLIMITED)
136 @Description(
137 shortDefinition="Set of query parameters with values",
138 formalDefinition=""
139 )
140 private java.util.List<ExtensionDt> myParameter;
141
142 @Child(name="response", order=2, min=0, max=1)
143 @Description(
144 shortDefinition="If this is a response to a query",
145 formalDefinition=""
146 )
147 private Response myResponse;
148
149
150 @Override
151 public boolean isEmpty() {
152 return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myParameter, myResponse);
153 }
154
155 @Override
156 public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
157 return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myParameter, myResponse);
158 }
159
160
161
162
163
164
165
166
167
168
169
170 public UriDt getIdentifier() {
171 if (myIdentifier == null) {
172 myIdentifier = new UriDt();
173 }
174 return myIdentifier;
175 }
176
177
178
179
180
181
182
183
184
185 public Query setIdentifier(UriDt theValue) {
186 myIdentifier = theValue;
187 return this;
188 }
189
190
191
192
193
194
195
196
197
198 public Query setIdentifier( String theUri) {
199 myIdentifier = new UriDt(theUri);
200 return this;
201 }
202
203
204
205
206
207
208
209
210
211
212
213
214 public java.util.List<ExtensionDt> getParameter() {
215 if (myParameter == null) {
216 myParameter = new java.util.ArrayList<ExtensionDt>();
217 }
218 return myParameter;
219 }
220
221
222
223
224
225
226
227
228
229 public Query setParameter(java.util.List<ExtensionDt> theValue) {
230 myParameter = theValue;
231 return this;
232 }
233
234
235
236
237
238
239
240
241
242 public ExtensionDt addParameter() {
243 ExtensionDt newType = new ExtensionDt();
244 getParameter().add(newType);
245 return newType;
246 }
247
248
249
250
251
252
253
254
255
256
257 public ExtensionDt getParameterFirstRep() {
258 if (getParameter().isEmpty()) {
259 return addParameter();
260 }
261 return getParameter().get(0);
262 }
263
264
265
266
267
268
269
270
271
272
273
274 public Response getResponse() {
275 if (myResponse == null) {
276 myResponse = new Response();
277 }
278 return myResponse;
279 }
280
281
282
283
284
285
286
287
288
289 public Query setResponse(Response theValue) {
290 myResponse = theValue;
291 return this;
292 }
293
294
295
296
297
298
299
300
301
302
303 @Block()
304 public static class Response extends BaseIdentifiableElement implements IResourceBlock {
305
306 @Child(name="identifier", type=UriDt.class, order=0, min=1, max=1)
307 @Description(
308 shortDefinition="Links response to source query",
309 formalDefinition=""
310 )
311 private UriDt myIdentifier;
312
313 @Child(name="outcome", type=CodeDt.class, order=1, min=1, max=1)
314 @Description(
315 shortDefinition="ok | limited | refused | error",
316 formalDefinition="Outcome of processing the query"
317 )
318 private BoundCodeDt<QueryOutcomeEnum> myOutcome;
319
320 @Child(name="total", type=IntegerDt.class, order=2, min=0, max=1)
321 @Description(
322 shortDefinition="Total number of matching records",
323 formalDefinition=""
324 )
325 private IntegerDt myTotal;
326
327 @Child(name="parameter", type=ExtensionDt.class, order=3, min=0, max=Child.MAX_UNLIMITED)
328 @Description(
329 shortDefinition="Parameters server used",
330 formalDefinition=""
331 )
332 private java.util.List<ExtensionDt> myParameter;
333
334 @Child(name="first", type=ExtensionDt.class, order=4, min=0, max=Child.MAX_UNLIMITED)
335 @Description(
336 shortDefinition="To get first page (if paged)",
337 formalDefinition=""
338 )
339 private java.util.List<ExtensionDt> myFirst;
340
341 @Child(name="previous", type=ExtensionDt.class, order=5, min=0, max=Child.MAX_UNLIMITED)
342 @Description(
343 shortDefinition="To get previous page (if paged)",
344 formalDefinition=""
345 )
346 private java.util.List<ExtensionDt> myPrevious;
347
348 @Child(name="next", type=ExtensionDt.class, order=6, min=0, max=Child.MAX_UNLIMITED)
349 @Description(
350 shortDefinition="To get next page (if paged)",
351 formalDefinition=""
352 )
353 private java.util.List<ExtensionDt> myNext;
354
355 @Child(name="last", type=ExtensionDt.class, order=7, min=0, max=Child.MAX_UNLIMITED)
356 @Description(
357 shortDefinition="To get last page (if paged)",
358 formalDefinition=""
359 )
360 private java.util.List<ExtensionDt> myLast;
361
362 @Child(name="reference", order=8, min=0, max=Child.MAX_UNLIMITED, type={
363 IResource.class })
364 @Description(
365 shortDefinition="Resources that are the results of the search",
366 formalDefinition=""
367 )
368 private java.util.List<ResourceReferenceDt> myReference;
369
370
371 @Override
372 public boolean isEmpty() {
373 return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myOutcome, myTotal, myParameter, myFirst, myPrevious, myNext, myLast, myReference);
374 }
375
376 @Override
377 public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
378 return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myOutcome, myTotal, myParameter, myFirst, myPrevious, myNext, myLast, myReference);
379 }
380
381
382
383
384
385
386
387
388
389
390
391 public UriDt getIdentifier() {
392 if (myIdentifier == null) {
393 myIdentifier = new UriDt();
394 }
395 return myIdentifier;
396 }
397
398
399
400
401
402
403
404
405
406 public Response setIdentifier(UriDt theValue) {
407 myIdentifier = theValue;
408 return this;
409 }
410
411
412
413
414
415
416
417
418
419 public Response setIdentifier( String theUri) {
420 myIdentifier = new UriDt(theUri);
421 return this;
422 }
423
424
425
426
427
428
429
430
431
432
433
434
435 public BoundCodeDt<QueryOutcomeEnum> getOutcome() {
436 if (myOutcome == null) {
437 myOutcome = new BoundCodeDt<QueryOutcomeEnum>(QueryOutcomeEnum.VALUESET_BINDER);
438 }
439 return myOutcome;
440 }
441
442
443
444
445
446
447
448
449
450 public Response setOutcome(BoundCodeDt<QueryOutcomeEnum> theValue) {
451 myOutcome = theValue;
452 return this;
453 }
454
455
456
457
458
459
460
461
462
463 public Response setOutcome(QueryOutcomeEnum theValue) {
464 getOutcome().setValueAsEnum(theValue);
465 return this;
466 }
467
468
469
470
471
472
473
474
475
476
477
478
479 public IntegerDt getTotal() {
480 if (myTotal == null) {
481 myTotal = new IntegerDt();
482 }
483 return myTotal;
484 }
485
486
487
488
489
490
491
492
493
494 public Response setTotal(IntegerDt theValue) {
495 myTotal = theValue;
496 return this;
497 }
498
499
500
501
502
503
504
505
506
507 public Response setTotal( int theInteger) {
508 myTotal = new IntegerDt(theInteger);
509 return this;
510 }
511
512
513
514
515
516
517
518
519
520
521
522
523 public java.util.List<ExtensionDt> getParameter() {
524 if (myParameter == null) {
525 myParameter = new java.util.ArrayList<ExtensionDt>();
526 }
527 return myParameter;
528 }
529
530
531
532
533
534
535
536
537
538 public Response setParameter(java.util.List<ExtensionDt> theValue) {
539 myParameter = theValue;
540 return this;
541 }
542
543
544
545
546
547
548
549
550
551 public ExtensionDt addParameter() {
552 ExtensionDt newType = new ExtensionDt();
553 getParameter().add(newType);
554 return newType;
555 }
556
557
558
559
560
561
562
563
564
565
566 public ExtensionDt getParameterFirstRep() {
567 if (getParameter().isEmpty()) {
568 return addParameter();
569 }
570 return getParameter().get(0);
571 }
572
573
574
575
576
577
578
579
580
581
582
583 public java.util.List<ExtensionDt> getFirst() {
584 if (myFirst == null) {
585 myFirst = new java.util.ArrayList<ExtensionDt>();
586 }
587 return myFirst;
588 }
589
590
591
592
593
594
595
596
597
598 public Response setFirst(java.util.List<ExtensionDt> theValue) {
599 myFirst = theValue;
600 return this;
601 }
602
603
604
605
606
607
608
609
610
611 public ExtensionDt addFirst() {
612 ExtensionDt newType = new ExtensionDt();
613 getFirst().add(newType);
614 return newType;
615 }
616
617
618
619
620
621
622
623
624
625
626 public ExtensionDt getFirstFirstRep() {
627 if (getFirst().isEmpty()) {
628 return addFirst();
629 }
630 return getFirst().get(0);
631 }
632
633
634
635
636
637
638
639
640
641
642
643 public java.util.List<ExtensionDt> getPrevious() {
644 if (myPrevious == null) {
645 myPrevious = new java.util.ArrayList<ExtensionDt>();
646 }
647 return myPrevious;
648 }
649
650
651
652
653
654
655
656
657
658 public Response setPrevious(java.util.List<ExtensionDt> theValue) {
659 myPrevious = theValue;
660 return this;
661 }
662
663
664
665
666
667
668
669
670
671 public ExtensionDt addPrevious() {
672 ExtensionDt newType = new ExtensionDt();
673 getPrevious().add(newType);
674 return newType;
675 }
676
677
678
679
680
681
682
683
684
685
686 public ExtensionDt getPreviousFirstRep() {
687 if (getPrevious().isEmpty()) {
688 return addPrevious();
689 }
690 return getPrevious().get(0);
691 }
692
693
694
695
696
697
698
699
700
701
702
703 public java.util.List<ExtensionDt> getNext() {
704 if (myNext == null) {
705 myNext = new java.util.ArrayList<ExtensionDt>();
706 }
707 return myNext;
708 }
709
710
711
712
713
714
715
716
717
718 public Response setNext(java.util.List<ExtensionDt> theValue) {
719 myNext = theValue;
720 return this;
721 }
722
723
724
725
726
727
728
729
730
731 public ExtensionDt addNext() {
732 ExtensionDt newType = new ExtensionDt();
733 getNext().add(newType);
734 return newType;
735 }
736
737
738
739
740
741
742
743
744
745
746 public ExtensionDt getNextFirstRep() {
747 if (getNext().isEmpty()) {
748 return addNext();
749 }
750 return getNext().get(0);
751 }
752
753
754
755
756
757
758
759
760
761
762
763 public java.util.List<ExtensionDt> getLast() {
764 if (myLast == null) {
765 myLast = new java.util.ArrayList<ExtensionDt>();
766 }
767 return myLast;
768 }
769
770
771
772
773
774
775
776
777
778 public Response setLast(java.util.List<ExtensionDt> theValue) {
779 myLast = theValue;
780 return this;
781 }
782
783
784
785
786
787
788
789
790
791 public ExtensionDt addLast() {
792 ExtensionDt newType = new ExtensionDt();
793 getLast().add(newType);
794 return newType;
795 }
796
797
798
799
800
801
802
803
804
805
806 public ExtensionDt getLastFirstRep() {
807 if (getLast().isEmpty()) {
808 return addLast();
809 }
810 return getLast().get(0);
811 }
812
813
814
815
816
817
818
819
820
821
822
823 public java.util.List<ResourceReferenceDt> getReference() {
824 if (myReference == null) {
825 myReference = new java.util.ArrayList<ResourceReferenceDt>();
826 }
827 return myReference;
828 }
829
830
831
832
833
834
835
836
837
838 public Response setReference(java.util.List<ResourceReferenceDt> theValue) {
839 myReference = theValue;
840 return this;
841 }
842
843
844
845
846
847
848
849
850
851 public ResourceReferenceDt addReference() {
852 ResourceReferenceDt newType = new ResourceReferenceDt();
853 getReference().add(newType);
854 return newType;
855 }
856
857
858 }
859
860
861
862
863 }