View Javadoc
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   * #%L
21   * HAPI FHIR - Core Library
22   * %%
23   * Copyright (C) 2014 University Health Network
24   * %%
25   * Licensed under the Apache License, Version 2.0 (the "License");
26   * you may not use this file except in compliance with the License.
27   * You may obtain a copy of the License at
28   * 
29   *      http://www.apache.org/licenses/LICENSE-2.0
30   * 
31   * Unless required by applicable law or agreed to in writing, software
32   * distributed under the License is distributed on an "AS IS" BASIS,
33   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34   * See the License for the specific language governing permissions and
35   * limitations under the License.
36   * #L%
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   * HAPI/FHIR <b>Query</b> Resource
64   * (A description of a query with a set of parameters)
65   *
66   * <p>
67   * <b>Definition:</b>
68   * 
69   * </p> 
70   *
71   * <p>
72   * <b>Requirements:</b>
73   * 
74   * </p> 
75   *
76   * <p>
77   * <b>Profile Definition:</b>
78   * <a href="http://hl7.org/fhir/profiles/Query">http://hl7.org/fhir/profiles/Query</a> 
79   * </p>
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  	 * Search parameter constant for <b>identifier</b>
87  	 * <p>
88  	 * Description: <b></b><br/>
89  	 * Type: <b>token</b><br/>
90  	 * Path: <b>Query.identifier</b><br/>
91  	 * </p>
92  	 */
93  	@SearchParamDefinition(name="identifier", path="Query.identifier", description="", type="token"  )
94  	public static final String SP_IDENTIFIER = "identifier";
95  
96  	/**
97  	 * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
98  	 * <p>
99  	 * Description: <b></b><br/>
100 	 * Type: <b>token</b><br/>
101 	 * Path: <b>Query.identifier</b><br/>
102 	 * </p>
103 	 */
104 	public static final TokenClientParam IDENTIFIER = new TokenClientParam(SP_IDENTIFIER);
105 
106 	/**
107 	 * Search parameter constant for <b>response</b>
108 	 * <p>
109 	 * Description: <b></b><br/>
110 	 * Type: <b>token</b><br/>
111 	 * Path: <b>Query.response.identifier</b><br/>
112 	 * </p>
113 	 */
114 	@SearchParamDefinition(name="response", path="Query.response.identifier", description="", type="token"  )
115 	public static final String SP_RESPONSE = "response";
116 
117 	/**
118 	 * <b>Fluent Client</b> search parameter constant for <b>response</b>
119 	 * <p>
120 	 * Description: <b></b><br/>
121 	 * Type: <b>token</b><br/>
122 	 * Path: <b>Query.response.identifier</b><br/>
123 	 * </p>
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 	 * Gets the value(s) for <b>identifier</b> (Links query and its response(s)).
162 	 * creating it if it does
163 	 * not exist. Will not return <code>null</code>.
164 	 *
165      * <p>
166      * <b>Definition:</b>
167      * 
168      * </p> 
169 	 */
170 	public UriDt getIdentifier() {  
171 		if (myIdentifier == null) {
172 			myIdentifier = new UriDt();
173 		}
174 		return myIdentifier;
175 	}
176 
177 	/**
178 	 * Sets the value(s) for <b>identifier</b> (Links query and its response(s))
179 	 *
180      * <p>
181      * <b>Definition:</b>
182      * 
183      * </p> 
184 	 */
185 	public Query setIdentifier(UriDt theValue) {
186 		myIdentifier = theValue;
187 		return this;
188 	}
189 
190  	/**
191 	 * Sets the value for <b>identifier</b> (Links query and its response(s))
192 	 *
193      * <p>
194      * <b>Definition:</b>
195      * 
196      * </p> 
197 	 */
198 	public Query setIdentifier( String theUri) {
199 		myIdentifier = new UriDt(theUri); 
200 		return this; 
201 	}
202 
203  
204 	/**
205 	 * Gets the value(s) for <b>parameter</b> (Set of query parameters with values).
206 	 * creating it if it does
207 	 * not exist. Will not return <code>null</code>.
208 	 *
209      * <p>
210      * <b>Definition:</b>
211      * 
212      * </p> 
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 	 * Sets the value(s) for <b>parameter</b> (Set of query parameters with values)
223 	 *
224      * <p>
225      * <b>Definition:</b>
226      * 
227      * </p> 
228 	 */
229 	public Query setParameter(java.util.List<ExtensionDt> theValue) {
230 		myParameter = theValue;
231 		return this;
232 	}
233 
234 	/**
235 	 * Adds and returns a new value for <b>parameter</b> (Set of query parameters with values)
236 	 *
237      * <p>
238      * <b>Definition:</b>
239      * 
240      * </p> 
241 	 */
242 	public ExtensionDt addParameter() {
243 		ExtensionDt newType = new ExtensionDt();
244 		getParameter().add(newType);
245 		return newType; 
246 	}
247 
248 	/**
249 	 * Gets the first repetition for <b>parameter</b> (Set of query parameters with values),
250 	 * creating it if it does not already exist.
251 	 *
252      * <p>
253      * <b>Definition:</b>
254      * 
255      * </p> 
256 	 */
257 	public ExtensionDt getParameterFirstRep() {
258 		if (getParameter().isEmpty()) {
259 			return addParameter();
260 		}
261 		return getParameter().get(0); 
262 	}
263   
264 	/**
265 	 * Gets the value(s) for <b>response</b> (If this is a response to a query).
266 	 * creating it if it does
267 	 * not exist. Will not return <code>null</code>.
268 	 *
269      * <p>
270      * <b>Definition:</b>
271      * 
272      * </p> 
273 	 */
274 	public Response getResponse() {  
275 		if (myResponse == null) {
276 			myResponse = new Response();
277 		}
278 		return myResponse;
279 	}
280 
281 	/**
282 	 * Sets the value(s) for <b>response</b> (If this is a response to a query)
283 	 *
284      * <p>
285      * <b>Definition:</b>
286      * 
287      * </p> 
288 	 */
289 	public Query setResponse(Response theValue) {
290 		myResponse = theValue;
291 		return this;
292 	}
293 
294   
295 	/**
296 	 * Block class for child element: <b>Query.response</b> (If this is a response to a query)
297 	 *
298      * <p>
299      * <b>Definition:</b>
300      * 
301      * </p> 
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 	 * Gets the value(s) for <b>identifier</b> (Links response to source query).
383 	 * creating it if it does
384 	 * not exist. Will not return <code>null</code>.
385 	 *
386      * <p>
387      * <b>Definition:</b>
388      * 
389      * </p> 
390 	 */
391 	public UriDt getIdentifier() {  
392 		if (myIdentifier == null) {
393 			myIdentifier = new UriDt();
394 		}
395 		return myIdentifier;
396 	}
397 
398 	/**
399 	 * Sets the value(s) for <b>identifier</b> (Links response to source query)
400 	 *
401      * <p>
402      * <b>Definition:</b>
403      * 
404      * </p> 
405 	 */
406 	public Response setIdentifier(UriDt theValue) {
407 		myIdentifier = theValue;
408 		return this;
409 	}
410 
411  	/**
412 	 * Sets the value for <b>identifier</b> (Links response to source query)
413 	 *
414      * <p>
415      * <b>Definition:</b>
416      * 
417      * </p> 
418 	 */
419 	public Response setIdentifier( String theUri) {
420 		myIdentifier = new UriDt(theUri); 
421 		return this; 
422 	}
423 
424  
425 	/**
426 	 * Gets the value(s) for <b>outcome</b> (ok | limited | refused | error).
427 	 * creating it if it does
428 	 * not exist. Will not return <code>null</code>.
429 	 *
430      * <p>
431      * <b>Definition:</b>
432      * Outcome of processing the query
433      * </p> 
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 	 * Sets the value(s) for <b>outcome</b> (ok | limited | refused | error)
444 	 *
445      * <p>
446      * <b>Definition:</b>
447      * Outcome of processing the query
448      * </p> 
449 	 */
450 	public Response setOutcome(BoundCodeDt<QueryOutcomeEnum> theValue) {
451 		myOutcome = theValue;
452 		return this;
453 	}
454 
455 	/**
456 	 * Sets the value(s) for <b>outcome</b> (ok | limited | refused | error)
457 	 *
458      * <p>
459      * <b>Definition:</b>
460      * Outcome of processing the query
461      * </p> 
462 	 */
463 	public Response setOutcome(QueryOutcomeEnum theValue) {
464 		getOutcome().setValueAsEnum(theValue);
465 		return this;
466 	}
467 
468   
469 	/**
470 	 * Gets the value(s) for <b>total</b> (Total number of matching records).
471 	 * creating it if it does
472 	 * not exist. Will not return <code>null</code>.
473 	 *
474      * <p>
475      * <b>Definition:</b>
476      * 
477      * </p> 
478 	 */
479 	public IntegerDt getTotal() {  
480 		if (myTotal == null) {
481 			myTotal = new IntegerDt();
482 		}
483 		return myTotal;
484 	}
485 
486 	/**
487 	 * Sets the value(s) for <b>total</b> (Total number of matching records)
488 	 *
489      * <p>
490      * <b>Definition:</b>
491      * 
492      * </p> 
493 	 */
494 	public Response setTotal(IntegerDt theValue) {
495 		myTotal = theValue;
496 		return this;
497 	}
498 
499  	/**
500 	 * Sets the value for <b>total</b> (Total number of matching records)
501 	 *
502      * <p>
503      * <b>Definition:</b>
504      * 
505      * </p> 
506 	 */
507 	public Response setTotal( int theInteger) {
508 		myTotal = new IntegerDt(theInteger); 
509 		return this; 
510 	}
511 
512  
513 	/**
514 	 * Gets the value(s) for <b>parameter</b> (Parameters server used).
515 	 * creating it if it does
516 	 * not exist. Will not return <code>null</code>.
517 	 *
518      * <p>
519      * <b>Definition:</b>
520      * 
521      * </p> 
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 	 * Sets the value(s) for <b>parameter</b> (Parameters server used)
532 	 *
533      * <p>
534      * <b>Definition:</b>
535      * 
536      * </p> 
537 	 */
538 	public Response setParameter(java.util.List<ExtensionDt> theValue) {
539 		myParameter = theValue;
540 		return this;
541 	}
542 
543 	/**
544 	 * Adds and returns a new value for <b>parameter</b> (Parameters server used)
545 	 *
546      * <p>
547      * <b>Definition:</b>
548      * 
549      * </p> 
550 	 */
551 	public ExtensionDt addParameter() {
552 		ExtensionDt newType = new ExtensionDt();
553 		getParameter().add(newType);
554 		return newType; 
555 	}
556 
557 	/**
558 	 * Gets the first repetition for <b>parameter</b> (Parameters server used),
559 	 * creating it if it does not already exist.
560 	 *
561      * <p>
562      * <b>Definition:</b>
563      * 
564      * </p> 
565 	 */
566 	public ExtensionDt getParameterFirstRep() {
567 		if (getParameter().isEmpty()) {
568 			return addParameter();
569 		}
570 		return getParameter().get(0); 
571 	}
572   
573 	/**
574 	 * Gets the value(s) for <b>first</b> (To get first page (if paged)).
575 	 * creating it if it does
576 	 * not exist. Will not return <code>null</code>.
577 	 *
578      * <p>
579      * <b>Definition:</b>
580      * 
581      * </p> 
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 	 * Sets the value(s) for <b>first</b> (To get first page (if paged))
592 	 *
593      * <p>
594      * <b>Definition:</b>
595      * 
596      * </p> 
597 	 */
598 	public Response setFirst(java.util.List<ExtensionDt> theValue) {
599 		myFirst = theValue;
600 		return this;
601 	}
602 
603 	/**
604 	 * Adds and returns a new value for <b>first</b> (To get first page (if paged))
605 	 *
606      * <p>
607      * <b>Definition:</b>
608      * 
609      * </p> 
610 	 */
611 	public ExtensionDt addFirst() {
612 		ExtensionDt newType = new ExtensionDt();
613 		getFirst().add(newType);
614 		return newType; 
615 	}
616 
617 	/**
618 	 * Gets the first repetition for <b>first</b> (To get first page (if paged)),
619 	 * creating it if it does not already exist.
620 	 *
621      * <p>
622      * <b>Definition:</b>
623      * 
624      * </p> 
625 	 */
626 	public ExtensionDt getFirstFirstRep() {
627 		if (getFirst().isEmpty()) {
628 			return addFirst();
629 		}
630 		return getFirst().get(0); 
631 	}
632   
633 	/**
634 	 * Gets the value(s) for <b>previous</b> (To get previous page (if paged)).
635 	 * creating it if it does
636 	 * not exist. Will not return <code>null</code>.
637 	 *
638      * <p>
639      * <b>Definition:</b>
640      * 
641      * </p> 
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 	 * Sets the value(s) for <b>previous</b> (To get previous page (if paged))
652 	 *
653      * <p>
654      * <b>Definition:</b>
655      * 
656      * </p> 
657 	 */
658 	public Response setPrevious(java.util.List<ExtensionDt> theValue) {
659 		myPrevious = theValue;
660 		return this;
661 	}
662 
663 	/**
664 	 * Adds and returns a new value for <b>previous</b> (To get previous page (if paged))
665 	 *
666      * <p>
667      * <b>Definition:</b>
668      * 
669      * </p> 
670 	 */
671 	public ExtensionDt addPrevious() {
672 		ExtensionDt newType = new ExtensionDt();
673 		getPrevious().add(newType);
674 		return newType; 
675 	}
676 
677 	/**
678 	 * Gets the first repetition for <b>previous</b> (To get previous page (if paged)),
679 	 * creating it if it does not already exist.
680 	 *
681      * <p>
682      * <b>Definition:</b>
683      * 
684      * </p> 
685 	 */
686 	public ExtensionDt getPreviousFirstRep() {
687 		if (getPrevious().isEmpty()) {
688 			return addPrevious();
689 		}
690 		return getPrevious().get(0); 
691 	}
692   
693 	/**
694 	 * Gets the value(s) for <b>next</b> (To get next page (if paged)).
695 	 * creating it if it does
696 	 * not exist. Will not return <code>null</code>.
697 	 *
698      * <p>
699      * <b>Definition:</b>
700      * 
701      * </p> 
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 	 * Sets the value(s) for <b>next</b> (To get next page (if paged))
712 	 *
713      * <p>
714      * <b>Definition:</b>
715      * 
716      * </p> 
717 	 */
718 	public Response setNext(java.util.List<ExtensionDt> theValue) {
719 		myNext = theValue;
720 		return this;
721 	}
722 
723 	/**
724 	 * Adds and returns a new value for <b>next</b> (To get next page (if paged))
725 	 *
726      * <p>
727      * <b>Definition:</b>
728      * 
729      * </p> 
730 	 */
731 	public ExtensionDt addNext() {
732 		ExtensionDt newType = new ExtensionDt();
733 		getNext().add(newType);
734 		return newType; 
735 	}
736 
737 	/**
738 	 * Gets the first repetition for <b>next</b> (To get next page (if paged)),
739 	 * creating it if it does not already exist.
740 	 *
741      * <p>
742      * <b>Definition:</b>
743      * 
744      * </p> 
745 	 */
746 	public ExtensionDt getNextFirstRep() {
747 		if (getNext().isEmpty()) {
748 			return addNext();
749 		}
750 		return getNext().get(0); 
751 	}
752   
753 	/**
754 	 * Gets the value(s) for <b>last</b> (To get last page (if paged)).
755 	 * creating it if it does
756 	 * not exist. Will not return <code>null</code>.
757 	 *
758      * <p>
759      * <b>Definition:</b>
760      * 
761      * </p> 
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 	 * Sets the value(s) for <b>last</b> (To get last page (if paged))
772 	 *
773      * <p>
774      * <b>Definition:</b>
775      * 
776      * </p> 
777 	 */
778 	public Response setLast(java.util.List<ExtensionDt> theValue) {
779 		myLast = theValue;
780 		return this;
781 	}
782 
783 	/**
784 	 * Adds and returns a new value for <b>last</b> (To get last page (if paged))
785 	 *
786      * <p>
787      * <b>Definition:</b>
788      * 
789      * </p> 
790 	 */
791 	public ExtensionDt addLast() {
792 		ExtensionDt newType = new ExtensionDt();
793 		getLast().add(newType);
794 		return newType; 
795 	}
796 
797 	/**
798 	 * Gets the first repetition for <b>last</b> (To get last page (if paged)),
799 	 * creating it if it does not already exist.
800 	 *
801      * <p>
802      * <b>Definition:</b>
803      * 
804      * </p> 
805 	 */
806 	public ExtensionDt getLastFirstRep() {
807 		if (getLast().isEmpty()) {
808 			return addLast();
809 		}
810 		return getLast().get(0); 
811 	}
812   
813 	/**
814 	 * Gets the value(s) for <b>reference</b> (Resources that are the results of the search).
815 	 * creating it if it does
816 	 * not exist. Will not return <code>null</code>.
817 	 *
818      * <p>
819      * <b>Definition:</b>
820      * 
821      * </p> 
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 	 * Sets the value(s) for <b>reference</b> (Resources that are the results of the search)
832 	 *
833      * <p>
834      * <b>Definition:</b>
835      * 
836      * </p> 
837 	 */
838 	public Response setReference(java.util.List<ResourceReferenceDt> theValue) {
839 		myReference = theValue;
840 		return this;
841 	}
842 
843 	/**
844 	 * Adds and returns a new value for <b>reference</b> (Resources that are the results of the search)
845 	 *
846      * <p>
847      * <b>Definition:</b>
848      * 
849      * </p> 
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 }