001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Thu, Mar 23, 2023 19:59+1100 for FHIR v5.0.0
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * A record of a request for service such as diagnostic investigations, treatments, or operations to be performed.
052 */
053@ResourceDef(name="ServiceRequest", profile="http://hl7.org/fhir/StructureDefinition/ServiceRequest")
054public class ServiceRequest extends DomainResource {
055
056    @Block()
057    public static class ServiceRequestOrderDetailComponent extends BackboneElement implements IBaseBackboneElement {
058        /**
059         * Indicates the context of the order details by reference.
060         */
061        @Child(name = "parameterFocus", type = {CodeableReference.class}, order=1, min=0, max=1, modifier=false, summary=false)
062        @Description(shortDefinition="The context of the order details by reference", formalDefinition="Indicates the context of the order details by reference." )
063        protected CodeableReference parameterFocus;
064
065        /**
066         * The parameter details for the service being requested.
067         */
068        @Child(name = "parameter", type = {}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
069        @Description(shortDefinition="The parameter details for the service being requested", formalDefinition="The parameter details for the service being requested." )
070        protected List<ServiceRequestOrderDetailParameterComponent> parameter;
071
072        private static final long serialVersionUID = -404214439L;
073
074    /**
075     * Constructor
076     */
077      public ServiceRequestOrderDetailComponent() {
078        super();
079      }
080
081        /**
082     * Constructor
083     */
084      public ServiceRequestOrderDetailComponent(ServiceRequestOrderDetailParameterComponent parameter) {
085        super();
086        this.addParameter(parameter);
087      }
088
089        /**
090         * @return {@link #parameterFocus} (Indicates the context of the order details by reference.)
091         */
092        public CodeableReference getParameterFocus() { 
093          if (this.parameterFocus == null)
094            if (Configuration.errorOnAutoCreate())
095              throw new Error("Attempt to auto-create ServiceRequestOrderDetailComponent.parameterFocus");
096            else if (Configuration.doAutoCreate())
097              this.parameterFocus = new CodeableReference(); // cc
098          return this.parameterFocus;
099        }
100
101        public boolean hasParameterFocus() { 
102          return this.parameterFocus != null && !this.parameterFocus.isEmpty();
103        }
104
105        /**
106         * @param value {@link #parameterFocus} (Indicates the context of the order details by reference.)
107         */
108        public ServiceRequestOrderDetailComponent setParameterFocus(CodeableReference value) { 
109          this.parameterFocus = value;
110          return this;
111        }
112
113        /**
114         * @return {@link #parameter} (The parameter details for the service being requested.)
115         */
116        public List<ServiceRequestOrderDetailParameterComponent> getParameter() { 
117          if (this.parameter == null)
118            this.parameter = new ArrayList<ServiceRequestOrderDetailParameterComponent>();
119          return this.parameter;
120        }
121
122        /**
123         * @return Returns a reference to <code>this</code> for easy method chaining
124         */
125        public ServiceRequestOrderDetailComponent setParameter(List<ServiceRequestOrderDetailParameterComponent> theParameter) { 
126          this.parameter = theParameter;
127          return this;
128        }
129
130        public boolean hasParameter() { 
131          if (this.parameter == null)
132            return false;
133          for (ServiceRequestOrderDetailParameterComponent item : this.parameter)
134            if (!item.isEmpty())
135              return true;
136          return false;
137        }
138
139        public ServiceRequestOrderDetailParameterComponent addParameter() { //3
140          ServiceRequestOrderDetailParameterComponent t = new ServiceRequestOrderDetailParameterComponent();
141          if (this.parameter == null)
142            this.parameter = new ArrayList<ServiceRequestOrderDetailParameterComponent>();
143          this.parameter.add(t);
144          return t;
145        }
146
147        public ServiceRequestOrderDetailComponent addParameter(ServiceRequestOrderDetailParameterComponent t) { //3
148          if (t == null)
149            return this;
150          if (this.parameter == null)
151            this.parameter = new ArrayList<ServiceRequestOrderDetailParameterComponent>();
152          this.parameter.add(t);
153          return this;
154        }
155
156        /**
157         * @return The first repetition of repeating field {@link #parameter}, creating it if it does not already exist {3}
158         */
159        public ServiceRequestOrderDetailParameterComponent getParameterFirstRep() { 
160          if (getParameter().isEmpty()) {
161            addParameter();
162          }
163          return getParameter().get(0);
164        }
165
166        protected void listChildren(List<Property> children) {
167          super.listChildren(children);
168          children.add(new Property("parameterFocus", "CodeableReference(Device|DeviceDefinition|DeviceRequest|SupplyRequest|Medication|MedicationRequest|BiologicallyDerivedProduct|Substance)", "Indicates the context of the order details by reference.", 0, 1, parameterFocus));
169          children.add(new Property("parameter", "", "The parameter details for the service being requested.", 0, java.lang.Integer.MAX_VALUE, parameter));
170        }
171
172        @Override
173        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
174          switch (_hash) {
175          case 1110086319: /*parameterFocus*/  return new Property("parameterFocus", "CodeableReference(Device|DeviceDefinition|DeviceRequest|SupplyRequest|Medication|MedicationRequest|BiologicallyDerivedProduct|Substance)", "Indicates the context of the order details by reference.", 0, 1, parameterFocus);
176          case 1954460585: /*parameter*/  return new Property("parameter", "", "The parameter details for the service being requested.", 0, java.lang.Integer.MAX_VALUE, parameter);
177          default: return super.getNamedProperty(_hash, _name, _checkValid);
178          }
179
180        }
181
182      @Override
183      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
184        switch (hash) {
185        case 1110086319: /*parameterFocus*/ return this.parameterFocus == null ? new Base[0] : new Base[] {this.parameterFocus}; // CodeableReference
186        case 1954460585: /*parameter*/ return this.parameter == null ? new Base[0] : this.parameter.toArray(new Base[this.parameter.size()]); // ServiceRequestOrderDetailParameterComponent
187        default: return super.getProperty(hash, name, checkValid);
188        }
189
190      }
191
192      @Override
193      public Base setProperty(int hash, String name, Base value) throws FHIRException {
194        switch (hash) {
195        case 1110086319: // parameterFocus
196          this.parameterFocus = TypeConvertor.castToCodeableReference(value); // CodeableReference
197          return value;
198        case 1954460585: // parameter
199          this.getParameter().add((ServiceRequestOrderDetailParameterComponent) value); // ServiceRequestOrderDetailParameterComponent
200          return value;
201        default: return super.setProperty(hash, name, value);
202        }
203
204      }
205
206      @Override
207      public Base setProperty(String name, Base value) throws FHIRException {
208        if (name.equals("parameterFocus")) {
209          this.parameterFocus = TypeConvertor.castToCodeableReference(value); // CodeableReference
210        } else if (name.equals("parameter")) {
211          this.getParameter().add((ServiceRequestOrderDetailParameterComponent) value);
212        } else
213          return super.setProperty(name, value);
214        return value;
215      }
216
217      @Override
218      public Base makeProperty(int hash, String name) throws FHIRException {
219        switch (hash) {
220        case 1110086319:  return getParameterFocus();
221        case 1954460585:  return addParameter(); 
222        default: return super.makeProperty(hash, name);
223        }
224
225      }
226
227      @Override
228      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
229        switch (hash) {
230        case 1110086319: /*parameterFocus*/ return new String[] {"CodeableReference"};
231        case 1954460585: /*parameter*/ return new String[] {};
232        default: return super.getTypesForProperty(hash, name);
233        }
234
235      }
236
237      @Override
238      public Base addChild(String name) throws FHIRException {
239        if (name.equals("parameterFocus")) {
240          this.parameterFocus = new CodeableReference();
241          return this.parameterFocus;
242        }
243        else if (name.equals("parameter")) {
244          return addParameter();
245        }
246        else
247          return super.addChild(name);
248      }
249
250      public ServiceRequestOrderDetailComponent copy() {
251        ServiceRequestOrderDetailComponent dst = new ServiceRequestOrderDetailComponent();
252        copyValues(dst);
253        return dst;
254      }
255
256      public void copyValues(ServiceRequestOrderDetailComponent dst) {
257        super.copyValues(dst);
258        dst.parameterFocus = parameterFocus == null ? null : parameterFocus.copy();
259        if (parameter != null) {
260          dst.parameter = new ArrayList<ServiceRequestOrderDetailParameterComponent>();
261          for (ServiceRequestOrderDetailParameterComponent i : parameter)
262            dst.parameter.add(i.copy());
263        };
264      }
265
266      @Override
267      public boolean equalsDeep(Base other_) {
268        if (!super.equalsDeep(other_))
269          return false;
270        if (!(other_ instanceof ServiceRequestOrderDetailComponent))
271          return false;
272        ServiceRequestOrderDetailComponent o = (ServiceRequestOrderDetailComponent) other_;
273        return compareDeep(parameterFocus, o.parameterFocus, true) && compareDeep(parameter, o.parameter, true)
274          ;
275      }
276
277      @Override
278      public boolean equalsShallow(Base other_) {
279        if (!super.equalsShallow(other_))
280          return false;
281        if (!(other_ instanceof ServiceRequestOrderDetailComponent))
282          return false;
283        ServiceRequestOrderDetailComponent o = (ServiceRequestOrderDetailComponent) other_;
284        return true;
285      }
286
287      public boolean isEmpty() {
288        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(parameterFocus, parameter
289          );
290      }
291
292  public String fhirType() {
293    return "ServiceRequest.orderDetail";
294
295  }
296
297  }
298
299    @Block()
300    public static class ServiceRequestOrderDetailParameterComponent extends BackboneElement implements IBaseBackboneElement {
301        /**
302         * A value representing the additional detail or instructions for the order (e.g., catheter insertion, body elevation, descriptive device configuration and/or setting instructions).
303         */
304        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
305        @Description(shortDefinition="The detail of the order being requested", formalDefinition="A value representing the additional detail or instructions for the order (e.g., catheter insertion, body elevation, descriptive device configuration and/or setting instructions)." )
306        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/servicerequest-orderdetail-parameter-code")
307        protected CodeableConcept code;
308
309        /**
310         * Indicates a value for the order detail.
311         */
312        @Child(name = "value", type = {Quantity.class, Ratio.class, Range.class, BooleanType.class, CodeableConcept.class, StringType.class, Period.class}, order=2, min=1, max=1, modifier=false, summary=true)
313        @Description(shortDefinition="The value for the order detail", formalDefinition="Indicates a value for the order detail." )
314        protected DataType value;
315
316        private static final long serialVersionUID = -1950789033L;
317
318    /**
319     * Constructor
320     */
321      public ServiceRequestOrderDetailParameterComponent() {
322        super();
323      }
324
325    /**
326     * Constructor
327     */
328      public ServiceRequestOrderDetailParameterComponent(CodeableConcept code, DataType value) {
329        super();
330        this.setCode(code);
331        this.setValue(value);
332      }
333
334        /**
335         * @return {@link #code} (A value representing the additional detail or instructions for the order (e.g., catheter insertion, body elevation, descriptive device configuration and/or setting instructions).)
336         */
337        public CodeableConcept getCode() { 
338          if (this.code == null)
339            if (Configuration.errorOnAutoCreate())
340              throw new Error("Attempt to auto-create ServiceRequestOrderDetailParameterComponent.code");
341            else if (Configuration.doAutoCreate())
342              this.code = new CodeableConcept(); // cc
343          return this.code;
344        }
345
346        public boolean hasCode() { 
347          return this.code != null && !this.code.isEmpty();
348        }
349
350        /**
351         * @param value {@link #code} (A value representing the additional detail or instructions for the order (e.g., catheter insertion, body elevation, descriptive device configuration and/or setting instructions).)
352         */
353        public ServiceRequestOrderDetailParameterComponent setCode(CodeableConcept value) { 
354          this.code = value;
355          return this;
356        }
357
358        /**
359         * @return {@link #value} (Indicates a value for the order detail.)
360         */
361        public DataType getValue() { 
362          return this.value;
363        }
364
365        /**
366         * @return {@link #value} (Indicates a value for the order detail.)
367         */
368        public Quantity getValueQuantity() throws FHIRException { 
369          if (this.value == null)
370            this.value = new Quantity();
371          if (!(this.value instanceof Quantity))
372            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered");
373          return (Quantity) this.value;
374        }
375
376        public boolean hasValueQuantity() { 
377          return this != null && this.value instanceof Quantity;
378        }
379
380        /**
381         * @return {@link #value} (Indicates a value for the order detail.)
382         */
383        public Ratio getValueRatio() throws FHIRException { 
384          if (this.value == null)
385            this.value = new Ratio();
386          if (!(this.value instanceof Ratio))
387            throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.value.getClass().getName()+" was encountered");
388          return (Ratio) this.value;
389        }
390
391        public boolean hasValueRatio() { 
392          return this != null && this.value instanceof Ratio;
393        }
394
395        /**
396         * @return {@link #value} (Indicates a value for the order detail.)
397         */
398        public Range getValueRange() throws FHIRException { 
399          if (this.value == null)
400            this.value = new Range();
401          if (!(this.value instanceof Range))
402            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered");
403          return (Range) this.value;
404        }
405
406        public boolean hasValueRange() { 
407          return this != null && this.value instanceof Range;
408        }
409
410        /**
411         * @return {@link #value} (Indicates a value for the order detail.)
412         */
413        public BooleanType getValueBooleanType() throws FHIRException { 
414          if (this.value == null)
415            this.value = new BooleanType();
416          if (!(this.value instanceof BooleanType))
417            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered");
418          return (BooleanType) this.value;
419        }
420
421        public boolean hasValueBooleanType() { 
422          return this != null && this.value instanceof BooleanType;
423        }
424
425        /**
426         * @return {@link #value} (Indicates a value for the order detail.)
427         */
428        public CodeableConcept getValueCodeableConcept() throws FHIRException { 
429          if (this.value == null)
430            this.value = new CodeableConcept();
431          if (!(this.value instanceof CodeableConcept))
432            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered");
433          return (CodeableConcept) this.value;
434        }
435
436        public boolean hasValueCodeableConcept() { 
437          return this != null && this.value instanceof CodeableConcept;
438        }
439
440        /**
441         * @return {@link #value} (Indicates a value for the order detail.)
442         */
443        public StringType getValueStringType() throws FHIRException { 
444          if (this.value == null)
445            this.value = new StringType();
446          if (!(this.value instanceof StringType))
447            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered");
448          return (StringType) this.value;
449        }
450
451        public boolean hasValueStringType() { 
452          return this != null && this.value instanceof StringType;
453        }
454
455        /**
456         * @return {@link #value} (Indicates a value for the order detail.)
457         */
458        public Period getValuePeriod() throws FHIRException { 
459          if (this.value == null)
460            this.value = new Period();
461          if (!(this.value instanceof Period))
462            throw new FHIRException("Type mismatch: the type Period was expected, but "+this.value.getClass().getName()+" was encountered");
463          return (Period) this.value;
464        }
465
466        public boolean hasValuePeriod() { 
467          return this != null && this.value instanceof Period;
468        }
469
470        public boolean hasValue() { 
471          return this.value != null && !this.value.isEmpty();
472        }
473
474        /**
475         * @param value {@link #value} (Indicates a value for the order detail.)
476         */
477        public ServiceRequestOrderDetailParameterComponent setValue(DataType value) { 
478          if (value != null && !(value instanceof Quantity || value instanceof Ratio || value instanceof Range || value instanceof BooleanType || value instanceof CodeableConcept || value instanceof StringType || value instanceof Period))
479            throw new FHIRException("Not the right type for ServiceRequest.orderDetail.parameter.value[x]: "+value.fhirType());
480          this.value = value;
481          return this;
482        }
483
484        protected void listChildren(List<Property> children) {
485          super.listChildren(children);
486          children.add(new Property("code", "CodeableConcept", "A value representing the additional detail or instructions for the order (e.g., catheter insertion, body elevation, descriptive device configuration and/or setting instructions).", 0, 1, code));
487          children.add(new Property("value[x]", "Quantity|Ratio|Range|boolean|CodeableConcept|string|Period", "Indicates a value for the order detail.", 0, 1, value));
488        }
489
490        @Override
491        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
492          switch (_hash) {
493          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "A value representing the additional detail or instructions for the order (e.g., catheter insertion, body elevation, descriptive device configuration and/or setting instructions).", 0, 1, code);
494          case -1410166417: /*value[x]*/  return new Property("value[x]", "Quantity|Ratio|Range|boolean|CodeableConcept|string|Period", "Indicates a value for the order detail.", 0, 1, value);
495          case 111972721: /*value*/  return new Property("value[x]", "Quantity|Ratio|Range|boolean|CodeableConcept|string|Period", "Indicates a value for the order detail.", 0, 1, value);
496          case -2029823716: /*valueQuantity*/  return new Property("value[x]", "Quantity", "Indicates a value for the order detail.", 0, 1, value);
497          case 2030767386: /*valueRatio*/  return new Property("value[x]", "Ratio", "Indicates a value for the order detail.", 0, 1, value);
498          case 2030761548: /*valueRange*/  return new Property("value[x]", "Range", "Indicates a value for the order detail.", 0, 1, value);
499          case 733421943: /*valueBoolean*/  return new Property("value[x]", "boolean", "Indicates a value for the order detail.", 0, 1, value);
500          case 924902896: /*valueCodeableConcept*/  return new Property("value[x]", "CodeableConcept", "Indicates a value for the order detail.", 0, 1, value);
501          case -1424603934: /*valueString*/  return new Property("value[x]", "string", "Indicates a value for the order detail.", 0, 1, value);
502          case -1524344174: /*valuePeriod*/  return new Property("value[x]", "Period", "Indicates a value for the order detail.", 0, 1, value);
503          default: return super.getNamedProperty(_hash, _name, _checkValid);
504          }
505
506        }
507
508      @Override
509      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
510        switch (hash) {
511        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
512        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DataType
513        default: return super.getProperty(hash, name, checkValid);
514        }
515
516      }
517
518      @Override
519      public Base setProperty(int hash, String name, Base value) throws FHIRException {
520        switch (hash) {
521        case 3059181: // code
522          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
523          return value;
524        case 111972721: // value
525          this.value = TypeConvertor.castToType(value); // DataType
526          return value;
527        default: return super.setProperty(hash, name, value);
528        }
529
530      }
531
532      @Override
533      public Base setProperty(String name, Base value) throws FHIRException {
534        if (name.equals("code")) {
535          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
536        } else if (name.equals("value[x]")) {
537          this.value = TypeConvertor.castToType(value); // DataType
538        } else
539          return super.setProperty(name, value);
540        return value;
541      }
542
543      @Override
544      public Base makeProperty(int hash, String name) throws FHIRException {
545        switch (hash) {
546        case 3059181:  return getCode();
547        case -1410166417:  return getValue();
548        case 111972721:  return getValue();
549        default: return super.makeProperty(hash, name);
550        }
551
552      }
553
554      @Override
555      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
556        switch (hash) {
557        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
558        case 111972721: /*value*/ return new String[] {"Quantity", "Ratio", "Range", "boolean", "CodeableConcept", "string", "Period"};
559        default: return super.getTypesForProperty(hash, name);
560        }
561
562      }
563
564      @Override
565      public Base addChild(String name) throws FHIRException {
566        if (name.equals("code")) {
567          this.code = new CodeableConcept();
568          return this.code;
569        }
570        else if (name.equals("valueQuantity")) {
571          this.value = new Quantity();
572          return this.value;
573        }
574        else if (name.equals("valueRatio")) {
575          this.value = new Ratio();
576          return this.value;
577        }
578        else if (name.equals("valueRange")) {
579          this.value = new Range();
580          return this.value;
581        }
582        else if (name.equals("valueBoolean")) {
583          this.value = new BooleanType();
584          return this.value;
585        }
586        else if (name.equals("valueCodeableConcept")) {
587          this.value = new CodeableConcept();
588          return this.value;
589        }
590        else if (name.equals("valueString")) {
591          this.value = new StringType();
592          return this.value;
593        }
594        else if (name.equals("valuePeriod")) {
595          this.value = new Period();
596          return this.value;
597        }
598        else
599          return super.addChild(name);
600      }
601
602      public ServiceRequestOrderDetailParameterComponent copy() {
603        ServiceRequestOrderDetailParameterComponent dst = new ServiceRequestOrderDetailParameterComponent();
604        copyValues(dst);
605        return dst;
606      }
607
608      public void copyValues(ServiceRequestOrderDetailParameterComponent dst) {
609        super.copyValues(dst);
610        dst.code = code == null ? null : code.copy();
611        dst.value = value == null ? null : value.copy();
612      }
613
614      @Override
615      public boolean equalsDeep(Base other_) {
616        if (!super.equalsDeep(other_))
617          return false;
618        if (!(other_ instanceof ServiceRequestOrderDetailParameterComponent))
619          return false;
620        ServiceRequestOrderDetailParameterComponent o = (ServiceRequestOrderDetailParameterComponent) other_;
621        return compareDeep(code, o.code, true) && compareDeep(value, o.value, true);
622      }
623
624      @Override
625      public boolean equalsShallow(Base other_) {
626        if (!super.equalsShallow(other_))
627          return false;
628        if (!(other_ instanceof ServiceRequestOrderDetailParameterComponent))
629          return false;
630        ServiceRequestOrderDetailParameterComponent o = (ServiceRequestOrderDetailParameterComponent) other_;
631        return true;
632      }
633
634      public boolean isEmpty() {
635        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, value);
636      }
637
638  public String fhirType() {
639    return "ServiceRequest.orderDetail.parameter";
640
641  }
642
643  }
644
645    @Block()
646    public static class ServiceRequestPatientInstructionComponent extends BackboneElement implements IBaseBackboneElement {
647        /**
648         * Instructions in terms that are understood by the patient or consumer.
649         */
650        @Child(name = "instruction", type = {MarkdownType.class, DocumentReference.class}, order=1, min=0, max=1, modifier=false, summary=true)
651        @Description(shortDefinition="Patient or consumer-oriented instructions", formalDefinition="Instructions in terms that are understood by the patient or consumer." )
652        protected DataType instruction;
653
654        private static final long serialVersionUID = 474568404L;
655
656    /**
657     * Constructor
658     */
659      public ServiceRequestPatientInstructionComponent() {
660        super();
661      }
662
663        /**
664         * @return {@link #instruction} (Instructions in terms that are understood by the patient or consumer.)
665         */
666        public DataType getInstruction() { 
667          return this.instruction;
668        }
669
670        /**
671         * @return {@link #instruction} (Instructions in terms that are understood by the patient or consumer.)
672         */
673        public MarkdownType getInstructionMarkdownType() throws FHIRException { 
674          if (this.instruction == null)
675            this.instruction = new MarkdownType();
676          if (!(this.instruction instanceof MarkdownType))
677            throw new FHIRException("Type mismatch: the type MarkdownType was expected, but "+this.instruction.getClass().getName()+" was encountered");
678          return (MarkdownType) this.instruction;
679        }
680
681        public boolean hasInstructionMarkdownType() { 
682          return this != null && this.instruction instanceof MarkdownType;
683        }
684
685        /**
686         * @return {@link #instruction} (Instructions in terms that are understood by the patient or consumer.)
687         */
688        public Reference getInstructionReference() throws FHIRException { 
689          if (this.instruction == null)
690            this.instruction = new Reference();
691          if (!(this.instruction instanceof Reference))
692            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.instruction.getClass().getName()+" was encountered");
693          return (Reference) this.instruction;
694        }
695
696        public boolean hasInstructionReference() { 
697          return this != null && this.instruction instanceof Reference;
698        }
699
700        public boolean hasInstruction() { 
701          return this.instruction != null && !this.instruction.isEmpty();
702        }
703
704        /**
705         * @param value {@link #instruction} (Instructions in terms that are understood by the patient or consumer.)
706         */
707        public ServiceRequestPatientInstructionComponent setInstruction(DataType value) { 
708          if (value != null && !(value instanceof MarkdownType || value instanceof Reference))
709            throw new FHIRException("Not the right type for ServiceRequest.patientInstruction.instruction[x]: "+value.fhirType());
710          this.instruction = value;
711          return this;
712        }
713
714        protected void listChildren(List<Property> children) {
715          super.listChildren(children);
716          children.add(new Property("instruction[x]", "markdown|Reference(DocumentReference)", "Instructions in terms that are understood by the patient or consumer.", 0, 1, instruction));
717        }
718
719        @Override
720        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
721          switch (_hash) {
722          case 1989248306: /*instruction[x]*/  return new Property("instruction[x]", "markdown|Reference(DocumentReference)", "Instructions in terms that are understood by the patient or consumer.", 0, 1, instruction);
723          case 301526158: /*instruction*/  return new Property("instruction[x]", "markdown|Reference(DocumentReference)", "Instructions in terms that are understood by the patient or consumer.", 0, 1, instruction);
724          case 13950877: /*instructionMarkdown*/  return new Property("instruction[x]", "markdown", "Instructions in terms that are understood by the patient or consumer.", 0, 1, instruction);
725          case 442151517: /*instructionReference*/  return new Property("instruction[x]", "Reference(DocumentReference)", "Instructions in terms that are understood by the patient or consumer.", 0, 1, instruction);
726          default: return super.getNamedProperty(_hash, _name, _checkValid);
727          }
728
729        }
730
731      @Override
732      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
733        switch (hash) {
734        case 301526158: /*instruction*/ return this.instruction == null ? new Base[0] : new Base[] {this.instruction}; // DataType
735        default: return super.getProperty(hash, name, checkValid);
736        }
737
738      }
739
740      @Override
741      public Base setProperty(int hash, String name, Base value) throws FHIRException {
742        switch (hash) {
743        case 301526158: // instruction
744          this.instruction = TypeConvertor.castToType(value); // DataType
745          return value;
746        default: return super.setProperty(hash, name, value);
747        }
748
749      }
750
751      @Override
752      public Base setProperty(String name, Base value) throws FHIRException {
753        if (name.equals("instruction[x]")) {
754          this.instruction = TypeConvertor.castToType(value); // DataType
755        } else
756          return super.setProperty(name, value);
757        return value;
758      }
759
760      @Override
761      public Base makeProperty(int hash, String name) throws FHIRException {
762        switch (hash) {
763        case 1989248306:  return getInstruction();
764        case 301526158:  return getInstruction();
765        default: return super.makeProperty(hash, name);
766        }
767
768      }
769
770      @Override
771      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
772        switch (hash) {
773        case 301526158: /*instruction*/ return new String[] {"markdown", "Reference"};
774        default: return super.getTypesForProperty(hash, name);
775        }
776
777      }
778
779      @Override
780      public Base addChild(String name) throws FHIRException {
781        if (name.equals("instructionMarkdown")) {
782          this.instruction = new MarkdownType();
783          return this.instruction;
784        }
785        else if (name.equals("instructionReference")) {
786          this.instruction = new Reference();
787          return this.instruction;
788        }
789        else
790          return super.addChild(name);
791      }
792
793      public ServiceRequestPatientInstructionComponent copy() {
794        ServiceRequestPatientInstructionComponent dst = new ServiceRequestPatientInstructionComponent();
795        copyValues(dst);
796        return dst;
797      }
798
799      public void copyValues(ServiceRequestPatientInstructionComponent dst) {
800        super.copyValues(dst);
801        dst.instruction = instruction == null ? null : instruction.copy();
802      }
803
804      @Override
805      public boolean equalsDeep(Base other_) {
806        if (!super.equalsDeep(other_))
807          return false;
808        if (!(other_ instanceof ServiceRequestPatientInstructionComponent))
809          return false;
810        ServiceRequestPatientInstructionComponent o = (ServiceRequestPatientInstructionComponent) other_;
811        return compareDeep(instruction, o.instruction, true);
812      }
813
814      @Override
815      public boolean equalsShallow(Base other_) {
816        if (!super.equalsShallow(other_))
817          return false;
818        if (!(other_ instanceof ServiceRequestPatientInstructionComponent))
819          return false;
820        ServiceRequestPatientInstructionComponent o = (ServiceRequestPatientInstructionComponent) other_;
821        return true;
822      }
823
824      public boolean isEmpty() {
825        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(instruction);
826      }
827
828  public String fhirType() {
829    return "ServiceRequest.patientInstruction";
830
831  }
832
833  }
834
835    /**
836     * Identifiers assigned to this order instance by the orderer and/or the receiver and/or order fulfiller.
837     */
838    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
839    @Description(shortDefinition="Identifiers assigned to this order", formalDefinition="Identifiers assigned to this order instance by the orderer and/or the receiver and/or order fulfiller." )
840    protected List<Identifier> identifier;
841
842    /**
843     * The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this ServiceRequest.
844     */
845    @Child(name = "instantiatesCanonical", type = {CanonicalType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
846    @Description(shortDefinition="Instantiates FHIR protocol or definition", formalDefinition="The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this ServiceRequest." )
847    protected List<CanonicalType> instantiatesCanonical;
848
849    /**
850     * The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this ServiceRequest.
851     */
852    @Child(name = "instantiatesUri", type = {UriType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
853    @Description(shortDefinition="Instantiates external protocol or definition", formalDefinition="The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this ServiceRequest." )
854    protected List<UriType> instantiatesUri;
855
856    /**
857     * Plan/proposal/order fulfilled by this request.
858     */
859    @Child(name = "basedOn", type = {CarePlan.class, ServiceRequest.class, MedicationRequest.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
860    @Description(shortDefinition="What request fulfills", formalDefinition="Plan/proposal/order fulfilled by this request." )
861    protected List<Reference> basedOn;
862
863    /**
864     * The request takes the place of the referenced completed or terminated request(s).
865     */
866    @Child(name = "replaces", type = {ServiceRequest.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
867    @Description(shortDefinition="What request replaces", formalDefinition="The request takes the place of the referenced completed or terminated request(s)." )
868    protected List<Reference> replaces;
869
870    /**
871     * A shared identifier common to all service requests that were authorized more or less simultaneously by a single author, representing the composite or group identifier.
872     */
873    @Child(name = "requisition", type = {Identifier.class}, order=5, min=0, max=1, modifier=false, summary=true)
874    @Description(shortDefinition="Composite Request ID", formalDefinition="A shared identifier common to all service requests that were authorized more or less simultaneously by a single author, representing the composite or group identifier." )
875    protected Identifier requisition;
876
877    /**
878     * The status of the order.
879     */
880    @Child(name = "status", type = {CodeType.class}, order=6, min=1, max=1, modifier=true, summary=true)
881    @Description(shortDefinition="draft | active | on-hold | revoked | completed | entered-in-error | unknown", formalDefinition="The status of the order." )
882    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/request-status")
883    protected Enumeration<RequestStatus> status;
884
885    /**
886     * Whether the request is a proposal, plan, an original order or a reflex order.
887     */
888    @Child(name = "intent", type = {CodeType.class}, order=7, min=1, max=1, modifier=true, summary=true)
889    @Description(shortDefinition="proposal | plan | directive | order +", formalDefinition="Whether the request is a proposal, plan, an original order or a reflex order." )
890    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/request-intent")
891    protected Enumeration<RequestIntent> intent;
892
893    /**
894     * A code that classifies the service for searching, sorting and display purposes (e.g. "Surgical Procedure").
895     */
896    @Child(name = "category", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
897    @Description(shortDefinition="Classification of service", formalDefinition="A code that classifies the service for searching, sorting and display purposes (e.g. \"Surgical Procedure\")." )
898    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/servicerequest-category")
899    protected List<CodeableConcept> category;
900
901    /**
902     * Indicates how quickly the ServiceRequest should be addressed with respect to other requests.
903     */
904    @Child(name = "priority", type = {CodeType.class}, order=9, min=0, max=1, modifier=false, summary=true)
905    @Description(shortDefinition="routine | urgent | asap | stat", formalDefinition="Indicates how quickly the ServiceRequest should be addressed with respect to other requests." )
906    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/request-priority")
907    protected Enumeration<RequestPriority> priority;
908
909    /**
910     * Set this to true if the record is saying that the service/procedure should NOT be performed.
911     */
912    @Child(name = "doNotPerform", type = {BooleanType.class}, order=10, min=0, max=1, modifier=true, summary=true)
913    @Description(shortDefinition="True if service/procedure should not be performed", formalDefinition="Set this to true if the record is saying that the service/procedure should NOT be performed." )
914    protected BooleanType doNotPerform;
915
916    /**
917     * A code or reference that identifies a particular service (i.e., procedure, diagnostic investigation, or panel of investigations) that have been requested.
918     */
919    @Child(name = "code", type = {CodeableReference.class}, order=11, min=0, max=1, modifier=false, summary=true)
920    @Description(shortDefinition="What is being requested/ordered", formalDefinition="A code or reference that identifies a particular service (i.e., procedure, diagnostic investigation, or panel of investigations) that have been requested." )
921    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/procedure-code")
922    protected CodeableReference code;
923
924    /**
925     * Additional details and instructions about the how the services are to be delivered.   For example, and order for a urinary catheter may have an order detail for an external or indwelling catheter, or an order for a bandage may require additional instructions specifying how the bandage should be applied.
926     */
927    @Child(name = "orderDetail", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
928    @Description(shortDefinition="Additional order information", formalDefinition="Additional details and instructions about the how the services are to be delivered.   For example, and order for a urinary catheter may have an order detail for an external or indwelling catheter, or an order for a bandage may require additional instructions specifying how the bandage should be applied." )
929    protected List<ServiceRequestOrderDetailComponent> orderDetail;
930
931    /**
932     * An amount of service being requested which can be a quantity ( for example $1,500 home modification), a ratio ( for example, 20 half day visits per month), or a range (2.0 to 1.8 Gy per fraction).
933     */
934    @Child(name = "quantity", type = {Quantity.class, Ratio.class, Range.class}, order=13, min=0, max=1, modifier=false, summary=true)
935    @Description(shortDefinition="Service amount", formalDefinition="An amount of service being requested which can be a quantity ( for example $1,500 home modification), a ratio ( for example, 20 half day visits per month), or a range (2.0 to 1.8 Gy per fraction)." )
936    protected DataType quantity;
937
938    /**
939     * On whom or what the service is to be performed. This is usually a human patient, but can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).
940     */
941    @Child(name = "subject", type = {Patient.class, Group.class, Location.class, Device.class}, order=14, min=1, max=1, modifier=false, summary=true)
942    @Description(shortDefinition="Individual or Entity the service is ordered for", formalDefinition="On whom or what the service is to be performed. This is usually a human patient, but can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans)." )
943    protected Reference subject;
944
945    /**
946     * The actual focus of a service request when it is not the subject of record representing something or someone associated with the subject such as a spouse, parent, fetus, or donor. The focus of a service request could also be an existing condition,  an intervention, the subject's diet,  another service request on the subject,  or a body structure such as tumor or implanted device.
947     */
948    @Child(name = "focus", type = {Reference.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
949    @Description(shortDefinition="What the service request is about, when it is not about the subject of record", formalDefinition="The actual focus of a service request when it is not the subject of record representing something or someone associated with the subject such as a spouse, parent, fetus, or donor. The focus of a service request could also be an existing condition,  an intervention, the subject's diet,  another service request on the subject,  or a body structure such as tumor or implanted device." )
950    protected List<Reference> focus;
951
952    /**
953     * An encounter that provides additional information about the healthcare context in which this request is made.
954     */
955    @Child(name = "encounter", type = {Encounter.class}, order=16, min=0, max=1, modifier=false, summary=true)
956    @Description(shortDefinition="Encounter in which the request was created", formalDefinition="An encounter that provides additional information about the healthcare context in which this request is made." )
957    protected Reference encounter;
958
959    /**
960     * The date/time at which the requested service should occur.
961     */
962    @Child(name = "occurrence", type = {DateTimeType.class, Period.class, Timing.class}, order=17, min=0, max=1, modifier=false, summary=true)
963    @Description(shortDefinition="When service should occur", formalDefinition="The date/time at which the requested service should occur." )
964    protected DataType occurrence;
965
966    /**
967     * If a CodeableConcept is present, it indicates the pre-condition for performing the service.  For example "pain", "on flare-up", etc.
968     */
969    @Child(name = "asNeeded", type = {BooleanType.class, CodeableConcept.class}, order=18, min=0, max=1, modifier=false, summary=true)
970    @Description(shortDefinition="Preconditions for service", formalDefinition="If a CodeableConcept is present, it indicates the pre-condition for performing the service.  For example \"pain\", \"on flare-up\", etc." )
971    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medication-as-needed-reason")
972    protected DataType asNeeded;
973
974    /**
975     * When the request transitioned to being actionable.
976     */
977    @Child(name = "authoredOn", type = {DateTimeType.class}, order=19, min=0, max=1, modifier=false, summary=true)
978    @Description(shortDefinition="Date request signed", formalDefinition="When the request transitioned to being actionable." )
979    protected DateTimeType authoredOn;
980
981    /**
982     * The individual who initiated the request and has responsibility for its activation.
983     */
984    @Child(name = "requester", type = {Practitioner.class, PractitionerRole.class, Organization.class, Patient.class, RelatedPerson.class, Device.class}, order=20, min=0, max=1, modifier=false, summary=true)
985    @Description(shortDefinition="Who/what is requesting service", formalDefinition="The individual who initiated the request and has responsibility for its activation." )
986    protected Reference requester;
987
988    /**
989     * Desired type of performer for doing the requested service.
990     */
991    @Child(name = "performerType", type = {CodeableConcept.class}, order=21, min=0, max=1, modifier=false, summary=true)
992    @Description(shortDefinition="Performer role", formalDefinition="Desired type of performer for doing the requested service." )
993    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/participant-role")
994    protected CodeableConcept performerType;
995
996    /**
997     * The desired performer for doing the requested service.  For example, the surgeon, dermatopathologist, endoscopist, etc.
998     */
999    @Child(name = "performer", type = {Practitioner.class, PractitionerRole.class, Organization.class, CareTeam.class, HealthcareService.class, Patient.class, Device.class, RelatedPerson.class}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1000    @Description(shortDefinition="Requested performer", formalDefinition="The desired performer for doing the requested service.  For example, the surgeon, dermatopathologist, endoscopist, etc." )
1001    protected List<Reference> performer;
1002
1003    /**
1004     * The preferred location(s) where the procedure should actually happen in coded or free text form. E.g. at home or nursing day care center.
1005     */
1006    @Child(name = "location", type = {CodeableReference.class}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1007    @Description(shortDefinition="Requested location", formalDefinition="The preferred location(s) where the procedure should actually happen in coded or free text form. E.g. at home or nursing day care center." )
1008    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://terminology.hl7.org/ValueSet/v3-ServiceDeliveryLocationRoleType")
1009    protected List<CodeableReference> location;
1010
1011    /**
1012     * An explanation or justification for why this service is being requested in coded or textual form.   This is often for billing purposes.  May relate to the resources referred to in `supportingInfo`.
1013     */
1014    @Child(name = "reason", type = {CodeableReference.class}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1015    @Description(shortDefinition="Explanation/Justification for procedure or service", formalDefinition="An explanation or justification for why this service is being requested in coded or textual form.   This is often for billing purposes.  May relate to the resources referred to in `supportingInfo`." )
1016    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/procedure-reason")
1017    protected List<CodeableReference> reason;
1018
1019    /**
1020     * Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be needed for delivering the requested service.
1021     */
1022    @Child(name = "insurance", type = {Coverage.class, ClaimResponse.class}, order=25, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1023    @Description(shortDefinition="Associated insurance coverage", formalDefinition="Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be needed for delivering the requested service." )
1024    protected List<Reference> insurance;
1025
1026    /**
1027     * Additional clinical information about the patient or specimen that may influence the services or their interpretations.     This information includes diagnosis, clinical findings and other observations.  In laboratory ordering these are typically referred to as "ask at order entry questions (AOEs)".  This includes observations explicitly requested by the producer (filler) to provide context or supporting information needed to complete the order. For example,  reporting the amount of inspired oxygen for blood gas measurements.
1028     */
1029    @Child(name = "supportingInfo", type = {CodeableReference.class}, order=26, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1030    @Description(shortDefinition="Additional clinical information", formalDefinition="Additional clinical information about the patient or specimen that may influence the services or their interpretations.     This information includes diagnosis, clinical findings and other observations.  In laboratory ordering these are typically referred to as \"ask at order entry questions (AOEs)\".  This includes observations explicitly requested by the producer (filler) to provide context or supporting information needed to complete the order. For example,  reporting the amount of inspired oxygen for blood gas measurements." )
1031    protected List<CodeableReference> supportingInfo;
1032
1033    /**
1034     * One or more specimens that the laboratory procedure will use.
1035     */
1036    @Child(name = "specimen", type = {Specimen.class}, order=27, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1037    @Description(shortDefinition="Procedure Samples", formalDefinition="One or more specimens that the laboratory procedure will use." )
1038    protected List<Reference> specimen;
1039
1040    /**
1041     * Anatomic location where the procedure should be performed. This is the target site.
1042     */
1043    @Child(name = "bodySite", type = {CodeableConcept.class}, order=28, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1044    @Description(shortDefinition="Coded location on Body", formalDefinition="Anatomic location where the procedure should be performed. This is the target site." )
1045    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/body-site")
1046    protected List<CodeableConcept> bodySite;
1047
1048    /**
1049     * Anatomic location where the procedure should be performed. This is the target site.
1050     */
1051    @Child(name = "bodyStructure", type = {BodyStructure.class}, order=29, min=0, max=1, modifier=false, summary=true)
1052    @Description(shortDefinition="BodyStructure-based location on the body", formalDefinition="Anatomic location where the procedure should be performed. This is the target site." )
1053    protected Reference bodyStructure;
1054
1055    /**
1056     * Any other notes and comments made about the service request. For example, internal billing notes.
1057     */
1058    @Child(name = "note", type = {Annotation.class}, order=30, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1059    @Description(shortDefinition="Comments", formalDefinition="Any other notes and comments made about the service request. For example, internal billing notes." )
1060    protected List<Annotation> note;
1061
1062    /**
1063     * Instructions in terms that are understood by the patient or consumer.
1064     */
1065    @Child(name = "patientInstruction", type = {}, order=31, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1066    @Description(shortDefinition="Patient or consumer-oriented instructions", formalDefinition="Instructions in terms that are understood by the patient or consumer." )
1067    protected List<ServiceRequestPatientInstructionComponent> patientInstruction;
1068
1069    /**
1070     * Key events in the history of the request.
1071     */
1072    @Child(name = "relevantHistory", type = {Provenance.class}, order=32, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1073    @Description(shortDefinition="Request provenance", formalDefinition="Key events in the history of the request." )
1074    protected List<Reference> relevantHistory;
1075
1076    private static final long serialVersionUID = -1785672942L;
1077
1078  /**
1079   * Constructor
1080   */
1081    public ServiceRequest() {
1082      super();
1083    }
1084
1085  /**
1086   * Constructor
1087   */
1088    public ServiceRequest(RequestStatus status, RequestIntent intent, Reference subject) {
1089      super();
1090      this.setStatus(status);
1091      this.setIntent(intent);
1092      this.setSubject(subject);
1093    }
1094
1095    /**
1096     * @return {@link #identifier} (Identifiers assigned to this order instance by the orderer and/or the receiver and/or order fulfiller.)
1097     */
1098    public List<Identifier> getIdentifier() { 
1099      if (this.identifier == null)
1100        this.identifier = new ArrayList<Identifier>();
1101      return this.identifier;
1102    }
1103
1104    /**
1105     * @return Returns a reference to <code>this</code> for easy method chaining
1106     */
1107    public ServiceRequest setIdentifier(List<Identifier> theIdentifier) { 
1108      this.identifier = theIdentifier;
1109      return this;
1110    }
1111
1112    public boolean hasIdentifier() { 
1113      if (this.identifier == null)
1114        return false;
1115      for (Identifier item : this.identifier)
1116        if (!item.isEmpty())
1117          return true;
1118      return false;
1119    }
1120
1121    public Identifier addIdentifier() { //3
1122      Identifier t = new Identifier();
1123      if (this.identifier == null)
1124        this.identifier = new ArrayList<Identifier>();
1125      this.identifier.add(t);
1126      return t;
1127    }
1128
1129    public ServiceRequest addIdentifier(Identifier t) { //3
1130      if (t == null)
1131        return this;
1132      if (this.identifier == null)
1133        this.identifier = new ArrayList<Identifier>();
1134      this.identifier.add(t);
1135      return this;
1136    }
1137
1138    /**
1139     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
1140     */
1141    public Identifier getIdentifierFirstRep() { 
1142      if (getIdentifier().isEmpty()) {
1143        addIdentifier();
1144      }
1145      return getIdentifier().get(0);
1146    }
1147
1148    /**
1149     * @return {@link #instantiatesCanonical} (The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this ServiceRequest.)
1150     */
1151    public List<CanonicalType> getInstantiatesCanonical() { 
1152      if (this.instantiatesCanonical == null)
1153        this.instantiatesCanonical = new ArrayList<CanonicalType>();
1154      return this.instantiatesCanonical;
1155    }
1156
1157    /**
1158     * @return Returns a reference to <code>this</code> for easy method chaining
1159     */
1160    public ServiceRequest setInstantiatesCanonical(List<CanonicalType> theInstantiatesCanonical) { 
1161      this.instantiatesCanonical = theInstantiatesCanonical;
1162      return this;
1163    }
1164
1165    public boolean hasInstantiatesCanonical() { 
1166      if (this.instantiatesCanonical == null)
1167        return false;
1168      for (CanonicalType item : this.instantiatesCanonical)
1169        if (!item.isEmpty())
1170          return true;
1171      return false;
1172    }
1173
1174    /**
1175     * @return {@link #instantiatesCanonical} (The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this ServiceRequest.)
1176     */
1177    public CanonicalType addInstantiatesCanonicalElement() {//2 
1178      CanonicalType t = new CanonicalType();
1179      if (this.instantiatesCanonical == null)
1180        this.instantiatesCanonical = new ArrayList<CanonicalType>();
1181      this.instantiatesCanonical.add(t);
1182      return t;
1183    }
1184
1185    /**
1186     * @param value {@link #instantiatesCanonical} (The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this ServiceRequest.)
1187     */
1188    public ServiceRequest addInstantiatesCanonical(String value) { //1
1189      CanonicalType t = new CanonicalType();
1190      t.setValue(value);
1191      if (this.instantiatesCanonical == null)
1192        this.instantiatesCanonical = new ArrayList<CanonicalType>();
1193      this.instantiatesCanonical.add(t);
1194      return this;
1195    }
1196
1197    /**
1198     * @param value {@link #instantiatesCanonical} (The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this ServiceRequest.)
1199     */
1200    public boolean hasInstantiatesCanonical(String value) { 
1201      if (this.instantiatesCanonical == null)
1202        return false;
1203      for (CanonicalType v : this.instantiatesCanonical)
1204        if (v.getValue().equals(value)) // canonical
1205          return true;
1206      return false;
1207    }
1208
1209    /**
1210     * @return {@link #instantiatesUri} (The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this ServiceRequest.)
1211     */
1212    public List<UriType> getInstantiatesUri() { 
1213      if (this.instantiatesUri == null)
1214        this.instantiatesUri = new ArrayList<UriType>();
1215      return this.instantiatesUri;
1216    }
1217
1218    /**
1219     * @return Returns a reference to <code>this</code> for easy method chaining
1220     */
1221    public ServiceRequest setInstantiatesUri(List<UriType> theInstantiatesUri) { 
1222      this.instantiatesUri = theInstantiatesUri;
1223      return this;
1224    }
1225
1226    public boolean hasInstantiatesUri() { 
1227      if (this.instantiatesUri == null)
1228        return false;
1229      for (UriType item : this.instantiatesUri)
1230        if (!item.isEmpty())
1231          return true;
1232      return false;
1233    }
1234
1235    /**
1236     * @return {@link #instantiatesUri} (The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this ServiceRequest.)
1237     */
1238    public UriType addInstantiatesUriElement() {//2 
1239      UriType t = new UriType();
1240      if (this.instantiatesUri == null)
1241        this.instantiatesUri = new ArrayList<UriType>();
1242      this.instantiatesUri.add(t);
1243      return t;
1244    }
1245
1246    /**
1247     * @param value {@link #instantiatesUri} (The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this ServiceRequest.)
1248     */
1249    public ServiceRequest addInstantiatesUri(String value) { //1
1250      UriType t = new UriType();
1251      t.setValue(value);
1252      if (this.instantiatesUri == null)
1253        this.instantiatesUri = new ArrayList<UriType>();
1254      this.instantiatesUri.add(t);
1255      return this;
1256    }
1257
1258    /**
1259     * @param value {@link #instantiatesUri} (The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this ServiceRequest.)
1260     */
1261    public boolean hasInstantiatesUri(String value) { 
1262      if (this.instantiatesUri == null)
1263        return false;
1264      for (UriType v : this.instantiatesUri)
1265        if (v.getValue().equals(value)) // uri
1266          return true;
1267      return false;
1268    }
1269
1270    /**
1271     * @return {@link #basedOn} (Plan/proposal/order fulfilled by this request.)
1272     */
1273    public List<Reference> getBasedOn() { 
1274      if (this.basedOn == null)
1275        this.basedOn = new ArrayList<Reference>();
1276      return this.basedOn;
1277    }
1278
1279    /**
1280     * @return Returns a reference to <code>this</code> for easy method chaining
1281     */
1282    public ServiceRequest setBasedOn(List<Reference> theBasedOn) { 
1283      this.basedOn = theBasedOn;
1284      return this;
1285    }
1286
1287    public boolean hasBasedOn() { 
1288      if (this.basedOn == null)
1289        return false;
1290      for (Reference item : this.basedOn)
1291        if (!item.isEmpty())
1292          return true;
1293      return false;
1294    }
1295
1296    public Reference addBasedOn() { //3
1297      Reference t = new Reference();
1298      if (this.basedOn == null)
1299        this.basedOn = new ArrayList<Reference>();
1300      this.basedOn.add(t);
1301      return t;
1302    }
1303
1304    public ServiceRequest addBasedOn(Reference t) { //3
1305      if (t == null)
1306        return this;
1307      if (this.basedOn == null)
1308        this.basedOn = new ArrayList<Reference>();
1309      this.basedOn.add(t);
1310      return this;
1311    }
1312
1313    /**
1314     * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist {3}
1315     */
1316    public Reference getBasedOnFirstRep() { 
1317      if (getBasedOn().isEmpty()) {
1318        addBasedOn();
1319      }
1320      return getBasedOn().get(0);
1321    }
1322
1323    /**
1324     * @return {@link #replaces} (The request takes the place of the referenced completed or terminated request(s).)
1325     */
1326    public List<Reference> getReplaces() { 
1327      if (this.replaces == null)
1328        this.replaces = new ArrayList<Reference>();
1329      return this.replaces;
1330    }
1331
1332    /**
1333     * @return Returns a reference to <code>this</code> for easy method chaining
1334     */
1335    public ServiceRequest setReplaces(List<Reference> theReplaces) { 
1336      this.replaces = theReplaces;
1337      return this;
1338    }
1339
1340    public boolean hasReplaces() { 
1341      if (this.replaces == null)
1342        return false;
1343      for (Reference item : this.replaces)
1344        if (!item.isEmpty())
1345          return true;
1346      return false;
1347    }
1348
1349    public Reference addReplaces() { //3
1350      Reference t = new Reference();
1351      if (this.replaces == null)
1352        this.replaces = new ArrayList<Reference>();
1353      this.replaces.add(t);
1354      return t;
1355    }
1356
1357    public ServiceRequest addReplaces(Reference t) { //3
1358      if (t == null)
1359        return this;
1360      if (this.replaces == null)
1361        this.replaces = new ArrayList<Reference>();
1362      this.replaces.add(t);
1363      return this;
1364    }
1365
1366    /**
1367     * @return The first repetition of repeating field {@link #replaces}, creating it if it does not already exist {3}
1368     */
1369    public Reference getReplacesFirstRep() { 
1370      if (getReplaces().isEmpty()) {
1371        addReplaces();
1372      }
1373      return getReplaces().get(0);
1374    }
1375
1376    /**
1377     * @return {@link #requisition} (A shared identifier common to all service requests that were authorized more or less simultaneously by a single author, representing the composite or group identifier.)
1378     */
1379    public Identifier getRequisition() { 
1380      if (this.requisition == null)
1381        if (Configuration.errorOnAutoCreate())
1382          throw new Error("Attempt to auto-create ServiceRequest.requisition");
1383        else if (Configuration.doAutoCreate())
1384          this.requisition = new Identifier(); // cc
1385      return this.requisition;
1386    }
1387
1388    public boolean hasRequisition() { 
1389      return this.requisition != null && !this.requisition.isEmpty();
1390    }
1391
1392    /**
1393     * @param value {@link #requisition} (A shared identifier common to all service requests that were authorized more or less simultaneously by a single author, representing the composite or group identifier.)
1394     */
1395    public ServiceRequest setRequisition(Identifier value) { 
1396      this.requisition = value;
1397      return this;
1398    }
1399
1400    /**
1401     * @return {@link #status} (The status of the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1402     */
1403    public Enumeration<RequestStatus> getStatusElement() { 
1404      if (this.status == null)
1405        if (Configuration.errorOnAutoCreate())
1406          throw new Error("Attempt to auto-create ServiceRequest.status");
1407        else if (Configuration.doAutoCreate())
1408          this.status = new Enumeration<RequestStatus>(new RequestStatusEnumFactory()); // bb
1409      return this.status;
1410    }
1411
1412    public boolean hasStatusElement() { 
1413      return this.status != null && !this.status.isEmpty();
1414    }
1415
1416    public boolean hasStatus() { 
1417      return this.status != null && !this.status.isEmpty();
1418    }
1419
1420    /**
1421     * @param value {@link #status} (The status of the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1422     */
1423    public ServiceRequest setStatusElement(Enumeration<RequestStatus> value) { 
1424      this.status = value;
1425      return this;
1426    }
1427
1428    /**
1429     * @return The status of the order.
1430     */
1431    public RequestStatus getStatus() { 
1432      return this.status == null ? null : this.status.getValue();
1433    }
1434
1435    /**
1436     * @param value The status of the order.
1437     */
1438    public ServiceRequest setStatus(RequestStatus value) { 
1439        if (this.status == null)
1440          this.status = new Enumeration<RequestStatus>(new RequestStatusEnumFactory());
1441        this.status.setValue(value);
1442      return this;
1443    }
1444
1445    /**
1446     * @return {@link #intent} (Whether the request is a proposal, plan, an original order or a reflex order.). This is the underlying object with id, value and extensions. The accessor "getIntent" gives direct access to the value
1447     */
1448    public Enumeration<RequestIntent> getIntentElement() { 
1449      if (this.intent == null)
1450        if (Configuration.errorOnAutoCreate())
1451          throw new Error("Attempt to auto-create ServiceRequest.intent");
1452        else if (Configuration.doAutoCreate())
1453          this.intent = new Enumeration<RequestIntent>(new RequestIntentEnumFactory()); // bb
1454      return this.intent;
1455    }
1456
1457    public boolean hasIntentElement() { 
1458      return this.intent != null && !this.intent.isEmpty();
1459    }
1460
1461    public boolean hasIntent() { 
1462      return this.intent != null && !this.intent.isEmpty();
1463    }
1464
1465    /**
1466     * @param value {@link #intent} (Whether the request is a proposal, plan, an original order or a reflex order.). This is the underlying object with id, value and extensions. The accessor "getIntent" gives direct access to the value
1467     */
1468    public ServiceRequest setIntentElement(Enumeration<RequestIntent> value) { 
1469      this.intent = value;
1470      return this;
1471    }
1472
1473    /**
1474     * @return Whether the request is a proposal, plan, an original order or a reflex order.
1475     */
1476    public RequestIntent getIntent() { 
1477      return this.intent == null ? null : this.intent.getValue();
1478    }
1479
1480    /**
1481     * @param value Whether the request is a proposal, plan, an original order or a reflex order.
1482     */
1483    public ServiceRequest setIntent(RequestIntent value) { 
1484        if (this.intent == null)
1485          this.intent = new Enumeration<RequestIntent>(new RequestIntentEnumFactory());
1486        this.intent.setValue(value);
1487      return this;
1488    }
1489
1490    /**
1491     * @return {@link #category} (A code that classifies the service for searching, sorting and display purposes (e.g. "Surgical Procedure").)
1492     */
1493    public List<CodeableConcept> getCategory() { 
1494      if (this.category == null)
1495        this.category = new ArrayList<CodeableConcept>();
1496      return this.category;
1497    }
1498
1499    /**
1500     * @return Returns a reference to <code>this</code> for easy method chaining
1501     */
1502    public ServiceRequest setCategory(List<CodeableConcept> theCategory) { 
1503      this.category = theCategory;
1504      return this;
1505    }
1506
1507    public boolean hasCategory() { 
1508      if (this.category == null)
1509        return false;
1510      for (CodeableConcept item : this.category)
1511        if (!item.isEmpty())
1512          return true;
1513      return false;
1514    }
1515
1516    public CodeableConcept addCategory() { //3
1517      CodeableConcept t = new CodeableConcept();
1518      if (this.category == null)
1519        this.category = new ArrayList<CodeableConcept>();
1520      this.category.add(t);
1521      return t;
1522    }
1523
1524    public ServiceRequest addCategory(CodeableConcept t) { //3
1525      if (t == null)
1526        return this;
1527      if (this.category == null)
1528        this.category = new ArrayList<CodeableConcept>();
1529      this.category.add(t);
1530      return this;
1531    }
1532
1533    /**
1534     * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist {3}
1535     */
1536    public CodeableConcept getCategoryFirstRep() { 
1537      if (getCategory().isEmpty()) {
1538        addCategory();
1539      }
1540      return getCategory().get(0);
1541    }
1542
1543    /**
1544     * @return {@link #priority} (Indicates how quickly the ServiceRequest should be addressed with respect to other requests.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value
1545     */
1546    public Enumeration<RequestPriority> getPriorityElement() { 
1547      if (this.priority == null)
1548        if (Configuration.errorOnAutoCreate())
1549          throw new Error("Attempt to auto-create ServiceRequest.priority");
1550        else if (Configuration.doAutoCreate())
1551          this.priority = new Enumeration<RequestPriority>(new RequestPriorityEnumFactory()); // bb
1552      return this.priority;
1553    }
1554
1555    public boolean hasPriorityElement() { 
1556      return this.priority != null && !this.priority.isEmpty();
1557    }
1558
1559    public boolean hasPriority() { 
1560      return this.priority != null && !this.priority.isEmpty();
1561    }
1562
1563    /**
1564     * @param value {@link #priority} (Indicates how quickly the ServiceRequest should be addressed with respect to other requests.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value
1565     */
1566    public ServiceRequest setPriorityElement(Enumeration<RequestPriority> value) { 
1567      this.priority = value;
1568      return this;
1569    }
1570
1571    /**
1572     * @return Indicates how quickly the ServiceRequest should be addressed with respect to other requests.
1573     */
1574    public RequestPriority getPriority() { 
1575      return this.priority == null ? null : this.priority.getValue();
1576    }
1577
1578    /**
1579     * @param value Indicates how quickly the ServiceRequest should be addressed with respect to other requests.
1580     */
1581    public ServiceRequest setPriority(RequestPriority value) { 
1582      if (value == null)
1583        this.priority = null;
1584      else {
1585        if (this.priority == null)
1586          this.priority = new Enumeration<RequestPriority>(new RequestPriorityEnumFactory());
1587        this.priority.setValue(value);
1588      }
1589      return this;
1590    }
1591
1592    /**
1593     * @return {@link #doNotPerform} (Set this to true if the record is saying that the service/procedure should NOT be performed.). This is the underlying object with id, value and extensions. The accessor "getDoNotPerform" gives direct access to the value
1594     */
1595    public BooleanType getDoNotPerformElement() { 
1596      if (this.doNotPerform == null)
1597        if (Configuration.errorOnAutoCreate())
1598          throw new Error("Attempt to auto-create ServiceRequest.doNotPerform");
1599        else if (Configuration.doAutoCreate())
1600          this.doNotPerform = new BooleanType(); // bb
1601      return this.doNotPerform;
1602    }
1603
1604    public boolean hasDoNotPerformElement() { 
1605      return this.doNotPerform != null && !this.doNotPerform.isEmpty();
1606    }
1607
1608    public boolean hasDoNotPerform() { 
1609      return this.doNotPerform != null && !this.doNotPerform.isEmpty();
1610    }
1611
1612    /**
1613     * @param value {@link #doNotPerform} (Set this to true if the record is saying that the service/procedure should NOT be performed.). This is the underlying object with id, value and extensions. The accessor "getDoNotPerform" gives direct access to the value
1614     */
1615    public ServiceRequest setDoNotPerformElement(BooleanType value) { 
1616      this.doNotPerform = value;
1617      return this;
1618    }
1619
1620    /**
1621     * @return Set this to true if the record is saying that the service/procedure should NOT be performed.
1622     */
1623    public boolean getDoNotPerform() { 
1624      return this.doNotPerform == null || this.doNotPerform.isEmpty() ? false : this.doNotPerform.getValue();
1625    }
1626
1627    /**
1628     * @param value Set this to true if the record is saying that the service/procedure should NOT be performed.
1629     */
1630    public ServiceRequest setDoNotPerform(boolean value) { 
1631        if (this.doNotPerform == null)
1632          this.doNotPerform = new BooleanType();
1633        this.doNotPerform.setValue(value);
1634      return this;
1635    }
1636
1637    /**
1638     * @return {@link #code} (A code or reference that identifies a particular service (i.e., procedure, diagnostic investigation, or panel of investigations) that have been requested.)
1639     */
1640    public CodeableReference getCode() { 
1641      if (this.code == null)
1642        if (Configuration.errorOnAutoCreate())
1643          throw new Error("Attempt to auto-create ServiceRequest.code");
1644        else if (Configuration.doAutoCreate())
1645          this.code = new CodeableReference(); // cc
1646      return this.code;
1647    }
1648
1649    public boolean hasCode() { 
1650      return this.code != null && !this.code.isEmpty();
1651    }
1652
1653    /**
1654     * @param value {@link #code} (A code or reference that identifies a particular service (i.e., procedure, diagnostic investigation, or panel of investigations) that have been requested.)
1655     */
1656    public ServiceRequest setCode(CodeableReference value) { 
1657      this.code = value;
1658      return this;
1659    }
1660
1661    /**
1662     * @return {@link #orderDetail} (Additional details and instructions about the how the services are to be delivered.   For example, and order for a urinary catheter may have an order detail for an external or indwelling catheter, or an order for a bandage may require additional instructions specifying how the bandage should be applied.)
1663     */
1664    public List<ServiceRequestOrderDetailComponent> getOrderDetail() { 
1665      if (this.orderDetail == null)
1666        this.orderDetail = new ArrayList<ServiceRequestOrderDetailComponent>();
1667      return this.orderDetail;
1668    }
1669
1670    /**
1671     * @return Returns a reference to <code>this</code> for easy method chaining
1672     */
1673    public ServiceRequest setOrderDetail(List<ServiceRequestOrderDetailComponent> theOrderDetail) { 
1674      this.orderDetail = theOrderDetail;
1675      return this;
1676    }
1677
1678    public boolean hasOrderDetail() { 
1679      if (this.orderDetail == null)
1680        return false;
1681      for (ServiceRequestOrderDetailComponent item : this.orderDetail)
1682        if (!item.isEmpty())
1683          return true;
1684      return false;
1685    }
1686
1687    public ServiceRequestOrderDetailComponent addOrderDetail() { //3
1688      ServiceRequestOrderDetailComponent t = new ServiceRequestOrderDetailComponent();
1689      if (this.orderDetail == null)
1690        this.orderDetail = new ArrayList<ServiceRequestOrderDetailComponent>();
1691      this.orderDetail.add(t);
1692      return t;
1693    }
1694
1695    public ServiceRequest addOrderDetail(ServiceRequestOrderDetailComponent t) { //3
1696      if (t == null)
1697        return this;
1698      if (this.orderDetail == null)
1699        this.orderDetail = new ArrayList<ServiceRequestOrderDetailComponent>();
1700      this.orderDetail.add(t);
1701      return this;
1702    }
1703
1704    /**
1705     * @return The first repetition of repeating field {@link #orderDetail}, creating it if it does not already exist {3}
1706     */
1707    public ServiceRequestOrderDetailComponent getOrderDetailFirstRep() { 
1708      if (getOrderDetail().isEmpty()) {
1709        addOrderDetail();
1710      }
1711      return getOrderDetail().get(0);
1712    }
1713
1714    /**
1715     * @return {@link #quantity} (An amount of service being requested which can be a quantity ( for example $1,500 home modification), a ratio ( for example, 20 half day visits per month), or a range (2.0 to 1.8 Gy per fraction).)
1716     */
1717    public DataType getQuantity() { 
1718      return this.quantity;
1719    }
1720
1721    /**
1722     * @return {@link #quantity} (An amount of service being requested which can be a quantity ( for example $1,500 home modification), a ratio ( for example, 20 half day visits per month), or a range (2.0 to 1.8 Gy per fraction).)
1723     */
1724    public Quantity getQuantityQuantity() throws FHIRException { 
1725      if (this.quantity == null)
1726        this.quantity = new Quantity();
1727      if (!(this.quantity instanceof Quantity))
1728        throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.quantity.getClass().getName()+" was encountered");
1729      return (Quantity) this.quantity;
1730    }
1731
1732    public boolean hasQuantityQuantity() { 
1733      return this != null && this.quantity instanceof Quantity;
1734    }
1735
1736    /**
1737     * @return {@link #quantity} (An amount of service being requested which can be a quantity ( for example $1,500 home modification), a ratio ( for example, 20 half day visits per month), or a range (2.0 to 1.8 Gy per fraction).)
1738     */
1739    public Ratio getQuantityRatio() throws FHIRException { 
1740      if (this.quantity == null)
1741        this.quantity = new Ratio();
1742      if (!(this.quantity instanceof Ratio))
1743        throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.quantity.getClass().getName()+" was encountered");
1744      return (Ratio) this.quantity;
1745    }
1746
1747    public boolean hasQuantityRatio() { 
1748      return this != null && this.quantity instanceof Ratio;
1749    }
1750
1751    /**
1752     * @return {@link #quantity} (An amount of service being requested which can be a quantity ( for example $1,500 home modification), a ratio ( for example, 20 half day visits per month), or a range (2.0 to 1.8 Gy per fraction).)
1753     */
1754    public Range getQuantityRange() throws FHIRException { 
1755      if (this.quantity == null)
1756        this.quantity = new Range();
1757      if (!(this.quantity instanceof Range))
1758        throw new FHIRException("Type mismatch: the type Range was expected, but "+this.quantity.getClass().getName()+" was encountered");
1759      return (Range) this.quantity;
1760    }
1761
1762    public boolean hasQuantityRange() { 
1763      return this != null && this.quantity instanceof Range;
1764    }
1765
1766    public boolean hasQuantity() { 
1767      return this.quantity != null && !this.quantity.isEmpty();
1768    }
1769
1770    /**
1771     * @param value {@link #quantity} (An amount of service being requested which can be a quantity ( for example $1,500 home modification), a ratio ( for example, 20 half day visits per month), or a range (2.0 to 1.8 Gy per fraction).)
1772     */
1773    public ServiceRequest setQuantity(DataType value) { 
1774      if (value != null && !(value instanceof Quantity || value instanceof Ratio || value instanceof Range))
1775        throw new FHIRException("Not the right type for ServiceRequest.quantity[x]: "+value.fhirType());
1776      this.quantity = value;
1777      return this;
1778    }
1779
1780    /**
1781     * @return {@link #subject} (On whom or what the service is to be performed. This is usually a human patient, but can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).)
1782     */
1783    public Reference getSubject() { 
1784      if (this.subject == null)
1785        if (Configuration.errorOnAutoCreate())
1786          throw new Error("Attempt to auto-create ServiceRequest.subject");
1787        else if (Configuration.doAutoCreate())
1788          this.subject = new Reference(); // cc
1789      return this.subject;
1790    }
1791
1792    public boolean hasSubject() { 
1793      return this.subject != null && !this.subject.isEmpty();
1794    }
1795
1796    /**
1797     * @param value {@link #subject} (On whom or what the service is to be performed. This is usually a human patient, but can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).)
1798     */
1799    public ServiceRequest setSubject(Reference value) { 
1800      this.subject = value;
1801      return this;
1802    }
1803
1804    /**
1805     * @return {@link #focus} (The actual focus of a service request when it is not the subject of record representing something or someone associated with the subject such as a spouse, parent, fetus, or donor. The focus of a service request could also be an existing condition,  an intervention, the subject's diet,  another service request on the subject,  or a body structure such as tumor or implanted device.)
1806     */
1807    public List<Reference> getFocus() { 
1808      if (this.focus == null)
1809        this.focus = new ArrayList<Reference>();
1810      return this.focus;
1811    }
1812
1813    /**
1814     * @return Returns a reference to <code>this</code> for easy method chaining
1815     */
1816    public ServiceRequest setFocus(List<Reference> theFocus) { 
1817      this.focus = theFocus;
1818      return this;
1819    }
1820
1821    public boolean hasFocus() { 
1822      if (this.focus == null)
1823        return false;
1824      for (Reference item : this.focus)
1825        if (!item.isEmpty())
1826          return true;
1827      return false;
1828    }
1829
1830    public Reference addFocus() { //3
1831      Reference t = new Reference();
1832      if (this.focus == null)
1833        this.focus = new ArrayList<Reference>();
1834      this.focus.add(t);
1835      return t;
1836    }
1837
1838    public ServiceRequest addFocus(Reference t) { //3
1839      if (t == null)
1840        return this;
1841      if (this.focus == null)
1842        this.focus = new ArrayList<Reference>();
1843      this.focus.add(t);
1844      return this;
1845    }
1846
1847    /**
1848     * @return The first repetition of repeating field {@link #focus}, creating it if it does not already exist {3}
1849     */
1850    public Reference getFocusFirstRep() { 
1851      if (getFocus().isEmpty()) {
1852        addFocus();
1853      }
1854      return getFocus().get(0);
1855    }
1856
1857    /**
1858     * @return {@link #encounter} (An encounter that provides additional information about the healthcare context in which this request is made.)
1859     */
1860    public Reference getEncounter() { 
1861      if (this.encounter == null)
1862        if (Configuration.errorOnAutoCreate())
1863          throw new Error("Attempt to auto-create ServiceRequest.encounter");
1864        else if (Configuration.doAutoCreate())
1865          this.encounter = new Reference(); // cc
1866      return this.encounter;
1867    }
1868
1869    public boolean hasEncounter() { 
1870      return this.encounter != null && !this.encounter.isEmpty();
1871    }
1872
1873    /**
1874     * @param value {@link #encounter} (An encounter that provides additional information about the healthcare context in which this request is made.)
1875     */
1876    public ServiceRequest setEncounter(Reference value) { 
1877      this.encounter = value;
1878      return this;
1879    }
1880
1881    /**
1882     * @return {@link #occurrence} (The date/time at which the requested service should occur.)
1883     */
1884    public DataType getOccurrence() { 
1885      return this.occurrence;
1886    }
1887
1888    /**
1889     * @return {@link #occurrence} (The date/time at which the requested service should occur.)
1890     */
1891    public DateTimeType getOccurrenceDateTimeType() throws FHIRException { 
1892      if (this.occurrence == null)
1893        this.occurrence = new DateTimeType();
1894      if (!(this.occurrence instanceof DateTimeType))
1895        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.occurrence.getClass().getName()+" was encountered");
1896      return (DateTimeType) this.occurrence;
1897    }
1898
1899    public boolean hasOccurrenceDateTimeType() { 
1900      return this != null && this.occurrence instanceof DateTimeType;
1901    }
1902
1903    /**
1904     * @return {@link #occurrence} (The date/time at which the requested service should occur.)
1905     */
1906    public Period getOccurrencePeriod() throws FHIRException { 
1907      if (this.occurrence == null)
1908        this.occurrence = new Period();
1909      if (!(this.occurrence instanceof Period))
1910        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.occurrence.getClass().getName()+" was encountered");
1911      return (Period) this.occurrence;
1912    }
1913
1914    public boolean hasOccurrencePeriod() { 
1915      return this != null && this.occurrence instanceof Period;
1916    }
1917
1918    /**
1919     * @return {@link #occurrence} (The date/time at which the requested service should occur.)
1920     */
1921    public Timing getOccurrenceTiming() throws FHIRException { 
1922      if (this.occurrence == null)
1923        this.occurrence = new Timing();
1924      if (!(this.occurrence instanceof Timing))
1925        throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.occurrence.getClass().getName()+" was encountered");
1926      return (Timing) this.occurrence;
1927    }
1928
1929    public boolean hasOccurrenceTiming() { 
1930      return this != null && this.occurrence instanceof Timing;
1931    }
1932
1933    public boolean hasOccurrence() { 
1934      return this.occurrence != null && !this.occurrence.isEmpty();
1935    }
1936
1937    /**
1938     * @param value {@link #occurrence} (The date/time at which the requested service should occur.)
1939     */
1940    public ServiceRequest setOccurrence(DataType value) { 
1941      if (value != null && !(value instanceof DateTimeType || value instanceof Period || value instanceof Timing))
1942        throw new FHIRException("Not the right type for ServiceRequest.occurrence[x]: "+value.fhirType());
1943      this.occurrence = value;
1944      return this;
1945    }
1946
1947    /**
1948     * @return {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the service.  For example "pain", "on flare-up", etc.)
1949     */
1950    public DataType getAsNeeded() { 
1951      return this.asNeeded;
1952    }
1953
1954    /**
1955     * @return {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the service.  For example "pain", "on flare-up", etc.)
1956     */
1957    public BooleanType getAsNeededBooleanType() throws FHIRException { 
1958      if (this.asNeeded == null)
1959        this.asNeeded = new BooleanType();
1960      if (!(this.asNeeded instanceof BooleanType))
1961        throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered");
1962      return (BooleanType) this.asNeeded;
1963    }
1964
1965    public boolean hasAsNeededBooleanType() { 
1966      return this != null && this.asNeeded instanceof BooleanType;
1967    }
1968
1969    /**
1970     * @return {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the service.  For example "pain", "on flare-up", etc.)
1971     */
1972    public CodeableConcept getAsNeededCodeableConcept() throws FHIRException { 
1973      if (this.asNeeded == null)
1974        this.asNeeded = new CodeableConcept();
1975      if (!(this.asNeeded instanceof CodeableConcept))
1976        throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered");
1977      return (CodeableConcept) this.asNeeded;
1978    }
1979
1980    public boolean hasAsNeededCodeableConcept() { 
1981      return this != null && this.asNeeded instanceof CodeableConcept;
1982    }
1983
1984    public boolean hasAsNeeded() { 
1985      return this.asNeeded != null && !this.asNeeded.isEmpty();
1986    }
1987
1988    /**
1989     * @param value {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the service.  For example "pain", "on flare-up", etc.)
1990     */
1991    public ServiceRequest setAsNeeded(DataType value) { 
1992      if (value != null && !(value instanceof BooleanType || value instanceof CodeableConcept))
1993        throw new FHIRException("Not the right type for ServiceRequest.asNeeded[x]: "+value.fhirType());
1994      this.asNeeded = value;
1995      return this;
1996    }
1997
1998    /**
1999     * @return {@link #authoredOn} (When the request transitioned to being actionable.). This is the underlying object with id, value and extensions. The accessor "getAuthoredOn" gives direct access to the value
2000     */
2001    public DateTimeType getAuthoredOnElement() { 
2002      if (this.authoredOn == null)
2003        if (Configuration.errorOnAutoCreate())
2004          throw new Error("Attempt to auto-create ServiceRequest.authoredOn");
2005        else if (Configuration.doAutoCreate())
2006          this.authoredOn = new DateTimeType(); // bb
2007      return this.authoredOn;
2008    }
2009
2010    public boolean hasAuthoredOnElement() { 
2011      return this.authoredOn != null && !this.authoredOn.isEmpty();
2012    }
2013
2014    public boolean hasAuthoredOn() { 
2015      return this.authoredOn != null && !this.authoredOn.isEmpty();
2016    }
2017
2018    /**
2019     * @param value {@link #authoredOn} (When the request transitioned to being actionable.). This is the underlying object with id, value and extensions. The accessor "getAuthoredOn" gives direct access to the value
2020     */
2021    public ServiceRequest setAuthoredOnElement(DateTimeType value) { 
2022      this.authoredOn = value;
2023      return this;
2024    }
2025
2026    /**
2027     * @return When the request transitioned to being actionable.
2028     */
2029    public Date getAuthoredOn() { 
2030      return this.authoredOn == null ? null : this.authoredOn.getValue();
2031    }
2032
2033    /**
2034     * @param value When the request transitioned to being actionable.
2035     */
2036    public ServiceRequest setAuthoredOn(Date value) { 
2037      if (value == null)
2038        this.authoredOn = null;
2039      else {
2040        if (this.authoredOn == null)
2041          this.authoredOn = new DateTimeType();
2042        this.authoredOn.setValue(value);
2043      }
2044      return this;
2045    }
2046
2047    /**
2048     * @return {@link #requester} (The individual who initiated the request and has responsibility for its activation.)
2049     */
2050    public Reference getRequester() { 
2051      if (this.requester == null)
2052        if (Configuration.errorOnAutoCreate())
2053          throw new Error("Attempt to auto-create ServiceRequest.requester");
2054        else if (Configuration.doAutoCreate())
2055          this.requester = new Reference(); // cc
2056      return this.requester;
2057    }
2058
2059    public boolean hasRequester() { 
2060      return this.requester != null && !this.requester.isEmpty();
2061    }
2062
2063    /**
2064     * @param value {@link #requester} (The individual who initiated the request and has responsibility for its activation.)
2065     */
2066    public ServiceRequest setRequester(Reference value) { 
2067      this.requester = value;
2068      return this;
2069    }
2070
2071    /**
2072     * @return {@link #performerType} (Desired type of performer for doing the requested service.)
2073     */
2074    public CodeableConcept getPerformerType() { 
2075      if (this.performerType == null)
2076        if (Configuration.errorOnAutoCreate())
2077          throw new Error("Attempt to auto-create ServiceRequest.performerType");
2078        else if (Configuration.doAutoCreate())
2079          this.performerType = new CodeableConcept(); // cc
2080      return this.performerType;
2081    }
2082
2083    public boolean hasPerformerType() { 
2084      return this.performerType != null && !this.performerType.isEmpty();
2085    }
2086
2087    /**
2088     * @param value {@link #performerType} (Desired type of performer for doing the requested service.)
2089     */
2090    public ServiceRequest setPerformerType(CodeableConcept value) { 
2091      this.performerType = value;
2092      return this;
2093    }
2094
2095    /**
2096     * @return {@link #performer} (The desired performer for doing the requested service.  For example, the surgeon, dermatopathologist, endoscopist, etc.)
2097     */
2098    public List<Reference> getPerformer() { 
2099      if (this.performer == null)
2100        this.performer = new ArrayList<Reference>();
2101      return this.performer;
2102    }
2103
2104    /**
2105     * @return Returns a reference to <code>this</code> for easy method chaining
2106     */
2107    public ServiceRequest setPerformer(List<Reference> thePerformer) { 
2108      this.performer = thePerformer;
2109      return this;
2110    }
2111
2112    public boolean hasPerformer() { 
2113      if (this.performer == null)
2114        return false;
2115      for (Reference item : this.performer)
2116        if (!item.isEmpty())
2117          return true;
2118      return false;
2119    }
2120
2121    public Reference addPerformer() { //3
2122      Reference t = new Reference();
2123      if (this.performer == null)
2124        this.performer = new ArrayList<Reference>();
2125      this.performer.add(t);
2126      return t;
2127    }
2128
2129    public ServiceRequest addPerformer(Reference t) { //3
2130      if (t == null)
2131        return this;
2132      if (this.performer == null)
2133        this.performer = new ArrayList<Reference>();
2134      this.performer.add(t);
2135      return this;
2136    }
2137
2138    /**
2139     * @return The first repetition of repeating field {@link #performer}, creating it if it does not already exist {3}
2140     */
2141    public Reference getPerformerFirstRep() { 
2142      if (getPerformer().isEmpty()) {
2143        addPerformer();
2144      }
2145      return getPerformer().get(0);
2146    }
2147
2148    /**
2149     * @return {@link #location} (The preferred location(s) where the procedure should actually happen in coded or free text form. E.g. at home or nursing day care center.)
2150     */
2151    public List<CodeableReference> getLocation() { 
2152      if (this.location == null)
2153        this.location = new ArrayList<CodeableReference>();
2154      return this.location;
2155    }
2156
2157    /**
2158     * @return Returns a reference to <code>this</code> for easy method chaining
2159     */
2160    public ServiceRequest setLocation(List<CodeableReference> theLocation) { 
2161      this.location = theLocation;
2162      return this;
2163    }
2164
2165    public boolean hasLocation() { 
2166      if (this.location == null)
2167        return false;
2168      for (CodeableReference item : this.location)
2169        if (!item.isEmpty())
2170          return true;
2171      return false;
2172    }
2173
2174    public CodeableReference addLocation() { //3
2175      CodeableReference t = new CodeableReference();
2176      if (this.location == null)
2177        this.location = new ArrayList<CodeableReference>();
2178      this.location.add(t);
2179      return t;
2180    }
2181
2182    public ServiceRequest addLocation(CodeableReference t) { //3
2183      if (t == null)
2184        return this;
2185      if (this.location == null)
2186        this.location = new ArrayList<CodeableReference>();
2187      this.location.add(t);
2188      return this;
2189    }
2190
2191    /**
2192     * @return The first repetition of repeating field {@link #location}, creating it if it does not already exist {3}
2193     */
2194    public CodeableReference getLocationFirstRep() { 
2195      if (getLocation().isEmpty()) {
2196        addLocation();
2197      }
2198      return getLocation().get(0);
2199    }
2200
2201    /**
2202     * @return {@link #reason} (An explanation or justification for why this service is being requested in coded or textual form.   This is often for billing purposes.  May relate to the resources referred to in `supportingInfo`.)
2203     */
2204    public List<CodeableReference> getReason() { 
2205      if (this.reason == null)
2206        this.reason = new ArrayList<CodeableReference>();
2207      return this.reason;
2208    }
2209
2210    /**
2211     * @return Returns a reference to <code>this</code> for easy method chaining
2212     */
2213    public ServiceRequest setReason(List<CodeableReference> theReason) { 
2214      this.reason = theReason;
2215      return this;
2216    }
2217
2218    public boolean hasReason() { 
2219      if (this.reason == null)
2220        return false;
2221      for (CodeableReference item : this.reason)
2222        if (!item.isEmpty())
2223          return true;
2224      return false;
2225    }
2226
2227    public CodeableReference addReason() { //3
2228      CodeableReference t = new CodeableReference();
2229      if (this.reason == null)
2230        this.reason = new ArrayList<CodeableReference>();
2231      this.reason.add(t);
2232      return t;
2233    }
2234
2235    public ServiceRequest addReason(CodeableReference t) { //3
2236      if (t == null)
2237        return this;
2238      if (this.reason == null)
2239        this.reason = new ArrayList<CodeableReference>();
2240      this.reason.add(t);
2241      return this;
2242    }
2243
2244    /**
2245     * @return The first repetition of repeating field {@link #reason}, creating it if it does not already exist {3}
2246     */
2247    public CodeableReference getReasonFirstRep() { 
2248      if (getReason().isEmpty()) {
2249        addReason();
2250      }
2251      return getReason().get(0);
2252    }
2253
2254    /**
2255     * @return {@link #insurance} (Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be needed for delivering the requested service.)
2256     */
2257    public List<Reference> getInsurance() { 
2258      if (this.insurance == null)
2259        this.insurance = new ArrayList<Reference>();
2260      return this.insurance;
2261    }
2262
2263    /**
2264     * @return Returns a reference to <code>this</code> for easy method chaining
2265     */
2266    public ServiceRequest setInsurance(List<Reference> theInsurance) { 
2267      this.insurance = theInsurance;
2268      return this;
2269    }
2270
2271    public boolean hasInsurance() { 
2272      if (this.insurance == null)
2273        return false;
2274      for (Reference item : this.insurance)
2275        if (!item.isEmpty())
2276          return true;
2277      return false;
2278    }
2279
2280    public Reference addInsurance() { //3
2281      Reference t = new Reference();
2282      if (this.insurance == null)
2283        this.insurance = new ArrayList<Reference>();
2284      this.insurance.add(t);
2285      return t;
2286    }
2287
2288    public ServiceRequest addInsurance(Reference t) { //3
2289      if (t == null)
2290        return this;
2291      if (this.insurance == null)
2292        this.insurance = new ArrayList<Reference>();
2293      this.insurance.add(t);
2294      return this;
2295    }
2296
2297    /**
2298     * @return The first repetition of repeating field {@link #insurance}, creating it if it does not already exist {3}
2299     */
2300    public Reference getInsuranceFirstRep() { 
2301      if (getInsurance().isEmpty()) {
2302        addInsurance();
2303      }
2304      return getInsurance().get(0);
2305    }
2306
2307    /**
2308     * @return {@link #supportingInfo} (Additional clinical information about the patient or specimen that may influence the services or their interpretations.     This information includes diagnosis, clinical findings and other observations.  In laboratory ordering these are typically referred to as "ask at order entry questions (AOEs)".  This includes observations explicitly requested by the producer (filler) to provide context or supporting information needed to complete the order. For example,  reporting the amount of inspired oxygen for blood gas measurements.)
2309     */
2310    public List<CodeableReference> getSupportingInfo() { 
2311      if (this.supportingInfo == null)
2312        this.supportingInfo = new ArrayList<CodeableReference>();
2313      return this.supportingInfo;
2314    }
2315
2316    /**
2317     * @return Returns a reference to <code>this</code> for easy method chaining
2318     */
2319    public ServiceRequest setSupportingInfo(List<CodeableReference> theSupportingInfo) { 
2320      this.supportingInfo = theSupportingInfo;
2321      return this;
2322    }
2323
2324    public boolean hasSupportingInfo() { 
2325      if (this.supportingInfo == null)
2326        return false;
2327      for (CodeableReference item : this.supportingInfo)
2328        if (!item.isEmpty())
2329          return true;
2330      return false;
2331    }
2332
2333    public CodeableReference addSupportingInfo() { //3
2334      CodeableReference t = new CodeableReference();
2335      if (this.supportingInfo == null)
2336        this.supportingInfo = new ArrayList<CodeableReference>();
2337      this.supportingInfo.add(t);
2338      return t;
2339    }
2340
2341    public ServiceRequest addSupportingInfo(CodeableReference t) { //3
2342      if (t == null)
2343        return this;
2344      if (this.supportingInfo == null)
2345        this.supportingInfo = new ArrayList<CodeableReference>();
2346      this.supportingInfo.add(t);
2347      return this;
2348    }
2349
2350    /**
2351     * @return The first repetition of repeating field {@link #supportingInfo}, creating it if it does not already exist {3}
2352     */
2353    public CodeableReference getSupportingInfoFirstRep() { 
2354      if (getSupportingInfo().isEmpty()) {
2355        addSupportingInfo();
2356      }
2357      return getSupportingInfo().get(0);
2358    }
2359
2360    /**
2361     * @return {@link #specimen} (One or more specimens that the laboratory procedure will use.)
2362     */
2363    public List<Reference> getSpecimen() { 
2364      if (this.specimen == null)
2365        this.specimen = new ArrayList<Reference>();
2366      return this.specimen;
2367    }
2368
2369    /**
2370     * @return Returns a reference to <code>this</code> for easy method chaining
2371     */
2372    public ServiceRequest setSpecimen(List<Reference> theSpecimen) { 
2373      this.specimen = theSpecimen;
2374      return this;
2375    }
2376
2377    public boolean hasSpecimen() { 
2378      if (this.specimen == null)
2379        return false;
2380      for (Reference item : this.specimen)
2381        if (!item.isEmpty())
2382          return true;
2383      return false;
2384    }
2385
2386    public Reference addSpecimen() { //3
2387      Reference t = new Reference();
2388      if (this.specimen == null)
2389        this.specimen = new ArrayList<Reference>();
2390      this.specimen.add(t);
2391      return t;
2392    }
2393
2394    public ServiceRequest addSpecimen(Reference t) { //3
2395      if (t == null)
2396        return this;
2397      if (this.specimen == null)
2398        this.specimen = new ArrayList<Reference>();
2399      this.specimen.add(t);
2400      return this;
2401    }
2402
2403    /**
2404     * @return The first repetition of repeating field {@link #specimen}, creating it if it does not already exist {3}
2405     */
2406    public Reference getSpecimenFirstRep() { 
2407      if (getSpecimen().isEmpty()) {
2408        addSpecimen();
2409      }
2410      return getSpecimen().get(0);
2411    }
2412
2413    /**
2414     * @return {@link #bodySite} (Anatomic location where the procedure should be performed. This is the target site.)
2415     */
2416    public List<CodeableConcept> getBodySite() { 
2417      if (this.bodySite == null)
2418        this.bodySite = new ArrayList<CodeableConcept>();
2419      return this.bodySite;
2420    }
2421
2422    /**
2423     * @return Returns a reference to <code>this</code> for easy method chaining
2424     */
2425    public ServiceRequest setBodySite(List<CodeableConcept> theBodySite) { 
2426      this.bodySite = theBodySite;
2427      return this;
2428    }
2429
2430    public boolean hasBodySite() { 
2431      if (this.bodySite == null)
2432        return false;
2433      for (CodeableConcept item : this.bodySite)
2434        if (!item.isEmpty())
2435          return true;
2436      return false;
2437    }
2438
2439    public CodeableConcept addBodySite() { //3
2440      CodeableConcept t = new CodeableConcept();
2441      if (this.bodySite == null)
2442        this.bodySite = new ArrayList<CodeableConcept>();
2443      this.bodySite.add(t);
2444      return t;
2445    }
2446
2447    public ServiceRequest addBodySite(CodeableConcept t) { //3
2448      if (t == null)
2449        return this;
2450      if (this.bodySite == null)
2451        this.bodySite = new ArrayList<CodeableConcept>();
2452      this.bodySite.add(t);
2453      return this;
2454    }
2455
2456    /**
2457     * @return The first repetition of repeating field {@link #bodySite}, creating it if it does not already exist {3}
2458     */
2459    public CodeableConcept getBodySiteFirstRep() { 
2460      if (getBodySite().isEmpty()) {
2461        addBodySite();
2462      }
2463      return getBodySite().get(0);
2464    }
2465
2466    /**
2467     * @return {@link #bodyStructure} (Anatomic location where the procedure should be performed. This is the target site.)
2468     */
2469    public Reference getBodyStructure() { 
2470      if (this.bodyStructure == null)
2471        if (Configuration.errorOnAutoCreate())
2472          throw new Error("Attempt to auto-create ServiceRequest.bodyStructure");
2473        else if (Configuration.doAutoCreate())
2474          this.bodyStructure = new Reference(); // cc
2475      return this.bodyStructure;
2476    }
2477
2478    public boolean hasBodyStructure() { 
2479      return this.bodyStructure != null && !this.bodyStructure.isEmpty();
2480    }
2481
2482    /**
2483     * @param value {@link #bodyStructure} (Anatomic location where the procedure should be performed. This is the target site.)
2484     */
2485    public ServiceRequest setBodyStructure(Reference value) { 
2486      this.bodyStructure = value;
2487      return this;
2488    }
2489
2490    /**
2491     * @return {@link #note} (Any other notes and comments made about the service request. For example, internal billing notes.)
2492     */
2493    public List<Annotation> getNote() { 
2494      if (this.note == null)
2495        this.note = new ArrayList<Annotation>();
2496      return this.note;
2497    }
2498
2499    /**
2500     * @return Returns a reference to <code>this</code> for easy method chaining
2501     */
2502    public ServiceRequest setNote(List<Annotation> theNote) { 
2503      this.note = theNote;
2504      return this;
2505    }
2506
2507    public boolean hasNote() { 
2508      if (this.note == null)
2509        return false;
2510      for (Annotation item : this.note)
2511        if (!item.isEmpty())
2512          return true;
2513      return false;
2514    }
2515
2516    public Annotation addNote() { //3
2517      Annotation t = new Annotation();
2518      if (this.note == null)
2519        this.note = new ArrayList<Annotation>();
2520      this.note.add(t);
2521      return t;
2522    }
2523
2524    public ServiceRequest addNote(Annotation t) { //3
2525      if (t == null)
2526        return this;
2527      if (this.note == null)
2528        this.note = new ArrayList<Annotation>();
2529      this.note.add(t);
2530      return this;
2531    }
2532
2533    /**
2534     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
2535     */
2536    public Annotation getNoteFirstRep() { 
2537      if (getNote().isEmpty()) {
2538        addNote();
2539      }
2540      return getNote().get(0);
2541    }
2542
2543    /**
2544     * @return {@link #patientInstruction} (Instructions in terms that are understood by the patient or consumer.)
2545     */
2546    public List<ServiceRequestPatientInstructionComponent> getPatientInstruction() { 
2547      if (this.patientInstruction == null)
2548        this.patientInstruction = new ArrayList<ServiceRequestPatientInstructionComponent>();
2549      return this.patientInstruction;
2550    }
2551
2552    /**
2553     * @return Returns a reference to <code>this</code> for easy method chaining
2554     */
2555    public ServiceRequest setPatientInstruction(List<ServiceRequestPatientInstructionComponent> thePatientInstruction) { 
2556      this.patientInstruction = thePatientInstruction;
2557      return this;
2558    }
2559
2560    public boolean hasPatientInstruction() { 
2561      if (this.patientInstruction == null)
2562        return false;
2563      for (ServiceRequestPatientInstructionComponent item : this.patientInstruction)
2564        if (!item.isEmpty())
2565          return true;
2566      return false;
2567    }
2568
2569    public ServiceRequestPatientInstructionComponent addPatientInstruction() { //3
2570      ServiceRequestPatientInstructionComponent t = new ServiceRequestPatientInstructionComponent();
2571      if (this.patientInstruction == null)
2572        this.patientInstruction = new ArrayList<ServiceRequestPatientInstructionComponent>();
2573      this.patientInstruction.add(t);
2574      return t;
2575    }
2576
2577    public ServiceRequest addPatientInstruction(ServiceRequestPatientInstructionComponent t) { //3
2578      if (t == null)
2579        return this;
2580      if (this.patientInstruction == null)
2581        this.patientInstruction = new ArrayList<ServiceRequestPatientInstructionComponent>();
2582      this.patientInstruction.add(t);
2583      return this;
2584    }
2585
2586    /**
2587     * @return The first repetition of repeating field {@link #patientInstruction}, creating it if it does not already exist {3}
2588     */
2589    public ServiceRequestPatientInstructionComponent getPatientInstructionFirstRep() { 
2590      if (getPatientInstruction().isEmpty()) {
2591        addPatientInstruction();
2592      }
2593      return getPatientInstruction().get(0);
2594    }
2595
2596    /**
2597     * @return {@link #relevantHistory} (Key events in the history of the request.)
2598     */
2599    public List<Reference> getRelevantHistory() { 
2600      if (this.relevantHistory == null)
2601        this.relevantHistory = new ArrayList<Reference>();
2602      return this.relevantHistory;
2603    }
2604
2605    /**
2606     * @return Returns a reference to <code>this</code> for easy method chaining
2607     */
2608    public ServiceRequest setRelevantHistory(List<Reference> theRelevantHistory) { 
2609      this.relevantHistory = theRelevantHistory;
2610      return this;
2611    }
2612
2613    public boolean hasRelevantHistory() { 
2614      if (this.relevantHistory == null)
2615        return false;
2616      for (Reference item : this.relevantHistory)
2617        if (!item.isEmpty())
2618          return true;
2619      return false;
2620    }
2621
2622    public Reference addRelevantHistory() { //3
2623      Reference t = new Reference();
2624      if (this.relevantHistory == null)
2625        this.relevantHistory = new ArrayList<Reference>();
2626      this.relevantHistory.add(t);
2627      return t;
2628    }
2629
2630    public ServiceRequest addRelevantHistory(Reference t) { //3
2631      if (t == null)
2632        return this;
2633      if (this.relevantHistory == null)
2634        this.relevantHistory = new ArrayList<Reference>();
2635      this.relevantHistory.add(t);
2636      return this;
2637    }
2638
2639    /**
2640     * @return The first repetition of repeating field {@link #relevantHistory}, creating it if it does not already exist {3}
2641     */
2642    public Reference getRelevantHistoryFirstRep() { 
2643      if (getRelevantHistory().isEmpty()) {
2644        addRelevantHistory();
2645      }
2646      return getRelevantHistory().get(0);
2647    }
2648
2649      protected void listChildren(List<Property> children) {
2650        super.listChildren(children);
2651        children.add(new Property("identifier", "Identifier", "Identifiers assigned to this order instance by the orderer and/or the receiver and/or order fulfiller.", 0, java.lang.Integer.MAX_VALUE, identifier));
2652        children.add(new Property("instantiatesCanonical", "canonical(ActivityDefinition|PlanDefinition)", "The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this ServiceRequest.", 0, java.lang.Integer.MAX_VALUE, instantiatesCanonical));
2653        children.add(new Property("instantiatesUri", "uri", "The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this ServiceRequest.", 0, java.lang.Integer.MAX_VALUE, instantiatesUri));
2654        children.add(new Property("basedOn", "Reference(CarePlan|ServiceRequest|MedicationRequest)", "Plan/proposal/order fulfilled by this request.", 0, java.lang.Integer.MAX_VALUE, basedOn));
2655        children.add(new Property("replaces", "Reference(ServiceRequest)", "The request takes the place of the referenced completed or terminated request(s).", 0, java.lang.Integer.MAX_VALUE, replaces));
2656        children.add(new Property("requisition", "Identifier", "A shared identifier common to all service requests that were authorized more or less simultaneously by a single author, representing the composite or group identifier.", 0, 1, requisition));
2657        children.add(new Property("status", "code", "The status of the order.", 0, 1, status));
2658        children.add(new Property("intent", "code", "Whether the request is a proposal, plan, an original order or a reflex order.", 0, 1, intent));
2659        children.add(new Property("category", "CodeableConcept", "A code that classifies the service for searching, sorting and display purposes (e.g. \"Surgical Procedure\").", 0, java.lang.Integer.MAX_VALUE, category));
2660        children.add(new Property("priority", "code", "Indicates how quickly the ServiceRequest should be addressed with respect to other requests.", 0, 1, priority));
2661        children.add(new Property("doNotPerform", "boolean", "Set this to true if the record is saying that the service/procedure should NOT be performed.", 0, 1, doNotPerform));
2662        children.add(new Property("code", "CodeableReference(ActivityDefinition|PlanDefinition)", "A code or reference that identifies a particular service (i.e., procedure, diagnostic investigation, or panel of investigations) that have been requested.", 0, 1, code));
2663        children.add(new Property("orderDetail", "", "Additional details and instructions about the how the services are to be delivered.   For example, and order for a urinary catheter may have an order detail for an external or indwelling catheter, or an order for a bandage may require additional instructions specifying how the bandage should be applied.", 0, java.lang.Integer.MAX_VALUE, orderDetail));
2664        children.add(new Property("quantity[x]", "Quantity|Ratio|Range", "An amount of service being requested which can be a quantity ( for example $1,500 home modification), a ratio ( for example, 20 half day visits per month), or a range (2.0 to 1.8 Gy per fraction).", 0, 1, quantity));
2665        children.add(new Property("subject", "Reference(Patient|Group|Location|Device)", "On whom or what the service is to be performed. This is usually a human patient, but can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).", 0, 1, subject));
2666        children.add(new Property("focus", "Reference(Any)", "The actual focus of a service request when it is not the subject of record representing something or someone associated with the subject such as a spouse, parent, fetus, or donor. The focus of a service request could also be an existing condition,  an intervention, the subject's diet,  another service request on the subject,  or a body structure such as tumor or implanted device.", 0, java.lang.Integer.MAX_VALUE, focus));
2667        children.add(new Property("encounter", "Reference(Encounter)", "An encounter that provides additional information about the healthcare context in which this request is made.", 0, 1, encounter));
2668        children.add(new Property("occurrence[x]", "dateTime|Period|Timing", "The date/time at which the requested service should occur.", 0, 1, occurrence));
2669        children.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "If a CodeableConcept is present, it indicates the pre-condition for performing the service.  For example \"pain\", \"on flare-up\", etc.", 0, 1, asNeeded));
2670        children.add(new Property("authoredOn", "dateTime", "When the request transitioned to being actionable.", 0, 1, authoredOn));
2671        children.add(new Property("requester", "Reference(Practitioner|PractitionerRole|Organization|Patient|RelatedPerson|Device)", "The individual who initiated the request and has responsibility for its activation.", 0, 1, requester));
2672        children.add(new Property("performerType", "CodeableConcept", "Desired type of performer for doing the requested service.", 0, 1, performerType));
2673        children.add(new Property("performer", "Reference(Practitioner|PractitionerRole|Organization|CareTeam|HealthcareService|Patient|Device|RelatedPerson)", "The desired performer for doing the requested service.  For example, the surgeon, dermatopathologist, endoscopist, etc.", 0, java.lang.Integer.MAX_VALUE, performer));
2674        children.add(new Property("location", "CodeableReference(Location)", "The preferred location(s) where the procedure should actually happen in coded or free text form. E.g. at home or nursing day care center.", 0, java.lang.Integer.MAX_VALUE, location));
2675        children.add(new Property("reason", "CodeableReference(Condition|Observation|DiagnosticReport|DocumentReference|DetectedIssue)", "An explanation or justification for why this service is being requested in coded or textual form.   This is often for billing purposes.  May relate to the resources referred to in `supportingInfo`.", 0, java.lang.Integer.MAX_VALUE, reason));
2676        children.add(new Property("insurance", "Reference(Coverage|ClaimResponse)", "Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be needed for delivering the requested service.", 0, java.lang.Integer.MAX_VALUE, insurance));
2677        children.add(new Property("supportingInfo", "CodeableReference(Any)", "Additional clinical information about the patient or specimen that may influence the services or their interpretations.     This information includes diagnosis, clinical findings and other observations.  In laboratory ordering these are typically referred to as \"ask at order entry questions (AOEs)\".  This includes observations explicitly requested by the producer (filler) to provide context or supporting information needed to complete the order. For example,  reporting the amount of inspired oxygen for blood gas measurements.", 0, java.lang.Integer.MAX_VALUE, supportingInfo));
2678        children.add(new Property("specimen", "Reference(Specimen)", "One or more specimens that the laboratory procedure will use.", 0, java.lang.Integer.MAX_VALUE, specimen));
2679        children.add(new Property("bodySite", "CodeableConcept", "Anatomic location where the procedure should be performed. This is the target site.", 0, java.lang.Integer.MAX_VALUE, bodySite));
2680        children.add(new Property("bodyStructure", "Reference(BodyStructure)", "Anatomic location where the procedure should be performed. This is the target site.", 0, 1, bodyStructure));
2681        children.add(new Property("note", "Annotation", "Any other notes and comments made about the service request. For example, internal billing notes.", 0, java.lang.Integer.MAX_VALUE, note));
2682        children.add(new Property("patientInstruction", "", "Instructions in terms that are understood by the patient or consumer.", 0, java.lang.Integer.MAX_VALUE, patientInstruction));
2683        children.add(new Property("relevantHistory", "Reference(Provenance)", "Key events in the history of the request.", 0, java.lang.Integer.MAX_VALUE, relevantHistory));
2684      }
2685
2686      @Override
2687      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2688        switch (_hash) {
2689        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifiers assigned to this order instance by the orderer and/or the receiver and/or order fulfiller.", 0, java.lang.Integer.MAX_VALUE, identifier);
2690        case 8911915: /*instantiatesCanonical*/  return new Property("instantiatesCanonical", "canonical(ActivityDefinition|PlanDefinition)", "The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this ServiceRequest.", 0, java.lang.Integer.MAX_VALUE, instantiatesCanonical);
2691        case -1926393373: /*instantiatesUri*/  return new Property("instantiatesUri", "uri", "The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this ServiceRequest.", 0, java.lang.Integer.MAX_VALUE, instantiatesUri);
2692        case -332612366: /*basedOn*/  return new Property("basedOn", "Reference(CarePlan|ServiceRequest|MedicationRequest)", "Plan/proposal/order fulfilled by this request.", 0, java.lang.Integer.MAX_VALUE, basedOn);
2693        case -430332865: /*replaces*/  return new Property("replaces", "Reference(ServiceRequest)", "The request takes the place of the referenced completed or terminated request(s).", 0, java.lang.Integer.MAX_VALUE, replaces);
2694        case 395923612: /*requisition*/  return new Property("requisition", "Identifier", "A shared identifier common to all service requests that were authorized more or less simultaneously by a single author, representing the composite or group identifier.", 0, 1, requisition);
2695        case -892481550: /*status*/  return new Property("status", "code", "The status of the order.", 0, 1, status);
2696        case -1183762788: /*intent*/  return new Property("intent", "code", "Whether the request is a proposal, plan, an original order or a reflex order.", 0, 1, intent);
2697        case 50511102: /*category*/  return new Property("category", "CodeableConcept", "A code that classifies the service for searching, sorting and display purposes (e.g. \"Surgical Procedure\").", 0, java.lang.Integer.MAX_VALUE, category);
2698        case -1165461084: /*priority*/  return new Property("priority", "code", "Indicates how quickly the ServiceRequest should be addressed with respect to other requests.", 0, 1, priority);
2699        case -1788508167: /*doNotPerform*/  return new Property("doNotPerform", "boolean", "Set this to true if the record is saying that the service/procedure should NOT be performed.", 0, 1, doNotPerform);
2700        case 3059181: /*code*/  return new Property("code", "CodeableReference(ActivityDefinition|PlanDefinition)", "A code or reference that identifies a particular service (i.e., procedure, diagnostic investigation, or panel of investigations) that have been requested.", 0, 1, code);
2701        case 1187338559: /*orderDetail*/  return new Property("orderDetail", "", "Additional details and instructions about the how the services are to be delivered.   For example, and order for a urinary catheter may have an order detail for an external or indwelling catheter, or an order for a bandage may require additional instructions specifying how the bandage should be applied.", 0, java.lang.Integer.MAX_VALUE, orderDetail);
2702        case -515002347: /*quantity[x]*/  return new Property("quantity[x]", "Quantity|Ratio|Range", "An amount of service being requested which can be a quantity ( for example $1,500 home modification), a ratio ( for example, 20 half day visits per month), or a range (2.0 to 1.8 Gy per fraction).", 0, 1, quantity);
2703        case -1285004149: /*quantity*/  return new Property("quantity[x]", "Quantity|Ratio|Range", "An amount of service being requested which can be a quantity ( for example $1,500 home modification), a ratio ( for example, 20 half day visits per month), or a range (2.0 to 1.8 Gy per fraction).", 0, 1, quantity);
2704        case -1087409610: /*quantityQuantity*/  return new Property("quantity[x]", "Quantity", "An amount of service being requested which can be a quantity ( for example $1,500 home modification), a ratio ( for example, 20 half day visits per month), or a range (2.0 to 1.8 Gy per fraction).", 0, 1, quantity);
2705        case -1004987840: /*quantityRatio*/  return new Property("quantity[x]", "Ratio", "An amount of service being requested which can be a quantity ( for example $1,500 home modification), a ratio ( for example, 20 half day visits per month), or a range (2.0 to 1.8 Gy per fraction).", 0, 1, quantity);
2706        case -1004993678: /*quantityRange*/  return new Property("quantity[x]", "Range", "An amount of service being requested which can be a quantity ( for example $1,500 home modification), a ratio ( for example, 20 half day visits per month), or a range (2.0 to 1.8 Gy per fraction).", 0, 1, quantity);
2707        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group|Location|Device)", "On whom or what the service is to be performed. This is usually a human patient, but can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).", 0, 1, subject);
2708        case 97604824: /*focus*/  return new Property("focus", "Reference(Any)", "The actual focus of a service request when it is not the subject of record representing something or someone associated with the subject such as a spouse, parent, fetus, or donor. The focus of a service request could also be an existing condition,  an intervention, the subject's diet,  another service request on the subject,  or a body structure such as tumor or implanted device.", 0, java.lang.Integer.MAX_VALUE, focus);
2709        case 1524132147: /*encounter*/  return new Property("encounter", "Reference(Encounter)", "An encounter that provides additional information about the healthcare context in which this request is made.", 0, 1, encounter);
2710        case -2022646513: /*occurrence[x]*/  return new Property("occurrence[x]", "dateTime|Period|Timing", "The date/time at which the requested service should occur.", 0, 1, occurrence);
2711        case 1687874001: /*occurrence*/  return new Property("occurrence[x]", "dateTime|Period|Timing", "The date/time at which the requested service should occur.", 0, 1, occurrence);
2712        case -298443636: /*occurrenceDateTime*/  return new Property("occurrence[x]", "dateTime", "The date/time at which the requested service should occur.", 0, 1, occurrence);
2713        case 1397156594: /*occurrencePeriod*/  return new Property("occurrence[x]", "Period", "The date/time at which the requested service should occur.", 0, 1, occurrence);
2714        case 1515218299: /*occurrenceTiming*/  return new Property("occurrence[x]", "Timing", "The date/time at which the requested service should occur.", 0, 1, occurrence);
2715        case -544329575: /*asNeeded[x]*/  return new Property("asNeeded[x]", "boolean|CodeableConcept", "If a CodeableConcept is present, it indicates the pre-condition for performing the service.  For example \"pain\", \"on flare-up\", etc.", 0, 1, asNeeded);
2716        case -1432923513: /*asNeeded*/  return new Property("asNeeded[x]", "boolean|CodeableConcept", "If a CodeableConcept is present, it indicates the pre-condition for performing the service.  For example \"pain\", \"on flare-up\", etc.", 0, 1, asNeeded);
2717        case -591717471: /*asNeededBoolean*/  return new Property("asNeeded[x]", "boolean", "If a CodeableConcept is present, it indicates the pre-condition for performing the service.  For example \"pain\", \"on flare-up\", etc.", 0, 1, asNeeded);
2718        case 1556420122: /*asNeededCodeableConcept*/  return new Property("asNeeded[x]", "CodeableConcept", "If a CodeableConcept is present, it indicates the pre-condition for performing the service.  For example \"pain\", \"on flare-up\", etc.", 0, 1, asNeeded);
2719        case -1500852503: /*authoredOn*/  return new Property("authoredOn", "dateTime", "When the request transitioned to being actionable.", 0, 1, authoredOn);
2720        case 693933948: /*requester*/  return new Property("requester", "Reference(Practitioner|PractitionerRole|Organization|Patient|RelatedPerson|Device)", "The individual who initiated the request and has responsibility for its activation.", 0, 1, requester);
2721        case -901444568: /*performerType*/  return new Property("performerType", "CodeableConcept", "Desired type of performer for doing the requested service.", 0, 1, performerType);
2722        case 481140686: /*performer*/  return new Property("performer", "Reference(Practitioner|PractitionerRole|Organization|CareTeam|HealthcareService|Patient|Device|RelatedPerson)", "The desired performer for doing the requested service.  For example, the surgeon, dermatopathologist, endoscopist, etc.", 0, java.lang.Integer.MAX_VALUE, performer);
2723        case 1901043637: /*location*/  return new Property("location", "CodeableReference(Location)", "The preferred location(s) where the procedure should actually happen in coded or free text form. E.g. at home or nursing day care center.", 0, java.lang.Integer.MAX_VALUE, location);
2724        case -934964668: /*reason*/  return new Property("reason", "CodeableReference(Condition|Observation|DiagnosticReport|DocumentReference|DetectedIssue)", "An explanation or justification for why this service is being requested in coded or textual form.   This is often for billing purposes.  May relate to the resources referred to in `supportingInfo`.", 0, java.lang.Integer.MAX_VALUE, reason);
2725        case 73049818: /*insurance*/  return new Property("insurance", "Reference(Coverage|ClaimResponse)", "Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be needed for delivering the requested service.", 0, java.lang.Integer.MAX_VALUE, insurance);
2726        case 1922406657: /*supportingInfo*/  return new Property("supportingInfo", "CodeableReference(Any)", "Additional clinical information about the patient or specimen that may influence the services or their interpretations.     This information includes diagnosis, clinical findings and other observations.  In laboratory ordering these are typically referred to as \"ask at order entry questions (AOEs)\".  This includes observations explicitly requested by the producer (filler) to provide context or supporting information needed to complete the order. For example,  reporting the amount of inspired oxygen for blood gas measurements.", 0, java.lang.Integer.MAX_VALUE, supportingInfo);
2727        case -2132868344: /*specimen*/  return new Property("specimen", "Reference(Specimen)", "One or more specimens that the laboratory procedure will use.", 0, java.lang.Integer.MAX_VALUE, specimen);
2728        case 1702620169: /*bodySite*/  return new Property("bodySite", "CodeableConcept", "Anatomic location where the procedure should be performed. This is the target site.", 0, java.lang.Integer.MAX_VALUE, bodySite);
2729        case -1001731599: /*bodyStructure*/  return new Property("bodyStructure", "Reference(BodyStructure)", "Anatomic location where the procedure should be performed. This is the target site.", 0, 1, bodyStructure);
2730        case 3387378: /*note*/  return new Property("note", "Annotation", "Any other notes and comments made about the service request. For example, internal billing notes.", 0, java.lang.Integer.MAX_VALUE, note);
2731        case 737543241: /*patientInstruction*/  return new Property("patientInstruction", "", "Instructions in terms that are understood by the patient or consumer.", 0, java.lang.Integer.MAX_VALUE, patientInstruction);
2732        case 1538891575: /*relevantHistory*/  return new Property("relevantHistory", "Reference(Provenance)", "Key events in the history of the request.", 0, java.lang.Integer.MAX_VALUE, relevantHistory);
2733        default: return super.getNamedProperty(_hash, _name, _checkValid);
2734        }
2735
2736      }
2737
2738      @Override
2739      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2740        switch (hash) {
2741        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2742        case 8911915: /*instantiatesCanonical*/ return this.instantiatesCanonical == null ? new Base[0] : this.instantiatesCanonical.toArray(new Base[this.instantiatesCanonical.size()]); // CanonicalType
2743        case -1926393373: /*instantiatesUri*/ return this.instantiatesUri == null ? new Base[0] : this.instantiatesUri.toArray(new Base[this.instantiatesUri.size()]); // UriType
2744        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
2745        case -430332865: /*replaces*/ return this.replaces == null ? new Base[0] : this.replaces.toArray(new Base[this.replaces.size()]); // Reference
2746        case 395923612: /*requisition*/ return this.requisition == null ? new Base[0] : new Base[] {this.requisition}; // Identifier
2747        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<RequestStatus>
2748        case -1183762788: /*intent*/ return this.intent == null ? new Base[0] : new Base[] {this.intent}; // Enumeration<RequestIntent>
2749        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
2750        case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Enumeration<RequestPriority>
2751        case -1788508167: /*doNotPerform*/ return this.doNotPerform == null ? new Base[0] : new Base[] {this.doNotPerform}; // BooleanType
2752        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableReference
2753        case 1187338559: /*orderDetail*/ return this.orderDetail == null ? new Base[0] : this.orderDetail.toArray(new Base[this.orderDetail.size()]); // ServiceRequestOrderDetailComponent
2754        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // DataType
2755        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
2756        case 97604824: /*focus*/ return this.focus == null ? new Base[0] : this.focus.toArray(new Base[this.focus.size()]); // Reference
2757        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference
2758        case 1687874001: /*occurrence*/ return this.occurrence == null ? new Base[0] : new Base[] {this.occurrence}; // DataType
2759        case -1432923513: /*asNeeded*/ return this.asNeeded == null ? new Base[0] : new Base[] {this.asNeeded}; // DataType
2760        case -1500852503: /*authoredOn*/ return this.authoredOn == null ? new Base[0] : new Base[] {this.authoredOn}; // DateTimeType
2761        case 693933948: /*requester*/ return this.requester == null ? new Base[0] : new Base[] {this.requester}; // Reference
2762        case -901444568: /*performerType*/ return this.performerType == null ? new Base[0] : new Base[] {this.performerType}; // CodeableConcept
2763        case 481140686: /*performer*/ return this.performer == null ? new Base[0] : this.performer.toArray(new Base[this.performer.size()]); // Reference
2764        case 1901043637: /*location*/ return this.location == null ? new Base[0] : this.location.toArray(new Base[this.location.size()]); // CodeableReference
2765        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableReference
2766        case 73049818: /*insurance*/ return this.insurance == null ? new Base[0] : this.insurance.toArray(new Base[this.insurance.size()]); // Reference
2767        case 1922406657: /*supportingInfo*/ return this.supportingInfo == null ? new Base[0] : this.supportingInfo.toArray(new Base[this.supportingInfo.size()]); // CodeableReference
2768        case -2132868344: /*specimen*/ return this.specimen == null ? new Base[0] : this.specimen.toArray(new Base[this.specimen.size()]); // Reference
2769        case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : this.bodySite.toArray(new Base[this.bodySite.size()]); // CodeableConcept
2770        case -1001731599: /*bodyStructure*/ return this.bodyStructure == null ? new Base[0] : new Base[] {this.bodyStructure}; // Reference
2771        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
2772        case 737543241: /*patientInstruction*/ return this.patientInstruction == null ? new Base[0] : this.patientInstruction.toArray(new Base[this.patientInstruction.size()]); // ServiceRequestPatientInstructionComponent
2773        case 1538891575: /*relevantHistory*/ return this.relevantHistory == null ? new Base[0] : this.relevantHistory.toArray(new Base[this.relevantHistory.size()]); // Reference
2774        default: return super.getProperty(hash, name, checkValid);
2775        }
2776
2777      }
2778
2779      @Override
2780      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2781        switch (hash) {
2782        case -1618432855: // identifier
2783          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
2784          return value;
2785        case 8911915: // instantiatesCanonical
2786          this.getInstantiatesCanonical().add(TypeConvertor.castToCanonical(value)); // CanonicalType
2787          return value;
2788        case -1926393373: // instantiatesUri
2789          this.getInstantiatesUri().add(TypeConvertor.castToUri(value)); // UriType
2790          return value;
2791        case -332612366: // basedOn
2792          this.getBasedOn().add(TypeConvertor.castToReference(value)); // Reference
2793          return value;
2794        case -430332865: // replaces
2795          this.getReplaces().add(TypeConvertor.castToReference(value)); // Reference
2796          return value;
2797        case 395923612: // requisition
2798          this.requisition = TypeConvertor.castToIdentifier(value); // Identifier
2799          return value;
2800        case -892481550: // status
2801          value = new RequestStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
2802          this.status = (Enumeration) value; // Enumeration<RequestStatus>
2803          return value;
2804        case -1183762788: // intent
2805          value = new RequestIntentEnumFactory().fromType(TypeConvertor.castToCode(value));
2806          this.intent = (Enumeration) value; // Enumeration<RequestIntent>
2807          return value;
2808        case 50511102: // category
2809          this.getCategory().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2810          return value;
2811        case -1165461084: // priority
2812          value = new RequestPriorityEnumFactory().fromType(TypeConvertor.castToCode(value));
2813          this.priority = (Enumeration) value; // Enumeration<RequestPriority>
2814          return value;
2815        case -1788508167: // doNotPerform
2816          this.doNotPerform = TypeConvertor.castToBoolean(value); // BooleanType
2817          return value;
2818        case 3059181: // code
2819          this.code = TypeConvertor.castToCodeableReference(value); // CodeableReference
2820          return value;
2821        case 1187338559: // orderDetail
2822          this.getOrderDetail().add((ServiceRequestOrderDetailComponent) value); // ServiceRequestOrderDetailComponent
2823          return value;
2824        case -1285004149: // quantity
2825          this.quantity = TypeConvertor.castToType(value); // DataType
2826          return value;
2827        case -1867885268: // subject
2828          this.subject = TypeConvertor.castToReference(value); // Reference
2829          return value;
2830        case 97604824: // focus
2831          this.getFocus().add(TypeConvertor.castToReference(value)); // Reference
2832          return value;
2833        case 1524132147: // encounter
2834          this.encounter = TypeConvertor.castToReference(value); // Reference
2835          return value;
2836        case 1687874001: // occurrence
2837          this.occurrence = TypeConvertor.castToType(value); // DataType
2838          return value;
2839        case -1432923513: // asNeeded
2840          this.asNeeded = TypeConvertor.castToType(value); // DataType
2841          return value;
2842        case -1500852503: // authoredOn
2843          this.authoredOn = TypeConvertor.castToDateTime(value); // DateTimeType
2844          return value;
2845        case 693933948: // requester
2846          this.requester = TypeConvertor.castToReference(value); // Reference
2847          return value;
2848        case -901444568: // performerType
2849          this.performerType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2850          return value;
2851        case 481140686: // performer
2852          this.getPerformer().add(TypeConvertor.castToReference(value)); // Reference
2853          return value;
2854        case 1901043637: // location
2855          this.getLocation().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference
2856          return value;
2857        case -934964668: // reason
2858          this.getReason().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference
2859          return value;
2860        case 73049818: // insurance
2861          this.getInsurance().add(TypeConvertor.castToReference(value)); // Reference
2862          return value;
2863        case 1922406657: // supportingInfo
2864          this.getSupportingInfo().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference
2865          return value;
2866        case -2132868344: // specimen
2867          this.getSpecimen().add(TypeConvertor.castToReference(value)); // Reference
2868          return value;
2869        case 1702620169: // bodySite
2870          this.getBodySite().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2871          return value;
2872        case -1001731599: // bodyStructure
2873          this.bodyStructure = TypeConvertor.castToReference(value); // Reference
2874          return value;
2875        case 3387378: // note
2876          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
2877          return value;
2878        case 737543241: // patientInstruction
2879          this.getPatientInstruction().add((ServiceRequestPatientInstructionComponent) value); // ServiceRequestPatientInstructionComponent
2880          return value;
2881        case 1538891575: // relevantHistory
2882          this.getRelevantHistory().add(TypeConvertor.castToReference(value)); // Reference
2883          return value;
2884        default: return super.setProperty(hash, name, value);
2885        }
2886
2887      }
2888
2889      @Override
2890      public Base setProperty(String name, Base value) throws FHIRException {
2891        if (name.equals("identifier")) {
2892          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
2893        } else if (name.equals("instantiatesCanonical")) {
2894          this.getInstantiatesCanonical().add(TypeConvertor.castToCanonical(value));
2895        } else if (name.equals("instantiatesUri")) {
2896          this.getInstantiatesUri().add(TypeConvertor.castToUri(value));
2897        } else if (name.equals("basedOn")) {
2898          this.getBasedOn().add(TypeConvertor.castToReference(value));
2899        } else if (name.equals("replaces")) {
2900          this.getReplaces().add(TypeConvertor.castToReference(value));
2901        } else if (name.equals("requisition")) {
2902          this.requisition = TypeConvertor.castToIdentifier(value); // Identifier
2903        } else if (name.equals("status")) {
2904          value = new RequestStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
2905          this.status = (Enumeration) value; // Enumeration<RequestStatus>
2906        } else if (name.equals("intent")) {
2907          value = new RequestIntentEnumFactory().fromType(TypeConvertor.castToCode(value));
2908          this.intent = (Enumeration) value; // Enumeration<RequestIntent>
2909        } else if (name.equals("category")) {
2910          this.getCategory().add(TypeConvertor.castToCodeableConcept(value));
2911        } else if (name.equals("priority")) {
2912          value = new RequestPriorityEnumFactory().fromType(TypeConvertor.castToCode(value));
2913          this.priority = (Enumeration) value; // Enumeration<RequestPriority>
2914        } else if (name.equals("doNotPerform")) {
2915          this.doNotPerform = TypeConvertor.castToBoolean(value); // BooleanType
2916        } else if (name.equals("code")) {
2917          this.code = TypeConvertor.castToCodeableReference(value); // CodeableReference
2918        } else if (name.equals("orderDetail")) {
2919          this.getOrderDetail().add((ServiceRequestOrderDetailComponent) value);
2920        } else if (name.equals("quantity[x]")) {
2921          this.quantity = TypeConvertor.castToType(value); // DataType
2922        } else if (name.equals("subject")) {
2923          this.subject = TypeConvertor.castToReference(value); // Reference
2924        } else if (name.equals("focus")) {
2925          this.getFocus().add(TypeConvertor.castToReference(value));
2926        } else if (name.equals("encounter")) {
2927          this.encounter = TypeConvertor.castToReference(value); // Reference
2928        } else if (name.equals("occurrence[x]")) {
2929          this.occurrence = TypeConvertor.castToType(value); // DataType
2930        } else if (name.equals("asNeeded[x]")) {
2931          this.asNeeded = TypeConvertor.castToType(value); // DataType
2932        } else if (name.equals("authoredOn")) {
2933          this.authoredOn = TypeConvertor.castToDateTime(value); // DateTimeType
2934        } else if (name.equals("requester")) {
2935          this.requester = TypeConvertor.castToReference(value); // Reference
2936        } else if (name.equals("performerType")) {
2937          this.performerType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2938        } else if (name.equals("performer")) {
2939          this.getPerformer().add(TypeConvertor.castToReference(value));
2940        } else if (name.equals("location")) {
2941          this.getLocation().add(TypeConvertor.castToCodeableReference(value));
2942        } else if (name.equals("reason")) {
2943          this.getReason().add(TypeConvertor.castToCodeableReference(value));
2944        } else if (name.equals("insurance")) {
2945          this.getInsurance().add(TypeConvertor.castToReference(value));
2946        } else if (name.equals("supportingInfo")) {
2947          this.getSupportingInfo().add(TypeConvertor.castToCodeableReference(value));
2948        } else if (name.equals("specimen")) {
2949          this.getSpecimen().add(TypeConvertor.castToReference(value));
2950        } else if (name.equals("bodySite")) {
2951          this.getBodySite().add(TypeConvertor.castToCodeableConcept(value));
2952        } else if (name.equals("bodyStructure")) {
2953          this.bodyStructure = TypeConvertor.castToReference(value); // Reference
2954        } else if (name.equals("note")) {
2955          this.getNote().add(TypeConvertor.castToAnnotation(value));
2956        } else if (name.equals("patientInstruction")) {
2957          this.getPatientInstruction().add((ServiceRequestPatientInstructionComponent) value);
2958        } else if (name.equals("relevantHistory")) {
2959          this.getRelevantHistory().add(TypeConvertor.castToReference(value));
2960        } else
2961          return super.setProperty(name, value);
2962        return value;
2963      }
2964
2965      @Override
2966      public Base makeProperty(int hash, String name) throws FHIRException {
2967        switch (hash) {
2968        case -1618432855:  return addIdentifier(); 
2969        case 8911915:  return addInstantiatesCanonicalElement();
2970        case -1926393373:  return addInstantiatesUriElement();
2971        case -332612366:  return addBasedOn(); 
2972        case -430332865:  return addReplaces(); 
2973        case 395923612:  return getRequisition();
2974        case -892481550:  return getStatusElement();
2975        case -1183762788:  return getIntentElement();
2976        case 50511102:  return addCategory(); 
2977        case -1165461084:  return getPriorityElement();
2978        case -1788508167:  return getDoNotPerformElement();
2979        case 3059181:  return getCode();
2980        case 1187338559:  return addOrderDetail(); 
2981        case -515002347:  return getQuantity();
2982        case -1285004149:  return getQuantity();
2983        case -1867885268:  return getSubject();
2984        case 97604824:  return addFocus(); 
2985        case 1524132147:  return getEncounter();
2986        case -2022646513:  return getOccurrence();
2987        case 1687874001:  return getOccurrence();
2988        case -544329575:  return getAsNeeded();
2989        case -1432923513:  return getAsNeeded();
2990        case -1500852503:  return getAuthoredOnElement();
2991        case 693933948:  return getRequester();
2992        case -901444568:  return getPerformerType();
2993        case 481140686:  return addPerformer(); 
2994        case 1901043637:  return addLocation(); 
2995        case -934964668:  return addReason(); 
2996        case 73049818:  return addInsurance(); 
2997        case 1922406657:  return addSupportingInfo(); 
2998        case -2132868344:  return addSpecimen(); 
2999        case 1702620169:  return addBodySite(); 
3000        case -1001731599:  return getBodyStructure();
3001        case 3387378:  return addNote(); 
3002        case 737543241:  return addPatientInstruction(); 
3003        case 1538891575:  return addRelevantHistory(); 
3004        default: return super.makeProperty(hash, name);
3005        }
3006
3007      }
3008
3009      @Override
3010      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3011        switch (hash) {
3012        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
3013        case 8911915: /*instantiatesCanonical*/ return new String[] {"canonical"};
3014        case -1926393373: /*instantiatesUri*/ return new String[] {"uri"};
3015        case -332612366: /*basedOn*/ return new String[] {"Reference"};
3016        case -430332865: /*replaces*/ return new String[] {"Reference"};
3017        case 395923612: /*requisition*/ return new String[] {"Identifier"};
3018        case -892481550: /*status*/ return new String[] {"code"};
3019        case -1183762788: /*intent*/ return new String[] {"code"};
3020        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
3021        case -1165461084: /*priority*/ return new String[] {"code"};
3022        case -1788508167: /*doNotPerform*/ return new String[] {"boolean"};
3023        case 3059181: /*code*/ return new String[] {"CodeableReference"};
3024        case 1187338559: /*orderDetail*/ return new String[] {};
3025        case -1285004149: /*quantity*/ return new String[] {"Quantity", "Ratio", "Range"};
3026        case -1867885268: /*subject*/ return new String[] {"Reference"};
3027        case 97604824: /*focus*/ return new String[] {"Reference"};
3028        case 1524132147: /*encounter*/ return new String[] {"Reference"};
3029        case 1687874001: /*occurrence*/ return new String[] {"dateTime", "Period", "Timing"};
3030        case -1432923513: /*asNeeded*/ return new String[] {"boolean", "CodeableConcept"};
3031        case -1500852503: /*authoredOn*/ return new String[] {"dateTime"};
3032        case 693933948: /*requester*/ return new String[] {"Reference"};
3033        case -901444568: /*performerType*/ return new String[] {"CodeableConcept"};
3034        case 481140686: /*performer*/ return new String[] {"Reference"};
3035        case 1901043637: /*location*/ return new String[] {"CodeableReference"};
3036        case -934964668: /*reason*/ return new String[] {"CodeableReference"};
3037        case 73049818: /*insurance*/ return new String[] {"Reference"};
3038        case 1922406657: /*supportingInfo*/ return new String[] {"CodeableReference"};
3039        case -2132868344: /*specimen*/ return new String[] {"Reference"};
3040        case 1702620169: /*bodySite*/ return new String[] {"CodeableConcept"};
3041        case -1001731599: /*bodyStructure*/ return new String[] {"Reference"};
3042        case 3387378: /*note*/ return new String[] {"Annotation"};
3043        case 737543241: /*patientInstruction*/ return new String[] {};
3044        case 1538891575: /*relevantHistory*/ return new String[] {"Reference"};
3045        default: return super.getTypesForProperty(hash, name);
3046        }
3047
3048      }
3049
3050      @Override
3051      public Base addChild(String name) throws FHIRException {
3052        if (name.equals("identifier")) {
3053          return addIdentifier();
3054        }
3055        else if (name.equals("instantiatesCanonical")) {
3056          throw new FHIRException("Cannot call addChild on a singleton property ServiceRequest.instantiatesCanonical");
3057        }
3058        else if (name.equals("instantiatesUri")) {
3059          throw new FHIRException("Cannot call addChild on a singleton property ServiceRequest.instantiatesUri");
3060        }
3061        else if (name.equals("basedOn")) {
3062          return addBasedOn();
3063        }
3064        else if (name.equals("replaces")) {
3065          return addReplaces();
3066        }
3067        else if (name.equals("requisition")) {
3068          this.requisition = new Identifier();
3069          return this.requisition;
3070        }
3071        else if (name.equals("status")) {
3072          throw new FHIRException("Cannot call addChild on a singleton property ServiceRequest.status");
3073        }
3074        else if (name.equals("intent")) {
3075          throw new FHIRException("Cannot call addChild on a singleton property ServiceRequest.intent");
3076        }
3077        else if (name.equals("category")) {
3078          return addCategory();
3079        }
3080        else if (name.equals("priority")) {
3081          throw new FHIRException("Cannot call addChild on a singleton property ServiceRequest.priority");
3082        }
3083        else if (name.equals("doNotPerform")) {
3084          throw new FHIRException("Cannot call addChild on a singleton property ServiceRequest.doNotPerform");
3085        }
3086        else if (name.equals("code")) {
3087          this.code = new CodeableReference();
3088          return this.code;
3089        }
3090        else if (name.equals("orderDetail")) {
3091          return addOrderDetail();
3092        }
3093        else if (name.equals("quantityQuantity")) {
3094          this.quantity = new Quantity();
3095          return this.quantity;
3096        }
3097        else if (name.equals("quantityRatio")) {
3098          this.quantity = new Ratio();
3099          return this.quantity;
3100        }
3101        else if (name.equals("quantityRange")) {
3102          this.quantity = new Range();
3103          return this.quantity;
3104        }
3105        else if (name.equals("subject")) {
3106          this.subject = new Reference();
3107          return this.subject;
3108        }
3109        else if (name.equals("focus")) {
3110          return addFocus();
3111        }
3112        else if (name.equals("encounter")) {
3113          this.encounter = new Reference();
3114          return this.encounter;
3115        }
3116        else if (name.equals("occurrenceDateTime")) {
3117          this.occurrence = new DateTimeType();
3118          return this.occurrence;
3119        }
3120        else if (name.equals("occurrencePeriod")) {
3121          this.occurrence = new Period();
3122          return this.occurrence;
3123        }
3124        else if (name.equals("occurrenceTiming")) {
3125          this.occurrence = new Timing();
3126          return this.occurrence;
3127        }
3128        else if (name.equals("asNeededBoolean")) {
3129          this.asNeeded = new BooleanType();
3130          return this.asNeeded;
3131        }
3132        else if (name.equals("asNeededCodeableConcept")) {
3133          this.asNeeded = new CodeableConcept();
3134          return this.asNeeded;
3135        }
3136        else if (name.equals("authoredOn")) {
3137          throw new FHIRException("Cannot call addChild on a singleton property ServiceRequest.authoredOn");
3138        }
3139        else if (name.equals("requester")) {
3140          this.requester = new Reference();
3141          return this.requester;
3142        }
3143        else if (name.equals("performerType")) {
3144          this.performerType = new CodeableConcept();
3145          return this.performerType;
3146        }
3147        else if (name.equals("performer")) {
3148          return addPerformer();
3149        }
3150        else if (name.equals("location")) {
3151          return addLocation();
3152        }
3153        else if (name.equals("reason")) {
3154          return addReason();
3155        }
3156        else if (name.equals("insurance")) {
3157          return addInsurance();
3158        }
3159        else if (name.equals("supportingInfo")) {
3160          return addSupportingInfo();
3161        }
3162        else if (name.equals("specimen")) {
3163          return addSpecimen();
3164        }
3165        else if (name.equals("bodySite")) {
3166          return addBodySite();
3167        }
3168        else if (name.equals("bodyStructure")) {
3169          this.bodyStructure = new Reference();
3170          return this.bodyStructure;
3171        }
3172        else if (name.equals("note")) {
3173          return addNote();
3174        }
3175        else if (name.equals("patientInstruction")) {
3176          return addPatientInstruction();
3177        }
3178        else if (name.equals("relevantHistory")) {
3179          return addRelevantHistory();
3180        }
3181        else
3182          return super.addChild(name);
3183      }
3184
3185  public String fhirType() {
3186    return "ServiceRequest";
3187
3188  }
3189
3190      public ServiceRequest copy() {
3191        ServiceRequest dst = new ServiceRequest();
3192        copyValues(dst);
3193        return dst;
3194      }
3195
3196      public void copyValues(ServiceRequest dst) {
3197        super.copyValues(dst);
3198        if (identifier != null) {
3199          dst.identifier = new ArrayList<Identifier>();
3200          for (Identifier i : identifier)
3201            dst.identifier.add(i.copy());
3202        };
3203        if (instantiatesCanonical != null) {
3204          dst.instantiatesCanonical = new ArrayList<CanonicalType>();
3205          for (CanonicalType i : instantiatesCanonical)
3206            dst.instantiatesCanonical.add(i.copy());
3207        };
3208        if (instantiatesUri != null) {
3209          dst.instantiatesUri = new ArrayList<UriType>();
3210          for (UriType i : instantiatesUri)
3211            dst.instantiatesUri.add(i.copy());
3212        };
3213        if (basedOn != null) {
3214          dst.basedOn = new ArrayList<Reference>();
3215          for (Reference i : basedOn)
3216            dst.basedOn.add(i.copy());
3217        };
3218        if (replaces != null) {
3219          dst.replaces = new ArrayList<Reference>();
3220          for (Reference i : replaces)
3221            dst.replaces.add(i.copy());
3222        };
3223        dst.requisition = requisition == null ? null : requisition.copy();
3224        dst.status = status == null ? null : status.copy();
3225        dst.intent = intent == null ? null : intent.copy();
3226        if (category != null) {
3227          dst.category = new ArrayList<CodeableConcept>();
3228          for (CodeableConcept i : category)
3229            dst.category.add(i.copy());
3230        };
3231        dst.priority = priority == null ? null : priority.copy();
3232        dst.doNotPerform = doNotPerform == null ? null : doNotPerform.copy();
3233        dst.code = code == null ? null : code.copy();
3234        if (orderDetail != null) {
3235          dst.orderDetail = new ArrayList<ServiceRequestOrderDetailComponent>();
3236          for (ServiceRequestOrderDetailComponent i : orderDetail)
3237            dst.orderDetail.add(i.copy());
3238        };
3239        dst.quantity = quantity == null ? null : quantity.copy();
3240        dst.subject = subject == null ? null : subject.copy();
3241        if (focus != null) {
3242          dst.focus = new ArrayList<Reference>();
3243          for (Reference i : focus)
3244            dst.focus.add(i.copy());
3245        };
3246        dst.encounter = encounter == null ? null : encounter.copy();
3247        dst.occurrence = occurrence == null ? null : occurrence.copy();
3248        dst.asNeeded = asNeeded == null ? null : asNeeded.copy();
3249        dst.authoredOn = authoredOn == null ? null : authoredOn.copy();
3250        dst.requester = requester == null ? null : requester.copy();
3251        dst.performerType = performerType == null ? null : performerType.copy();
3252        if (performer != null) {
3253          dst.performer = new ArrayList<Reference>();
3254          for (Reference i : performer)
3255            dst.performer.add(i.copy());
3256        };
3257        if (location != null) {
3258          dst.location = new ArrayList<CodeableReference>();
3259          for (CodeableReference i : location)
3260            dst.location.add(i.copy());
3261        };
3262        if (reason != null) {
3263          dst.reason = new ArrayList<CodeableReference>();
3264          for (CodeableReference i : reason)
3265            dst.reason.add(i.copy());
3266        };
3267        if (insurance != null) {
3268          dst.insurance = new ArrayList<Reference>();
3269          for (Reference i : insurance)
3270            dst.insurance.add(i.copy());
3271        };
3272        if (supportingInfo != null) {
3273          dst.supportingInfo = new ArrayList<CodeableReference>();
3274          for (CodeableReference i : supportingInfo)
3275            dst.supportingInfo.add(i.copy());
3276        };
3277        if (specimen != null) {
3278          dst.specimen = new ArrayList<Reference>();
3279          for (Reference i : specimen)
3280            dst.specimen.add(i.copy());
3281        };
3282        if (bodySite != null) {
3283          dst.bodySite = new ArrayList<CodeableConcept>();
3284          for (CodeableConcept i : bodySite)
3285            dst.bodySite.add(i.copy());
3286        };
3287        dst.bodyStructure = bodyStructure == null ? null : bodyStructure.copy();
3288        if (note != null) {
3289          dst.note = new ArrayList<Annotation>();
3290          for (Annotation i : note)
3291            dst.note.add(i.copy());
3292        };
3293        if (patientInstruction != null) {
3294          dst.patientInstruction = new ArrayList<ServiceRequestPatientInstructionComponent>();
3295          for (ServiceRequestPatientInstructionComponent i : patientInstruction)
3296            dst.patientInstruction.add(i.copy());
3297        };
3298        if (relevantHistory != null) {
3299          dst.relevantHistory = new ArrayList<Reference>();
3300          for (Reference i : relevantHistory)
3301            dst.relevantHistory.add(i.copy());
3302        };
3303      }
3304
3305      protected ServiceRequest typedCopy() {
3306        return copy();
3307      }
3308
3309      @Override
3310      public boolean equalsDeep(Base other_) {
3311        if (!super.equalsDeep(other_))
3312          return false;
3313        if (!(other_ instanceof ServiceRequest))
3314          return false;
3315        ServiceRequest o = (ServiceRequest) other_;
3316        return compareDeep(identifier, o.identifier, true) && compareDeep(instantiatesCanonical, o.instantiatesCanonical, true)
3317           && compareDeep(instantiatesUri, o.instantiatesUri, true) && compareDeep(basedOn, o.basedOn, true)
3318           && compareDeep(replaces, o.replaces, true) && compareDeep(requisition, o.requisition, true) && compareDeep(status, o.status, true)
3319           && compareDeep(intent, o.intent, true) && compareDeep(category, o.category, true) && compareDeep(priority, o.priority, true)
3320           && compareDeep(doNotPerform, o.doNotPerform, true) && compareDeep(code, o.code, true) && compareDeep(orderDetail, o.orderDetail, true)
3321           && compareDeep(quantity, o.quantity, true) && compareDeep(subject, o.subject, true) && compareDeep(focus, o.focus, true)
3322           && compareDeep(encounter, o.encounter, true) && compareDeep(occurrence, o.occurrence, true) && compareDeep(asNeeded, o.asNeeded, true)
3323           && compareDeep(authoredOn, o.authoredOn, true) && compareDeep(requester, o.requester, true) && compareDeep(performerType, o.performerType, true)
3324           && compareDeep(performer, o.performer, true) && compareDeep(location, o.location, true) && compareDeep(reason, o.reason, true)
3325           && compareDeep(insurance, o.insurance, true) && compareDeep(supportingInfo, o.supportingInfo, true)
3326           && compareDeep(specimen, o.specimen, true) && compareDeep(bodySite, o.bodySite, true) && compareDeep(bodyStructure, o.bodyStructure, true)
3327           && compareDeep(note, o.note, true) && compareDeep(patientInstruction, o.patientInstruction, true)
3328           && compareDeep(relevantHistory, o.relevantHistory, true);
3329      }
3330
3331      @Override
3332      public boolean equalsShallow(Base other_) {
3333        if (!super.equalsShallow(other_))
3334          return false;
3335        if (!(other_ instanceof ServiceRequest))
3336          return false;
3337        ServiceRequest o = (ServiceRequest) other_;
3338        return compareValues(instantiatesCanonical, o.instantiatesCanonical, true) && compareValues(instantiatesUri, o.instantiatesUri, true)
3339           && compareValues(status, o.status, true) && compareValues(intent, o.intent, true) && compareValues(priority, o.priority, true)
3340           && compareValues(doNotPerform, o.doNotPerform, true) && compareValues(authoredOn, o.authoredOn, true)
3341          ;
3342      }
3343
3344      public boolean isEmpty() {
3345        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, instantiatesCanonical
3346          , instantiatesUri, basedOn, replaces, requisition, status, intent, category, priority
3347          , doNotPerform, code, orderDetail, quantity, subject, focus, encounter, occurrence
3348          , asNeeded, authoredOn, requester, performerType, performer, location, reason
3349          , insurance, supportingInfo, specimen, bodySite, bodyStructure, note, patientInstruction
3350          , relevantHistory);
3351      }
3352
3353  @Override
3354  public ResourceType getResourceType() {
3355    return ResourceType.ServiceRequest;
3356   }
3357
3358 /**
3359   * Search parameter: <b>authored</b>
3360   * <p>
3361   * Description: <b>Date request signed</b><br>
3362   * Type: <b>date</b><br>
3363   * Path: <b>ServiceRequest.authoredOn</b><br>
3364   * </p>
3365   */
3366  @SearchParamDefinition(name="authored", path="ServiceRequest.authoredOn", description="Date request signed", type="date" )
3367  public static final String SP_AUTHORED = "authored";
3368 /**
3369   * <b>Fluent Client</b> search parameter constant for <b>authored</b>
3370   * <p>
3371   * Description: <b>Date request signed</b><br>
3372   * Type: <b>date</b><br>
3373   * Path: <b>ServiceRequest.authoredOn</b><br>
3374   * </p>
3375   */
3376  public static final ca.uhn.fhir.rest.gclient.DateClientParam AUTHORED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_AUTHORED);
3377
3378 /**
3379   * Search parameter: <b>based-on</b>
3380   * <p>
3381   * Description: <b>What request fulfills</b><br>
3382   * Type: <b>reference</b><br>
3383   * Path: <b>ServiceRequest.basedOn</b><br>
3384   * </p>
3385   */
3386  @SearchParamDefinition(name="based-on", path="ServiceRequest.basedOn", description="What request fulfills", type="reference", target={CarePlan.class, MedicationRequest.class, ServiceRequest.class } )
3387  public static final String SP_BASED_ON = "based-on";
3388 /**
3389   * <b>Fluent Client</b> search parameter constant for <b>based-on</b>
3390   * <p>
3391   * Description: <b>What request fulfills</b><br>
3392   * Type: <b>reference</b><br>
3393   * Path: <b>ServiceRequest.basedOn</b><br>
3394   * </p>
3395   */
3396  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASED_ON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BASED_ON);
3397
3398/**
3399   * Constant for fluent queries to be used to add include statements. Specifies
3400   * the path value of "<b>ServiceRequest:based-on</b>".
3401   */
3402  public static final ca.uhn.fhir.model.api.Include INCLUDE_BASED_ON = new ca.uhn.fhir.model.api.Include("ServiceRequest:based-on").toLocked();
3403
3404 /**
3405   * Search parameter: <b>body-site</b>
3406   * <p>
3407   * Description: <b>Where procedure is going to be done</b><br>
3408   * Type: <b>token</b><br>
3409   * Path: <b>ServiceRequest.bodySite</b><br>
3410   * </p>
3411   */
3412  @SearchParamDefinition(name="body-site", path="ServiceRequest.bodySite", description="Where procedure is going to be done", type="token" )
3413  public static final String SP_BODY_SITE = "body-site";
3414 /**
3415   * <b>Fluent Client</b> search parameter constant for <b>body-site</b>
3416   * <p>
3417   * Description: <b>Where procedure is going to be done</b><br>
3418   * Type: <b>token</b><br>
3419   * Path: <b>ServiceRequest.bodySite</b><br>
3420   * </p>
3421   */
3422  public static final ca.uhn.fhir.rest.gclient.TokenClientParam BODY_SITE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_BODY_SITE);
3423
3424 /**
3425   * Search parameter: <b>body-structure</b>
3426   * <p>
3427   * Description: <b>Body structure Where procedure is going to be done</b><br>
3428   * Type: <b>reference</b><br>
3429   * Path: <b>ServiceRequest.bodyStructure</b><br>
3430   * </p>
3431   */
3432  @SearchParamDefinition(name="body-structure", path="ServiceRequest.bodyStructure", description="Body structure Where procedure is going to be done", type="reference", target={BodyStructure.class } )
3433  public static final String SP_BODY_STRUCTURE = "body-structure";
3434 /**
3435   * <b>Fluent Client</b> search parameter constant for <b>body-structure</b>
3436   * <p>
3437   * Description: <b>Body structure Where procedure is going to be done</b><br>
3438   * Type: <b>reference</b><br>
3439   * Path: <b>ServiceRequest.bodyStructure</b><br>
3440   * </p>
3441   */
3442  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BODY_STRUCTURE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BODY_STRUCTURE);
3443
3444/**
3445   * Constant for fluent queries to be used to add include statements. Specifies
3446   * the path value of "<b>ServiceRequest:body-structure</b>".
3447   */
3448  public static final ca.uhn.fhir.model.api.Include INCLUDE_BODY_STRUCTURE = new ca.uhn.fhir.model.api.Include("ServiceRequest:body-structure").toLocked();
3449
3450 /**
3451   * Search parameter: <b>category</b>
3452   * <p>
3453   * Description: <b>Classification of service</b><br>
3454   * Type: <b>token</b><br>
3455   * Path: <b>ServiceRequest.category</b><br>
3456   * </p>
3457   */
3458  @SearchParamDefinition(name="category", path="ServiceRequest.category", description="Classification of service", type="token" )
3459  public static final String SP_CATEGORY = "category";
3460 /**
3461   * <b>Fluent Client</b> search parameter constant for <b>category</b>
3462   * <p>
3463   * Description: <b>Classification of service</b><br>
3464   * Type: <b>token</b><br>
3465   * Path: <b>ServiceRequest.category</b><br>
3466   * </p>
3467   */
3468  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY);
3469
3470 /**
3471   * Search parameter: <b>code-concept</b>
3472   * <p>
3473   * Description: <b>What is being requested/ordered</b><br>
3474   * Type: <b>token</b><br>
3475   * Path: <b>ServiceRequest.code.concept</b><br>
3476   * </p>
3477   */
3478  @SearchParamDefinition(name="code-concept", path="ServiceRequest.code.concept", description="What is being requested/ordered", type="token" )
3479  public static final String SP_CODE_CONCEPT = "code-concept";
3480 /**
3481   * <b>Fluent Client</b> search parameter constant for <b>code-concept</b>
3482   * <p>
3483   * Description: <b>What is being requested/ordered</b><br>
3484   * Type: <b>token</b><br>
3485   * Path: <b>ServiceRequest.code.concept</b><br>
3486   * </p>
3487   */
3488  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE_CONCEPT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE_CONCEPT);
3489
3490 /**
3491   * Search parameter: <b>code-reference</b>
3492   * <p>
3493   * Description: <b>What is being requested/ordered</b><br>
3494   * Type: <b>reference</b><br>
3495   * Path: <b>ServiceRequest.code.reference</b><br>
3496   * </p>
3497   */
3498  @SearchParamDefinition(name="code-reference", path="ServiceRequest.code.reference", description="What is being requested/ordered", type="reference", target={ActivityDefinition.class, PlanDefinition.class } )
3499  public static final String SP_CODE_REFERENCE = "code-reference";
3500 /**
3501   * <b>Fluent Client</b> search parameter constant for <b>code-reference</b>
3502   * <p>
3503   * Description: <b>What is being requested/ordered</b><br>
3504   * Type: <b>reference</b><br>
3505   * Path: <b>ServiceRequest.code.reference</b><br>
3506   * </p>
3507   */
3508  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CODE_REFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CODE_REFERENCE);
3509
3510/**
3511   * Constant for fluent queries to be used to add include statements. Specifies
3512   * the path value of "<b>ServiceRequest:code-reference</b>".
3513   */
3514  public static final ca.uhn.fhir.model.api.Include INCLUDE_CODE_REFERENCE = new ca.uhn.fhir.model.api.Include("ServiceRequest:code-reference").toLocked();
3515
3516 /**
3517   * Search parameter: <b>instantiates-canonical</b>
3518   * <p>
3519   * Description: <b>Instantiates FHIR protocol or definition</b><br>
3520   * Type: <b>reference</b><br>
3521   * Path: <b>ServiceRequest.instantiatesCanonical</b><br>
3522   * </p>
3523   */
3524  @SearchParamDefinition(name="instantiates-canonical", path="ServiceRequest.instantiatesCanonical", description="Instantiates FHIR protocol or definition", type="reference", target={ActivityDefinition.class, PlanDefinition.class } )
3525  public static final String SP_INSTANTIATES_CANONICAL = "instantiates-canonical";
3526 /**
3527   * <b>Fluent Client</b> search parameter constant for <b>instantiates-canonical</b>
3528   * <p>
3529   * Description: <b>Instantiates FHIR protocol or definition</b><br>
3530   * Type: <b>reference</b><br>
3531   * Path: <b>ServiceRequest.instantiatesCanonical</b><br>
3532   * </p>
3533   */
3534  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INSTANTIATES_CANONICAL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INSTANTIATES_CANONICAL);
3535
3536/**
3537   * Constant for fluent queries to be used to add include statements. Specifies
3538   * the path value of "<b>ServiceRequest:instantiates-canonical</b>".
3539   */
3540  public static final ca.uhn.fhir.model.api.Include INCLUDE_INSTANTIATES_CANONICAL = new ca.uhn.fhir.model.api.Include("ServiceRequest:instantiates-canonical").toLocked();
3541
3542 /**
3543   * Search parameter: <b>instantiates-uri</b>
3544   * <p>
3545   * Description: <b>Instantiates external protocol or definition</b><br>
3546   * Type: <b>uri</b><br>
3547   * Path: <b>ServiceRequest.instantiatesUri</b><br>
3548   * </p>
3549   */
3550  @SearchParamDefinition(name="instantiates-uri", path="ServiceRequest.instantiatesUri", description="Instantiates external protocol or definition", type="uri" )
3551  public static final String SP_INSTANTIATES_URI = "instantiates-uri";
3552 /**
3553   * <b>Fluent Client</b> search parameter constant for <b>instantiates-uri</b>
3554   * <p>
3555   * Description: <b>Instantiates external protocol or definition</b><br>
3556   * Type: <b>uri</b><br>
3557   * Path: <b>ServiceRequest.instantiatesUri</b><br>
3558   * </p>
3559   */
3560  public static final ca.uhn.fhir.rest.gclient.UriClientParam INSTANTIATES_URI = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_INSTANTIATES_URI);
3561
3562 /**
3563   * Search parameter: <b>intent</b>
3564   * <p>
3565   * Description: <b>proposal | plan | directive | order +</b><br>
3566   * Type: <b>token</b><br>
3567   * Path: <b>ServiceRequest.intent</b><br>
3568   * </p>
3569   */
3570  @SearchParamDefinition(name="intent", path="ServiceRequest.intent", description="proposal | plan | directive | order +", type="token" )
3571  public static final String SP_INTENT = "intent";
3572 /**
3573   * <b>Fluent Client</b> search parameter constant for <b>intent</b>
3574   * <p>
3575   * Description: <b>proposal | plan | directive | order +</b><br>
3576   * Type: <b>token</b><br>
3577   * Path: <b>ServiceRequest.intent</b><br>
3578   * </p>
3579   */
3580  public static final ca.uhn.fhir.rest.gclient.TokenClientParam INTENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_INTENT);
3581
3582 /**
3583   * Search parameter: <b>occurrence</b>
3584   * <p>
3585   * Description: <b>When service should occur</b><br>
3586   * Type: <b>date</b><br>
3587   * Path: <b>ServiceRequest.occurrence.ofType(dateTime) | ServiceRequest.occurrence.ofType(Period) | ServiceRequest.occurrence.ofType(Timing)</b><br>
3588   * </p>
3589   */
3590  @SearchParamDefinition(name="occurrence", path="ServiceRequest.occurrence.ofType(dateTime) | ServiceRequest.occurrence.ofType(Period) | ServiceRequest.occurrence.ofType(Timing)", description="When service should occur", type="date" )
3591  public static final String SP_OCCURRENCE = "occurrence";
3592 /**
3593   * <b>Fluent Client</b> search parameter constant for <b>occurrence</b>
3594   * <p>
3595   * Description: <b>When service should occur</b><br>
3596   * Type: <b>date</b><br>
3597   * Path: <b>ServiceRequest.occurrence.ofType(dateTime) | ServiceRequest.occurrence.ofType(Period) | ServiceRequest.occurrence.ofType(Timing)</b><br>
3598   * </p>
3599   */
3600  public static final ca.uhn.fhir.rest.gclient.DateClientParam OCCURRENCE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_OCCURRENCE);
3601
3602 /**
3603   * Search parameter: <b>performer-type</b>
3604   * <p>
3605   * Description: <b>Performer role</b><br>
3606   * Type: <b>token</b><br>
3607   * Path: <b>ServiceRequest.performerType</b><br>
3608   * </p>
3609   */
3610  @SearchParamDefinition(name="performer-type", path="ServiceRequest.performerType", description="Performer role", type="token" )
3611  public static final String SP_PERFORMER_TYPE = "performer-type";
3612 /**
3613   * <b>Fluent Client</b> search parameter constant for <b>performer-type</b>
3614   * <p>
3615   * Description: <b>Performer role</b><br>
3616   * Type: <b>token</b><br>
3617   * Path: <b>ServiceRequest.performerType</b><br>
3618   * </p>
3619   */
3620  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PERFORMER_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PERFORMER_TYPE);
3621
3622 /**
3623   * Search parameter: <b>performer</b>
3624   * <p>
3625   * Description: <b>Requested performer</b><br>
3626   * Type: <b>reference</b><br>
3627   * Path: <b>ServiceRequest.performer</b><br>
3628   * </p>
3629   */
3630  @SearchParamDefinition(name="performer", path="ServiceRequest.performer", description="Requested performer", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for RelatedPerson") }, target={CareTeam.class, Device.class, HealthcareService.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
3631  public static final String SP_PERFORMER = "performer";
3632 /**
3633   * <b>Fluent Client</b> search parameter constant for <b>performer</b>
3634   * <p>
3635   * Description: <b>Requested performer</b><br>
3636   * Type: <b>reference</b><br>
3637   * Path: <b>ServiceRequest.performer</b><br>
3638   * </p>
3639   */
3640  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER);
3641
3642/**
3643   * Constant for fluent queries to be used to add include statements. Specifies
3644   * the path value of "<b>ServiceRequest:performer</b>".
3645   */
3646  public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("ServiceRequest:performer").toLocked();
3647
3648 /**
3649   * Search parameter: <b>priority</b>
3650   * <p>
3651   * Description: <b>routine | urgent | asap | stat</b><br>
3652   * Type: <b>token</b><br>
3653   * Path: <b>ServiceRequest.priority</b><br>
3654   * </p>
3655   */
3656  @SearchParamDefinition(name="priority", path="ServiceRequest.priority", description="routine | urgent | asap | stat", type="token" )
3657  public static final String SP_PRIORITY = "priority";
3658 /**
3659   * <b>Fluent Client</b> search parameter constant for <b>priority</b>
3660   * <p>
3661   * Description: <b>routine | urgent | asap | stat</b><br>
3662   * Type: <b>token</b><br>
3663   * Path: <b>ServiceRequest.priority</b><br>
3664   * </p>
3665   */
3666  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PRIORITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PRIORITY);
3667
3668 /**
3669   * Search parameter: <b>replaces</b>
3670   * <p>
3671   * Description: <b>What request replaces</b><br>
3672   * Type: <b>reference</b><br>
3673   * Path: <b>ServiceRequest.replaces</b><br>
3674   * </p>
3675   */
3676  @SearchParamDefinition(name="replaces", path="ServiceRequest.replaces", description="What request replaces", type="reference", target={ServiceRequest.class } )
3677  public static final String SP_REPLACES = "replaces";
3678 /**
3679   * <b>Fluent Client</b> search parameter constant for <b>replaces</b>
3680   * <p>
3681   * Description: <b>What request replaces</b><br>
3682   * Type: <b>reference</b><br>
3683   * Path: <b>ServiceRequest.replaces</b><br>
3684   * </p>
3685   */
3686  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REPLACES = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REPLACES);
3687
3688/**
3689   * Constant for fluent queries to be used to add include statements. Specifies
3690   * the path value of "<b>ServiceRequest:replaces</b>".
3691   */
3692  public static final ca.uhn.fhir.model.api.Include INCLUDE_REPLACES = new ca.uhn.fhir.model.api.Include("ServiceRequest:replaces").toLocked();
3693
3694 /**
3695   * Search parameter: <b>requester</b>
3696   * <p>
3697   * Description: <b>Who/what is requesting service</b><br>
3698   * Type: <b>reference</b><br>
3699   * Path: <b>ServiceRequest.requester</b><br>
3700   * </p>
3701   */
3702  @SearchParamDefinition(name="requester", path="ServiceRequest.requester", description="Who/what is requesting service", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner") }, target={Device.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
3703  public static final String SP_REQUESTER = "requester";
3704 /**
3705   * <b>Fluent Client</b> search parameter constant for <b>requester</b>
3706   * <p>
3707   * Description: <b>Who/what is requesting service</b><br>
3708   * Type: <b>reference</b><br>
3709   * Path: <b>ServiceRequest.requester</b><br>
3710   * </p>
3711   */
3712  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTER);
3713
3714/**
3715   * Constant for fluent queries to be used to add include statements. Specifies
3716   * the path value of "<b>ServiceRequest:requester</b>".
3717   */
3718  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTER = new ca.uhn.fhir.model.api.Include("ServiceRequest:requester").toLocked();
3719
3720 /**
3721   * Search parameter: <b>requisition</b>
3722   * <p>
3723   * Description: <b>Composite Request ID</b><br>
3724   * Type: <b>token</b><br>
3725   * Path: <b>ServiceRequest.requisition</b><br>
3726   * </p>
3727   */
3728  @SearchParamDefinition(name="requisition", path="ServiceRequest.requisition", description="Composite Request ID", type="token" )
3729  public static final String SP_REQUISITION = "requisition";
3730 /**
3731   * <b>Fluent Client</b> search parameter constant for <b>requisition</b>
3732   * <p>
3733   * Description: <b>Composite Request ID</b><br>
3734   * Type: <b>token</b><br>
3735   * Path: <b>ServiceRequest.requisition</b><br>
3736   * </p>
3737   */
3738  public static final ca.uhn.fhir.rest.gclient.TokenClientParam REQUISITION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REQUISITION);
3739
3740 /**
3741   * Search parameter: <b>specimen</b>
3742   * <p>
3743   * Description: <b>Specimen to be tested</b><br>
3744   * Type: <b>reference</b><br>
3745   * Path: <b>ServiceRequest.specimen</b><br>
3746   * </p>
3747   */
3748  @SearchParamDefinition(name="specimen", path="ServiceRequest.specimen", description="Specimen to be tested", type="reference", target={Specimen.class } )
3749  public static final String SP_SPECIMEN = "specimen";
3750 /**
3751   * <b>Fluent Client</b> search parameter constant for <b>specimen</b>
3752   * <p>
3753   * Description: <b>Specimen to be tested</b><br>
3754   * Type: <b>reference</b><br>
3755   * Path: <b>ServiceRequest.specimen</b><br>
3756   * </p>
3757   */
3758  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SPECIMEN = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SPECIMEN);
3759
3760/**
3761   * Constant for fluent queries to be used to add include statements. Specifies
3762   * the path value of "<b>ServiceRequest:specimen</b>".
3763   */
3764  public static final ca.uhn.fhir.model.api.Include INCLUDE_SPECIMEN = new ca.uhn.fhir.model.api.Include("ServiceRequest:specimen").toLocked();
3765
3766 /**
3767   * Search parameter: <b>status</b>
3768   * <p>
3769   * Description: <b>draft | active | on-hold | revoked | completed | entered-in-error | unknown</b><br>
3770   * Type: <b>token</b><br>
3771   * Path: <b>ServiceRequest.status</b><br>
3772   * </p>
3773   */
3774  @SearchParamDefinition(name="status", path="ServiceRequest.status", description="draft | active | on-hold | revoked | completed | entered-in-error | unknown", type="token" )
3775  public static final String SP_STATUS = "status";
3776 /**
3777   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3778   * <p>
3779   * Description: <b>draft | active | on-hold | revoked | completed | entered-in-error | unknown</b><br>
3780   * Type: <b>token</b><br>
3781   * Path: <b>ServiceRequest.status</b><br>
3782   * </p>
3783   */
3784  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3785
3786 /**
3787   * Search parameter: <b>subject</b>
3788   * <p>
3789   * Description: <b>Search by subject</b><br>
3790   * Type: <b>reference</b><br>
3791   * Path: <b>ServiceRequest.subject</b><br>
3792   * </p>
3793   */
3794  @SearchParamDefinition(name="subject", path="ServiceRequest.subject", description="Search by subject", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient") }, target={Device.class, Group.class, Location.class, Patient.class } )
3795  public static final String SP_SUBJECT = "subject";
3796 /**
3797   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
3798   * <p>
3799   * Description: <b>Search by subject</b><br>
3800   * Type: <b>reference</b><br>
3801   * Path: <b>ServiceRequest.subject</b><br>
3802   * </p>
3803   */
3804  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
3805
3806/**
3807   * Constant for fluent queries to be used to add include statements. Specifies
3808   * the path value of "<b>ServiceRequest:subject</b>".
3809   */
3810  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("ServiceRequest:subject").toLocked();
3811
3812 /**
3813   * Search parameter: <b>encounter</b>
3814   * <p>
3815   * Description: <b>Multiple Resources: 
3816
3817* [AuditEvent](auditevent.html): Encounter related to the activity recorded in the AuditEvent
3818* [CarePlan](careplan.html): The Encounter during which this CarePlan was created
3819* [ChargeItem](chargeitem.html): Encounter associated with event
3820* [Claim](claim.html): Encounters associated with a billed line item
3821* [ClinicalImpression](clinicalimpression.html): The Encounter during which this ClinicalImpression was created
3822* [Communication](communication.html): The Encounter during which this Communication was created
3823* [CommunicationRequest](communicationrequest.html): The Encounter during which this CommunicationRequest was created
3824* [Composition](composition.html): Context of the Composition
3825* [Condition](condition.html): The Encounter during which this Condition was created
3826* [DeviceRequest](devicerequest.html): Encounter during which request was created
3827* [DiagnosticReport](diagnosticreport.html): The Encounter when the order was made
3828* [EncounterHistory](encounterhistory.html): The Encounter associated with this set of history values
3829* [ExplanationOfBenefit](explanationofbenefit.html): Encounters associated with a billed line item
3830* [Flag](flag.html): Alert relevant during encounter
3831* [ImagingStudy](imagingstudy.html): The context of the study
3832* [List](list.html): Context in which list created
3833* [MedicationDispense](medicationdispense.html): Returns dispenses with a specific encounter
3834* [MedicationStatement](medicationstatement.html): Returns statements for a specific encounter
3835* [NutritionIntake](nutritionintake.html): Returns statements for a specific encounter
3836* [NutritionOrder](nutritionorder.html): Return nutrition orders with this encounter identifier
3837* [Observation](observation.html): Encounter related to the observation
3838* [Procedure](procedure.html): The Encounter during which this Procedure was created
3839* [Provenance](provenance.html): Encounter related to the Provenance
3840* [QuestionnaireResponse](questionnaireresponse.html): Encounter associated with the questionnaire response
3841* [RequestOrchestration](requestorchestration.html): The encounter the request orchestration applies to
3842* [RiskAssessment](riskassessment.html): Where was assessment performed?
3843* [ServiceRequest](servicerequest.html): An encounter in which this request is made
3844* [Task](task.html): Search by encounter
3845* [VisionPrescription](visionprescription.html): Return prescriptions with this encounter identifier
3846</b><br>
3847   * Type: <b>reference</b><br>
3848   * Path: <b>AuditEvent.encounter | CarePlan.encounter | ChargeItem.encounter | Claim.item.encounter | ClinicalImpression.encounter | Communication.encounter | CommunicationRequest.encounter | Composition.encounter | Condition.encounter | DeviceRequest.encounter | DiagnosticReport.encounter | EncounterHistory.encounter | ExplanationOfBenefit.item.encounter | Flag.encounter | ImagingStudy.encounter | List.encounter | MedicationDispense.encounter | MedicationStatement.encounter | NutritionIntake.encounter | NutritionOrder.encounter | Observation.encounter | Procedure.encounter | Provenance.encounter | QuestionnaireResponse.encounter | RequestOrchestration.encounter | RiskAssessment.encounter | ServiceRequest.encounter | Task.encounter | VisionPrescription.encounter</b><br>
3849   * </p>
3850   */
3851  @SearchParamDefinition(name="encounter", path="AuditEvent.encounter | CarePlan.encounter | ChargeItem.encounter | Claim.item.encounter | ClinicalImpression.encounter | Communication.encounter | CommunicationRequest.encounter | Composition.encounter | Condition.encounter | DeviceRequest.encounter | DiagnosticReport.encounter | EncounterHistory.encounter | ExplanationOfBenefit.item.encounter | Flag.encounter | ImagingStudy.encounter | List.encounter | MedicationDispense.encounter | MedicationStatement.encounter | NutritionIntake.encounter | NutritionOrder.encounter | Observation.encounter | Procedure.encounter | Provenance.encounter | QuestionnaireResponse.encounter | RequestOrchestration.encounter | RiskAssessment.encounter | ServiceRequest.encounter | Task.encounter | VisionPrescription.encounter", description="Multiple Resources: \r\n\r\n* [AuditEvent](auditevent.html): Encounter related to the activity recorded in the AuditEvent\r\n* [CarePlan](careplan.html): The Encounter during which this CarePlan was created\r\n* [ChargeItem](chargeitem.html): Encounter associated with event\r\n* [Claim](claim.html): Encounters associated with a billed line item\r\n* [ClinicalImpression](clinicalimpression.html): The Encounter during which this ClinicalImpression was created\r\n* [Communication](communication.html): The Encounter during which this Communication was created\r\n* [CommunicationRequest](communicationrequest.html): The Encounter during which this CommunicationRequest was created\r\n* [Composition](composition.html): Context of the Composition\r\n* [Condition](condition.html): The Encounter during which this Condition was created\r\n* [DeviceRequest](devicerequest.html): Encounter during which request was created\r\n* [DiagnosticReport](diagnosticreport.html): The Encounter when the order was made\r\n* [EncounterHistory](encounterhistory.html): The Encounter associated with this set of history values\r\n* [ExplanationOfBenefit](explanationofbenefit.html): Encounters associated with a billed line item\r\n* [Flag](flag.html): Alert relevant during encounter\r\n* [ImagingStudy](imagingstudy.html): The context of the study\r\n* [List](list.html): Context in which list created\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses with a specific encounter\r\n* [MedicationStatement](medicationstatement.html): Returns statements for a specific encounter\r\n* [NutritionIntake](nutritionintake.html): Returns statements for a specific encounter\r\n* [NutritionOrder](nutritionorder.html): Return nutrition orders with this encounter identifier\r\n* [Observation](observation.html): Encounter related to the observation\r\n* [Procedure](procedure.html): The Encounter during which this Procedure was created\r\n* [Provenance](provenance.html): Encounter related to the Provenance\r\n* [QuestionnaireResponse](questionnaireresponse.html): Encounter associated with the questionnaire response\r\n* [RequestOrchestration](requestorchestration.html): The encounter the request orchestration applies to\r\n* [RiskAssessment](riskassessment.html): Where was assessment performed?\r\n* [ServiceRequest](servicerequest.html): An encounter in which this request is made\r\n* [Task](task.html): Search by encounter\r\n* [VisionPrescription](visionprescription.html): Return prescriptions with this encounter identifier\r\n", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Encounter") }, target={Encounter.class } )
3852  public static final String SP_ENCOUNTER = "encounter";
3853 /**
3854   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
3855   * <p>
3856   * Description: <b>Multiple Resources: 
3857
3858* [AuditEvent](auditevent.html): Encounter related to the activity recorded in the AuditEvent
3859* [CarePlan](careplan.html): The Encounter during which this CarePlan was created
3860* [ChargeItem](chargeitem.html): Encounter associated with event
3861* [Claim](claim.html): Encounters associated with a billed line item
3862* [ClinicalImpression](clinicalimpression.html): The Encounter during which this ClinicalImpression was created
3863* [Communication](communication.html): The Encounter during which this Communication was created
3864* [CommunicationRequest](communicationrequest.html): The Encounter during which this CommunicationRequest was created
3865* [Composition](composition.html): Context of the Composition
3866* [Condition](condition.html): The Encounter during which this Condition was created
3867* [DeviceRequest](devicerequest.html): Encounter during which request was created
3868* [DiagnosticReport](diagnosticreport.html): The Encounter when the order was made
3869* [EncounterHistory](encounterhistory.html): The Encounter associated with this set of history values
3870* [ExplanationOfBenefit](explanationofbenefit.html): Encounters associated with a billed line item
3871* [Flag](flag.html): Alert relevant during encounter
3872* [ImagingStudy](imagingstudy.html): The context of the study
3873* [List](list.html): Context in which list created
3874* [MedicationDispense](medicationdispense.html): Returns dispenses with a specific encounter
3875* [MedicationStatement](medicationstatement.html): Returns statements for a specific encounter
3876* [NutritionIntake](nutritionintake.html): Returns statements for a specific encounter
3877* [NutritionOrder](nutritionorder.html): Return nutrition orders with this encounter identifier
3878* [Observation](observation.html): Encounter related to the observation
3879* [Procedure](procedure.html): The Encounter during which this Procedure was created
3880* [Provenance](provenance.html): Encounter related to the Provenance
3881* [QuestionnaireResponse](questionnaireresponse.html): Encounter associated with the questionnaire response
3882* [RequestOrchestration](requestorchestration.html): The encounter the request orchestration applies to
3883* [RiskAssessment](riskassessment.html): Where was assessment performed?
3884* [ServiceRequest](servicerequest.html): An encounter in which this request is made
3885* [Task](task.html): Search by encounter
3886* [VisionPrescription](visionprescription.html): Return prescriptions with this encounter identifier
3887</b><br>
3888   * Type: <b>reference</b><br>
3889   * Path: <b>AuditEvent.encounter | CarePlan.encounter | ChargeItem.encounter | Claim.item.encounter | ClinicalImpression.encounter | Communication.encounter | CommunicationRequest.encounter | Composition.encounter | Condition.encounter | DeviceRequest.encounter | DiagnosticReport.encounter | EncounterHistory.encounter | ExplanationOfBenefit.item.encounter | Flag.encounter | ImagingStudy.encounter | List.encounter | MedicationDispense.encounter | MedicationStatement.encounter | NutritionIntake.encounter | NutritionOrder.encounter | Observation.encounter | Procedure.encounter | Provenance.encounter | QuestionnaireResponse.encounter | RequestOrchestration.encounter | RiskAssessment.encounter | ServiceRequest.encounter | Task.encounter | VisionPrescription.encounter</b><br>
3890   * </p>
3891   */
3892  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER);
3893
3894/**
3895   * Constant for fluent queries to be used to add include statements. Specifies
3896   * the path value of "<b>ServiceRequest:encounter</b>".
3897   */
3898  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("ServiceRequest:encounter").toLocked();
3899
3900 /**
3901   * Search parameter: <b>identifier</b>
3902   * <p>
3903   * Description: <b>Multiple Resources: 
3904
3905* [Account](account.html): Account number
3906* [AdverseEvent](adverseevent.html): Business identifier for the event
3907* [AllergyIntolerance](allergyintolerance.html): External ids for this item
3908* [Appointment](appointment.html): An Identifier of the Appointment
3909* [AppointmentResponse](appointmentresponse.html): An Identifier in this appointment response
3910* [Basic](basic.html): Business identifier
3911* [BodyStructure](bodystructure.html): Bodystructure identifier
3912* [CarePlan](careplan.html): External Ids for this plan
3913* [CareTeam](careteam.html): External Ids for this team
3914* [ChargeItem](chargeitem.html): Business Identifier for item
3915* [Claim](claim.html): The primary identifier of the financial resource
3916* [ClaimResponse](claimresponse.html): The identity of the ClaimResponse
3917* [ClinicalImpression](clinicalimpression.html): Business identifier
3918* [Communication](communication.html): Unique identifier
3919* [CommunicationRequest](communicationrequest.html): Unique identifier
3920* [Composition](composition.html): Version-independent identifier for the Composition
3921* [Condition](condition.html): A unique identifier of the condition record
3922* [Consent](consent.html): Identifier for this record (external references)
3923* [Contract](contract.html): The identity of the contract
3924* [Coverage](coverage.html): The primary identifier of the insured and the coverage
3925* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The business identifier of the Eligibility
3926* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The business identifier
3927* [DetectedIssue](detectedissue.html): Unique id for the detected issue
3928* [DeviceRequest](devicerequest.html): Business identifier for request/order
3929* [DeviceUsage](deviceusage.html): Search by identifier
3930* [DiagnosticReport](diagnosticreport.html): An identifier for the report
3931* [DocumentReference](documentreference.html): Identifier of the attachment binary
3932* [Encounter](encounter.html): Identifier(s) by which this encounter is known
3933* [EnrollmentRequest](enrollmentrequest.html): The business identifier of the Enrollment
3934* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
3935* [ExplanationOfBenefit](explanationofbenefit.html): The business identifier of the Explanation of Benefit
3936* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
3937* [Flag](flag.html): Business identifier
3938* [Goal](goal.html): External Ids for this goal
3939* [GuidanceResponse](guidanceresponse.html): The identifier of the guidance response
3940* [ImagingSelection](imagingselection.html): Identifiers for the imaging selection
3941* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
3942* [Immunization](immunization.html): Business identifier
3943* [ImmunizationEvaluation](immunizationevaluation.html): ID of the evaluation
3944* [ImmunizationRecommendation](immunizationrecommendation.html): Business identifier
3945* [Invoice](invoice.html): Business Identifier for item
3946* [List](list.html): Business identifier
3947* [MeasureReport](measurereport.html): External identifier of the measure report to be returned
3948* [Medication](medication.html): Returns medications with this external identifier
3949* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
3950* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
3951* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
3952* [MedicationStatement](medicationstatement.html): Return statements with this external identifier
3953* [MolecularSequence](molecularsequence.html): The unique identity for a particular sequence
3954* [NutritionIntake](nutritionintake.html): Return statements with this external identifier
3955* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
3956* [Observation](observation.html): The unique id for a particular observation
3957* [Person](person.html): A person Identifier
3958* [Procedure](procedure.html): A unique identifier for a procedure
3959* [QuestionnaireResponse](questionnaireresponse.html): The unique identifier for the questionnaire response
3960* [RelatedPerson](relatedperson.html): An Identifier of the RelatedPerson
3961* [RequestOrchestration](requestorchestration.html): External identifiers for the request orchestration
3962* [ResearchSubject](researchsubject.html): Business Identifier for research subject in a study
3963* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
3964* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
3965* [Specimen](specimen.html): The unique identifier associated with the specimen
3966* [SupplyDelivery](supplydelivery.html): External identifier
3967* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
3968* [Task](task.html): Search for a task instance by its business identifier
3969* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
3970</b><br>
3971   * Type: <b>token</b><br>
3972   * Path: <b>Account.identifier | AdverseEvent.identifier | AllergyIntolerance.identifier | Appointment.identifier | AppointmentResponse.identifier | Basic.identifier | BodyStructure.identifier | CarePlan.identifier | CareTeam.identifier | ChargeItem.identifier | Claim.identifier | ClaimResponse.identifier | ClinicalImpression.identifier | Communication.identifier | CommunicationRequest.identifier | Composition.identifier | Condition.identifier | Consent.identifier | Contract.identifier | Coverage.identifier | CoverageEligibilityRequest.identifier | CoverageEligibilityResponse.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DeviceUsage.identifier | DiagnosticReport.identifier | DocumentReference.identifier | Encounter.identifier | EnrollmentRequest.identifier | EpisodeOfCare.identifier | ExplanationOfBenefit.identifier | FamilyMemberHistory.identifier | Flag.identifier | Goal.identifier | GuidanceResponse.identifier | ImagingSelection.identifier | ImagingStudy.identifier | Immunization.identifier | ImmunizationEvaluation.identifier | ImmunizationRecommendation.identifier | Invoice.identifier | List.identifier | MeasureReport.identifier | Medication.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationStatement.identifier | MolecularSequence.identifier | NutritionIntake.identifier | NutritionOrder.identifier | Observation.identifier | Person.identifier | Procedure.identifier | QuestionnaireResponse.identifier | RelatedPerson.identifier | RequestOrchestration.identifier | ResearchSubject.identifier | RiskAssessment.identifier | ServiceRequest.identifier | Specimen.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | Task.identifier | VisionPrescription.identifier</b><br>
3973   * </p>
3974   */
3975  @SearchParamDefinition(name="identifier", path="Account.identifier | AdverseEvent.identifier | AllergyIntolerance.identifier | Appointment.identifier | AppointmentResponse.identifier | Basic.identifier | BodyStructure.identifier | CarePlan.identifier | CareTeam.identifier | ChargeItem.identifier | Claim.identifier | ClaimResponse.identifier | ClinicalImpression.identifier | Communication.identifier | CommunicationRequest.identifier | Composition.identifier | Condition.identifier | Consent.identifier | Contract.identifier | Coverage.identifier | CoverageEligibilityRequest.identifier | CoverageEligibilityResponse.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DeviceUsage.identifier | DiagnosticReport.identifier | DocumentReference.identifier | Encounter.identifier | EnrollmentRequest.identifier | EpisodeOfCare.identifier | ExplanationOfBenefit.identifier | FamilyMemberHistory.identifier | Flag.identifier | Goal.identifier | GuidanceResponse.identifier | ImagingSelection.identifier | ImagingStudy.identifier | Immunization.identifier | ImmunizationEvaluation.identifier | ImmunizationRecommendation.identifier | Invoice.identifier | List.identifier | MeasureReport.identifier | Medication.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationStatement.identifier | MolecularSequence.identifier | NutritionIntake.identifier | NutritionOrder.identifier | Observation.identifier | Person.identifier | Procedure.identifier | QuestionnaireResponse.identifier | RelatedPerson.identifier | RequestOrchestration.identifier | ResearchSubject.identifier | RiskAssessment.identifier | ServiceRequest.identifier | Specimen.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | Task.identifier | VisionPrescription.identifier", description="Multiple Resources: \r\n\r\n* [Account](account.html): Account number\r\n* [AdverseEvent](adverseevent.html): Business identifier for the event\r\n* [AllergyIntolerance](allergyintolerance.html): External ids for this item\r\n* [Appointment](appointment.html): An Identifier of the Appointment\r\n* [AppointmentResponse](appointmentresponse.html): An Identifier in this appointment response\r\n* [Basic](basic.html): Business identifier\r\n* [BodyStructure](bodystructure.html): Bodystructure identifier\r\n* [CarePlan](careplan.html): External Ids for this plan\r\n* [CareTeam](careteam.html): External Ids for this team\r\n* [ChargeItem](chargeitem.html): Business Identifier for item\r\n* [Claim](claim.html): The primary identifier of the financial resource\r\n* [ClaimResponse](claimresponse.html): The identity of the ClaimResponse\r\n* [ClinicalImpression](clinicalimpression.html): Business identifier\r\n* [Communication](communication.html): Unique identifier\r\n* [CommunicationRequest](communicationrequest.html): Unique identifier\r\n* [Composition](composition.html): Version-independent identifier for the Composition\r\n* [Condition](condition.html): A unique identifier of the condition record\r\n* [Consent](consent.html): Identifier for this record (external references)\r\n* [Contract](contract.html): The identity of the contract\r\n* [Coverage](coverage.html): The primary identifier of the insured and the coverage\r\n* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The business identifier of the Eligibility\r\n* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The business identifier\r\n* [DetectedIssue](detectedissue.html): Unique id for the detected issue\r\n* [DeviceRequest](devicerequest.html): Business identifier for request/order\r\n* [DeviceUsage](deviceusage.html): Search by identifier\r\n* [DiagnosticReport](diagnosticreport.html): An identifier for the report\r\n* [DocumentReference](documentreference.html): Identifier of the attachment binary\r\n* [Encounter](encounter.html): Identifier(s) by which this encounter is known\r\n* [EnrollmentRequest](enrollmentrequest.html): The business identifier of the Enrollment\r\n* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare\r\n* [ExplanationOfBenefit](explanationofbenefit.html): The business identifier of the Explanation of Benefit\r\n* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier\r\n* [Flag](flag.html): Business identifier\r\n* [Goal](goal.html): External Ids for this goal\r\n* [GuidanceResponse](guidanceresponse.html): The identifier of the guidance response\r\n* [ImagingSelection](imagingselection.html): Identifiers for the imaging selection\r\n* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID\r\n* [Immunization](immunization.html): Business identifier\r\n* [ImmunizationEvaluation](immunizationevaluation.html): ID of the evaluation\r\n* [ImmunizationRecommendation](immunizationrecommendation.html): Business identifier\r\n* [Invoice](invoice.html): Business Identifier for item\r\n* [List](list.html): Business identifier\r\n* [MeasureReport](measurereport.html): External identifier of the measure report to be returned\r\n* [Medication](medication.html): Returns medications with this external identifier\r\n* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier\r\n* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier\r\n* [MedicationStatement](medicationstatement.html): Return statements with this external identifier\r\n* [MolecularSequence](molecularsequence.html): The unique identity for a particular sequence\r\n* [NutritionIntake](nutritionintake.html): Return statements with this external identifier\r\n* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier\r\n* [Observation](observation.html): The unique id for a particular observation\r\n* [Person](person.html): A person Identifier\r\n* [Procedure](procedure.html): A unique identifier for a procedure\r\n* [QuestionnaireResponse](questionnaireresponse.html): The unique identifier for the questionnaire response\r\n* [RelatedPerson](relatedperson.html): An Identifier of the RelatedPerson\r\n* [RequestOrchestration](requestorchestration.html): External identifiers for the request orchestration\r\n* [ResearchSubject](researchsubject.html): Business Identifier for research subject in a study\r\n* [RiskAssessment](riskassessment.html): Unique identifier for the assessment\r\n* [ServiceRequest](servicerequest.html): Identifiers assigned to this order\r\n* [Specimen](specimen.html): The unique identifier associated with the specimen\r\n* [SupplyDelivery](supplydelivery.html): External identifier\r\n* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest\r\n* [Task](task.html): Search for a task instance by its business identifier\r\n* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier\r\n", type="token" )
3976  public static final String SP_IDENTIFIER = "identifier";
3977 /**
3978   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3979   * <p>
3980   * Description: <b>Multiple Resources: 
3981
3982* [Account](account.html): Account number
3983* [AdverseEvent](adverseevent.html): Business identifier for the event
3984* [AllergyIntolerance](allergyintolerance.html): External ids for this item
3985* [Appointment](appointment.html): An Identifier of the Appointment
3986* [AppointmentResponse](appointmentresponse.html): An Identifier in this appointment response
3987* [Basic](basic.html): Business identifier
3988* [BodyStructure](bodystructure.html): Bodystructure identifier
3989* [CarePlan](careplan.html): External Ids for this plan
3990* [CareTeam](careteam.html): External Ids for this team
3991* [ChargeItem](chargeitem.html): Business Identifier for item
3992* [Claim](claim.html): The primary identifier of the financial resource
3993* [ClaimResponse](claimresponse.html): The identity of the ClaimResponse
3994* [ClinicalImpression](clinicalimpression.html): Business identifier
3995* [Communication](communication.html): Unique identifier
3996* [CommunicationRequest](communicationrequest.html): Unique identifier
3997* [Composition](composition.html): Version-independent identifier for the Composition
3998* [Condition](condition.html): A unique identifier of the condition record
3999* [Consent](consent.html): Identifier for this record (external references)
4000* [Contract](contract.html): The identity of the contract
4001* [Coverage](coverage.html): The primary identifier of the insured and the coverage
4002* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The business identifier of the Eligibility
4003* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The business identifier
4004* [DetectedIssue](detectedissue.html): Unique id for the detected issue
4005* [DeviceRequest](devicerequest.html): Business identifier for request/order
4006* [DeviceUsage](deviceusage.html): Search by identifier
4007* [DiagnosticReport](diagnosticreport.html): An identifier for the report
4008* [DocumentReference](documentreference.html): Identifier of the attachment binary
4009* [Encounter](encounter.html): Identifier(s) by which this encounter is known
4010* [EnrollmentRequest](enrollmentrequest.html): The business identifier of the Enrollment
4011* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
4012* [ExplanationOfBenefit](explanationofbenefit.html): The business identifier of the Explanation of Benefit
4013* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
4014* [Flag](flag.html): Business identifier
4015* [Goal](goal.html): External Ids for this goal
4016* [GuidanceResponse](guidanceresponse.html): The identifier of the guidance response
4017* [ImagingSelection](imagingselection.html): Identifiers for the imaging selection
4018* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
4019* [Immunization](immunization.html): Business identifier
4020* [ImmunizationEvaluation](immunizationevaluation.html): ID of the evaluation
4021* [ImmunizationRecommendation](immunizationrecommendation.html): Business identifier
4022* [Invoice](invoice.html): Business Identifier for item
4023* [List](list.html): Business identifier
4024* [MeasureReport](measurereport.html): External identifier of the measure report to be returned
4025* [Medication](medication.html): Returns medications with this external identifier
4026* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
4027* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
4028* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
4029* [MedicationStatement](medicationstatement.html): Return statements with this external identifier
4030* [MolecularSequence](molecularsequence.html): The unique identity for a particular sequence
4031* [NutritionIntake](nutritionintake.html): Return statements with this external identifier
4032* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
4033* [Observation](observation.html): The unique id for a particular observation
4034* [Person](person.html): A person Identifier
4035* [Procedure](procedure.html): A unique identifier for a procedure
4036* [QuestionnaireResponse](questionnaireresponse.html): The unique identifier for the questionnaire response
4037* [RelatedPerson](relatedperson.html): An Identifier of the RelatedPerson
4038* [RequestOrchestration](requestorchestration.html): External identifiers for the request orchestration
4039* [ResearchSubject](researchsubject.html): Business Identifier for research subject in a study
4040* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
4041* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
4042* [Specimen](specimen.html): The unique identifier associated with the specimen
4043* [SupplyDelivery](supplydelivery.html): External identifier
4044* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
4045* [Task](task.html): Search for a task instance by its business identifier
4046* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
4047</b><br>
4048   * Type: <b>token</b><br>
4049   * Path: <b>Account.identifier | AdverseEvent.identifier | AllergyIntolerance.identifier | Appointment.identifier | AppointmentResponse.identifier | Basic.identifier | BodyStructure.identifier | CarePlan.identifier | CareTeam.identifier | ChargeItem.identifier | Claim.identifier | ClaimResponse.identifier | ClinicalImpression.identifier | Communication.identifier | CommunicationRequest.identifier | Composition.identifier | Condition.identifier | Consent.identifier | Contract.identifier | Coverage.identifier | CoverageEligibilityRequest.identifier | CoverageEligibilityResponse.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DeviceUsage.identifier | DiagnosticReport.identifier | DocumentReference.identifier | Encounter.identifier | EnrollmentRequest.identifier | EpisodeOfCare.identifier | ExplanationOfBenefit.identifier | FamilyMemberHistory.identifier | Flag.identifier | Goal.identifier | GuidanceResponse.identifier | ImagingSelection.identifier | ImagingStudy.identifier | Immunization.identifier | ImmunizationEvaluation.identifier | ImmunizationRecommendation.identifier | Invoice.identifier | List.identifier | MeasureReport.identifier | Medication.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationStatement.identifier | MolecularSequence.identifier | NutritionIntake.identifier | NutritionOrder.identifier | Observation.identifier | Person.identifier | Procedure.identifier | QuestionnaireResponse.identifier | RelatedPerson.identifier | RequestOrchestration.identifier | ResearchSubject.identifier | RiskAssessment.identifier | ServiceRequest.identifier | Specimen.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | Task.identifier | VisionPrescription.identifier</b><br>
4050   * </p>
4051   */
4052  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
4053
4054 /**
4055   * Search parameter: <b>patient</b>
4056   * <p>
4057   * Description: <b>Multiple Resources: 
4058
4059* [Account](account.html): The entity that caused the expenses
4060* [AdverseEvent](adverseevent.html): Subject impacted by event
4061* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
4062* [Appointment](appointment.html): One of the individuals of the appointment is this patient
4063* [AppointmentResponse](appointmentresponse.html): This Response is for this Patient
4064* [AuditEvent](auditevent.html): Where the activity involved patient data
4065* [Basic](basic.html): Identifies the focus of this resource
4066* [BodyStructure](bodystructure.html): Who this is about
4067* [CarePlan](careplan.html): Who the care plan is for
4068* [CareTeam](careteam.html): Who care team is for
4069* [ChargeItem](chargeitem.html): Individual service was done for/to
4070* [Claim](claim.html): Patient receiving the products or services
4071* [ClaimResponse](claimresponse.html): The subject of care
4072* [ClinicalImpression](clinicalimpression.html): Patient assessed
4073* [Communication](communication.html): Focus of message
4074* [CommunicationRequest](communicationrequest.html): Focus of message
4075* [Composition](composition.html): Who and/or what the composition is about
4076* [Condition](condition.html): Who has the condition?
4077* [Consent](consent.html): Who the consent applies to
4078* [Contract](contract.html): The identity of the subject of the contract (if a patient)
4079* [Coverage](coverage.html): Retrieve coverages for a patient
4080* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The reference to the patient
4081* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The reference to the patient
4082* [DetectedIssue](detectedissue.html): Associated patient
4083* [DeviceRequest](devicerequest.html): Individual the service is ordered for
4084* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
4085* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
4086* [DocumentReference](documentreference.html): Who/what is the subject of the document
4087* [Encounter](encounter.html): The patient present at the encounter
4088* [EnrollmentRequest](enrollmentrequest.html): The party to be enrolled
4089* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
4090* [ExplanationOfBenefit](explanationofbenefit.html): The reference to the patient
4091* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
4092* [Flag](flag.html): The identity of a subject to list flags for
4093* [Goal](goal.html): Who this goal is intended for
4094* [GuidanceResponse](guidanceresponse.html): The identity of a patient to search for guidance response results
4095* [ImagingSelection](imagingselection.html): Who the study is about
4096* [ImagingStudy](imagingstudy.html): Who the study is about
4097* [Immunization](immunization.html): The patient for the vaccination record
4098* [ImmunizationEvaluation](immunizationevaluation.html): The patient being evaluated
4099* [ImmunizationRecommendation](immunizationrecommendation.html): Who this profile is for
4100* [Invoice](invoice.html): Recipient(s) of goods and services
4101* [List](list.html): If all resources have the same subject
4102* [MeasureReport](measurereport.html): The identity of a patient to search for individual measure report results for
4103* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
4104* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
4105* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
4106* [MedicationStatement](medicationstatement.html): Returns statements for a specific patient.
4107* [MolecularSequence](molecularsequence.html): The subject that the sequence is about
4108* [NutritionIntake](nutritionintake.html): Returns statements for a specific patient.
4109* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement
4110* [Observation](observation.html): The subject that the observation is about (if patient)
4111* [Person](person.html): The Person links to this Patient
4112* [Procedure](procedure.html): Search by subject - a patient
4113* [Provenance](provenance.html): Where the activity involved patient data
4114* [QuestionnaireResponse](questionnaireresponse.html): The patient that is the subject of the questionnaire response
4115* [RelatedPerson](relatedperson.html): The patient this related person is related to
4116* [RequestOrchestration](requestorchestration.html): The identity of a patient to search for request orchestrations
4117* [ResearchSubject](researchsubject.html): Who or what is part of study
4118* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
4119* [ServiceRequest](servicerequest.html): Search by subject - a patient
4120* [Specimen](specimen.html): The patient the specimen comes from
4121* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
4122* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined
4123* [Task](task.html): Search by patient
4124* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
4125</b><br>
4126   * Type: <b>reference</b><br>
4127   * Path: <b>Account.subject.where(resolve() is Patient) | AdverseEvent.subject.where(resolve() is Patient) | AllergyIntolerance.patient | Appointment.participant.actor.where(resolve() is Patient) | Appointment.subject.where(resolve() is Patient) | AppointmentResponse.actor.where(resolve() is Patient) | AuditEvent.patient | Basic.subject.where(resolve() is Patient) | BodyStructure.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ChargeItem.subject.where(resolve() is Patient) | Claim.patient | ClaimResponse.patient | ClinicalImpression.subject.where(resolve() is Patient) | Communication.subject.where(resolve() is Patient) | CommunicationRequest.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | Contract.subject.where(resolve() is Patient) | Coverage.beneficiary | CoverageEligibilityRequest.patient | CoverageEligibilityResponse.patient | DetectedIssue.subject.where(resolve() is Patient) | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EnrollmentRequest.candidate | EpisodeOfCare.patient | ExplanationOfBenefit.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | GuidanceResponse.subject.where(resolve() is Patient) | ImagingSelection.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | ImmunizationEvaluation.patient | ImmunizationRecommendation.patient | Invoice.subject.where(resolve() is Patient) | List.subject.where(resolve() is Patient) | MeasureReport.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationStatement.subject.where(resolve() is Patient) | MolecularSequence.subject.where(resolve() is Patient) | NutritionIntake.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Person.link.target.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | Provenance.patient | QuestionnaireResponse.subject.where(resolve() is Patient) | RelatedPerson.patient | RequestOrchestration.subject.where(resolve() is Patient) | ResearchSubject.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | Specimen.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | Task.for.where(resolve() is Patient) | VisionPrescription.patient</b><br>
4128   * </p>
4129   */
4130  @SearchParamDefinition(name="patient", path="Account.subject.where(resolve() is Patient) | AdverseEvent.subject.where(resolve() is Patient) | AllergyIntolerance.patient | Appointment.participant.actor.where(resolve() is Patient) | Appointment.subject.where(resolve() is Patient) | AppointmentResponse.actor.where(resolve() is Patient) | AuditEvent.patient | Basic.subject.where(resolve() is Patient) | BodyStructure.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ChargeItem.subject.where(resolve() is Patient) | Claim.patient | ClaimResponse.patient | ClinicalImpression.subject.where(resolve() is Patient) | Communication.subject.where(resolve() is Patient) | CommunicationRequest.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | Contract.subject.where(resolve() is Patient) | Coverage.beneficiary | CoverageEligibilityRequest.patient | CoverageEligibilityResponse.patient | DetectedIssue.subject.where(resolve() is Patient) | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EnrollmentRequest.candidate | EpisodeOfCare.patient | ExplanationOfBenefit.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | GuidanceResponse.subject.where(resolve() is Patient) | ImagingSelection.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | ImmunizationEvaluation.patient | ImmunizationRecommendation.patient | Invoice.subject.where(resolve() is Patient) | List.subject.where(resolve() is Patient) | MeasureReport.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationStatement.subject.where(resolve() is Patient) | MolecularSequence.subject.where(resolve() is Patient) | NutritionIntake.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Person.link.target.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | Provenance.patient | QuestionnaireResponse.subject.where(resolve() is Patient) | RelatedPerson.patient | RequestOrchestration.subject.where(resolve() is Patient) | ResearchSubject.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | Specimen.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | Task.for.where(resolve() is Patient) | VisionPrescription.patient", description="Multiple Resources: \r\n\r\n* [Account](account.html): The entity that caused the expenses\r\n* [AdverseEvent](adverseevent.html): Subject impacted by event\r\n* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for\r\n* [Appointment](appointment.html): One of the individuals of the appointment is this patient\r\n* [AppointmentResponse](appointmentresponse.html): This Response is for this Patient\r\n* [AuditEvent](auditevent.html): Where the activity involved patient data\r\n* [Basic](basic.html): Identifies the focus of this resource\r\n* [BodyStructure](bodystructure.html): Who this is about\r\n* [CarePlan](careplan.html): Who the care plan is for\r\n* [CareTeam](careteam.html): Who care team is for\r\n* [ChargeItem](chargeitem.html): Individual service was done for/to\r\n* [Claim](claim.html): Patient receiving the products or services\r\n* [ClaimResponse](claimresponse.html): The subject of care\r\n* [ClinicalImpression](clinicalimpression.html): Patient assessed\r\n* [Communication](communication.html): Focus of message\r\n* [CommunicationRequest](communicationrequest.html): Focus of message\r\n* [Composition](composition.html): Who and/or what the composition is about\r\n* [Condition](condition.html): Who has the condition?\r\n* [Consent](consent.html): Who the consent applies to\r\n* [Contract](contract.html): The identity of the subject of the contract (if a patient)\r\n* [Coverage](coverage.html): Retrieve coverages for a patient\r\n* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The reference to the patient\r\n* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The reference to the patient\r\n* [DetectedIssue](detectedissue.html): Associated patient\r\n* [DeviceRequest](devicerequest.html): Individual the service is ordered for\r\n* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device\r\n* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient\r\n* [DocumentReference](documentreference.html): Who/what is the subject of the document\r\n* [Encounter](encounter.html): The patient present at the encounter\r\n* [EnrollmentRequest](enrollmentrequest.html): The party to be enrolled\r\n* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care\r\n* [ExplanationOfBenefit](explanationofbenefit.html): The reference to the patient\r\n* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for\r\n* [Flag](flag.html): The identity of a subject to list flags for\r\n* [Goal](goal.html): Who this goal is intended for\r\n* [GuidanceResponse](guidanceresponse.html): The identity of a patient to search for guidance response results\r\n* [ImagingSelection](imagingselection.html): Who the study is about\r\n* [ImagingStudy](imagingstudy.html): Who the study is about\r\n* [Immunization](immunization.html): The patient for the vaccination record\r\n* [ImmunizationEvaluation](immunizationevaluation.html): The patient being evaluated\r\n* [ImmunizationRecommendation](immunizationrecommendation.html): Who this profile is for\r\n* [Invoice](invoice.html): Recipient(s) of goods and services\r\n* [List](list.html): If all resources have the same subject\r\n* [MeasureReport](measurereport.html): The identity of a patient to search for individual measure report results for\r\n* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for\r\n* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for\r\n* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient\r\n* [MedicationStatement](medicationstatement.html): Returns statements for a specific patient.\r\n* [MolecularSequence](molecularsequence.html): The subject that the sequence is about\r\n* [NutritionIntake](nutritionintake.html): Returns statements for a specific patient.\r\n* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement\r\n* [Observation](observation.html): The subject that the observation is about (if patient)\r\n* [Person](person.html): The Person links to this Patient\r\n* [Procedure](procedure.html): Search by subject - a patient\r\n* [Provenance](provenance.html): Where the activity involved patient data\r\n* [QuestionnaireResponse](questionnaireresponse.html): The patient that is the subject of the questionnaire response\r\n* [RelatedPerson](relatedperson.html): The patient this related person is related to\r\n* [RequestOrchestration](requestorchestration.html): The identity of a patient to search for request orchestrations\r\n* [ResearchSubject](researchsubject.html): Who or what is part of study\r\n* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?\r\n* [ServiceRequest](servicerequest.html): Search by subject - a patient\r\n* [Specimen](specimen.html): The patient the specimen comes from\r\n* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied\r\n* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined\r\n* [Task](task.html): Search by patient\r\n* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for\r\n", type="reference", target={Patient.class } )
4131  public static final String SP_PATIENT = "patient";
4132 /**
4133   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
4134   * <p>
4135   * Description: <b>Multiple Resources: 
4136
4137* [Account](account.html): The entity that caused the expenses
4138* [AdverseEvent](adverseevent.html): Subject impacted by event
4139* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
4140* [Appointment](appointment.html): One of the individuals of the appointment is this patient
4141* [AppointmentResponse](appointmentresponse.html): This Response is for this Patient
4142* [AuditEvent](auditevent.html): Where the activity involved patient data
4143* [Basic](basic.html): Identifies the focus of this resource
4144* [BodyStructure](bodystructure.html): Who this is about
4145* [CarePlan](careplan.html): Who the care plan is for
4146* [CareTeam](careteam.html): Who care team is for
4147* [ChargeItem](chargeitem.html): Individual service was done for/to
4148* [Claim](claim.html): Patient receiving the products or services
4149* [ClaimResponse](claimresponse.html): The subject of care
4150* [ClinicalImpression](clinicalimpression.html): Patient assessed
4151* [Communication](communication.html): Focus of message
4152* [CommunicationRequest](communicationrequest.html): Focus of message
4153* [Composition](composition.html): Who and/or what the composition is about
4154* [Condition](condition.html): Who has the condition?
4155* [Consent](consent.html): Who the consent applies to
4156* [Contract](contract.html): The identity of the subject of the contract (if a patient)
4157* [Coverage](coverage.html): Retrieve coverages for a patient
4158* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The reference to the patient
4159* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The reference to the patient
4160* [DetectedIssue](detectedissue.html): Associated patient
4161* [DeviceRequest](devicerequest.html): Individual the service is ordered for
4162* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
4163* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
4164* [DocumentReference](documentreference.html): Who/what is the subject of the document
4165* [Encounter](encounter.html): The patient present at the encounter
4166* [EnrollmentRequest](enrollmentrequest.html): The party to be enrolled
4167* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
4168* [ExplanationOfBenefit](explanationofbenefit.html): The reference to the patient
4169* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
4170* [Flag](flag.html): The identity of a subject to list flags for
4171* [Goal](goal.html): Who this goal is intended for
4172* [GuidanceResponse](guidanceresponse.html): The identity of a patient to search for guidance response results
4173* [ImagingSelection](imagingselection.html): Who the study is about
4174* [ImagingStudy](imagingstudy.html): Who the study is about
4175* [Immunization](immunization.html): The patient for the vaccination record
4176* [ImmunizationEvaluation](immunizationevaluation.html): The patient being evaluated
4177* [ImmunizationRecommendation](immunizationrecommendation.html): Who this profile is for
4178* [Invoice](invoice.html): Recipient(s) of goods and services
4179* [List](list.html): If all resources have the same subject
4180* [MeasureReport](measurereport.html): The identity of a patient to search for individual measure report results for
4181* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
4182* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
4183* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
4184* [MedicationStatement](medicationstatement.html): Returns statements for a specific patient.
4185* [MolecularSequence](molecularsequence.html): The subject that the sequence is about
4186* [NutritionIntake](nutritionintake.html): Returns statements for a specific patient.
4187* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement
4188* [Observation](observation.html): The subject that the observation is about (if patient)
4189* [Person](person.html): The Person links to this Patient
4190* [Procedure](procedure.html): Search by subject - a patient
4191* [Provenance](provenance.html): Where the activity involved patient data
4192* [QuestionnaireResponse](questionnaireresponse.html): The patient that is the subject of the questionnaire response
4193* [RelatedPerson](relatedperson.html): The patient this related person is related to
4194* [RequestOrchestration](requestorchestration.html): The identity of a patient to search for request orchestrations
4195* [ResearchSubject](researchsubject.html): Who or what is part of study
4196* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
4197* [ServiceRequest](servicerequest.html): Search by subject - a patient
4198* [Specimen](specimen.html): The patient the specimen comes from
4199* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
4200* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined
4201* [Task](task.html): Search by patient
4202* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
4203</b><br>
4204   * Type: <b>reference</b><br>
4205   * Path: <b>Account.subject.where(resolve() is Patient) | AdverseEvent.subject.where(resolve() is Patient) | AllergyIntolerance.patient | Appointment.participant.actor.where(resolve() is Patient) | Appointment.subject.where(resolve() is Patient) | AppointmentResponse.actor.where(resolve() is Patient) | AuditEvent.patient | Basic.subject.where(resolve() is Patient) | BodyStructure.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ChargeItem.subject.where(resolve() is Patient) | Claim.patient | ClaimResponse.patient | ClinicalImpression.subject.where(resolve() is Patient) | Communication.subject.where(resolve() is Patient) | CommunicationRequest.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | Contract.subject.where(resolve() is Patient) | Coverage.beneficiary | CoverageEligibilityRequest.patient | CoverageEligibilityResponse.patient | DetectedIssue.subject.where(resolve() is Patient) | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EnrollmentRequest.candidate | EpisodeOfCare.patient | ExplanationOfBenefit.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | GuidanceResponse.subject.where(resolve() is Patient) | ImagingSelection.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | ImmunizationEvaluation.patient | ImmunizationRecommendation.patient | Invoice.subject.where(resolve() is Patient) | List.subject.where(resolve() is Patient) | MeasureReport.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationStatement.subject.where(resolve() is Patient) | MolecularSequence.subject.where(resolve() is Patient) | NutritionIntake.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Person.link.target.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | Provenance.patient | QuestionnaireResponse.subject.where(resolve() is Patient) | RelatedPerson.patient | RequestOrchestration.subject.where(resolve() is Patient) | ResearchSubject.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | Specimen.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | Task.for.where(resolve() is Patient) | VisionPrescription.patient</b><br>
4206   * </p>
4207   */
4208  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
4209
4210/**
4211   * Constant for fluent queries to be used to add include statements. Specifies
4212   * the path value of "<b>ServiceRequest:patient</b>".
4213   */
4214  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("ServiceRequest:patient").toLocked();
4215
4216
4217}
4218