001package org.hl7.fhir.r4.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Sun, May 6, 2018 17:51-0400 for FHIR v3.4.0
033
034import java.util.*;
035
036import org.hl7.fhir.utilities.Utilities;
037import ca.uhn.fhir.model.api.annotation.ResourceDef;
038import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
039import ca.uhn.fhir.model.api.annotation.Child;
040import ca.uhn.fhir.model.api.annotation.ChildOrder;
041import ca.uhn.fhir.model.api.annotation.Description;
042import ca.uhn.fhir.model.api.annotation.Block;
043import org.hl7.fhir.instance.model.api.*;
044import org.hl7.fhir.exceptions.FHIRException;
045/**
046 * An action that is or was performed on a patient. This can be a physical intervention like an operation, or less invasive like counseling or hypnotherapy.
047 */
048@ResourceDef(name="Procedure", profile="http://hl7.org/fhir/Profile/Procedure")
049public class Procedure extends DomainResource {
050
051    public enum ProcedureStatus {
052        /**
053         * The core event has not started yet, but some staging activities have begun (e.g. surgical suite preparation).  Preparation stages may be tracked for billing purposes.
054         */
055        PREPARATION, 
056        /**
057         * The event is currently occurring
058         */
059        INPROGRESS, 
060        /**
061         * The event was terminated prior to any impact on the subject (though preparatory actions may have been taken)
062         */
063        NOTDONE, 
064        /**
065         * The event has been temporarily stopped but is expected to resume in the future
066         */
067        SUSPENDED, 
068        /**
069         * The event was  terminated prior to the full completion of the intended actions but after having at least some impact on the subject.
070         */
071        ABORTED, 
072        /**
073         * The event has now concluded
074         */
075        COMPLETED, 
076        /**
077         * This electronic record should never have existed, though it is possible that real-world decisions were based on it.  (If real-world activity has occurred, the status should be "cancelled" rather than "entered-in-error".)
078         */
079        ENTEREDINERROR, 
080        /**
081         * The authoring system does not know which of the status values currently applies for this request.  Note: This concept is not to be used for "other" - one of the listed statuses is presumed to apply, it's just not known which one.
082         */
083        UNKNOWN, 
084        /**
085         * added to help the parsers with the generic types
086         */
087        NULL;
088        public static ProcedureStatus fromCode(String codeString) throws FHIRException {
089            if (codeString == null || "".equals(codeString))
090                return null;
091        if ("preparation".equals(codeString))
092          return PREPARATION;
093        if ("in-progress".equals(codeString))
094          return INPROGRESS;
095        if ("not-done".equals(codeString))
096          return NOTDONE;
097        if ("suspended".equals(codeString))
098          return SUSPENDED;
099        if ("aborted".equals(codeString))
100          return ABORTED;
101        if ("completed".equals(codeString))
102          return COMPLETED;
103        if ("entered-in-error".equals(codeString))
104          return ENTEREDINERROR;
105        if ("unknown".equals(codeString))
106          return UNKNOWN;
107        if (Configuration.isAcceptInvalidEnums())
108          return null;
109        else
110          throw new FHIRException("Unknown ProcedureStatus code '"+codeString+"'");
111        }
112        public String toCode() {
113          switch (this) {
114            case PREPARATION: return "preparation";
115            case INPROGRESS: return "in-progress";
116            case NOTDONE: return "not-done";
117            case SUSPENDED: return "suspended";
118            case ABORTED: return "aborted";
119            case COMPLETED: return "completed";
120            case ENTEREDINERROR: return "entered-in-error";
121            case UNKNOWN: return "unknown";
122            default: return "?";
123          }
124        }
125        public String getSystem() {
126          switch (this) {
127            case PREPARATION: return "http://hl7.org/fhir/event-status";
128            case INPROGRESS: return "http://hl7.org/fhir/event-status";
129            case NOTDONE: return "http://hl7.org/fhir/event-status";
130            case SUSPENDED: return "http://hl7.org/fhir/event-status";
131            case ABORTED: return "http://hl7.org/fhir/event-status";
132            case COMPLETED: return "http://hl7.org/fhir/event-status";
133            case ENTEREDINERROR: return "http://hl7.org/fhir/event-status";
134            case UNKNOWN: return "http://hl7.org/fhir/event-status";
135            default: return "?";
136          }
137        }
138        public String getDefinition() {
139          switch (this) {
140            case PREPARATION: return "The core event has not started yet, but some staging activities have begun (e.g. surgical suite preparation).  Preparation stages may be tracked for billing purposes.";
141            case INPROGRESS: return "The event is currently occurring";
142            case NOTDONE: return "The event was terminated prior to any impact on the subject (though preparatory actions may have been taken)";
143            case SUSPENDED: return "The event has been temporarily stopped but is expected to resume in the future";
144            case ABORTED: return "The event was  terminated prior to the full completion of the intended actions but after having at least some impact on the subject.";
145            case COMPLETED: return "The event has now concluded";
146            case ENTEREDINERROR: return "This electronic record should never have existed, though it is possible that real-world decisions were based on it.  (If real-world activity has occurred, the status should be \"cancelled\" rather than \"entered-in-error\".)";
147            case UNKNOWN: return "The authoring system does not know which of the status values currently applies for this request.  Note: This concept is not to be used for \"other\" - one of the listed statuses is presumed to apply, it's just not known which one.";
148            default: return "?";
149          }
150        }
151        public String getDisplay() {
152          switch (this) {
153            case PREPARATION: return "Preparation";
154            case INPROGRESS: return "In Progress";
155            case NOTDONE: return "Not Done";
156            case SUSPENDED: return "Suspended";
157            case ABORTED: return "Aborted";
158            case COMPLETED: return "Completed";
159            case ENTEREDINERROR: return "Entered in Error";
160            case UNKNOWN: return "Unknown";
161            default: return "?";
162          }
163        }
164    }
165
166  public static class ProcedureStatusEnumFactory implements EnumFactory<ProcedureStatus> {
167    public ProcedureStatus fromCode(String codeString) throws IllegalArgumentException {
168      if (codeString == null || "".equals(codeString))
169            if (codeString == null || "".equals(codeString))
170                return null;
171        if ("preparation".equals(codeString))
172          return ProcedureStatus.PREPARATION;
173        if ("in-progress".equals(codeString))
174          return ProcedureStatus.INPROGRESS;
175        if ("not-done".equals(codeString))
176          return ProcedureStatus.NOTDONE;
177        if ("suspended".equals(codeString))
178          return ProcedureStatus.SUSPENDED;
179        if ("aborted".equals(codeString))
180          return ProcedureStatus.ABORTED;
181        if ("completed".equals(codeString))
182          return ProcedureStatus.COMPLETED;
183        if ("entered-in-error".equals(codeString))
184          return ProcedureStatus.ENTEREDINERROR;
185        if ("unknown".equals(codeString))
186          return ProcedureStatus.UNKNOWN;
187        throw new IllegalArgumentException("Unknown ProcedureStatus code '"+codeString+"'");
188        }
189        public Enumeration<ProcedureStatus> fromType(Base code) throws FHIRException {
190          if (code == null)
191            return null;
192          if (code.isEmpty())
193            return new Enumeration<ProcedureStatus>(this);
194          String codeString = ((PrimitiveType) code).asStringValue();
195          if (codeString == null || "".equals(codeString))
196            return null;
197        if ("preparation".equals(codeString))
198          return new Enumeration<ProcedureStatus>(this, ProcedureStatus.PREPARATION);
199        if ("in-progress".equals(codeString))
200          return new Enumeration<ProcedureStatus>(this, ProcedureStatus.INPROGRESS);
201        if ("not-done".equals(codeString))
202          return new Enumeration<ProcedureStatus>(this, ProcedureStatus.NOTDONE);
203        if ("suspended".equals(codeString))
204          return new Enumeration<ProcedureStatus>(this, ProcedureStatus.SUSPENDED);
205        if ("aborted".equals(codeString))
206          return new Enumeration<ProcedureStatus>(this, ProcedureStatus.ABORTED);
207        if ("completed".equals(codeString))
208          return new Enumeration<ProcedureStatus>(this, ProcedureStatus.COMPLETED);
209        if ("entered-in-error".equals(codeString))
210          return new Enumeration<ProcedureStatus>(this, ProcedureStatus.ENTEREDINERROR);
211        if ("unknown".equals(codeString))
212          return new Enumeration<ProcedureStatus>(this, ProcedureStatus.UNKNOWN);
213        throw new FHIRException("Unknown ProcedureStatus code '"+codeString+"'");
214        }
215    public String toCode(ProcedureStatus code) {
216      if (code == ProcedureStatus.PREPARATION)
217        return "preparation";
218      if (code == ProcedureStatus.INPROGRESS)
219        return "in-progress";
220      if (code == ProcedureStatus.NOTDONE)
221        return "not-done";
222      if (code == ProcedureStatus.SUSPENDED)
223        return "suspended";
224      if (code == ProcedureStatus.ABORTED)
225        return "aborted";
226      if (code == ProcedureStatus.COMPLETED)
227        return "completed";
228      if (code == ProcedureStatus.ENTEREDINERROR)
229        return "entered-in-error";
230      if (code == ProcedureStatus.UNKNOWN)
231        return "unknown";
232      return "?";
233      }
234    public String toSystem(ProcedureStatus code) {
235      return code.getSystem();
236      }
237    }
238
239    @Block()
240    public static class ProcedurePerformerComponent extends BackboneElement implements IBaseBackboneElement {
241        /**
242         * For example: surgeon, anaethetist, endoscopist.
243         */
244        @Child(name = "role", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
245        @Description(shortDefinition="The role the actor was in", formalDefinition="For example: surgeon, anaethetist, endoscopist." )
246        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/performer-role")
247        protected CodeableConcept role;
248
249        /**
250         * The practitioner who was involved in the procedure.
251         */
252        @Child(name = "actor", type = {Practitioner.class, PractitionerRole.class, Organization.class, Patient.class, RelatedPerson.class, Device.class}, order=2, min=1, max=1, modifier=false, summary=true)
253        @Description(shortDefinition="The reference to the practitioner", formalDefinition="The practitioner who was involved in the procedure." )
254        protected Reference actor;
255
256        /**
257         * The actual object that is the target of the reference (The practitioner who was involved in the procedure.)
258         */
259        protected Resource actorTarget;
260
261        /**
262         * The organization the device or practitioner was acting on behalf of.
263         */
264        @Child(name = "onBehalfOf", type = {Organization.class}, order=3, min=0, max=1, modifier=false, summary=false)
265        @Description(shortDefinition="Organization the device or practitioner was acting for", formalDefinition="The organization the device or practitioner was acting on behalf of." )
266        protected Reference onBehalfOf;
267
268        /**
269         * The actual object that is the target of the reference (The organization the device or practitioner was acting on behalf of.)
270         */
271        protected Organization onBehalfOfTarget;
272
273        private static final long serialVersionUID = 213950062L;
274
275    /**
276     * Constructor
277     */
278      public ProcedurePerformerComponent() {
279        super();
280      }
281
282    /**
283     * Constructor
284     */
285      public ProcedurePerformerComponent(Reference actor) {
286        super();
287        this.actor = actor;
288      }
289
290        /**
291         * @return {@link #role} (For example: surgeon, anaethetist, endoscopist.)
292         */
293        public CodeableConcept getRole() { 
294          if (this.role == null)
295            if (Configuration.errorOnAutoCreate())
296              throw new Error("Attempt to auto-create ProcedurePerformerComponent.role");
297            else if (Configuration.doAutoCreate())
298              this.role = new CodeableConcept(); // cc
299          return this.role;
300        }
301
302        public boolean hasRole() { 
303          return this.role != null && !this.role.isEmpty();
304        }
305
306        /**
307         * @param value {@link #role} (For example: surgeon, anaethetist, endoscopist.)
308         */
309        public ProcedurePerformerComponent setRole(CodeableConcept value) { 
310          this.role = value;
311          return this;
312        }
313
314        /**
315         * @return {@link #actor} (The practitioner who was involved in the procedure.)
316         */
317        public Reference getActor() { 
318          if (this.actor == null)
319            if (Configuration.errorOnAutoCreate())
320              throw new Error("Attempt to auto-create ProcedurePerformerComponent.actor");
321            else if (Configuration.doAutoCreate())
322              this.actor = new Reference(); // cc
323          return this.actor;
324        }
325
326        public boolean hasActor() { 
327          return this.actor != null && !this.actor.isEmpty();
328        }
329
330        /**
331         * @param value {@link #actor} (The practitioner who was involved in the procedure.)
332         */
333        public ProcedurePerformerComponent setActor(Reference value) { 
334          this.actor = value;
335          return this;
336        }
337
338        /**
339         * @return {@link #actor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who was involved in the procedure.)
340         */
341        public Resource getActorTarget() { 
342          return this.actorTarget;
343        }
344
345        /**
346         * @param value {@link #actor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who was involved in the procedure.)
347         */
348        public ProcedurePerformerComponent setActorTarget(Resource value) { 
349          this.actorTarget = value;
350          return this;
351        }
352
353        /**
354         * @return {@link #onBehalfOf} (The organization the device or practitioner was acting on behalf of.)
355         */
356        public Reference getOnBehalfOf() { 
357          if (this.onBehalfOf == null)
358            if (Configuration.errorOnAutoCreate())
359              throw new Error("Attempt to auto-create ProcedurePerformerComponent.onBehalfOf");
360            else if (Configuration.doAutoCreate())
361              this.onBehalfOf = new Reference(); // cc
362          return this.onBehalfOf;
363        }
364
365        public boolean hasOnBehalfOf() { 
366          return this.onBehalfOf != null && !this.onBehalfOf.isEmpty();
367        }
368
369        /**
370         * @param value {@link #onBehalfOf} (The organization the device or practitioner was acting on behalf of.)
371         */
372        public ProcedurePerformerComponent setOnBehalfOf(Reference value) { 
373          this.onBehalfOf = value;
374          return this;
375        }
376
377        /**
378         * @return {@link #onBehalfOf} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization the device or practitioner was acting on behalf of.)
379         */
380        public Organization getOnBehalfOfTarget() { 
381          if (this.onBehalfOfTarget == null)
382            if (Configuration.errorOnAutoCreate())
383              throw new Error("Attempt to auto-create ProcedurePerformerComponent.onBehalfOf");
384            else if (Configuration.doAutoCreate())
385              this.onBehalfOfTarget = new Organization(); // aa
386          return this.onBehalfOfTarget;
387        }
388
389        /**
390         * @param value {@link #onBehalfOf} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization the device or practitioner was acting on behalf of.)
391         */
392        public ProcedurePerformerComponent setOnBehalfOfTarget(Organization value) { 
393          this.onBehalfOfTarget = value;
394          return this;
395        }
396
397        protected void listChildren(List<Property> children) {
398          super.listChildren(children);
399          children.add(new Property("role", "CodeableConcept", "For example: surgeon, anaethetist, endoscopist.", 0, 1, role));
400          children.add(new Property("actor", "Reference(Practitioner|PractitionerRole|Organization|Patient|RelatedPerson|Device)", "The practitioner who was involved in the procedure.", 0, 1, actor));
401          children.add(new Property("onBehalfOf", "Reference(Organization)", "The organization the device or practitioner was acting on behalf of.", 0, 1, onBehalfOf));
402        }
403
404        @Override
405        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
406          switch (_hash) {
407          case 3506294: /*role*/  return new Property("role", "CodeableConcept", "For example: surgeon, anaethetist, endoscopist.", 0, 1, role);
408          case 92645877: /*actor*/  return new Property("actor", "Reference(Practitioner|PractitionerRole|Organization|Patient|RelatedPerson|Device)", "The practitioner who was involved in the procedure.", 0, 1, actor);
409          case -14402964: /*onBehalfOf*/  return new Property("onBehalfOf", "Reference(Organization)", "The organization the device or practitioner was acting on behalf of.", 0, 1, onBehalfOf);
410          default: return super.getNamedProperty(_hash, _name, _checkValid);
411          }
412
413        }
414
415      @Override
416      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
417        switch (hash) {
418        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept
419        case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference
420        case -14402964: /*onBehalfOf*/ return this.onBehalfOf == null ? new Base[0] : new Base[] {this.onBehalfOf}; // Reference
421        default: return super.getProperty(hash, name, checkValid);
422        }
423
424      }
425
426      @Override
427      public Base setProperty(int hash, String name, Base value) throws FHIRException {
428        switch (hash) {
429        case 3506294: // role
430          this.role = castToCodeableConcept(value); // CodeableConcept
431          return value;
432        case 92645877: // actor
433          this.actor = castToReference(value); // Reference
434          return value;
435        case -14402964: // onBehalfOf
436          this.onBehalfOf = castToReference(value); // Reference
437          return value;
438        default: return super.setProperty(hash, name, value);
439        }
440
441      }
442
443      @Override
444      public Base setProperty(String name, Base value) throws FHIRException {
445        if (name.equals("role")) {
446          this.role = castToCodeableConcept(value); // CodeableConcept
447        } else if (name.equals("actor")) {
448          this.actor = castToReference(value); // Reference
449        } else if (name.equals("onBehalfOf")) {
450          this.onBehalfOf = castToReference(value); // Reference
451        } else
452          return super.setProperty(name, value);
453        return value;
454      }
455
456      @Override
457      public Base makeProperty(int hash, String name) throws FHIRException {
458        switch (hash) {
459        case 3506294:  return getRole(); 
460        case 92645877:  return getActor(); 
461        case -14402964:  return getOnBehalfOf(); 
462        default: return super.makeProperty(hash, name);
463        }
464
465      }
466
467      @Override
468      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
469        switch (hash) {
470        case 3506294: /*role*/ return new String[] {"CodeableConcept"};
471        case 92645877: /*actor*/ return new String[] {"Reference"};
472        case -14402964: /*onBehalfOf*/ return new String[] {"Reference"};
473        default: return super.getTypesForProperty(hash, name);
474        }
475
476      }
477
478      @Override
479      public Base addChild(String name) throws FHIRException {
480        if (name.equals("role")) {
481          this.role = new CodeableConcept();
482          return this.role;
483        }
484        else if (name.equals("actor")) {
485          this.actor = new Reference();
486          return this.actor;
487        }
488        else if (name.equals("onBehalfOf")) {
489          this.onBehalfOf = new Reference();
490          return this.onBehalfOf;
491        }
492        else
493          return super.addChild(name);
494      }
495
496      public ProcedurePerformerComponent copy() {
497        ProcedurePerformerComponent dst = new ProcedurePerformerComponent();
498        copyValues(dst);
499        dst.role = role == null ? null : role.copy();
500        dst.actor = actor == null ? null : actor.copy();
501        dst.onBehalfOf = onBehalfOf == null ? null : onBehalfOf.copy();
502        return dst;
503      }
504
505      @Override
506      public boolean equalsDeep(Base other_) {
507        if (!super.equalsDeep(other_))
508          return false;
509        if (!(other_ instanceof ProcedurePerformerComponent))
510          return false;
511        ProcedurePerformerComponent o = (ProcedurePerformerComponent) other_;
512        return compareDeep(role, o.role, true) && compareDeep(actor, o.actor, true) && compareDeep(onBehalfOf, o.onBehalfOf, true)
513          ;
514      }
515
516      @Override
517      public boolean equalsShallow(Base other_) {
518        if (!super.equalsShallow(other_))
519          return false;
520        if (!(other_ instanceof ProcedurePerformerComponent))
521          return false;
522        ProcedurePerformerComponent o = (ProcedurePerformerComponent) other_;
523        return true;
524      }
525
526      public boolean isEmpty() {
527        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(role, actor, onBehalfOf
528          );
529      }
530
531  public String fhirType() {
532    return "Procedure.performer";
533
534  }
535
536  }
537
538    @Block()
539    public static class ProcedureFocalDeviceComponent extends BackboneElement implements IBaseBackboneElement {
540        /**
541         * The kind of change that happened to the device during the procedure.
542         */
543        @Child(name = "action", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
544        @Description(shortDefinition="Kind of change to device", formalDefinition="The kind of change that happened to the device during the procedure." )
545        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-action")
546        protected CodeableConcept action;
547
548        /**
549         * The device that was manipulated (changed) during the procedure.
550         */
551        @Child(name = "manipulated", type = {Device.class}, order=2, min=1, max=1, modifier=false, summary=false)
552        @Description(shortDefinition="Device that was changed", formalDefinition="The device that was manipulated (changed) during the procedure." )
553        protected Reference manipulated;
554
555        /**
556         * The actual object that is the target of the reference (The device that was manipulated (changed) during the procedure.)
557         */
558        protected Device manipulatedTarget;
559
560        private static final long serialVersionUID = 1779937807L;
561
562    /**
563     * Constructor
564     */
565      public ProcedureFocalDeviceComponent() {
566        super();
567      }
568
569    /**
570     * Constructor
571     */
572      public ProcedureFocalDeviceComponent(Reference manipulated) {
573        super();
574        this.manipulated = manipulated;
575      }
576
577        /**
578         * @return {@link #action} (The kind of change that happened to the device during the procedure.)
579         */
580        public CodeableConcept getAction() { 
581          if (this.action == null)
582            if (Configuration.errorOnAutoCreate())
583              throw new Error("Attempt to auto-create ProcedureFocalDeviceComponent.action");
584            else if (Configuration.doAutoCreate())
585              this.action = new CodeableConcept(); // cc
586          return this.action;
587        }
588
589        public boolean hasAction() { 
590          return this.action != null && !this.action.isEmpty();
591        }
592
593        /**
594         * @param value {@link #action} (The kind of change that happened to the device during the procedure.)
595         */
596        public ProcedureFocalDeviceComponent setAction(CodeableConcept value) { 
597          this.action = value;
598          return this;
599        }
600
601        /**
602         * @return {@link #manipulated} (The device that was manipulated (changed) during the procedure.)
603         */
604        public Reference getManipulated() { 
605          if (this.manipulated == null)
606            if (Configuration.errorOnAutoCreate())
607              throw new Error("Attempt to auto-create ProcedureFocalDeviceComponent.manipulated");
608            else if (Configuration.doAutoCreate())
609              this.manipulated = new Reference(); // cc
610          return this.manipulated;
611        }
612
613        public boolean hasManipulated() { 
614          return this.manipulated != null && !this.manipulated.isEmpty();
615        }
616
617        /**
618         * @param value {@link #manipulated} (The device that was manipulated (changed) during the procedure.)
619         */
620        public ProcedureFocalDeviceComponent setManipulated(Reference value) { 
621          this.manipulated = value;
622          return this;
623        }
624
625        /**
626         * @return {@link #manipulated} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The device that was manipulated (changed) during the procedure.)
627         */
628        public Device getManipulatedTarget() { 
629          if (this.manipulatedTarget == null)
630            if (Configuration.errorOnAutoCreate())
631              throw new Error("Attempt to auto-create ProcedureFocalDeviceComponent.manipulated");
632            else if (Configuration.doAutoCreate())
633              this.manipulatedTarget = new Device(); // aa
634          return this.manipulatedTarget;
635        }
636
637        /**
638         * @param value {@link #manipulated} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The device that was manipulated (changed) during the procedure.)
639         */
640        public ProcedureFocalDeviceComponent setManipulatedTarget(Device value) { 
641          this.manipulatedTarget = value;
642          return this;
643        }
644
645        protected void listChildren(List<Property> children) {
646          super.listChildren(children);
647          children.add(new Property("action", "CodeableConcept", "The kind of change that happened to the device during the procedure.", 0, 1, action));
648          children.add(new Property("manipulated", "Reference(Device)", "The device that was manipulated (changed) during the procedure.", 0, 1, manipulated));
649        }
650
651        @Override
652        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
653          switch (_hash) {
654          case -1422950858: /*action*/  return new Property("action", "CodeableConcept", "The kind of change that happened to the device during the procedure.", 0, 1, action);
655          case 947372650: /*manipulated*/  return new Property("manipulated", "Reference(Device)", "The device that was manipulated (changed) during the procedure.", 0, 1, manipulated);
656          default: return super.getNamedProperty(_hash, _name, _checkValid);
657          }
658
659        }
660
661      @Override
662      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
663        switch (hash) {
664        case -1422950858: /*action*/ return this.action == null ? new Base[0] : new Base[] {this.action}; // CodeableConcept
665        case 947372650: /*manipulated*/ return this.manipulated == null ? new Base[0] : new Base[] {this.manipulated}; // Reference
666        default: return super.getProperty(hash, name, checkValid);
667        }
668
669      }
670
671      @Override
672      public Base setProperty(int hash, String name, Base value) throws FHIRException {
673        switch (hash) {
674        case -1422950858: // action
675          this.action = castToCodeableConcept(value); // CodeableConcept
676          return value;
677        case 947372650: // manipulated
678          this.manipulated = castToReference(value); // Reference
679          return value;
680        default: return super.setProperty(hash, name, value);
681        }
682
683      }
684
685      @Override
686      public Base setProperty(String name, Base value) throws FHIRException {
687        if (name.equals("action")) {
688          this.action = castToCodeableConcept(value); // CodeableConcept
689        } else if (name.equals("manipulated")) {
690          this.manipulated = castToReference(value); // Reference
691        } else
692          return super.setProperty(name, value);
693        return value;
694      }
695
696      @Override
697      public Base makeProperty(int hash, String name) throws FHIRException {
698        switch (hash) {
699        case -1422950858:  return getAction(); 
700        case 947372650:  return getManipulated(); 
701        default: return super.makeProperty(hash, name);
702        }
703
704      }
705
706      @Override
707      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
708        switch (hash) {
709        case -1422950858: /*action*/ return new String[] {"CodeableConcept"};
710        case 947372650: /*manipulated*/ return new String[] {"Reference"};
711        default: return super.getTypesForProperty(hash, name);
712        }
713
714      }
715
716      @Override
717      public Base addChild(String name) throws FHIRException {
718        if (name.equals("action")) {
719          this.action = new CodeableConcept();
720          return this.action;
721        }
722        else if (name.equals("manipulated")) {
723          this.manipulated = new Reference();
724          return this.manipulated;
725        }
726        else
727          return super.addChild(name);
728      }
729
730      public ProcedureFocalDeviceComponent copy() {
731        ProcedureFocalDeviceComponent dst = new ProcedureFocalDeviceComponent();
732        copyValues(dst);
733        dst.action = action == null ? null : action.copy();
734        dst.manipulated = manipulated == null ? null : manipulated.copy();
735        return dst;
736      }
737
738      @Override
739      public boolean equalsDeep(Base other_) {
740        if (!super.equalsDeep(other_))
741          return false;
742        if (!(other_ instanceof ProcedureFocalDeviceComponent))
743          return false;
744        ProcedureFocalDeviceComponent o = (ProcedureFocalDeviceComponent) other_;
745        return compareDeep(action, o.action, true) && compareDeep(manipulated, o.manipulated, true);
746      }
747
748      @Override
749      public boolean equalsShallow(Base other_) {
750        if (!super.equalsShallow(other_))
751          return false;
752        if (!(other_ instanceof ProcedureFocalDeviceComponent))
753          return false;
754        ProcedureFocalDeviceComponent o = (ProcedureFocalDeviceComponent) other_;
755        return true;
756      }
757
758      public boolean isEmpty() {
759        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(action, manipulated);
760      }
761
762  public String fhirType() {
763    return "Procedure.focalDevice";
764
765  }
766
767  }
768
769    /**
770     * Business identifiers assigned to this procedure by the performer or other systems which remain constant as the resource is updated and propagates from server to server.
771     */
772    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
773    @Description(shortDefinition="External Identifiers for this procedure", formalDefinition="Business identifiers assigned to this procedure by the performer or other systems which remain constant as the resource is updated and propagates from server to server." )
774    protected List<Identifier> identifier;
775
776    /**
777     * A protocol, guideline, orderset or other definition that was adhered to in whole or in part by this procedure.
778     */
779    @Child(name = "instantiates", type = {UriType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
780    @Description(shortDefinition="Instantiates protocol or definition", formalDefinition="A protocol, guideline, orderset or other definition that was adhered to in whole or in part by this procedure." )
781    protected List<UriType> instantiates;
782
783    /**
784     * A reference to a resource that contains details of the request for this procedure.
785     */
786    @Child(name = "basedOn", type = {CarePlan.class, ServiceRequest.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
787    @Description(shortDefinition="A request for this procedure", formalDefinition="A reference to a resource that contains details of the request for this procedure." )
788    protected List<Reference> basedOn;
789    /**
790     * The actual objects that are the target of the reference (A reference to a resource that contains details of the request for this procedure.)
791     */
792    protected List<Resource> basedOnTarget;
793
794
795    /**
796     * A larger event of which this particular procedure is a component or step.
797     */
798    @Child(name = "partOf", type = {Procedure.class, Observation.class, MedicationAdministration.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
799    @Description(shortDefinition="Part of referenced event", formalDefinition="A larger event of which this particular procedure is a component or step." )
800    protected List<Reference> partOf;
801    /**
802     * The actual objects that are the target of the reference (A larger event of which this particular procedure is a component or step.)
803     */
804    protected List<Resource> partOfTarget;
805
806
807    /**
808     * A code specifying the state of the procedure. Generally this will be in-progress or completed state.
809     */
810    @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1, modifier=true, summary=true)
811    @Description(shortDefinition="preparation | in-progress | not-done | suspended | aborted | completed | entered-in-error | unknown", formalDefinition="A code specifying the state of the procedure. Generally this will be in-progress or completed state." )
812    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/event-status")
813    protected Enumeration<ProcedureStatus> status;
814
815    /**
816     * Captures the reason for the current state of the procedure.
817     */
818    @Child(name = "statusReason", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true)
819    @Description(shortDefinition="Reason for current status", formalDefinition="Captures the reason for the current state of the procedure." )
820    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/procedure-not-performed-reason")
821    protected CodeableConcept statusReason;
822
823    /**
824     * A code that classifies the procedure for searching, sorting and display purposes (e.g. "Surgical Procedure").
825     */
826    @Child(name = "category", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true)
827    @Description(shortDefinition="Classification of the procedure", formalDefinition="A code that classifies the procedure for searching, sorting and display purposes (e.g. \"Surgical Procedure\")." )
828    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/procedure-category")
829    protected CodeableConcept category;
830
831    /**
832     * The specific procedure that is performed. Use text if the exact nature of the procedure cannot be coded (e.g. "Laparoscopic Appendectomy").
833     */
834    @Child(name = "code", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=true)
835    @Description(shortDefinition="Identification of the procedure", formalDefinition="The specific procedure that is performed. Use text if the exact nature of the procedure cannot be coded (e.g. \"Laparoscopic Appendectomy\")." )
836    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/procedure-code")
837    protected CodeableConcept code;
838
839    /**
840     * The person, animal or group on which the procedure was performed.
841     */
842    @Child(name = "subject", type = {Patient.class, Group.class}, order=8, min=1, max=1, modifier=false, summary=true)
843    @Description(shortDefinition="Who the procedure was performed on", formalDefinition="The person, animal or group on which the procedure was performed." )
844    protected Reference subject;
845
846    /**
847     * The actual object that is the target of the reference (The person, animal or group on which the procedure was performed.)
848     */
849    protected Resource subjectTarget;
850
851    /**
852     * The encounter during which the procedure was performed.
853     */
854    @Child(name = "context", type = {Encounter.class, EpisodeOfCare.class}, order=9, min=0, max=1, modifier=false, summary=true)
855    @Description(shortDefinition="Encounter or episode associated with the procedure", formalDefinition="The encounter during which the procedure was performed." )
856    protected Reference context;
857
858    /**
859     * The actual object that is the target of the reference (The encounter during which the procedure was performed.)
860     */
861    protected Resource contextTarget;
862
863    /**
864     * Estimated or actual date, date-time, period, or age when the procedure was performed.  Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.
865     */
866    @Child(name = "performed", type = {DateTimeType.class, Period.class, StringType.class, Age.class, Range.class}, order=10, min=0, max=1, modifier=false, summary=true)
867    @Description(shortDefinition="When the procedure was performed", formalDefinition="Estimated or actual date, date-time, period, or age when the procedure was performed.  Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured." )
868    protected Type performed;
869
870    /**
871     * Individual who recorded the record and takes responsibility for its content.
872     */
873    @Child(name = "recorder", type = {Patient.class, RelatedPerson.class, Practitioner.class, PractitionerRole.class}, order=11, min=0, max=1, modifier=false, summary=true)
874    @Description(shortDefinition="Who recorded the procedure", formalDefinition="Individual who recorded the record and takes responsibility for its content." )
875    protected Reference recorder;
876
877    /**
878     * The actual object that is the target of the reference (Individual who recorded the record and takes responsibility for its content.)
879     */
880    protected Resource recorderTarget;
881
882    /**
883     * Individual who is making the procedure statement.
884     */
885    @Child(name = "asserter", type = {Patient.class, RelatedPerson.class, Practitioner.class, PractitionerRole.class}, order=12, min=0, max=1, modifier=false, summary=true)
886    @Description(shortDefinition="Person who asserts this procedure", formalDefinition="Individual who is making the procedure statement." )
887    protected Reference asserter;
888
889    /**
890     * The actual object that is the target of the reference (Individual who is making the procedure statement.)
891     */
892    protected Resource asserterTarget;
893
894    /**
895     * Limited to 'real' people rather than equipment.
896     */
897    @Child(name = "performer", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
898    @Description(shortDefinition="The people who performed the procedure", formalDefinition="Limited to 'real' people rather than equipment." )
899    protected List<ProcedurePerformerComponent> performer;
900
901    /**
902     * The location where the procedure actually happened.  E.g. a newborn at home, a tracheostomy at a restaurant.
903     */
904    @Child(name = "location", type = {Location.class}, order=14, min=0, max=1, modifier=false, summary=true)
905    @Description(shortDefinition="Where the procedure happened", formalDefinition="The location where the procedure actually happened.  E.g. a newborn at home, a tracheostomy at a restaurant." )
906    protected Reference location;
907
908    /**
909     * The actual object that is the target of the reference (The location where the procedure actually happened.  E.g. a newborn at home, a tracheostomy at a restaurant.)
910     */
911    protected Location locationTarget;
912
913    /**
914     * The coded reason why the procedure was performed. This may be coded entity of some type, or may simply be present as text.
915     */
916    @Child(name = "reasonCode", type = {CodeableConcept.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
917    @Description(shortDefinition="Coded reason procedure performed", formalDefinition="The coded reason why the procedure was performed. This may be coded entity of some type, or may simply be present as text." )
918    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/procedure-reason")
919    protected List<CodeableConcept> reasonCode;
920
921    /**
922     * The justification of why the procedure was performed.
923     */
924    @Child(name = "reasonReference", type = {Condition.class, Observation.class, Procedure.class, DiagnosticReport.class, DocumentReference.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
925    @Description(shortDefinition="The justification that the procedure was performed", formalDefinition="The justification of why the procedure was performed." )
926    protected List<Reference> reasonReference;
927    /**
928     * The actual objects that are the target of the reference (The justification of why the procedure was performed.)
929     */
930    protected List<Resource> reasonReferenceTarget;
931
932
933    /**
934     * Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.
935     */
936    @Child(name = "bodySite", type = {CodeableConcept.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
937    @Description(shortDefinition="Target body sites", formalDefinition="Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion." )
938    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/body-site")
939    protected List<CodeableConcept> bodySite;
940
941    /**
942     * The outcome of the procedure - did it resolve reasons for the procedure being performed?
943     */
944    @Child(name = "outcome", type = {CodeableConcept.class}, order=18, min=0, max=1, modifier=false, summary=true)
945    @Description(shortDefinition="The result of procedure", formalDefinition="The outcome of the procedure - did it resolve reasons for the procedure being performed?" )
946    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/procedure-outcome")
947    protected CodeableConcept outcome;
948
949    /**
950     * This could be a histology result, pathology report, surgical report, etc.
951     */
952    @Child(name = "report", type = {DiagnosticReport.class, DocumentReference.class, Composition.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
953    @Description(shortDefinition="Any report resulting from the procedure", formalDefinition="This could be a histology result, pathology report, surgical report, etc." )
954    protected List<Reference> report;
955    /**
956     * The actual objects that are the target of the reference (This could be a histology result, pathology report, surgical report, etc.)
957     */
958    protected List<Resource> reportTarget;
959
960
961    /**
962     * Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues.
963     */
964    @Child(name = "complication", type = {CodeableConcept.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
965    @Description(shortDefinition="Complication following the procedure", formalDefinition="Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues." )
966    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/condition-code")
967    protected List<CodeableConcept> complication;
968
969    /**
970     * Any complications that occurred during the procedure, or in the immediate post-performance period.
971     */
972    @Child(name = "complicationDetail", type = {Condition.class}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
973    @Description(shortDefinition="A condition that is a result of the procedure", formalDefinition="Any complications that occurred during the procedure, or in the immediate post-performance period." )
974    protected List<Reference> complicationDetail;
975    /**
976     * The actual objects that are the target of the reference (Any complications that occurred during the procedure, or in the immediate post-performance period.)
977     */
978    protected List<Condition> complicationDetailTarget;
979
980
981    /**
982     * If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or could potentially be more complex in which case the CarePlan resource can be used.
983     */
984    @Child(name = "followUp", type = {CodeableConcept.class}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
985    @Description(shortDefinition="Instructions for follow up", formalDefinition="If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or could potentially be more complex in which case the CarePlan resource can be used." )
986    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/procedure-followup")
987    protected List<CodeableConcept> followUp;
988
989    /**
990     * Any other notes and comments about the procedure.
991     */
992    @Child(name = "note", type = {Annotation.class}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
993    @Description(shortDefinition="Additional information about the procedure", formalDefinition="Any other notes and comments about the procedure." )
994    protected List<Annotation> note;
995
996    /**
997     * A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure.
998     */
999    @Child(name = "focalDevice", type = {}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1000    @Description(shortDefinition="Manipulated, implanted, or removed device", formalDefinition="A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure." )
1001    protected List<ProcedureFocalDeviceComponent> focalDevice;
1002
1003    /**
1004     * Identifies medications, devices and any other substance used as part of the procedure.
1005     */
1006    @Child(name = "usedReference", type = {Device.class, Medication.class, Substance.class}, order=25, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1007    @Description(shortDefinition="Items used during procedure", formalDefinition="Identifies medications, devices and any other substance used as part of the procedure." )
1008    protected List<Reference> usedReference;
1009    /**
1010     * The actual objects that are the target of the reference (Identifies medications, devices and any other substance used as part of the procedure.)
1011     */
1012    protected List<Resource> usedReferenceTarget;
1013
1014
1015    /**
1016     * Identifies coded items that were used as part of the procedure.
1017     */
1018    @Child(name = "usedCode", type = {CodeableConcept.class}, order=26, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1019    @Description(shortDefinition="Coded items used during the procedure", formalDefinition="Identifies coded items that were used as part of the procedure." )
1020    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-kind")
1021    protected List<CodeableConcept> usedCode;
1022
1023    private static final long serialVersionUID = 1262412132L;
1024
1025  /**
1026   * Constructor
1027   */
1028    public Procedure() {
1029      super();
1030    }
1031
1032  /**
1033   * Constructor
1034   */
1035    public Procedure(Enumeration<ProcedureStatus> status, Reference subject) {
1036      super();
1037      this.status = status;
1038      this.subject = subject;
1039    }
1040
1041    /**
1042     * @return {@link #identifier} (Business identifiers assigned to this procedure by the performer or other systems which remain constant as the resource is updated and propagates from server to server.)
1043     */
1044    public List<Identifier> getIdentifier() { 
1045      if (this.identifier == null)
1046        this.identifier = new ArrayList<Identifier>();
1047      return this.identifier;
1048    }
1049
1050    /**
1051     * @return Returns a reference to <code>this</code> for easy method chaining
1052     */
1053    public Procedure setIdentifier(List<Identifier> theIdentifier) { 
1054      this.identifier = theIdentifier;
1055      return this;
1056    }
1057
1058    public boolean hasIdentifier() { 
1059      if (this.identifier == null)
1060        return false;
1061      for (Identifier item : this.identifier)
1062        if (!item.isEmpty())
1063          return true;
1064      return false;
1065    }
1066
1067    public Identifier addIdentifier() { //3
1068      Identifier t = new Identifier();
1069      if (this.identifier == null)
1070        this.identifier = new ArrayList<Identifier>();
1071      this.identifier.add(t);
1072      return t;
1073    }
1074
1075    public Procedure addIdentifier(Identifier t) { //3
1076      if (t == null)
1077        return this;
1078      if (this.identifier == null)
1079        this.identifier = new ArrayList<Identifier>();
1080      this.identifier.add(t);
1081      return this;
1082    }
1083
1084    /**
1085     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
1086     */
1087    public Identifier getIdentifierFirstRep() { 
1088      if (getIdentifier().isEmpty()) {
1089        addIdentifier();
1090      }
1091      return getIdentifier().get(0);
1092    }
1093
1094    /**
1095     * @return {@link #instantiates} (A protocol, guideline, orderset or other definition that was adhered to in whole or in part by this procedure.)
1096     */
1097    public List<UriType> getInstantiates() { 
1098      if (this.instantiates == null)
1099        this.instantiates = new ArrayList<UriType>();
1100      return this.instantiates;
1101    }
1102
1103    /**
1104     * @return Returns a reference to <code>this</code> for easy method chaining
1105     */
1106    public Procedure setInstantiates(List<UriType> theInstantiates) { 
1107      this.instantiates = theInstantiates;
1108      return this;
1109    }
1110
1111    public boolean hasInstantiates() { 
1112      if (this.instantiates == null)
1113        return false;
1114      for (UriType item : this.instantiates)
1115        if (!item.isEmpty())
1116          return true;
1117      return false;
1118    }
1119
1120    /**
1121     * @return {@link #instantiates} (A protocol, guideline, orderset or other definition that was adhered to in whole or in part by this procedure.)
1122     */
1123    public UriType addInstantiatesElement() {//2 
1124      UriType t = new UriType();
1125      if (this.instantiates == null)
1126        this.instantiates = new ArrayList<UriType>();
1127      this.instantiates.add(t);
1128      return t;
1129    }
1130
1131    /**
1132     * @param value {@link #instantiates} (A protocol, guideline, orderset or other definition that was adhered to in whole or in part by this procedure.)
1133     */
1134    public Procedure addInstantiates(String value) { //1
1135      UriType t = new UriType();
1136      t.setValue(value);
1137      if (this.instantiates == null)
1138        this.instantiates = new ArrayList<UriType>();
1139      this.instantiates.add(t);
1140      return this;
1141    }
1142
1143    /**
1144     * @param value {@link #instantiates} (A protocol, guideline, orderset or other definition that was adhered to in whole or in part by this procedure.)
1145     */
1146    public boolean hasInstantiates(String value) { 
1147      if (this.instantiates == null)
1148        return false;
1149      for (UriType v : this.instantiates)
1150        if (v.getValue().equals(value)) // uri
1151          return true;
1152      return false;
1153    }
1154
1155    /**
1156     * @return {@link #basedOn} (A reference to a resource that contains details of the request for this procedure.)
1157     */
1158    public List<Reference> getBasedOn() { 
1159      if (this.basedOn == null)
1160        this.basedOn = new ArrayList<Reference>();
1161      return this.basedOn;
1162    }
1163
1164    /**
1165     * @return Returns a reference to <code>this</code> for easy method chaining
1166     */
1167    public Procedure setBasedOn(List<Reference> theBasedOn) { 
1168      this.basedOn = theBasedOn;
1169      return this;
1170    }
1171
1172    public boolean hasBasedOn() { 
1173      if (this.basedOn == null)
1174        return false;
1175      for (Reference item : this.basedOn)
1176        if (!item.isEmpty())
1177          return true;
1178      return false;
1179    }
1180
1181    public Reference addBasedOn() { //3
1182      Reference t = new Reference();
1183      if (this.basedOn == null)
1184        this.basedOn = new ArrayList<Reference>();
1185      this.basedOn.add(t);
1186      return t;
1187    }
1188
1189    public Procedure addBasedOn(Reference t) { //3
1190      if (t == null)
1191        return this;
1192      if (this.basedOn == null)
1193        this.basedOn = new ArrayList<Reference>();
1194      this.basedOn.add(t);
1195      return this;
1196    }
1197
1198    /**
1199     * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist
1200     */
1201    public Reference getBasedOnFirstRep() { 
1202      if (getBasedOn().isEmpty()) {
1203        addBasedOn();
1204      }
1205      return getBasedOn().get(0);
1206    }
1207
1208    /**
1209     * @deprecated Use Reference#setResource(IBaseResource) instead
1210     */
1211    @Deprecated
1212    public List<Resource> getBasedOnTarget() { 
1213      if (this.basedOnTarget == null)
1214        this.basedOnTarget = new ArrayList<Resource>();
1215      return this.basedOnTarget;
1216    }
1217
1218    /**
1219     * @return {@link #partOf} (A larger event of which this particular procedure is a component or step.)
1220     */
1221    public List<Reference> getPartOf() { 
1222      if (this.partOf == null)
1223        this.partOf = new ArrayList<Reference>();
1224      return this.partOf;
1225    }
1226
1227    /**
1228     * @return Returns a reference to <code>this</code> for easy method chaining
1229     */
1230    public Procedure setPartOf(List<Reference> thePartOf) { 
1231      this.partOf = thePartOf;
1232      return this;
1233    }
1234
1235    public boolean hasPartOf() { 
1236      if (this.partOf == null)
1237        return false;
1238      for (Reference item : this.partOf)
1239        if (!item.isEmpty())
1240          return true;
1241      return false;
1242    }
1243
1244    public Reference addPartOf() { //3
1245      Reference t = new Reference();
1246      if (this.partOf == null)
1247        this.partOf = new ArrayList<Reference>();
1248      this.partOf.add(t);
1249      return t;
1250    }
1251
1252    public Procedure addPartOf(Reference t) { //3
1253      if (t == null)
1254        return this;
1255      if (this.partOf == null)
1256        this.partOf = new ArrayList<Reference>();
1257      this.partOf.add(t);
1258      return this;
1259    }
1260
1261    /**
1262     * @return The first repetition of repeating field {@link #partOf}, creating it if it does not already exist
1263     */
1264    public Reference getPartOfFirstRep() { 
1265      if (getPartOf().isEmpty()) {
1266        addPartOf();
1267      }
1268      return getPartOf().get(0);
1269    }
1270
1271    /**
1272     * @deprecated Use Reference#setResource(IBaseResource) instead
1273     */
1274    @Deprecated
1275    public List<Resource> getPartOfTarget() { 
1276      if (this.partOfTarget == null)
1277        this.partOfTarget = new ArrayList<Resource>();
1278      return this.partOfTarget;
1279    }
1280
1281    /**
1282     * @return {@link #status} (A code specifying the state of the procedure. Generally this will be in-progress or completed state.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1283     */
1284    public Enumeration<ProcedureStatus> getStatusElement() { 
1285      if (this.status == null)
1286        if (Configuration.errorOnAutoCreate())
1287          throw new Error("Attempt to auto-create Procedure.status");
1288        else if (Configuration.doAutoCreate())
1289          this.status = new Enumeration<ProcedureStatus>(new ProcedureStatusEnumFactory()); // bb
1290      return this.status;
1291    }
1292
1293    public boolean hasStatusElement() { 
1294      return this.status != null && !this.status.isEmpty();
1295    }
1296
1297    public boolean hasStatus() { 
1298      return this.status != null && !this.status.isEmpty();
1299    }
1300
1301    /**
1302     * @param value {@link #status} (A code specifying the state of the procedure. Generally this will be in-progress or completed state.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1303     */
1304    public Procedure setStatusElement(Enumeration<ProcedureStatus> value) { 
1305      this.status = value;
1306      return this;
1307    }
1308
1309    /**
1310     * @return A code specifying the state of the procedure. Generally this will be in-progress or completed state.
1311     */
1312    public ProcedureStatus getStatus() { 
1313      return this.status == null ? null : this.status.getValue();
1314    }
1315
1316    /**
1317     * @param value A code specifying the state of the procedure. Generally this will be in-progress or completed state.
1318     */
1319    public Procedure setStatus(ProcedureStatus value) { 
1320        if (this.status == null)
1321          this.status = new Enumeration<ProcedureStatus>(new ProcedureStatusEnumFactory());
1322        this.status.setValue(value);
1323      return this;
1324    }
1325
1326    /**
1327     * @return {@link #statusReason} (Captures the reason for the current state of the procedure.)
1328     */
1329    public CodeableConcept getStatusReason() { 
1330      if (this.statusReason == null)
1331        if (Configuration.errorOnAutoCreate())
1332          throw new Error("Attempt to auto-create Procedure.statusReason");
1333        else if (Configuration.doAutoCreate())
1334          this.statusReason = new CodeableConcept(); // cc
1335      return this.statusReason;
1336    }
1337
1338    public boolean hasStatusReason() { 
1339      return this.statusReason != null && !this.statusReason.isEmpty();
1340    }
1341
1342    /**
1343     * @param value {@link #statusReason} (Captures the reason for the current state of the procedure.)
1344     */
1345    public Procedure setStatusReason(CodeableConcept value) { 
1346      this.statusReason = value;
1347      return this;
1348    }
1349
1350    /**
1351     * @return {@link #category} (A code that classifies the procedure for searching, sorting and display purposes (e.g. "Surgical Procedure").)
1352     */
1353    public CodeableConcept getCategory() { 
1354      if (this.category == null)
1355        if (Configuration.errorOnAutoCreate())
1356          throw new Error("Attempt to auto-create Procedure.category");
1357        else if (Configuration.doAutoCreate())
1358          this.category = new CodeableConcept(); // cc
1359      return this.category;
1360    }
1361
1362    public boolean hasCategory() { 
1363      return this.category != null && !this.category.isEmpty();
1364    }
1365
1366    /**
1367     * @param value {@link #category} (A code that classifies the procedure for searching, sorting and display purposes (e.g. "Surgical Procedure").)
1368     */
1369    public Procedure setCategory(CodeableConcept value) { 
1370      this.category = value;
1371      return this;
1372    }
1373
1374    /**
1375     * @return {@link #code} (The specific procedure that is performed. Use text if the exact nature of the procedure cannot be coded (e.g. "Laparoscopic Appendectomy").)
1376     */
1377    public CodeableConcept getCode() { 
1378      if (this.code == null)
1379        if (Configuration.errorOnAutoCreate())
1380          throw new Error("Attempt to auto-create Procedure.code");
1381        else if (Configuration.doAutoCreate())
1382          this.code = new CodeableConcept(); // cc
1383      return this.code;
1384    }
1385
1386    public boolean hasCode() { 
1387      return this.code != null && !this.code.isEmpty();
1388    }
1389
1390    /**
1391     * @param value {@link #code} (The specific procedure that is performed. Use text if the exact nature of the procedure cannot be coded (e.g. "Laparoscopic Appendectomy").)
1392     */
1393    public Procedure setCode(CodeableConcept value) { 
1394      this.code = value;
1395      return this;
1396    }
1397
1398    /**
1399     * @return {@link #subject} (The person, animal or group on which the procedure was performed.)
1400     */
1401    public Reference getSubject() { 
1402      if (this.subject == null)
1403        if (Configuration.errorOnAutoCreate())
1404          throw new Error("Attempt to auto-create Procedure.subject");
1405        else if (Configuration.doAutoCreate())
1406          this.subject = new Reference(); // cc
1407      return this.subject;
1408    }
1409
1410    public boolean hasSubject() { 
1411      return this.subject != null && !this.subject.isEmpty();
1412    }
1413
1414    /**
1415     * @param value {@link #subject} (The person, animal or group on which the procedure was performed.)
1416     */
1417    public Procedure setSubject(Reference value) { 
1418      this.subject = value;
1419      return this;
1420    }
1421
1422    /**
1423     * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person, animal or group on which the procedure was performed.)
1424     */
1425    public Resource getSubjectTarget() { 
1426      return this.subjectTarget;
1427    }
1428
1429    /**
1430     * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person, animal or group on which the procedure was performed.)
1431     */
1432    public Procedure setSubjectTarget(Resource value) { 
1433      this.subjectTarget = value;
1434      return this;
1435    }
1436
1437    /**
1438     * @return {@link #context} (The encounter during which the procedure was performed.)
1439     */
1440    public Reference getContext() { 
1441      if (this.context == null)
1442        if (Configuration.errorOnAutoCreate())
1443          throw new Error("Attempt to auto-create Procedure.context");
1444        else if (Configuration.doAutoCreate())
1445          this.context = new Reference(); // cc
1446      return this.context;
1447    }
1448
1449    public boolean hasContext() { 
1450      return this.context != null && !this.context.isEmpty();
1451    }
1452
1453    /**
1454     * @param value {@link #context} (The encounter during which the procedure was performed.)
1455     */
1456    public Procedure setContext(Reference value) { 
1457      this.context = value;
1458      return this;
1459    }
1460
1461    /**
1462     * @return {@link #context} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The encounter during which the procedure was performed.)
1463     */
1464    public Resource getContextTarget() { 
1465      return this.contextTarget;
1466    }
1467
1468    /**
1469     * @param value {@link #context} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The encounter during which the procedure was performed.)
1470     */
1471    public Procedure setContextTarget(Resource value) { 
1472      this.contextTarget = value;
1473      return this;
1474    }
1475
1476    /**
1477     * @return {@link #performed} (Estimated or actual date, date-time, period, or age when the procedure was performed.  Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.)
1478     */
1479    public Type getPerformed() { 
1480      return this.performed;
1481    }
1482
1483    /**
1484     * @return {@link #performed} (Estimated or actual date, date-time, period, or age when the procedure was performed.  Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.)
1485     */
1486    public DateTimeType getPerformedDateTimeType() throws FHIRException { 
1487      if (this.performed == null)
1488        return null;
1489      if (!(this.performed instanceof DateTimeType))
1490        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.performed.getClass().getName()+" was encountered");
1491      return (DateTimeType) this.performed;
1492    }
1493
1494    public boolean hasPerformedDateTimeType() { 
1495      return this != null && this.performed instanceof DateTimeType;
1496    }
1497
1498    /**
1499     * @return {@link #performed} (Estimated or actual date, date-time, period, or age when the procedure was performed.  Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.)
1500     */
1501    public Period getPerformedPeriod() throws FHIRException { 
1502      if (this.performed == null)
1503        return null;
1504      if (!(this.performed instanceof Period))
1505        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.performed.getClass().getName()+" was encountered");
1506      return (Period) this.performed;
1507    }
1508
1509    public boolean hasPerformedPeriod() { 
1510      return this != null && this.performed instanceof Period;
1511    }
1512
1513    /**
1514     * @return {@link #performed} (Estimated or actual date, date-time, period, or age when the procedure was performed.  Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.)
1515     */
1516    public StringType getPerformedStringType() throws FHIRException { 
1517      if (this.performed == null)
1518        return null;
1519      if (!(this.performed instanceof StringType))
1520        throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.performed.getClass().getName()+" was encountered");
1521      return (StringType) this.performed;
1522    }
1523
1524    public boolean hasPerformedStringType() { 
1525      return this != null && this.performed instanceof StringType;
1526    }
1527
1528    /**
1529     * @return {@link #performed} (Estimated or actual date, date-time, period, or age when the procedure was performed.  Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.)
1530     */
1531    public Age getPerformedAge() throws FHIRException { 
1532      if (this.performed == null)
1533        return null;
1534      if (!(this.performed instanceof Age))
1535        throw new FHIRException("Type mismatch: the type Age was expected, but "+this.performed.getClass().getName()+" was encountered");
1536      return (Age) this.performed;
1537    }
1538
1539    public boolean hasPerformedAge() { 
1540      return this != null && this.performed instanceof Age;
1541    }
1542
1543    /**
1544     * @return {@link #performed} (Estimated or actual date, date-time, period, or age when the procedure was performed.  Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.)
1545     */
1546    public Range getPerformedRange() throws FHIRException { 
1547      if (this.performed == null)
1548        return null;
1549      if (!(this.performed instanceof Range))
1550        throw new FHIRException("Type mismatch: the type Range was expected, but "+this.performed.getClass().getName()+" was encountered");
1551      return (Range) this.performed;
1552    }
1553
1554    public boolean hasPerformedRange() { 
1555      return this != null && this.performed instanceof Range;
1556    }
1557
1558    public boolean hasPerformed() { 
1559      return this.performed != null && !this.performed.isEmpty();
1560    }
1561
1562    /**
1563     * @param value {@link #performed} (Estimated or actual date, date-time, period, or age when the procedure was performed.  Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.)
1564     */
1565    public Procedure setPerformed(Type value) { 
1566      if (value != null && !(value instanceof DateTimeType || value instanceof Period || value instanceof StringType || value instanceof Age || value instanceof Range))
1567        throw new Error("Not the right type for Procedure.performed[x]: "+value.fhirType());
1568      this.performed = value;
1569      return this;
1570    }
1571
1572    /**
1573     * @return {@link #recorder} (Individual who recorded the record and takes responsibility for its content.)
1574     */
1575    public Reference getRecorder() { 
1576      if (this.recorder == null)
1577        if (Configuration.errorOnAutoCreate())
1578          throw new Error("Attempt to auto-create Procedure.recorder");
1579        else if (Configuration.doAutoCreate())
1580          this.recorder = new Reference(); // cc
1581      return this.recorder;
1582    }
1583
1584    public boolean hasRecorder() { 
1585      return this.recorder != null && !this.recorder.isEmpty();
1586    }
1587
1588    /**
1589     * @param value {@link #recorder} (Individual who recorded the record and takes responsibility for its content.)
1590     */
1591    public Procedure setRecorder(Reference value) { 
1592      this.recorder = value;
1593      return this;
1594    }
1595
1596    /**
1597     * @return {@link #recorder} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Individual who recorded the record and takes responsibility for its content.)
1598     */
1599    public Resource getRecorderTarget() { 
1600      return this.recorderTarget;
1601    }
1602
1603    /**
1604     * @param value {@link #recorder} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Individual who recorded the record and takes responsibility for its content.)
1605     */
1606    public Procedure setRecorderTarget(Resource value) { 
1607      this.recorderTarget = value;
1608      return this;
1609    }
1610
1611    /**
1612     * @return {@link #asserter} (Individual who is making the procedure statement.)
1613     */
1614    public Reference getAsserter() { 
1615      if (this.asserter == null)
1616        if (Configuration.errorOnAutoCreate())
1617          throw new Error("Attempt to auto-create Procedure.asserter");
1618        else if (Configuration.doAutoCreate())
1619          this.asserter = new Reference(); // cc
1620      return this.asserter;
1621    }
1622
1623    public boolean hasAsserter() { 
1624      return this.asserter != null && !this.asserter.isEmpty();
1625    }
1626
1627    /**
1628     * @param value {@link #asserter} (Individual who is making the procedure statement.)
1629     */
1630    public Procedure setAsserter(Reference value) { 
1631      this.asserter = value;
1632      return this;
1633    }
1634
1635    /**
1636     * @return {@link #asserter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Individual who is making the procedure statement.)
1637     */
1638    public Resource getAsserterTarget() { 
1639      return this.asserterTarget;
1640    }
1641
1642    /**
1643     * @param value {@link #asserter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Individual who is making the procedure statement.)
1644     */
1645    public Procedure setAsserterTarget(Resource value) { 
1646      this.asserterTarget = value;
1647      return this;
1648    }
1649
1650    /**
1651     * @return {@link #performer} (Limited to 'real' people rather than equipment.)
1652     */
1653    public List<ProcedurePerformerComponent> getPerformer() { 
1654      if (this.performer == null)
1655        this.performer = new ArrayList<ProcedurePerformerComponent>();
1656      return this.performer;
1657    }
1658
1659    /**
1660     * @return Returns a reference to <code>this</code> for easy method chaining
1661     */
1662    public Procedure setPerformer(List<ProcedurePerformerComponent> thePerformer) { 
1663      this.performer = thePerformer;
1664      return this;
1665    }
1666
1667    public boolean hasPerformer() { 
1668      if (this.performer == null)
1669        return false;
1670      for (ProcedurePerformerComponent item : this.performer)
1671        if (!item.isEmpty())
1672          return true;
1673      return false;
1674    }
1675
1676    public ProcedurePerformerComponent addPerformer() { //3
1677      ProcedurePerformerComponent t = new ProcedurePerformerComponent();
1678      if (this.performer == null)
1679        this.performer = new ArrayList<ProcedurePerformerComponent>();
1680      this.performer.add(t);
1681      return t;
1682    }
1683
1684    public Procedure addPerformer(ProcedurePerformerComponent t) { //3
1685      if (t == null)
1686        return this;
1687      if (this.performer == null)
1688        this.performer = new ArrayList<ProcedurePerformerComponent>();
1689      this.performer.add(t);
1690      return this;
1691    }
1692
1693    /**
1694     * @return The first repetition of repeating field {@link #performer}, creating it if it does not already exist
1695     */
1696    public ProcedurePerformerComponent getPerformerFirstRep() { 
1697      if (getPerformer().isEmpty()) {
1698        addPerformer();
1699      }
1700      return getPerformer().get(0);
1701    }
1702
1703    /**
1704     * @return {@link #location} (The location where the procedure actually happened.  E.g. a newborn at home, a tracheostomy at a restaurant.)
1705     */
1706    public Reference getLocation() { 
1707      if (this.location == null)
1708        if (Configuration.errorOnAutoCreate())
1709          throw new Error("Attempt to auto-create Procedure.location");
1710        else if (Configuration.doAutoCreate())
1711          this.location = new Reference(); // cc
1712      return this.location;
1713    }
1714
1715    public boolean hasLocation() { 
1716      return this.location != null && !this.location.isEmpty();
1717    }
1718
1719    /**
1720     * @param value {@link #location} (The location where the procedure actually happened.  E.g. a newborn at home, a tracheostomy at a restaurant.)
1721     */
1722    public Procedure setLocation(Reference value) { 
1723      this.location = value;
1724      return this;
1725    }
1726
1727    /**
1728     * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The location where the procedure actually happened.  E.g. a newborn at home, a tracheostomy at a restaurant.)
1729     */
1730    public Location getLocationTarget() { 
1731      if (this.locationTarget == null)
1732        if (Configuration.errorOnAutoCreate())
1733          throw new Error("Attempt to auto-create Procedure.location");
1734        else if (Configuration.doAutoCreate())
1735          this.locationTarget = new Location(); // aa
1736      return this.locationTarget;
1737    }
1738
1739    /**
1740     * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The location where the procedure actually happened.  E.g. a newborn at home, a tracheostomy at a restaurant.)
1741     */
1742    public Procedure setLocationTarget(Location value) { 
1743      this.locationTarget = value;
1744      return this;
1745    }
1746
1747    /**
1748     * @return {@link #reasonCode} (The coded reason why the procedure was performed. This may be coded entity of some type, or may simply be present as text.)
1749     */
1750    public List<CodeableConcept> getReasonCode() { 
1751      if (this.reasonCode == null)
1752        this.reasonCode = new ArrayList<CodeableConcept>();
1753      return this.reasonCode;
1754    }
1755
1756    /**
1757     * @return Returns a reference to <code>this</code> for easy method chaining
1758     */
1759    public Procedure setReasonCode(List<CodeableConcept> theReasonCode) { 
1760      this.reasonCode = theReasonCode;
1761      return this;
1762    }
1763
1764    public boolean hasReasonCode() { 
1765      if (this.reasonCode == null)
1766        return false;
1767      for (CodeableConcept item : this.reasonCode)
1768        if (!item.isEmpty())
1769          return true;
1770      return false;
1771    }
1772
1773    public CodeableConcept addReasonCode() { //3
1774      CodeableConcept t = new CodeableConcept();
1775      if (this.reasonCode == null)
1776        this.reasonCode = new ArrayList<CodeableConcept>();
1777      this.reasonCode.add(t);
1778      return t;
1779    }
1780
1781    public Procedure addReasonCode(CodeableConcept t) { //3
1782      if (t == null)
1783        return this;
1784      if (this.reasonCode == null)
1785        this.reasonCode = new ArrayList<CodeableConcept>();
1786      this.reasonCode.add(t);
1787      return this;
1788    }
1789
1790    /**
1791     * @return The first repetition of repeating field {@link #reasonCode}, creating it if it does not already exist
1792     */
1793    public CodeableConcept getReasonCodeFirstRep() { 
1794      if (getReasonCode().isEmpty()) {
1795        addReasonCode();
1796      }
1797      return getReasonCode().get(0);
1798    }
1799
1800    /**
1801     * @return {@link #reasonReference} (The justification of why the procedure was performed.)
1802     */
1803    public List<Reference> getReasonReference() { 
1804      if (this.reasonReference == null)
1805        this.reasonReference = new ArrayList<Reference>();
1806      return this.reasonReference;
1807    }
1808
1809    /**
1810     * @return Returns a reference to <code>this</code> for easy method chaining
1811     */
1812    public Procedure setReasonReference(List<Reference> theReasonReference) { 
1813      this.reasonReference = theReasonReference;
1814      return this;
1815    }
1816
1817    public boolean hasReasonReference() { 
1818      if (this.reasonReference == null)
1819        return false;
1820      for (Reference item : this.reasonReference)
1821        if (!item.isEmpty())
1822          return true;
1823      return false;
1824    }
1825
1826    public Reference addReasonReference() { //3
1827      Reference t = new Reference();
1828      if (this.reasonReference == null)
1829        this.reasonReference = new ArrayList<Reference>();
1830      this.reasonReference.add(t);
1831      return t;
1832    }
1833
1834    public Procedure addReasonReference(Reference t) { //3
1835      if (t == null)
1836        return this;
1837      if (this.reasonReference == null)
1838        this.reasonReference = new ArrayList<Reference>();
1839      this.reasonReference.add(t);
1840      return this;
1841    }
1842
1843    /**
1844     * @return The first repetition of repeating field {@link #reasonReference}, creating it if it does not already exist
1845     */
1846    public Reference getReasonReferenceFirstRep() { 
1847      if (getReasonReference().isEmpty()) {
1848        addReasonReference();
1849      }
1850      return getReasonReference().get(0);
1851    }
1852
1853    /**
1854     * @deprecated Use Reference#setResource(IBaseResource) instead
1855     */
1856    @Deprecated
1857    public List<Resource> getReasonReferenceTarget() { 
1858      if (this.reasonReferenceTarget == null)
1859        this.reasonReferenceTarget = new ArrayList<Resource>();
1860      return this.reasonReferenceTarget;
1861    }
1862
1863    /**
1864     * @return {@link #bodySite} (Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.)
1865     */
1866    public List<CodeableConcept> getBodySite() { 
1867      if (this.bodySite == null)
1868        this.bodySite = new ArrayList<CodeableConcept>();
1869      return this.bodySite;
1870    }
1871
1872    /**
1873     * @return Returns a reference to <code>this</code> for easy method chaining
1874     */
1875    public Procedure setBodySite(List<CodeableConcept> theBodySite) { 
1876      this.bodySite = theBodySite;
1877      return this;
1878    }
1879
1880    public boolean hasBodySite() { 
1881      if (this.bodySite == null)
1882        return false;
1883      for (CodeableConcept item : this.bodySite)
1884        if (!item.isEmpty())
1885          return true;
1886      return false;
1887    }
1888
1889    public CodeableConcept addBodySite() { //3
1890      CodeableConcept t = new CodeableConcept();
1891      if (this.bodySite == null)
1892        this.bodySite = new ArrayList<CodeableConcept>();
1893      this.bodySite.add(t);
1894      return t;
1895    }
1896
1897    public Procedure addBodySite(CodeableConcept t) { //3
1898      if (t == null)
1899        return this;
1900      if (this.bodySite == null)
1901        this.bodySite = new ArrayList<CodeableConcept>();
1902      this.bodySite.add(t);
1903      return this;
1904    }
1905
1906    /**
1907     * @return The first repetition of repeating field {@link #bodySite}, creating it if it does not already exist
1908     */
1909    public CodeableConcept getBodySiteFirstRep() { 
1910      if (getBodySite().isEmpty()) {
1911        addBodySite();
1912      }
1913      return getBodySite().get(0);
1914    }
1915
1916    /**
1917     * @return {@link #outcome} (The outcome of the procedure - did it resolve reasons for the procedure being performed?)
1918     */
1919    public CodeableConcept getOutcome() { 
1920      if (this.outcome == null)
1921        if (Configuration.errorOnAutoCreate())
1922          throw new Error("Attempt to auto-create Procedure.outcome");
1923        else if (Configuration.doAutoCreate())
1924          this.outcome = new CodeableConcept(); // cc
1925      return this.outcome;
1926    }
1927
1928    public boolean hasOutcome() { 
1929      return this.outcome != null && !this.outcome.isEmpty();
1930    }
1931
1932    /**
1933     * @param value {@link #outcome} (The outcome of the procedure - did it resolve reasons for the procedure being performed?)
1934     */
1935    public Procedure setOutcome(CodeableConcept value) { 
1936      this.outcome = value;
1937      return this;
1938    }
1939
1940    /**
1941     * @return {@link #report} (This could be a histology result, pathology report, surgical report, etc.)
1942     */
1943    public List<Reference> getReport() { 
1944      if (this.report == null)
1945        this.report = new ArrayList<Reference>();
1946      return this.report;
1947    }
1948
1949    /**
1950     * @return Returns a reference to <code>this</code> for easy method chaining
1951     */
1952    public Procedure setReport(List<Reference> theReport) { 
1953      this.report = theReport;
1954      return this;
1955    }
1956
1957    public boolean hasReport() { 
1958      if (this.report == null)
1959        return false;
1960      for (Reference item : this.report)
1961        if (!item.isEmpty())
1962          return true;
1963      return false;
1964    }
1965
1966    public Reference addReport() { //3
1967      Reference t = new Reference();
1968      if (this.report == null)
1969        this.report = new ArrayList<Reference>();
1970      this.report.add(t);
1971      return t;
1972    }
1973
1974    public Procedure addReport(Reference t) { //3
1975      if (t == null)
1976        return this;
1977      if (this.report == null)
1978        this.report = new ArrayList<Reference>();
1979      this.report.add(t);
1980      return this;
1981    }
1982
1983    /**
1984     * @return The first repetition of repeating field {@link #report}, creating it if it does not already exist
1985     */
1986    public Reference getReportFirstRep() { 
1987      if (getReport().isEmpty()) {
1988        addReport();
1989      }
1990      return getReport().get(0);
1991    }
1992
1993    /**
1994     * @deprecated Use Reference#setResource(IBaseResource) instead
1995     */
1996    @Deprecated
1997    public List<Resource> getReportTarget() { 
1998      if (this.reportTarget == null)
1999        this.reportTarget = new ArrayList<Resource>();
2000      return this.reportTarget;
2001    }
2002
2003    /**
2004     * @return {@link #complication} (Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues.)
2005     */
2006    public List<CodeableConcept> getComplication() { 
2007      if (this.complication == null)
2008        this.complication = new ArrayList<CodeableConcept>();
2009      return this.complication;
2010    }
2011
2012    /**
2013     * @return Returns a reference to <code>this</code> for easy method chaining
2014     */
2015    public Procedure setComplication(List<CodeableConcept> theComplication) { 
2016      this.complication = theComplication;
2017      return this;
2018    }
2019
2020    public boolean hasComplication() { 
2021      if (this.complication == null)
2022        return false;
2023      for (CodeableConcept item : this.complication)
2024        if (!item.isEmpty())
2025          return true;
2026      return false;
2027    }
2028
2029    public CodeableConcept addComplication() { //3
2030      CodeableConcept t = new CodeableConcept();
2031      if (this.complication == null)
2032        this.complication = new ArrayList<CodeableConcept>();
2033      this.complication.add(t);
2034      return t;
2035    }
2036
2037    public Procedure addComplication(CodeableConcept t) { //3
2038      if (t == null)
2039        return this;
2040      if (this.complication == null)
2041        this.complication = new ArrayList<CodeableConcept>();
2042      this.complication.add(t);
2043      return this;
2044    }
2045
2046    /**
2047     * @return The first repetition of repeating field {@link #complication}, creating it if it does not already exist
2048     */
2049    public CodeableConcept getComplicationFirstRep() { 
2050      if (getComplication().isEmpty()) {
2051        addComplication();
2052      }
2053      return getComplication().get(0);
2054    }
2055
2056    /**
2057     * @return {@link #complicationDetail} (Any complications that occurred during the procedure, or in the immediate post-performance period.)
2058     */
2059    public List<Reference> getComplicationDetail() { 
2060      if (this.complicationDetail == null)
2061        this.complicationDetail = new ArrayList<Reference>();
2062      return this.complicationDetail;
2063    }
2064
2065    /**
2066     * @return Returns a reference to <code>this</code> for easy method chaining
2067     */
2068    public Procedure setComplicationDetail(List<Reference> theComplicationDetail) { 
2069      this.complicationDetail = theComplicationDetail;
2070      return this;
2071    }
2072
2073    public boolean hasComplicationDetail() { 
2074      if (this.complicationDetail == null)
2075        return false;
2076      for (Reference item : this.complicationDetail)
2077        if (!item.isEmpty())
2078          return true;
2079      return false;
2080    }
2081
2082    public Reference addComplicationDetail() { //3
2083      Reference t = new Reference();
2084      if (this.complicationDetail == null)
2085        this.complicationDetail = new ArrayList<Reference>();
2086      this.complicationDetail.add(t);
2087      return t;
2088    }
2089
2090    public Procedure addComplicationDetail(Reference t) { //3
2091      if (t == null)
2092        return this;
2093      if (this.complicationDetail == null)
2094        this.complicationDetail = new ArrayList<Reference>();
2095      this.complicationDetail.add(t);
2096      return this;
2097    }
2098
2099    /**
2100     * @return The first repetition of repeating field {@link #complicationDetail}, creating it if it does not already exist
2101     */
2102    public Reference getComplicationDetailFirstRep() { 
2103      if (getComplicationDetail().isEmpty()) {
2104        addComplicationDetail();
2105      }
2106      return getComplicationDetail().get(0);
2107    }
2108
2109    /**
2110     * @deprecated Use Reference#setResource(IBaseResource) instead
2111     */
2112    @Deprecated
2113    public List<Condition> getComplicationDetailTarget() { 
2114      if (this.complicationDetailTarget == null)
2115        this.complicationDetailTarget = new ArrayList<Condition>();
2116      return this.complicationDetailTarget;
2117    }
2118
2119    /**
2120     * @deprecated Use Reference#setResource(IBaseResource) instead
2121     */
2122    @Deprecated
2123    public Condition addComplicationDetailTarget() { 
2124      Condition r = new Condition();
2125      if (this.complicationDetailTarget == null)
2126        this.complicationDetailTarget = new ArrayList<Condition>();
2127      this.complicationDetailTarget.add(r);
2128      return r;
2129    }
2130
2131    /**
2132     * @return {@link #followUp} (If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or could potentially be more complex in which case the CarePlan resource can be used.)
2133     */
2134    public List<CodeableConcept> getFollowUp() { 
2135      if (this.followUp == null)
2136        this.followUp = new ArrayList<CodeableConcept>();
2137      return this.followUp;
2138    }
2139
2140    /**
2141     * @return Returns a reference to <code>this</code> for easy method chaining
2142     */
2143    public Procedure setFollowUp(List<CodeableConcept> theFollowUp) { 
2144      this.followUp = theFollowUp;
2145      return this;
2146    }
2147
2148    public boolean hasFollowUp() { 
2149      if (this.followUp == null)
2150        return false;
2151      for (CodeableConcept item : this.followUp)
2152        if (!item.isEmpty())
2153          return true;
2154      return false;
2155    }
2156
2157    public CodeableConcept addFollowUp() { //3
2158      CodeableConcept t = new CodeableConcept();
2159      if (this.followUp == null)
2160        this.followUp = new ArrayList<CodeableConcept>();
2161      this.followUp.add(t);
2162      return t;
2163    }
2164
2165    public Procedure addFollowUp(CodeableConcept t) { //3
2166      if (t == null)
2167        return this;
2168      if (this.followUp == null)
2169        this.followUp = new ArrayList<CodeableConcept>();
2170      this.followUp.add(t);
2171      return this;
2172    }
2173
2174    /**
2175     * @return The first repetition of repeating field {@link #followUp}, creating it if it does not already exist
2176     */
2177    public CodeableConcept getFollowUpFirstRep() { 
2178      if (getFollowUp().isEmpty()) {
2179        addFollowUp();
2180      }
2181      return getFollowUp().get(0);
2182    }
2183
2184    /**
2185     * @return {@link #note} (Any other notes and comments about the procedure.)
2186     */
2187    public List<Annotation> getNote() { 
2188      if (this.note == null)
2189        this.note = new ArrayList<Annotation>();
2190      return this.note;
2191    }
2192
2193    /**
2194     * @return Returns a reference to <code>this</code> for easy method chaining
2195     */
2196    public Procedure setNote(List<Annotation> theNote) { 
2197      this.note = theNote;
2198      return this;
2199    }
2200
2201    public boolean hasNote() { 
2202      if (this.note == null)
2203        return false;
2204      for (Annotation item : this.note)
2205        if (!item.isEmpty())
2206          return true;
2207      return false;
2208    }
2209
2210    public Annotation addNote() { //3
2211      Annotation t = new Annotation();
2212      if (this.note == null)
2213        this.note = new ArrayList<Annotation>();
2214      this.note.add(t);
2215      return t;
2216    }
2217
2218    public Procedure addNote(Annotation t) { //3
2219      if (t == null)
2220        return this;
2221      if (this.note == null)
2222        this.note = new ArrayList<Annotation>();
2223      this.note.add(t);
2224      return this;
2225    }
2226
2227    /**
2228     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist
2229     */
2230    public Annotation getNoteFirstRep() { 
2231      if (getNote().isEmpty()) {
2232        addNote();
2233      }
2234      return getNote().get(0);
2235    }
2236
2237    /**
2238     * @return {@link #focalDevice} (A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure.)
2239     */
2240    public List<ProcedureFocalDeviceComponent> getFocalDevice() { 
2241      if (this.focalDevice == null)
2242        this.focalDevice = new ArrayList<ProcedureFocalDeviceComponent>();
2243      return this.focalDevice;
2244    }
2245
2246    /**
2247     * @return Returns a reference to <code>this</code> for easy method chaining
2248     */
2249    public Procedure setFocalDevice(List<ProcedureFocalDeviceComponent> theFocalDevice) { 
2250      this.focalDevice = theFocalDevice;
2251      return this;
2252    }
2253
2254    public boolean hasFocalDevice() { 
2255      if (this.focalDevice == null)
2256        return false;
2257      for (ProcedureFocalDeviceComponent item : this.focalDevice)
2258        if (!item.isEmpty())
2259          return true;
2260      return false;
2261    }
2262
2263    public ProcedureFocalDeviceComponent addFocalDevice() { //3
2264      ProcedureFocalDeviceComponent t = new ProcedureFocalDeviceComponent();
2265      if (this.focalDevice == null)
2266        this.focalDevice = new ArrayList<ProcedureFocalDeviceComponent>();
2267      this.focalDevice.add(t);
2268      return t;
2269    }
2270
2271    public Procedure addFocalDevice(ProcedureFocalDeviceComponent t) { //3
2272      if (t == null)
2273        return this;
2274      if (this.focalDevice == null)
2275        this.focalDevice = new ArrayList<ProcedureFocalDeviceComponent>();
2276      this.focalDevice.add(t);
2277      return this;
2278    }
2279
2280    /**
2281     * @return The first repetition of repeating field {@link #focalDevice}, creating it if it does not already exist
2282     */
2283    public ProcedureFocalDeviceComponent getFocalDeviceFirstRep() { 
2284      if (getFocalDevice().isEmpty()) {
2285        addFocalDevice();
2286      }
2287      return getFocalDevice().get(0);
2288    }
2289
2290    /**
2291     * @return {@link #usedReference} (Identifies medications, devices and any other substance used as part of the procedure.)
2292     */
2293    public List<Reference> getUsedReference() { 
2294      if (this.usedReference == null)
2295        this.usedReference = new ArrayList<Reference>();
2296      return this.usedReference;
2297    }
2298
2299    /**
2300     * @return Returns a reference to <code>this</code> for easy method chaining
2301     */
2302    public Procedure setUsedReference(List<Reference> theUsedReference) { 
2303      this.usedReference = theUsedReference;
2304      return this;
2305    }
2306
2307    public boolean hasUsedReference() { 
2308      if (this.usedReference == null)
2309        return false;
2310      for (Reference item : this.usedReference)
2311        if (!item.isEmpty())
2312          return true;
2313      return false;
2314    }
2315
2316    public Reference addUsedReference() { //3
2317      Reference t = new Reference();
2318      if (this.usedReference == null)
2319        this.usedReference = new ArrayList<Reference>();
2320      this.usedReference.add(t);
2321      return t;
2322    }
2323
2324    public Procedure addUsedReference(Reference t) { //3
2325      if (t == null)
2326        return this;
2327      if (this.usedReference == null)
2328        this.usedReference = new ArrayList<Reference>();
2329      this.usedReference.add(t);
2330      return this;
2331    }
2332
2333    /**
2334     * @return The first repetition of repeating field {@link #usedReference}, creating it if it does not already exist
2335     */
2336    public Reference getUsedReferenceFirstRep() { 
2337      if (getUsedReference().isEmpty()) {
2338        addUsedReference();
2339      }
2340      return getUsedReference().get(0);
2341    }
2342
2343    /**
2344     * @deprecated Use Reference#setResource(IBaseResource) instead
2345     */
2346    @Deprecated
2347    public List<Resource> getUsedReferenceTarget() { 
2348      if (this.usedReferenceTarget == null)
2349        this.usedReferenceTarget = new ArrayList<Resource>();
2350      return this.usedReferenceTarget;
2351    }
2352
2353    /**
2354     * @return {@link #usedCode} (Identifies coded items that were used as part of the procedure.)
2355     */
2356    public List<CodeableConcept> getUsedCode() { 
2357      if (this.usedCode == null)
2358        this.usedCode = new ArrayList<CodeableConcept>();
2359      return this.usedCode;
2360    }
2361
2362    /**
2363     * @return Returns a reference to <code>this</code> for easy method chaining
2364     */
2365    public Procedure setUsedCode(List<CodeableConcept> theUsedCode) { 
2366      this.usedCode = theUsedCode;
2367      return this;
2368    }
2369
2370    public boolean hasUsedCode() { 
2371      if (this.usedCode == null)
2372        return false;
2373      for (CodeableConcept item : this.usedCode)
2374        if (!item.isEmpty())
2375          return true;
2376      return false;
2377    }
2378
2379    public CodeableConcept addUsedCode() { //3
2380      CodeableConcept t = new CodeableConcept();
2381      if (this.usedCode == null)
2382        this.usedCode = new ArrayList<CodeableConcept>();
2383      this.usedCode.add(t);
2384      return t;
2385    }
2386
2387    public Procedure addUsedCode(CodeableConcept t) { //3
2388      if (t == null)
2389        return this;
2390      if (this.usedCode == null)
2391        this.usedCode = new ArrayList<CodeableConcept>();
2392      this.usedCode.add(t);
2393      return this;
2394    }
2395
2396    /**
2397     * @return The first repetition of repeating field {@link #usedCode}, creating it if it does not already exist
2398     */
2399    public CodeableConcept getUsedCodeFirstRep() { 
2400      if (getUsedCode().isEmpty()) {
2401        addUsedCode();
2402      }
2403      return getUsedCode().get(0);
2404    }
2405
2406      protected void listChildren(List<Property> children) {
2407        super.listChildren(children);
2408        children.add(new Property("identifier", "Identifier", "Business identifiers assigned to this procedure by the performer or other systems which remain constant as the resource is updated and propagates from server to server.", 0, java.lang.Integer.MAX_VALUE, identifier));
2409        children.add(new Property("instantiates", "uri", "A protocol, guideline, orderset or other definition that was adhered to in whole or in part by this procedure.", 0, java.lang.Integer.MAX_VALUE, instantiates));
2410        children.add(new Property("basedOn", "Reference(CarePlan|ServiceRequest)", "A reference to a resource that contains details of the request for this procedure.", 0, java.lang.Integer.MAX_VALUE, basedOn));
2411        children.add(new Property("partOf", "Reference(Procedure|Observation|MedicationAdministration)", "A larger event of which this particular procedure is a component or step.", 0, java.lang.Integer.MAX_VALUE, partOf));
2412        children.add(new Property("status", "code", "A code specifying the state of the procedure. Generally this will be in-progress or completed state.", 0, 1, status));
2413        children.add(new Property("statusReason", "CodeableConcept", "Captures the reason for the current state of the procedure.", 0, 1, statusReason));
2414        children.add(new Property("category", "CodeableConcept", "A code that classifies the procedure for searching, sorting and display purposes (e.g. \"Surgical Procedure\").", 0, 1, category));
2415        children.add(new Property("code", "CodeableConcept", "The specific procedure that is performed. Use text if the exact nature of the procedure cannot be coded (e.g. \"Laparoscopic Appendectomy\").", 0, 1, code));
2416        children.add(new Property("subject", "Reference(Patient|Group)", "The person, animal or group on which the procedure was performed.", 0, 1, subject));
2417        children.add(new Property("context", "Reference(Encounter|EpisodeOfCare)", "The encounter during which the procedure was performed.", 0, 1, context));
2418        children.add(new Property("performed[x]", "dateTime|Period|string|Age|Range", "Estimated or actual date, date-time, period, or age when the procedure was performed.  Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.", 0, 1, performed));
2419        children.add(new Property("recorder", "Reference(Patient|RelatedPerson|Practitioner|PractitionerRole)", "Individual who recorded the record and takes responsibility for its content.", 0, 1, recorder));
2420        children.add(new Property("asserter", "Reference(Patient|RelatedPerson|Practitioner|PractitionerRole)", "Individual who is making the procedure statement.", 0, 1, asserter));
2421        children.add(new Property("performer", "", "Limited to 'real' people rather than equipment.", 0, java.lang.Integer.MAX_VALUE, performer));
2422        children.add(new Property("location", "Reference(Location)", "The location where the procedure actually happened.  E.g. a newborn at home, a tracheostomy at a restaurant.", 0, 1, location));
2423        children.add(new Property("reasonCode", "CodeableConcept", "The coded reason why the procedure was performed. This may be coded entity of some type, or may simply be present as text.", 0, java.lang.Integer.MAX_VALUE, reasonCode));
2424        children.add(new Property("reasonReference", "Reference(Condition|Observation|Procedure|DiagnosticReport|DocumentReference)", "The justification of why the procedure was performed.", 0, java.lang.Integer.MAX_VALUE, reasonReference));
2425        children.add(new Property("bodySite", "CodeableConcept", "Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.", 0, java.lang.Integer.MAX_VALUE, bodySite));
2426        children.add(new Property("outcome", "CodeableConcept", "The outcome of the procedure - did it resolve reasons for the procedure being performed?", 0, 1, outcome));
2427        children.add(new Property("report", "Reference(DiagnosticReport|DocumentReference|Composition)", "This could be a histology result, pathology report, surgical report, etc.", 0, java.lang.Integer.MAX_VALUE, report));
2428        children.add(new Property("complication", "CodeableConcept", "Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues.", 0, java.lang.Integer.MAX_VALUE, complication));
2429        children.add(new Property("complicationDetail", "Reference(Condition)", "Any complications that occurred during the procedure, or in the immediate post-performance period.", 0, java.lang.Integer.MAX_VALUE, complicationDetail));
2430        children.add(new Property("followUp", "CodeableConcept", "If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or could potentially be more complex in which case the CarePlan resource can be used.", 0, java.lang.Integer.MAX_VALUE, followUp));
2431        children.add(new Property("note", "Annotation", "Any other notes and comments about the procedure.", 0, java.lang.Integer.MAX_VALUE, note));
2432        children.add(new Property("focalDevice", "", "A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure.", 0, java.lang.Integer.MAX_VALUE, focalDevice));
2433        children.add(new Property("usedReference", "Reference(Device|Medication|Substance)", "Identifies medications, devices and any other substance used as part of the procedure.", 0, java.lang.Integer.MAX_VALUE, usedReference));
2434        children.add(new Property("usedCode", "CodeableConcept", "Identifies coded items that were used as part of the procedure.", 0, java.lang.Integer.MAX_VALUE, usedCode));
2435      }
2436
2437      @Override
2438      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2439        switch (_hash) {
2440        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Business identifiers assigned to this procedure by the performer or other systems which remain constant as the resource is updated and propagates from server to server.", 0, java.lang.Integer.MAX_VALUE, identifier);
2441        case -246883639: /*instantiates*/  return new Property("instantiates", "uri", "A protocol, guideline, orderset or other definition that was adhered to in whole or in part by this procedure.", 0, java.lang.Integer.MAX_VALUE, instantiates);
2442        case -332612366: /*basedOn*/  return new Property("basedOn", "Reference(CarePlan|ServiceRequest)", "A reference to a resource that contains details of the request for this procedure.", 0, java.lang.Integer.MAX_VALUE, basedOn);
2443        case -995410646: /*partOf*/  return new Property("partOf", "Reference(Procedure|Observation|MedicationAdministration)", "A larger event of which this particular procedure is a component or step.", 0, java.lang.Integer.MAX_VALUE, partOf);
2444        case -892481550: /*status*/  return new Property("status", "code", "A code specifying the state of the procedure. Generally this will be in-progress or completed state.", 0, 1, status);
2445        case 2051346646: /*statusReason*/  return new Property("statusReason", "CodeableConcept", "Captures the reason for the current state of the procedure.", 0, 1, statusReason);
2446        case 50511102: /*category*/  return new Property("category", "CodeableConcept", "A code that classifies the procedure for searching, sorting and display purposes (e.g. \"Surgical Procedure\").", 0, 1, category);
2447        case 3059181: /*code*/  return new Property("code", "CodeableConcept", "The specific procedure that is performed. Use text if the exact nature of the procedure cannot be coded (e.g. \"Laparoscopic Appendectomy\").", 0, 1, code);
2448        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group)", "The person, animal or group on which the procedure was performed.", 0, 1, subject);
2449        case 951530927: /*context*/  return new Property("context", "Reference(Encounter|EpisodeOfCare)", "The encounter during which the procedure was performed.", 0, 1, context);
2450        case 1355984064: /*performed[x]*/  return new Property("performed[x]", "dateTime|Period|string|Age|Range", "Estimated or actual date, date-time, period, or age when the procedure was performed.  Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.", 0, 1, performed);
2451        case 481140672: /*performed*/  return new Property("performed[x]", "dateTime|Period|string|Age|Range", "Estimated or actual date, date-time, period, or age when the procedure was performed.  Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.", 0, 1, performed);
2452        case 1118270331: /*performedDateTime*/  return new Property("performed[x]", "dateTime|Period|string|Age|Range", "Estimated or actual date, date-time, period, or age when the procedure was performed.  Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.", 0, 1, performed);
2453        case 1622094241: /*performedPeriod*/  return new Property("performed[x]", "dateTime|Period|string|Age|Range", "Estimated or actual date, date-time, period, or age when the procedure was performed.  Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.", 0, 1, performed);
2454        case 1721834481: /*performedString*/  return new Property("performed[x]", "dateTime|Period|string|Age|Range", "Estimated or actual date, date-time, period, or age when the procedure was performed.  Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.", 0, 1, performed);
2455        case 1355958559: /*performedAge*/  return new Property("performed[x]", "dateTime|Period|string|Age|Range", "Estimated or actual date, date-time, period, or age when the procedure was performed.  Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.", 0, 1, performed);
2456        case 1716617565: /*performedRange*/  return new Property("performed[x]", "dateTime|Period|string|Age|Range", "Estimated or actual date, date-time, period, or age when the procedure was performed.  Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.", 0, 1, performed);
2457        case -799233858: /*recorder*/  return new Property("recorder", "Reference(Patient|RelatedPerson|Practitioner|PractitionerRole)", "Individual who recorded the record and takes responsibility for its content.", 0, 1, recorder);
2458        case -373242253: /*asserter*/  return new Property("asserter", "Reference(Patient|RelatedPerson|Practitioner|PractitionerRole)", "Individual who is making the procedure statement.", 0, 1, asserter);
2459        case 481140686: /*performer*/  return new Property("performer", "", "Limited to 'real' people rather than equipment.", 0, java.lang.Integer.MAX_VALUE, performer);
2460        case 1901043637: /*location*/  return new Property("location", "Reference(Location)", "The location where the procedure actually happened.  E.g. a newborn at home, a tracheostomy at a restaurant.", 0, 1, location);
2461        case 722137681: /*reasonCode*/  return new Property("reasonCode", "CodeableConcept", "The coded reason why the procedure was performed. This may be coded entity of some type, or may simply be present as text.", 0, java.lang.Integer.MAX_VALUE, reasonCode);
2462        case -1146218137: /*reasonReference*/  return new Property("reasonReference", "Reference(Condition|Observation|Procedure|DiagnosticReport|DocumentReference)", "The justification of why the procedure was performed.", 0, java.lang.Integer.MAX_VALUE, reasonReference);
2463        case 1702620169: /*bodySite*/  return new Property("bodySite", "CodeableConcept", "Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.", 0, java.lang.Integer.MAX_VALUE, bodySite);
2464        case -1106507950: /*outcome*/  return new Property("outcome", "CodeableConcept", "The outcome of the procedure - did it resolve reasons for the procedure being performed?", 0, 1, outcome);
2465        case -934521548: /*report*/  return new Property("report", "Reference(DiagnosticReport|DocumentReference|Composition)", "This could be a histology result, pathology report, surgical report, etc.", 0, java.lang.Integer.MAX_VALUE, report);
2466        case -1644401602: /*complication*/  return new Property("complication", "CodeableConcept", "Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues.", 0, java.lang.Integer.MAX_VALUE, complication);
2467        case -1685272017: /*complicationDetail*/  return new Property("complicationDetail", "Reference(Condition)", "Any complications that occurred during the procedure, or in the immediate post-performance period.", 0, java.lang.Integer.MAX_VALUE, complicationDetail);
2468        case 301801004: /*followUp*/  return new Property("followUp", "CodeableConcept", "If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or could potentially be more complex in which case the CarePlan resource can be used.", 0, java.lang.Integer.MAX_VALUE, followUp);
2469        case 3387378: /*note*/  return new Property("note", "Annotation", "Any other notes and comments about the procedure.", 0, java.lang.Integer.MAX_VALUE, note);
2470        case -1129235173: /*focalDevice*/  return new Property("focalDevice", "", "A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure.", 0, java.lang.Integer.MAX_VALUE, focalDevice);
2471        case -504932338: /*usedReference*/  return new Property("usedReference", "Reference(Device|Medication|Substance)", "Identifies medications, devices and any other substance used as part of the procedure.", 0, java.lang.Integer.MAX_VALUE, usedReference);
2472        case -279910582: /*usedCode*/  return new Property("usedCode", "CodeableConcept", "Identifies coded items that were used as part of the procedure.", 0, java.lang.Integer.MAX_VALUE, usedCode);
2473        default: return super.getNamedProperty(_hash, _name, _checkValid);
2474        }
2475
2476      }
2477
2478      @Override
2479      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2480        switch (hash) {
2481        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2482        case -246883639: /*instantiates*/ return this.instantiates == null ? new Base[0] : this.instantiates.toArray(new Base[this.instantiates.size()]); // UriType
2483        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
2484        case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : this.partOf.toArray(new Base[this.partOf.size()]); // Reference
2485        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<ProcedureStatus>
2486        case 2051346646: /*statusReason*/ return this.statusReason == null ? new Base[0] : new Base[] {this.statusReason}; // CodeableConcept
2487        case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept
2488        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
2489        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
2490        case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // Reference
2491        case 481140672: /*performed*/ return this.performed == null ? new Base[0] : new Base[] {this.performed}; // Type
2492        case -799233858: /*recorder*/ return this.recorder == null ? new Base[0] : new Base[] {this.recorder}; // Reference
2493        case -373242253: /*asserter*/ return this.asserter == null ? new Base[0] : new Base[] {this.asserter}; // Reference
2494        case 481140686: /*performer*/ return this.performer == null ? new Base[0] : this.performer.toArray(new Base[this.performer.size()]); // ProcedurePerformerComponent
2495        case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference
2496        case 722137681: /*reasonCode*/ return this.reasonCode == null ? new Base[0] : this.reasonCode.toArray(new Base[this.reasonCode.size()]); // CodeableConcept
2497        case -1146218137: /*reasonReference*/ return this.reasonReference == null ? new Base[0] : this.reasonReference.toArray(new Base[this.reasonReference.size()]); // Reference
2498        case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : this.bodySite.toArray(new Base[this.bodySite.size()]); // CodeableConcept
2499        case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // CodeableConcept
2500        case -934521548: /*report*/ return this.report == null ? new Base[0] : this.report.toArray(new Base[this.report.size()]); // Reference
2501        case -1644401602: /*complication*/ return this.complication == null ? new Base[0] : this.complication.toArray(new Base[this.complication.size()]); // CodeableConcept
2502        case -1685272017: /*complicationDetail*/ return this.complicationDetail == null ? new Base[0] : this.complicationDetail.toArray(new Base[this.complicationDetail.size()]); // Reference
2503        case 301801004: /*followUp*/ return this.followUp == null ? new Base[0] : this.followUp.toArray(new Base[this.followUp.size()]); // CodeableConcept
2504        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
2505        case -1129235173: /*focalDevice*/ return this.focalDevice == null ? new Base[0] : this.focalDevice.toArray(new Base[this.focalDevice.size()]); // ProcedureFocalDeviceComponent
2506        case -504932338: /*usedReference*/ return this.usedReference == null ? new Base[0] : this.usedReference.toArray(new Base[this.usedReference.size()]); // Reference
2507        case -279910582: /*usedCode*/ return this.usedCode == null ? new Base[0] : this.usedCode.toArray(new Base[this.usedCode.size()]); // CodeableConcept
2508        default: return super.getProperty(hash, name, checkValid);
2509        }
2510
2511      }
2512
2513      @Override
2514      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2515        switch (hash) {
2516        case -1618432855: // identifier
2517          this.getIdentifier().add(castToIdentifier(value)); // Identifier
2518          return value;
2519        case -246883639: // instantiates
2520          this.getInstantiates().add(castToUri(value)); // UriType
2521          return value;
2522        case -332612366: // basedOn
2523          this.getBasedOn().add(castToReference(value)); // Reference
2524          return value;
2525        case -995410646: // partOf
2526          this.getPartOf().add(castToReference(value)); // Reference
2527          return value;
2528        case -892481550: // status
2529          value = new ProcedureStatusEnumFactory().fromType(castToCode(value));
2530          this.status = (Enumeration) value; // Enumeration<ProcedureStatus>
2531          return value;
2532        case 2051346646: // statusReason
2533          this.statusReason = castToCodeableConcept(value); // CodeableConcept
2534          return value;
2535        case 50511102: // category
2536          this.category = castToCodeableConcept(value); // CodeableConcept
2537          return value;
2538        case 3059181: // code
2539          this.code = castToCodeableConcept(value); // CodeableConcept
2540          return value;
2541        case -1867885268: // subject
2542          this.subject = castToReference(value); // Reference
2543          return value;
2544        case 951530927: // context
2545          this.context = castToReference(value); // Reference
2546          return value;
2547        case 481140672: // performed
2548          this.performed = castToType(value); // Type
2549          return value;
2550        case -799233858: // recorder
2551          this.recorder = castToReference(value); // Reference
2552          return value;
2553        case -373242253: // asserter
2554          this.asserter = castToReference(value); // Reference
2555          return value;
2556        case 481140686: // performer
2557          this.getPerformer().add((ProcedurePerformerComponent) value); // ProcedurePerformerComponent
2558          return value;
2559        case 1901043637: // location
2560          this.location = castToReference(value); // Reference
2561          return value;
2562        case 722137681: // reasonCode
2563          this.getReasonCode().add(castToCodeableConcept(value)); // CodeableConcept
2564          return value;
2565        case -1146218137: // reasonReference
2566          this.getReasonReference().add(castToReference(value)); // Reference
2567          return value;
2568        case 1702620169: // bodySite
2569          this.getBodySite().add(castToCodeableConcept(value)); // CodeableConcept
2570          return value;
2571        case -1106507950: // outcome
2572          this.outcome = castToCodeableConcept(value); // CodeableConcept
2573          return value;
2574        case -934521548: // report
2575          this.getReport().add(castToReference(value)); // Reference
2576          return value;
2577        case -1644401602: // complication
2578          this.getComplication().add(castToCodeableConcept(value)); // CodeableConcept
2579          return value;
2580        case -1685272017: // complicationDetail
2581          this.getComplicationDetail().add(castToReference(value)); // Reference
2582          return value;
2583        case 301801004: // followUp
2584          this.getFollowUp().add(castToCodeableConcept(value)); // CodeableConcept
2585          return value;
2586        case 3387378: // note
2587          this.getNote().add(castToAnnotation(value)); // Annotation
2588          return value;
2589        case -1129235173: // focalDevice
2590          this.getFocalDevice().add((ProcedureFocalDeviceComponent) value); // ProcedureFocalDeviceComponent
2591          return value;
2592        case -504932338: // usedReference
2593          this.getUsedReference().add(castToReference(value)); // Reference
2594          return value;
2595        case -279910582: // usedCode
2596          this.getUsedCode().add(castToCodeableConcept(value)); // CodeableConcept
2597          return value;
2598        default: return super.setProperty(hash, name, value);
2599        }
2600
2601      }
2602
2603      @Override
2604      public Base setProperty(String name, Base value) throws FHIRException {
2605        if (name.equals("identifier")) {
2606          this.getIdentifier().add(castToIdentifier(value));
2607        } else if (name.equals("instantiates")) {
2608          this.getInstantiates().add(castToUri(value));
2609        } else if (name.equals("basedOn")) {
2610          this.getBasedOn().add(castToReference(value));
2611        } else if (name.equals("partOf")) {
2612          this.getPartOf().add(castToReference(value));
2613        } else if (name.equals("status")) {
2614          value = new ProcedureStatusEnumFactory().fromType(castToCode(value));
2615          this.status = (Enumeration) value; // Enumeration<ProcedureStatus>
2616        } else if (name.equals("statusReason")) {
2617          this.statusReason = castToCodeableConcept(value); // CodeableConcept
2618        } else if (name.equals("category")) {
2619          this.category = castToCodeableConcept(value); // CodeableConcept
2620        } else if (name.equals("code")) {
2621          this.code = castToCodeableConcept(value); // CodeableConcept
2622        } else if (name.equals("subject")) {
2623          this.subject = castToReference(value); // Reference
2624        } else if (name.equals("context")) {
2625          this.context = castToReference(value); // Reference
2626        } else if (name.equals("performed[x]")) {
2627          this.performed = castToType(value); // Type
2628        } else if (name.equals("recorder")) {
2629          this.recorder = castToReference(value); // Reference
2630        } else if (name.equals("asserter")) {
2631          this.asserter = castToReference(value); // Reference
2632        } else if (name.equals("performer")) {
2633          this.getPerformer().add((ProcedurePerformerComponent) value);
2634        } else if (name.equals("location")) {
2635          this.location = castToReference(value); // Reference
2636        } else if (name.equals("reasonCode")) {
2637          this.getReasonCode().add(castToCodeableConcept(value));
2638        } else if (name.equals("reasonReference")) {
2639          this.getReasonReference().add(castToReference(value));
2640        } else if (name.equals("bodySite")) {
2641          this.getBodySite().add(castToCodeableConcept(value));
2642        } else if (name.equals("outcome")) {
2643          this.outcome = castToCodeableConcept(value); // CodeableConcept
2644        } else if (name.equals("report")) {
2645          this.getReport().add(castToReference(value));
2646        } else if (name.equals("complication")) {
2647          this.getComplication().add(castToCodeableConcept(value));
2648        } else if (name.equals("complicationDetail")) {
2649          this.getComplicationDetail().add(castToReference(value));
2650        } else if (name.equals("followUp")) {
2651          this.getFollowUp().add(castToCodeableConcept(value));
2652        } else if (name.equals("note")) {
2653          this.getNote().add(castToAnnotation(value));
2654        } else if (name.equals("focalDevice")) {
2655          this.getFocalDevice().add((ProcedureFocalDeviceComponent) value);
2656        } else if (name.equals("usedReference")) {
2657          this.getUsedReference().add(castToReference(value));
2658        } else if (name.equals("usedCode")) {
2659          this.getUsedCode().add(castToCodeableConcept(value));
2660        } else
2661          return super.setProperty(name, value);
2662        return value;
2663      }
2664
2665      @Override
2666      public Base makeProperty(int hash, String name) throws FHIRException {
2667        switch (hash) {
2668        case -1618432855:  return addIdentifier(); 
2669        case -246883639:  return addInstantiatesElement();
2670        case -332612366:  return addBasedOn(); 
2671        case -995410646:  return addPartOf(); 
2672        case -892481550:  return getStatusElement();
2673        case 2051346646:  return getStatusReason(); 
2674        case 50511102:  return getCategory(); 
2675        case 3059181:  return getCode(); 
2676        case -1867885268:  return getSubject(); 
2677        case 951530927:  return getContext(); 
2678        case 1355984064:  return getPerformed(); 
2679        case 481140672:  return getPerformed(); 
2680        case -799233858:  return getRecorder(); 
2681        case -373242253:  return getAsserter(); 
2682        case 481140686:  return addPerformer(); 
2683        case 1901043637:  return getLocation(); 
2684        case 722137681:  return addReasonCode(); 
2685        case -1146218137:  return addReasonReference(); 
2686        case 1702620169:  return addBodySite(); 
2687        case -1106507950:  return getOutcome(); 
2688        case -934521548:  return addReport(); 
2689        case -1644401602:  return addComplication(); 
2690        case -1685272017:  return addComplicationDetail(); 
2691        case 301801004:  return addFollowUp(); 
2692        case 3387378:  return addNote(); 
2693        case -1129235173:  return addFocalDevice(); 
2694        case -504932338:  return addUsedReference(); 
2695        case -279910582:  return addUsedCode(); 
2696        default: return super.makeProperty(hash, name);
2697        }
2698
2699      }
2700
2701      @Override
2702      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2703        switch (hash) {
2704        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2705        case -246883639: /*instantiates*/ return new String[] {"uri"};
2706        case -332612366: /*basedOn*/ return new String[] {"Reference"};
2707        case -995410646: /*partOf*/ return new String[] {"Reference"};
2708        case -892481550: /*status*/ return new String[] {"code"};
2709        case 2051346646: /*statusReason*/ return new String[] {"CodeableConcept"};
2710        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
2711        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
2712        case -1867885268: /*subject*/ return new String[] {"Reference"};
2713        case 951530927: /*context*/ return new String[] {"Reference"};
2714        case 481140672: /*performed*/ return new String[] {"dateTime", "Period", "string", "Age", "Range"};
2715        case -799233858: /*recorder*/ return new String[] {"Reference"};
2716        case -373242253: /*asserter*/ return new String[] {"Reference"};
2717        case 481140686: /*performer*/ return new String[] {};
2718        case 1901043637: /*location*/ return new String[] {"Reference"};
2719        case 722137681: /*reasonCode*/ return new String[] {"CodeableConcept"};
2720        case -1146218137: /*reasonReference*/ return new String[] {"Reference"};
2721        case 1702620169: /*bodySite*/ return new String[] {"CodeableConcept"};
2722        case -1106507950: /*outcome*/ return new String[] {"CodeableConcept"};
2723        case -934521548: /*report*/ return new String[] {"Reference"};
2724        case -1644401602: /*complication*/ return new String[] {"CodeableConcept"};
2725        case -1685272017: /*complicationDetail*/ return new String[] {"Reference"};
2726        case 301801004: /*followUp*/ return new String[] {"CodeableConcept"};
2727        case 3387378: /*note*/ return new String[] {"Annotation"};
2728        case -1129235173: /*focalDevice*/ return new String[] {};
2729        case -504932338: /*usedReference*/ return new String[] {"Reference"};
2730        case -279910582: /*usedCode*/ return new String[] {"CodeableConcept"};
2731        default: return super.getTypesForProperty(hash, name);
2732        }
2733
2734      }
2735
2736      @Override
2737      public Base addChild(String name) throws FHIRException {
2738        if (name.equals("identifier")) {
2739          return addIdentifier();
2740        }
2741        else if (name.equals("instantiates")) {
2742          throw new FHIRException("Cannot call addChild on a primitive type Procedure.instantiates");
2743        }
2744        else if (name.equals("basedOn")) {
2745          return addBasedOn();
2746        }
2747        else if (name.equals("partOf")) {
2748          return addPartOf();
2749        }
2750        else if (name.equals("status")) {
2751          throw new FHIRException("Cannot call addChild on a primitive type Procedure.status");
2752        }
2753        else if (name.equals("statusReason")) {
2754          this.statusReason = new CodeableConcept();
2755          return this.statusReason;
2756        }
2757        else if (name.equals("category")) {
2758          this.category = new CodeableConcept();
2759          return this.category;
2760        }
2761        else if (name.equals("code")) {
2762          this.code = new CodeableConcept();
2763          return this.code;
2764        }
2765        else if (name.equals("subject")) {
2766          this.subject = new Reference();
2767          return this.subject;
2768        }
2769        else if (name.equals("context")) {
2770          this.context = new Reference();
2771          return this.context;
2772        }
2773        else if (name.equals("performedDateTime")) {
2774          this.performed = new DateTimeType();
2775          return this.performed;
2776        }
2777        else if (name.equals("performedPeriod")) {
2778          this.performed = new Period();
2779          return this.performed;
2780        }
2781        else if (name.equals("performedString")) {
2782          this.performed = new StringType();
2783          return this.performed;
2784        }
2785        else if (name.equals("performedAge")) {
2786          this.performed = new Age();
2787          return this.performed;
2788        }
2789        else if (name.equals("performedRange")) {
2790          this.performed = new Range();
2791          return this.performed;
2792        }
2793        else if (name.equals("recorder")) {
2794          this.recorder = new Reference();
2795          return this.recorder;
2796        }
2797        else if (name.equals("asserter")) {
2798          this.asserter = new Reference();
2799          return this.asserter;
2800        }
2801        else if (name.equals("performer")) {
2802          return addPerformer();
2803        }
2804        else if (name.equals("location")) {
2805          this.location = new Reference();
2806          return this.location;
2807        }
2808        else if (name.equals("reasonCode")) {
2809          return addReasonCode();
2810        }
2811        else if (name.equals("reasonReference")) {
2812          return addReasonReference();
2813        }
2814        else if (name.equals("bodySite")) {
2815          return addBodySite();
2816        }
2817        else if (name.equals("outcome")) {
2818          this.outcome = new CodeableConcept();
2819          return this.outcome;
2820        }
2821        else if (name.equals("report")) {
2822          return addReport();
2823        }
2824        else if (name.equals("complication")) {
2825          return addComplication();
2826        }
2827        else if (name.equals("complicationDetail")) {
2828          return addComplicationDetail();
2829        }
2830        else if (name.equals("followUp")) {
2831          return addFollowUp();
2832        }
2833        else if (name.equals("note")) {
2834          return addNote();
2835        }
2836        else if (name.equals("focalDevice")) {
2837          return addFocalDevice();
2838        }
2839        else if (name.equals("usedReference")) {
2840          return addUsedReference();
2841        }
2842        else if (name.equals("usedCode")) {
2843          return addUsedCode();
2844        }
2845        else
2846          return super.addChild(name);
2847      }
2848
2849  public String fhirType() {
2850    return "Procedure";
2851
2852  }
2853
2854      public Procedure copy() {
2855        Procedure dst = new Procedure();
2856        copyValues(dst);
2857        if (identifier != null) {
2858          dst.identifier = new ArrayList<Identifier>();
2859          for (Identifier i : identifier)
2860            dst.identifier.add(i.copy());
2861        };
2862        if (instantiates != null) {
2863          dst.instantiates = new ArrayList<UriType>();
2864          for (UriType i : instantiates)
2865            dst.instantiates.add(i.copy());
2866        };
2867        if (basedOn != null) {
2868          dst.basedOn = new ArrayList<Reference>();
2869          for (Reference i : basedOn)
2870            dst.basedOn.add(i.copy());
2871        };
2872        if (partOf != null) {
2873          dst.partOf = new ArrayList<Reference>();
2874          for (Reference i : partOf)
2875            dst.partOf.add(i.copy());
2876        };
2877        dst.status = status == null ? null : status.copy();
2878        dst.statusReason = statusReason == null ? null : statusReason.copy();
2879        dst.category = category == null ? null : category.copy();
2880        dst.code = code == null ? null : code.copy();
2881        dst.subject = subject == null ? null : subject.copy();
2882        dst.context = context == null ? null : context.copy();
2883        dst.performed = performed == null ? null : performed.copy();
2884        dst.recorder = recorder == null ? null : recorder.copy();
2885        dst.asserter = asserter == null ? null : asserter.copy();
2886        if (performer != null) {
2887          dst.performer = new ArrayList<ProcedurePerformerComponent>();
2888          for (ProcedurePerformerComponent i : performer)
2889            dst.performer.add(i.copy());
2890        };
2891        dst.location = location == null ? null : location.copy();
2892        if (reasonCode != null) {
2893          dst.reasonCode = new ArrayList<CodeableConcept>();
2894          for (CodeableConcept i : reasonCode)
2895            dst.reasonCode.add(i.copy());
2896        };
2897        if (reasonReference != null) {
2898          dst.reasonReference = new ArrayList<Reference>();
2899          for (Reference i : reasonReference)
2900            dst.reasonReference.add(i.copy());
2901        };
2902        if (bodySite != null) {
2903          dst.bodySite = new ArrayList<CodeableConcept>();
2904          for (CodeableConcept i : bodySite)
2905            dst.bodySite.add(i.copy());
2906        };
2907        dst.outcome = outcome == null ? null : outcome.copy();
2908        if (report != null) {
2909          dst.report = new ArrayList<Reference>();
2910          for (Reference i : report)
2911            dst.report.add(i.copy());
2912        };
2913        if (complication != null) {
2914          dst.complication = new ArrayList<CodeableConcept>();
2915          for (CodeableConcept i : complication)
2916            dst.complication.add(i.copy());
2917        };
2918        if (complicationDetail != null) {
2919          dst.complicationDetail = new ArrayList<Reference>();
2920          for (Reference i : complicationDetail)
2921            dst.complicationDetail.add(i.copy());
2922        };
2923        if (followUp != null) {
2924          dst.followUp = new ArrayList<CodeableConcept>();
2925          for (CodeableConcept i : followUp)
2926            dst.followUp.add(i.copy());
2927        };
2928        if (note != null) {
2929          dst.note = new ArrayList<Annotation>();
2930          for (Annotation i : note)
2931            dst.note.add(i.copy());
2932        };
2933        if (focalDevice != null) {
2934          dst.focalDevice = new ArrayList<ProcedureFocalDeviceComponent>();
2935          for (ProcedureFocalDeviceComponent i : focalDevice)
2936            dst.focalDevice.add(i.copy());
2937        };
2938        if (usedReference != null) {
2939          dst.usedReference = new ArrayList<Reference>();
2940          for (Reference i : usedReference)
2941            dst.usedReference.add(i.copy());
2942        };
2943        if (usedCode != null) {
2944          dst.usedCode = new ArrayList<CodeableConcept>();
2945          for (CodeableConcept i : usedCode)
2946            dst.usedCode.add(i.copy());
2947        };
2948        return dst;
2949      }
2950
2951      protected Procedure typedCopy() {
2952        return copy();
2953      }
2954
2955      @Override
2956      public boolean equalsDeep(Base other_) {
2957        if (!super.equalsDeep(other_))
2958          return false;
2959        if (!(other_ instanceof Procedure))
2960          return false;
2961        Procedure o = (Procedure) other_;
2962        return compareDeep(identifier, o.identifier, true) && compareDeep(instantiates, o.instantiates, true)
2963           && compareDeep(basedOn, o.basedOn, true) && compareDeep(partOf, o.partOf, true) && compareDeep(status, o.status, true)
2964           && compareDeep(statusReason, o.statusReason, true) && compareDeep(category, o.category, true) && compareDeep(code, o.code, true)
2965           && compareDeep(subject, o.subject, true) && compareDeep(context, o.context, true) && compareDeep(performed, o.performed, true)
2966           && compareDeep(recorder, o.recorder, true) && compareDeep(asserter, o.asserter, true) && compareDeep(performer, o.performer, true)
2967           && compareDeep(location, o.location, true) && compareDeep(reasonCode, o.reasonCode, true) && compareDeep(reasonReference, o.reasonReference, true)
2968           && compareDeep(bodySite, o.bodySite, true) && compareDeep(outcome, o.outcome, true) && compareDeep(report, o.report, true)
2969           && compareDeep(complication, o.complication, true) && compareDeep(complicationDetail, o.complicationDetail, true)
2970           && compareDeep(followUp, o.followUp, true) && compareDeep(note, o.note, true) && compareDeep(focalDevice, o.focalDevice, true)
2971           && compareDeep(usedReference, o.usedReference, true) && compareDeep(usedCode, o.usedCode, true)
2972          ;
2973      }
2974
2975      @Override
2976      public boolean equalsShallow(Base other_) {
2977        if (!super.equalsShallow(other_))
2978          return false;
2979        if (!(other_ instanceof Procedure))
2980          return false;
2981        Procedure o = (Procedure) other_;
2982        return compareValues(instantiates, o.instantiates, true) && compareValues(status, o.status, true);
2983      }
2984
2985      public boolean isEmpty() {
2986        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, instantiates, basedOn
2987          , partOf, status, statusReason, category, code, subject, context, performed
2988          , recorder, asserter, performer, location, reasonCode, reasonReference, bodySite
2989          , outcome, report, complication, complicationDetail, followUp, note, focalDevice
2990          , usedReference, usedCode);
2991      }
2992
2993  @Override
2994  public ResourceType getResourceType() {
2995    return ResourceType.Procedure;
2996   }
2997
2998 /**
2999   * Search parameter: <b>date</b>
3000   * <p>
3001   * Description: <b>When the procedure was performed</b><br>
3002   * Type: <b>date</b><br>
3003   * Path: <b>Procedure.performed[x]</b><br>
3004   * </p>
3005   */
3006  @SearchParamDefinition(name="date", path="Procedure.performed", description="When the procedure was performed", type="date" )
3007  public static final String SP_DATE = "date";
3008 /**
3009   * <b>Fluent Client</b> search parameter constant for <b>date</b>
3010   * <p>
3011   * Description: <b>When the procedure was performed</b><br>
3012   * Type: <b>date</b><br>
3013   * Path: <b>Procedure.performed[x]</b><br>
3014   * </p>
3015   */
3016  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
3017
3018 /**
3019   * Search parameter: <b>identifier</b>
3020   * <p>
3021   * Description: <b>A unique identifier for a procedure</b><br>
3022   * Type: <b>token</b><br>
3023   * Path: <b>Procedure.identifier</b><br>
3024   * </p>
3025   */
3026  @SearchParamDefinition(name="identifier", path="Procedure.identifier", description="A unique identifier for a procedure", type="token" )
3027  public static final String SP_IDENTIFIER = "identifier";
3028 /**
3029   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3030   * <p>
3031   * Description: <b>A unique identifier for a procedure</b><br>
3032   * Type: <b>token</b><br>
3033   * Path: <b>Procedure.identifier</b><br>
3034   * </p>
3035   */
3036  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
3037
3038 /**
3039   * Search parameter: <b>instantiates</b>
3040   * <p>
3041   * Description: <b>Instantiates protocol or definition</b><br>
3042   * Type: <b>uri</b><br>
3043   * Path: <b>Procedure.instantiates</b><br>
3044   * </p>
3045   */
3046  @SearchParamDefinition(name="instantiates", path="Procedure.instantiates", description="Instantiates protocol or definition", type="uri" )
3047  public static final String SP_INSTANTIATES = "instantiates";
3048 /**
3049   * <b>Fluent Client</b> search parameter constant for <b>instantiates</b>
3050   * <p>
3051   * Description: <b>Instantiates protocol or definition</b><br>
3052   * Type: <b>uri</b><br>
3053   * Path: <b>Procedure.instantiates</b><br>
3054   * </p>
3055   */
3056  public static final ca.uhn.fhir.rest.gclient.UriClientParam INSTANTIATES = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_INSTANTIATES);
3057
3058 /**
3059   * Search parameter: <b>code</b>
3060   * <p>
3061   * Description: <b>A code to identify a  procedure</b><br>
3062   * Type: <b>token</b><br>
3063   * Path: <b>Procedure.code</b><br>
3064   * </p>
3065   */
3066  @SearchParamDefinition(name="code", path="Procedure.code", description="A code to identify a  procedure", type="token" )
3067  public static final String SP_CODE = "code";
3068 /**
3069   * <b>Fluent Client</b> search parameter constant for <b>code</b>
3070   * <p>
3071   * Description: <b>A code to identify a  procedure</b><br>
3072   * Type: <b>token</b><br>
3073   * Path: <b>Procedure.code</b><br>
3074   * </p>
3075   */
3076  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
3077
3078 /**
3079   * Search parameter: <b>performer</b>
3080   * <p>
3081   * Description: <b>The reference to the practitioner</b><br>
3082   * Type: <b>reference</b><br>
3083   * Path: <b>Procedure.performer.actor</b><br>
3084   * </p>
3085   */
3086  @SearchParamDefinition(name="performer", path="Procedure.performer.actor", description="The reference to the practitioner", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="RelatedPerson") }, target={Device.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
3087  public static final String SP_PERFORMER = "performer";
3088 /**
3089   * <b>Fluent Client</b> search parameter constant for <b>performer</b>
3090   * <p>
3091   * Description: <b>The reference to the practitioner</b><br>
3092   * Type: <b>reference</b><br>
3093   * Path: <b>Procedure.performer.actor</b><br>
3094   * </p>
3095   */
3096  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER);
3097
3098/**
3099   * Constant for fluent queries to be used to add include statements. Specifies
3100   * the path value of "<b>Procedure:performer</b>".
3101   */
3102  public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("Procedure:performer").toLocked();
3103
3104 /**
3105   * Search parameter: <b>subject</b>
3106   * <p>
3107   * Description: <b>Search by subject</b><br>
3108   * Type: <b>reference</b><br>
3109   * Path: <b>Procedure.subject</b><br>
3110   * </p>
3111   */
3112  @SearchParamDefinition(name="subject", path="Procedure.subject", description="Search by subject", type="reference", target={Group.class, Patient.class } )
3113  public static final String SP_SUBJECT = "subject";
3114 /**
3115   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
3116   * <p>
3117   * Description: <b>Search by subject</b><br>
3118   * Type: <b>reference</b><br>
3119   * Path: <b>Procedure.subject</b><br>
3120   * </p>
3121   */
3122  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
3123
3124/**
3125   * Constant for fluent queries to be used to add include statements. Specifies
3126   * the path value of "<b>Procedure:subject</b>".
3127   */
3128  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Procedure:subject").toLocked();
3129
3130 /**
3131   * Search parameter: <b>part-of</b>
3132   * <p>
3133   * Description: <b>Part of referenced event</b><br>
3134   * Type: <b>reference</b><br>
3135   * Path: <b>Procedure.partOf</b><br>
3136   * </p>
3137   */
3138  @SearchParamDefinition(name="part-of", path="Procedure.partOf", description="Part of referenced event", type="reference", target={MedicationAdministration.class, Observation.class, Procedure.class } )
3139  public static final String SP_PART_OF = "part-of";
3140 /**
3141   * <b>Fluent Client</b> search parameter constant for <b>part-of</b>
3142   * <p>
3143   * Description: <b>Part of referenced event</b><br>
3144   * Type: <b>reference</b><br>
3145   * Path: <b>Procedure.partOf</b><br>
3146   * </p>
3147   */
3148  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PART_OF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PART_OF);
3149
3150/**
3151   * Constant for fluent queries to be used to add include statements. Specifies
3152   * the path value of "<b>Procedure:part-of</b>".
3153   */
3154  public static final ca.uhn.fhir.model.api.Include INCLUDE_PART_OF = new ca.uhn.fhir.model.api.Include("Procedure:part-of").toLocked();
3155
3156 /**
3157   * Search parameter: <b>encounter</b>
3158   * <p>
3159   * Description: <b>Search by encounter</b><br>
3160   * Type: <b>reference</b><br>
3161   * Path: <b>Procedure.context</b><br>
3162   * </p>
3163   */
3164  @SearchParamDefinition(name="encounter", path="Procedure.context", description="Search by encounter", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Encounter") }, target={Encounter.class } )
3165  public static final String SP_ENCOUNTER = "encounter";
3166 /**
3167   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
3168   * <p>
3169   * Description: <b>Search by encounter</b><br>
3170   * Type: <b>reference</b><br>
3171   * Path: <b>Procedure.context</b><br>
3172   * </p>
3173   */
3174  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER);
3175
3176/**
3177   * Constant for fluent queries to be used to add include statements. Specifies
3178   * the path value of "<b>Procedure:encounter</b>".
3179   */
3180  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("Procedure:encounter").toLocked();
3181
3182 /**
3183   * Search parameter: <b>based-on</b>
3184   * <p>
3185   * Description: <b>A request for this procedure</b><br>
3186   * Type: <b>reference</b><br>
3187   * Path: <b>Procedure.basedOn</b><br>
3188   * </p>
3189   */
3190  @SearchParamDefinition(name="based-on", path="Procedure.basedOn", description="A request for this procedure", type="reference", target={CarePlan.class, ServiceRequest.class } )
3191  public static final String SP_BASED_ON = "based-on";
3192 /**
3193   * <b>Fluent Client</b> search parameter constant for <b>based-on</b>
3194   * <p>
3195   * Description: <b>A request for this procedure</b><br>
3196   * Type: <b>reference</b><br>
3197   * Path: <b>Procedure.basedOn</b><br>
3198   * </p>
3199   */
3200  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASED_ON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BASED_ON);
3201
3202/**
3203   * Constant for fluent queries to be used to add include statements. Specifies
3204   * the path value of "<b>Procedure:based-on</b>".
3205   */
3206  public static final ca.uhn.fhir.model.api.Include INCLUDE_BASED_ON = new ca.uhn.fhir.model.api.Include("Procedure:based-on").toLocked();
3207
3208 /**
3209   * Search parameter: <b>patient</b>
3210   * <p>
3211   * Description: <b>Search by subject - a patient</b><br>
3212   * Type: <b>reference</b><br>
3213   * Path: <b>Procedure.subject</b><br>
3214   * </p>
3215   */
3216  @SearchParamDefinition(name="patient", path="Procedure.subject", description="Search by subject - a patient", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Patient.class } )
3217  public static final String SP_PATIENT = "patient";
3218 /**
3219   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
3220   * <p>
3221   * Description: <b>Search by subject - a patient</b><br>
3222   * Type: <b>reference</b><br>
3223   * Path: <b>Procedure.subject</b><br>
3224   * </p>
3225   */
3226  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
3227
3228/**
3229   * Constant for fluent queries to be used to add include statements. Specifies
3230   * the path value of "<b>Procedure:patient</b>".
3231   */
3232  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Procedure:patient").toLocked();
3233
3234 /**
3235   * Search parameter: <b>context</b>
3236   * <p>
3237   * Description: <b>Encounter or episode associated with the procedure</b><br>
3238   * Type: <b>reference</b><br>
3239   * Path: <b>Procedure.context</b><br>
3240   * </p>
3241   */
3242  @SearchParamDefinition(name="context", path="Procedure.context", description="Encounter or episode associated with the procedure", type="reference", target={Encounter.class, EpisodeOfCare.class } )
3243  public static final String SP_CONTEXT = "context";
3244 /**
3245   * <b>Fluent Client</b> search parameter constant for <b>context</b>
3246   * <p>
3247   * Description: <b>Encounter or episode associated with the procedure</b><br>
3248   * Type: <b>reference</b><br>
3249   * Path: <b>Procedure.context</b><br>
3250   * </p>
3251   */
3252  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONTEXT);
3253
3254/**
3255   * Constant for fluent queries to be used to add include statements. Specifies
3256   * the path value of "<b>Procedure:context</b>".
3257   */
3258  public static final ca.uhn.fhir.model.api.Include INCLUDE_CONTEXT = new ca.uhn.fhir.model.api.Include("Procedure:context").toLocked();
3259
3260 /**
3261   * Search parameter: <b>location</b>
3262   * <p>
3263   * Description: <b>Where the procedure happened</b><br>
3264   * Type: <b>reference</b><br>
3265   * Path: <b>Procedure.location</b><br>
3266   * </p>
3267   */
3268  @SearchParamDefinition(name="location", path="Procedure.location", description="Where the procedure happened", type="reference", target={Location.class } )
3269  public static final String SP_LOCATION = "location";
3270 /**
3271   * <b>Fluent Client</b> search parameter constant for <b>location</b>
3272   * <p>
3273   * Description: <b>Where the procedure happened</b><br>
3274   * Type: <b>reference</b><br>
3275   * Path: <b>Procedure.location</b><br>
3276   * </p>
3277   */
3278  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION);
3279
3280/**
3281   * Constant for fluent queries to be used to add include statements. Specifies
3282   * the path value of "<b>Procedure:location</b>".
3283   */
3284  public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("Procedure:location").toLocked();
3285
3286 /**
3287   * Search parameter: <b>category</b>
3288   * <p>
3289   * Description: <b>Classification of the procedure</b><br>
3290   * Type: <b>token</b><br>
3291   * Path: <b>Procedure.category</b><br>
3292   * </p>
3293   */
3294  @SearchParamDefinition(name="category", path="Procedure.category", description="Classification of the procedure", type="token" )
3295  public static final String SP_CATEGORY = "category";
3296 /**
3297   * <b>Fluent Client</b> search parameter constant for <b>category</b>
3298   * <p>
3299   * Description: <b>Classification of the procedure</b><br>
3300   * Type: <b>token</b><br>
3301   * Path: <b>Procedure.category</b><br>
3302   * </p>
3303   */
3304  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY);
3305
3306 /**
3307   * Search parameter: <b>status</b>
3308   * <p>
3309   * Description: <b>preparation | in-progress | not-done | suspended | aborted | completed | entered-in-error | unknown</b><br>
3310   * Type: <b>token</b><br>
3311   * Path: <b>Procedure.status</b><br>
3312   * </p>
3313   */
3314  @SearchParamDefinition(name="status", path="Procedure.status", description="preparation | in-progress | not-done | suspended | aborted | completed | entered-in-error | unknown", type="token" )
3315  public static final String SP_STATUS = "status";
3316 /**
3317   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3318   * <p>
3319   * Description: <b>preparation | in-progress | not-done | suspended | aborted | completed | entered-in-error | unknown</b><br>
3320   * Type: <b>token</b><br>
3321   * Path: <b>Procedure.status</b><br>
3322   * </p>
3323   */
3324  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3325
3326
3327}
3328