001package org.hl7.fhir.dstu3.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 Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.1
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;
045import org.hl7.fhir.exceptions.FHIRFormatError;
046/**
047 * A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s).
048 */
049@ResourceDef(name="Appointment", profile="http://hl7.org/fhir/StructureDefinition/Appointment")
050public class Appointment extends DomainResource {
051
052    public enum AppointmentStatus {
053        /**
054         * None of the participant(s) have finalized their acceptance of the appointment request, and the start/end time may not be set yet.
055         */
056        PROPOSED, 
057        /**
058         * Some or all of the participant(s) have not finalized their acceptance of the appointment request.
059         */
060        PENDING, 
061        /**
062         * All participant(s) have been considered and the appointment is confirmed to go ahead at the date/times specified.
063         */
064        BOOKED, 
065        /**
066         * Some of the patients have arrived.
067         */
068        ARRIVED, 
069        /**
070         * This appointment has completed and may have resulted in an encounter.
071         */
072        FULFILLED, 
073        /**
074         * The appointment has been cancelled.
075         */
076        CANCELLED, 
077        /**
078         * Some or all of the participant(s) have not/did not appear for the appointment (usually the patient).
079         */
080        NOSHOW, 
081        /**
082         * This instance should not have been part of this patient's medical record.
083         */
084        ENTEREDINERROR, 
085        /**
086         * added to help the parsers with the generic types
087         */
088        NULL;
089        public static AppointmentStatus fromCode(String codeString) throws FHIRException {
090            if (codeString == null || "".equals(codeString))
091                return null;
092        if ("proposed".equals(codeString))
093          return PROPOSED;
094        if ("pending".equals(codeString))
095          return PENDING;
096        if ("booked".equals(codeString))
097          return BOOKED;
098        if ("arrived".equals(codeString))
099          return ARRIVED;
100        if ("fulfilled".equals(codeString))
101          return FULFILLED;
102        if ("cancelled".equals(codeString))
103          return CANCELLED;
104        if ("noshow".equals(codeString))
105          return NOSHOW;
106        if ("entered-in-error".equals(codeString))
107          return ENTEREDINERROR;
108        if (Configuration.isAcceptInvalidEnums())
109          return null;
110        else
111          throw new FHIRException("Unknown AppointmentStatus code '"+codeString+"'");
112        }
113        public String toCode() {
114          switch (this) {
115            case PROPOSED: return "proposed";
116            case PENDING: return "pending";
117            case BOOKED: return "booked";
118            case ARRIVED: return "arrived";
119            case FULFILLED: return "fulfilled";
120            case CANCELLED: return "cancelled";
121            case NOSHOW: return "noshow";
122            case ENTEREDINERROR: return "entered-in-error";
123            default: return "?";
124          }
125        }
126        public String getSystem() {
127          switch (this) {
128            case PROPOSED: return "http://hl7.org/fhir/appointmentstatus";
129            case PENDING: return "http://hl7.org/fhir/appointmentstatus";
130            case BOOKED: return "http://hl7.org/fhir/appointmentstatus";
131            case ARRIVED: return "http://hl7.org/fhir/appointmentstatus";
132            case FULFILLED: return "http://hl7.org/fhir/appointmentstatus";
133            case CANCELLED: return "http://hl7.org/fhir/appointmentstatus";
134            case NOSHOW: return "http://hl7.org/fhir/appointmentstatus";
135            case ENTEREDINERROR: return "http://hl7.org/fhir/appointmentstatus";
136            default: return "?";
137          }
138        }
139        public String getDefinition() {
140          switch (this) {
141            case PROPOSED: return "None of the participant(s) have finalized their acceptance of the appointment request, and the start/end time may not be set yet.";
142            case PENDING: return "Some or all of the participant(s) have not finalized their acceptance of the appointment request.";
143            case BOOKED: return "All participant(s) have been considered and the appointment is confirmed to go ahead at the date/times specified.";
144            case ARRIVED: return "Some of the patients have arrived.";
145            case FULFILLED: return "This appointment has completed and may have resulted in an encounter.";
146            case CANCELLED: return "The appointment has been cancelled.";
147            case NOSHOW: return "Some or all of the participant(s) have not/did not appear for the appointment (usually the patient).";
148            case ENTEREDINERROR: return "This instance should not have been part of this patient's medical record.";
149            default: return "?";
150          }
151        }
152        public String getDisplay() {
153          switch (this) {
154            case PROPOSED: return "Proposed";
155            case PENDING: return "Pending";
156            case BOOKED: return "Booked";
157            case ARRIVED: return "Arrived";
158            case FULFILLED: return "Fulfilled";
159            case CANCELLED: return "Cancelled";
160            case NOSHOW: return "No Show";
161            case ENTEREDINERROR: return "Entered in error";
162            default: return "?";
163          }
164        }
165    }
166
167  public static class AppointmentStatusEnumFactory implements EnumFactory<AppointmentStatus> {
168    public AppointmentStatus fromCode(String codeString) throws IllegalArgumentException {
169      if (codeString == null || "".equals(codeString))
170            if (codeString == null || "".equals(codeString))
171                return null;
172        if ("proposed".equals(codeString))
173          return AppointmentStatus.PROPOSED;
174        if ("pending".equals(codeString))
175          return AppointmentStatus.PENDING;
176        if ("booked".equals(codeString))
177          return AppointmentStatus.BOOKED;
178        if ("arrived".equals(codeString))
179          return AppointmentStatus.ARRIVED;
180        if ("fulfilled".equals(codeString))
181          return AppointmentStatus.FULFILLED;
182        if ("cancelled".equals(codeString))
183          return AppointmentStatus.CANCELLED;
184        if ("noshow".equals(codeString))
185          return AppointmentStatus.NOSHOW;
186        if ("entered-in-error".equals(codeString))
187          return AppointmentStatus.ENTEREDINERROR;
188        throw new IllegalArgumentException("Unknown AppointmentStatus code '"+codeString+"'");
189        }
190        public Enumeration<AppointmentStatus> fromType(Base code) throws FHIRException {
191          if (code == null)
192            return null;
193          if (code.isEmpty())
194            return new Enumeration<AppointmentStatus>(this);
195          String codeString = ((PrimitiveType) code).asStringValue();
196          if (codeString == null || "".equals(codeString))
197            return null;
198        if ("proposed".equals(codeString))
199          return new Enumeration<AppointmentStatus>(this, AppointmentStatus.PROPOSED);
200        if ("pending".equals(codeString))
201          return new Enumeration<AppointmentStatus>(this, AppointmentStatus.PENDING);
202        if ("booked".equals(codeString))
203          return new Enumeration<AppointmentStatus>(this, AppointmentStatus.BOOKED);
204        if ("arrived".equals(codeString))
205          return new Enumeration<AppointmentStatus>(this, AppointmentStatus.ARRIVED);
206        if ("fulfilled".equals(codeString))
207          return new Enumeration<AppointmentStatus>(this, AppointmentStatus.FULFILLED);
208        if ("cancelled".equals(codeString))
209          return new Enumeration<AppointmentStatus>(this, AppointmentStatus.CANCELLED);
210        if ("noshow".equals(codeString))
211          return new Enumeration<AppointmentStatus>(this, AppointmentStatus.NOSHOW);
212        if ("entered-in-error".equals(codeString))
213          return new Enumeration<AppointmentStatus>(this, AppointmentStatus.ENTEREDINERROR);
214        throw new FHIRException("Unknown AppointmentStatus code '"+codeString+"'");
215        }
216    public String toCode(AppointmentStatus code) {
217      if (code == AppointmentStatus.PROPOSED)
218        return "proposed";
219      if (code == AppointmentStatus.PENDING)
220        return "pending";
221      if (code == AppointmentStatus.BOOKED)
222        return "booked";
223      if (code == AppointmentStatus.ARRIVED)
224        return "arrived";
225      if (code == AppointmentStatus.FULFILLED)
226        return "fulfilled";
227      if (code == AppointmentStatus.CANCELLED)
228        return "cancelled";
229      if (code == AppointmentStatus.NOSHOW)
230        return "noshow";
231      if (code == AppointmentStatus.ENTEREDINERROR)
232        return "entered-in-error";
233      return "?";
234      }
235    public String toSystem(AppointmentStatus code) {
236      return code.getSystem();
237      }
238    }
239
240    public enum ParticipantRequired {
241        /**
242         * The participant is required to attend the appointment.
243         */
244        REQUIRED, 
245        /**
246         * The participant may optionally attend the appointment.
247         */
248        OPTIONAL, 
249        /**
250         * The participant is excluded from the appointment, and may not be informed of the appointment taking place. (Appointment is about them, not for them - such as 2 doctors discussing results about a patient's test).
251         */
252        INFORMATIONONLY, 
253        /**
254         * added to help the parsers with the generic types
255         */
256        NULL;
257        public static ParticipantRequired fromCode(String codeString) throws FHIRException {
258            if (codeString == null || "".equals(codeString))
259                return null;
260        if ("required".equals(codeString))
261          return REQUIRED;
262        if ("optional".equals(codeString))
263          return OPTIONAL;
264        if ("information-only".equals(codeString))
265          return INFORMATIONONLY;
266        if (Configuration.isAcceptInvalidEnums())
267          return null;
268        else
269          throw new FHIRException("Unknown ParticipantRequired code '"+codeString+"'");
270        }
271        public String toCode() {
272          switch (this) {
273            case REQUIRED: return "required";
274            case OPTIONAL: return "optional";
275            case INFORMATIONONLY: return "information-only";
276            default: return "?";
277          }
278        }
279        public String getSystem() {
280          switch (this) {
281            case REQUIRED: return "http://hl7.org/fhir/participantrequired";
282            case OPTIONAL: return "http://hl7.org/fhir/participantrequired";
283            case INFORMATIONONLY: return "http://hl7.org/fhir/participantrequired";
284            default: return "?";
285          }
286        }
287        public String getDefinition() {
288          switch (this) {
289            case REQUIRED: return "The participant is required to attend the appointment.";
290            case OPTIONAL: return "The participant may optionally attend the appointment.";
291            case INFORMATIONONLY: return "The participant is excluded from the appointment, and may not be informed of the appointment taking place. (Appointment is about them, not for them - such as 2 doctors discussing results about a patient's test).";
292            default: return "?";
293          }
294        }
295        public String getDisplay() {
296          switch (this) {
297            case REQUIRED: return "Required";
298            case OPTIONAL: return "Optional";
299            case INFORMATIONONLY: return "Information Only";
300            default: return "?";
301          }
302        }
303    }
304
305  public static class ParticipantRequiredEnumFactory implements EnumFactory<ParticipantRequired> {
306    public ParticipantRequired fromCode(String codeString) throws IllegalArgumentException {
307      if (codeString == null || "".equals(codeString))
308            if (codeString == null || "".equals(codeString))
309                return null;
310        if ("required".equals(codeString))
311          return ParticipantRequired.REQUIRED;
312        if ("optional".equals(codeString))
313          return ParticipantRequired.OPTIONAL;
314        if ("information-only".equals(codeString))
315          return ParticipantRequired.INFORMATIONONLY;
316        throw new IllegalArgumentException("Unknown ParticipantRequired code '"+codeString+"'");
317        }
318        public Enumeration<ParticipantRequired> fromType(Base code) throws FHIRException {
319          if (code == null)
320            return null;
321          if (code.isEmpty())
322            return new Enumeration<ParticipantRequired>(this);
323          String codeString = ((PrimitiveType) code).asStringValue();
324          if (codeString == null || "".equals(codeString))
325            return null;
326        if ("required".equals(codeString))
327          return new Enumeration<ParticipantRequired>(this, ParticipantRequired.REQUIRED);
328        if ("optional".equals(codeString))
329          return new Enumeration<ParticipantRequired>(this, ParticipantRequired.OPTIONAL);
330        if ("information-only".equals(codeString))
331          return new Enumeration<ParticipantRequired>(this, ParticipantRequired.INFORMATIONONLY);
332        throw new FHIRException("Unknown ParticipantRequired code '"+codeString+"'");
333        }
334    public String toCode(ParticipantRequired code) {
335      if (code == ParticipantRequired.REQUIRED)
336        return "required";
337      if (code == ParticipantRequired.OPTIONAL)
338        return "optional";
339      if (code == ParticipantRequired.INFORMATIONONLY)
340        return "information-only";
341      return "?";
342      }
343    public String toSystem(ParticipantRequired code) {
344      return code.getSystem();
345      }
346    }
347
348    public enum ParticipationStatus {
349        /**
350         * The participant has accepted the appointment.
351         */
352        ACCEPTED, 
353        /**
354         * The participant has declined the appointment and will not participate in the appointment.
355         */
356        DECLINED, 
357        /**
358         * The participant has  tentatively accepted the appointment. This could be automatically created by a system and requires further processing before it can be accepted. There is no commitment that attendance will occur.
359         */
360        TENTATIVE, 
361        /**
362         * The participant needs to indicate if they accept the appointment by changing this status to one of the other statuses.
363         */
364        NEEDSACTION, 
365        /**
366         * added to help the parsers with the generic types
367         */
368        NULL;
369        public static ParticipationStatus fromCode(String codeString) throws FHIRException {
370            if (codeString == null || "".equals(codeString))
371                return null;
372        if ("accepted".equals(codeString))
373          return ACCEPTED;
374        if ("declined".equals(codeString))
375          return DECLINED;
376        if ("tentative".equals(codeString))
377          return TENTATIVE;
378        if ("needs-action".equals(codeString))
379          return NEEDSACTION;
380        if (Configuration.isAcceptInvalidEnums())
381          return null;
382        else
383          throw new FHIRException("Unknown ParticipationStatus code '"+codeString+"'");
384        }
385        public String toCode() {
386          switch (this) {
387            case ACCEPTED: return "accepted";
388            case DECLINED: return "declined";
389            case TENTATIVE: return "tentative";
390            case NEEDSACTION: return "needs-action";
391            default: return "?";
392          }
393        }
394        public String getSystem() {
395          switch (this) {
396            case ACCEPTED: return "http://hl7.org/fhir/participationstatus";
397            case DECLINED: return "http://hl7.org/fhir/participationstatus";
398            case TENTATIVE: return "http://hl7.org/fhir/participationstatus";
399            case NEEDSACTION: return "http://hl7.org/fhir/participationstatus";
400            default: return "?";
401          }
402        }
403        public String getDefinition() {
404          switch (this) {
405            case ACCEPTED: return "The participant has accepted the appointment.";
406            case DECLINED: return "The participant has declined the appointment and will not participate in the appointment.";
407            case TENTATIVE: return "The participant has  tentatively accepted the appointment. This could be automatically created by a system and requires further processing before it can be accepted. There is no commitment that attendance will occur.";
408            case NEEDSACTION: return "The participant needs to indicate if they accept the appointment by changing this status to one of the other statuses.";
409            default: return "?";
410          }
411        }
412        public String getDisplay() {
413          switch (this) {
414            case ACCEPTED: return "Accepted";
415            case DECLINED: return "Declined";
416            case TENTATIVE: return "Tentative";
417            case NEEDSACTION: return "Needs Action";
418            default: return "?";
419          }
420        }
421    }
422
423  public static class ParticipationStatusEnumFactory implements EnumFactory<ParticipationStatus> {
424    public ParticipationStatus fromCode(String codeString) throws IllegalArgumentException {
425      if (codeString == null || "".equals(codeString))
426            if (codeString == null || "".equals(codeString))
427                return null;
428        if ("accepted".equals(codeString))
429          return ParticipationStatus.ACCEPTED;
430        if ("declined".equals(codeString))
431          return ParticipationStatus.DECLINED;
432        if ("tentative".equals(codeString))
433          return ParticipationStatus.TENTATIVE;
434        if ("needs-action".equals(codeString))
435          return ParticipationStatus.NEEDSACTION;
436        throw new IllegalArgumentException("Unknown ParticipationStatus code '"+codeString+"'");
437        }
438        public Enumeration<ParticipationStatus> fromType(Base code) throws FHIRException {
439          if (code == null)
440            return null;
441          if (code.isEmpty())
442            return new Enumeration<ParticipationStatus>(this);
443          String codeString = ((PrimitiveType) code).asStringValue();
444          if (codeString == null || "".equals(codeString))
445            return null;
446        if ("accepted".equals(codeString))
447          return new Enumeration<ParticipationStatus>(this, ParticipationStatus.ACCEPTED);
448        if ("declined".equals(codeString))
449          return new Enumeration<ParticipationStatus>(this, ParticipationStatus.DECLINED);
450        if ("tentative".equals(codeString))
451          return new Enumeration<ParticipationStatus>(this, ParticipationStatus.TENTATIVE);
452        if ("needs-action".equals(codeString))
453          return new Enumeration<ParticipationStatus>(this, ParticipationStatus.NEEDSACTION);
454        throw new FHIRException("Unknown ParticipationStatus code '"+codeString+"'");
455        }
456    public String toCode(ParticipationStatus code) {
457      if (code == ParticipationStatus.ACCEPTED)
458        return "accepted";
459      if (code == ParticipationStatus.DECLINED)
460        return "declined";
461      if (code == ParticipationStatus.TENTATIVE)
462        return "tentative";
463      if (code == ParticipationStatus.NEEDSACTION)
464        return "needs-action";
465      return "?";
466      }
467    public String toSystem(ParticipationStatus code) {
468      return code.getSystem();
469      }
470    }
471
472    @Block()
473    public static class AppointmentParticipantComponent extends BackboneElement implements IBaseBackboneElement {
474        /**
475         * Role of participant in the appointment.
476         */
477        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
478        @Description(shortDefinition="Role of participant in the appointment", formalDefinition="Role of participant in the appointment." )
479        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/encounter-participant-type")
480        protected List<CodeableConcept> type;
481
482        /**
483         * A Person, Location/HealthcareService or Device that is participating in the appointment.
484         */
485        @Child(name = "actor", type = {Patient.class, Practitioner.class, RelatedPerson.class, Device.class, HealthcareService.class, Location.class}, order=2, min=0, max=1, modifier=false, summary=true)
486        @Description(shortDefinition="Person, Location/HealthcareService or Device", formalDefinition="A Person, Location/HealthcareService or Device that is participating in the appointment." )
487        protected Reference actor;
488
489        /**
490         * The actual object that is the target of the reference (A Person, Location/HealthcareService or Device that is participating in the appointment.)
491         */
492        protected Resource actorTarget;
493
494        /**
495         * Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.
496         */
497        @Child(name = "required", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=true)
498        @Description(shortDefinition="required | optional | information-only", formalDefinition="Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present." )
499        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/participantrequired")
500        protected Enumeration<ParticipantRequired> required;
501
502        /**
503         * Participation status of the actor.
504         */
505        @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1, modifier=false, summary=false)
506        @Description(shortDefinition="accepted | declined | tentative | needs-action", formalDefinition="Participation status of the actor." )
507        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/participationstatus")
508        protected Enumeration<ParticipationStatus> status;
509
510        private static final long serialVersionUID = -1620552507L;
511
512    /**
513     * Constructor
514     */
515      public AppointmentParticipantComponent() {
516        super();
517      }
518
519    /**
520     * Constructor
521     */
522      public AppointmentParticipantComponent(Enumeration<ParticipationStatus> status) {
523        super();
524        this.status = status;
525      }
526
527        /**
528         * @return {@link #type} (Role of participant in the appointment.)
529         */
530        public List<CodeableConcept> getType() { 
531          if (this.type == null)
532            this.type = new ArrayList<CodeableConcept>();
533          return this.type;
534        }
535
536        /**
537         * @return Returns a reference to <code>this</code> for easy method chaining
538         */
539        public AppointmentParticipantComponent setType(List<CodeableConcept> theType) { 
540          this.type = theType;
541          return this;
542        }
543
544        public boolean hasType() { 
545          if (this.type == null)
546            return false;
547          for (CodeableConcept item : this.type)
548            if (!item.isEmpty())
549              return true;
550          return false;
551        }
552
553        public CodeableConcept addType() { //3
554          CodeableConcept t = new CodeableConcept();
555          if (this.type == null)
556            this.type = new ArrayList<CodeableConcept>();
557          this.type.add(t);
558          return t;
559        }
560
561        public AppointmentParticipantComponent addType(CodeableConcept t) { //3
562          if (t == null)
563            return this;
564          if (this.type == null)
565            this.type = new ArrayList<CodeableConcept>();
566          this.type.add(t);
567          return this;
568        }
569
570        /**
571         * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist
572         */
573        public CodeableConcept getTypeFirstRep() { 
574          if (getType().isEmpty()) {
575            addType();
576          }
577          return getType().get(0);
578        }
579
580        /**
581         * @return {@link #actor} (A Person, Location/HealthcareService or Device that is participating in the appointment.)
582         */
583        public Reference getActor() { 
584          if (this.actor == null)
585            if (Configuration.errorOnAutoCreate())
586              throw new Error("Attempt to auto-create AppointmentParticipantComponent.actor");
587            else if (Configuration.doAutoCreate())
588              this.actor = new Reference(); // cc
589          return this.actor;
590        }
591
592        public boolean hasActor() { 
593          return this.actor != null && !this.actor.isEmpty();
594        }
595
596        /**
597         * @param value {@link #actor} (A Person, Location/HealthcareService or Device that is participating in the appointment.)
598         */
599        public AppointmentParticipantComponent setActor(Reference value)  { 
600          this.actor = value;
601          return this;
602        }
603
604        /**
605         * @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. (A Person, Location/HealthcareService or Device that is participating in the appointment.)
606         */
607        public Resource getActorTarget() { 
608          return this.actorTarget;
609        }
610
611        /**
612         * @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. (A Person, Location/HealthcareService or Device that is participating in the appointment.)
613         */
614        public AppointmentParticipantComponent setActorTarget(Resource value) { 
615          this.actorTarget = value;
616          return this;
617        }
618
619        /**
620         * @return {@link #required} (Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value
621         */
622        public Enumeration<ParticipantRequired> getRequiredElement() { 
623          if (this.required == null)
624            if (Configuration.errorOnAutoCreate())
625              throw new Error("Attempt to auto-create AppointmentParticipantComponent.required");
626            else if (Configuration.doAutoCreate())
627              this.required = new Enumeration<ParticipantRequired>(new ParticipantRequiredEnumFactory()); // bb
628          return this.required;
629        }
630
631        public boolean hasRequiredElement() { 
632          return this.required != null && !this.required.isEmpty();
633        }
634
635        public boolean hasRequired() { 
636          return this.required != null && !this.required.isEmpty();
637        }
638
639        /**
640         * @param value {@link #required} (Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value
641         */
642        public AppointmentParticipantComponent setRequiredElement(Enumeration<ParticipantRequired> value) { 
643          this.required = value;
644          return this;
645        }
646
647        /**
648         * @return Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.
649         */
650        public ParticipantRequired getRequired() { 
651          return this.required == null ? null : this.required.getValue();
652        }
653
654        /**
655         * @param value Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.
656         */
657        public AppointmentParticipantComponent setRequired(ParticipantRequired value) { 
658          if (value == null)
659            this.required = null;
660          else {
661            if (this.required == null)
662              this.required = new Enumeration<ParticipantRequired>(new ParticipantRequiredEnumFactory());
663            this.required.setValue(value);
664          }
665          return this;
666        }
667
668        /**
669         * @return {@link #status} (Participation status of the actor.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
670         */
671        public Enumeration<ParticipationStatus> getStatusElement() { 
672          if (this.status == null)
673            if (Configuration.errorOnAutoCreate())
674              throw new Error("Attempt to auto-create AppointmentParticipantComponent.status");
675            else if (Configuration.doAutoCreate())
676              this.status = new Enumeration<ParticipationStatus>(new ParticipationStatusEnumFactory()); // bb
677          return this.status;
678        }
679
680        public boolean hasStatusElement() { 
681          return this.status != null && !this.status.isEmpty();
682        }
683
684        public boolean hasStatus() { 
685          return this.status != null && !this.status.isEmpty();
686        }
687
688        /**
689         * @param value {@link #status} (Participation status of the actor.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
690         */
691        public AppointmentParticipantComponent setStatusElement(Enumeration<ParticipationStatus> value) { 
692          this.status = value;
693          return this;
694        }
695
696        /**
697         * @return Participation status of the actor.
698         */
699        public ParticipationStatus getStatus() { 
700          return this.status == null ? null : this.status.getValue();
701        }
702
703        /**
704         * @param value Participation status of the actor.
705         */
706        public AppointmentParticipantComponent setStatus(ParticipationStatus value) { 
707            if (this.status == null)
708              this.status = new Enumeration<ParticipationStatus>(new ParticipationStatusEnumFactory());
709            this.status.setValue(value);
710          return this;
711        }
712
713        protected void listChildren(List<Property> children) {
714          super.listChildren(children);
715          children.add(new Property("type", "CodeableConcept", "Role of participant in the appointment.", 0, java.lang.Integer.MAX_VALUE, type));
716          children.add(new Property("actor", "Reference(Patient|Practitioner|RelatedPerson|Device|HealthcareService|Location)", "A Person, Location/HealthcareService or Device that is participating in the appointment.", 0, 1, actor));
717          children.add(new Property("required", "code", "Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.", 0, 1, required));
718          children.add(new Property("status", "code", "Participation status of the actor.", 0, 1, status));
719        }
720
721        @Override
722        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
723          switch (_hash) {
724          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Role of participant in the appointment.", 0, java.lang.Integer.MAX_VALUE, type);
725          case 92645877: /*actor*/  return new Property("actor", "Reference(Patient|Practitioner|RelatedPerson|Device|HealthcareService|Location)", "A Person, Location/HealthcareService or Device that is participating in the appointment.", 0, 1, actor);
726          case -393139297: /*required*/  return new Property("required", "code", "Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.", 0, 1, required);
727          case -892481550: /*status*/  return new Property("status", "code", "Participation status of the actor.", 0, 1, status);
728          default: return super.getNamedProperty(_hash, _name, _checkValid);
729          }
730
731        }
732
733      @Override
734      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
735        switch (hash) {
736        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept
737        case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference
738        case -393139297: /*required*/ return this.required == null ? new Base[0] : new Base[] {this.required}; // Enumeration<ParticipantRequired>
739        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<ParticipationStatus>
740        default: return super.getProperty(hash, name, checkValid);
741        }
742
743      }
744
745      @Override
746      public Base setProperty(int hash, String name, Base value) throws FHIRException {
747        switch (hash) {
748        case 3575610: // type
749          this.getType().add(castToCodeableConcept(value)); // CodeableConcept
750          return value;
751        case 92645877: // actor
752          this.actor = castToReference(value); // Reference
753          return value;
754        case -393139297: // required
755          value = new ParticipantRequiredEnumFactory().fromType(castToCode(value));
756          this.required = (Enumeration) value; // Enumeration<ParticipantRequired>
757          return value;
758        case -892481550: // status
759          value = new ParticipationStatusEnumFactory().fromType(castToCode(value));
760          this.status = (Enumeration) value; // Enumeration<ParticipationStatus>
761          return value;
762        default: return super.setProperty(hash, name, value);
763        }
764
765      }
766
767      @Override
768      public Base setProperty(String name, Base value) throws FHIRException {
769        if (name.equals("type")) {
770          this.getType().add(castToCodeableConcept(value));
771        } else if (name.equals("actor")) {
772          this.actor = castToReference(value); // Reference
773        } else if (name.equals("required")) {
774          value = new ParticipantRequiredEnumFactory().fromType(castToCode(value));
775          this.required = (Enumeration) value; // Enumeration<ParticipantRequired>
776        } else if (name.equals("status")) {
777          value = new ParticipationStatusEnumFactory().fromType(castToCode(value));
778          this.status = (Enumeration) value; // Enumeration<ParticipationStatus>
779        } else
780          return super.setProperty(name, value);
781        return value;
782      }
783
784      @Override
785      public Base makeProperty(int hash, String name) throws FHIRException {
786        switch (hash) {
787        case 3575610:  return addType(); 
788        case 92645877:  return getActor(); 
789        case -393139297:  return getRequiredElement();
790        case -892481550:  return getStatusElement();
791        default: return super.makeProperty(hash, name);
792        }
793
794      }
795
796      @Override
797      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
798        switch (hash) {
799        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
800        case 92645877: /*actor*/ return new String[] {"Reference"};
801        case -393139297: /*required*/ return new String[] {"code"};
802        case -892481550: /*status*/ return new String[] {"code"};
803        default: return super.getTypesForProperty(hash, name);
804        }
805
806      }
807
808      @Override
809      public Base addChild(String name) throws FHIRException {
810        if (name.equals("type")) {
811          return addType();
812        }
813        else if (name.equals("actor")) {
814          this.actor = new Reference();
815          return this.actor;
816        }
817        else if (name.equals("required")) {
818          throw new FHIRException("Cannot call addChild on a primitive type Appointment.required");
819        }
820        else if (name.equals("status")) {
821          throw new FHIRException("Cannot call addChild on a primitive type Appointment.status");
822        }
823        else
824          return super.addChild(name);
825      }
826
827      public AppointmentParticipantComponent copy() {
828        AppointmentParticipantComponent dst = new AppointmentParticipantComponent();
829        copyValues(dst);
830        if (type != null) {
831          dst.type = new ArrayList<CodeableConcept>();
832          for (CodeableConcept i : type)
833            dst.type.add(i.copy());
834        };
835        dst.actor = actor == null ? null : actor.copy();
836        dst.required = required == null ? null : required.copy();
837        dst.status = status == null ? null : status.copy();
838        return dst;
839      }
840
841      @Override
842      public boolean equalsDeep(Base other_) {
843        if (!super.equalsDeep(other_))
844          return false;
845        if (!(other_ instanceof AppointmentParticipantComponent))
846          return false;
847        AppointmentParticipantComponent o = (AppointmentParticipantComponent) other_;
848        return compareDeep(type, o.type, true) && compareDeep(actor, o.actor, true) && compareDeep(required, o.required, true)
849           && compareDeep(status, o.status, true);
850      }
851
852      @Override
853      public boolean equalsShallow(Base other_) {
854        if (!super.equalsShallow(other_))
855          return false;
856        if (!(other_ instanceof AppointmentParticipantComponent))
857          return false;
858        AppointmentParticipantComponent o = (AppointmentParticipantComponent) other_;
859        return compareValues(required, o.required, true) && compareValues(status, o.status, true);
860      }
861
862      public boolean isEmpty() {
863        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, actor, required, status
864          );
865      }
866
867  public String fhirType() {
868    return "Appointment.participant";
869
870  }
871
872  }
873
874    /**
875     * This records identifiers associated with this appointment concern that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).
876     */
877    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
878    @Description(shortDefinition="External Ids for this item", formalDefinition="This records identifiers associated with this appointment concern that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." )
879    protected List<Identifier> identifier;
880
881    /**
882     * The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.
883     */
884    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
885    @Description(shortDefinition="proposed | pending | booked | arrived | fulfilled | cancelled | noshow | entered-in-error", formalDefinition="The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status." )
886    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/appointmentstatus")
887    protected Enumeration<AppointmentStatus> status;
888
889    /**
890     * A broad categorisation of the service that is to be performed during this appointment.
891     */
892    @Child(name = "serviceCategory", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
893    @Description(shortDefinition="A broad categorisation of the service that is to be performed during this appointment", formalDefinition="A broad categorisation of the service that is to be performed during this appointment." )
894    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/service-category")
895    protected CodeableConcept serviceCategory;
896
897    /**
898     * The specific service that is to be performed during this appointment.
899     */
900    @Child(name = "serviceType", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
901    @Description(shortDefinition="The specific service that is to be performed during this appointment", formalDefinition="The specific service that is to be performed during this appointment." )
902    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/service-type")
903    protected List<CodeableConcept> serviceType;
904
905    /**
906     * The specialty of a practitioner that would be required to perform the service requested in this appointment.
907     */
908    @Child(name = "specialty", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
909    @Description(shortDefinition="The specialty of a practitioner that would be required to perform the service requested in this appointment", formalDefinition="The specialty of a practitioner that would be required to perform the service requested in this appointment." )
910    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/c80-practice-codes")
911    protected List<CodeableConcept> specialty;
912
913    /**
914     * The style of appointment or patient that has been booked in the slot (not service type).
915     */
916    @Child(name = "appointmentType", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true)
917    @Description(shortDefinition="The style of appointment or patient that has been booked in the slot (not service type)", formalDefinition="The style of appointment or patient that has been booked in the slot (not service type)." )
918    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/v2-0276")
919    protected CodeableConcept appointmentType;
920
921    /**
922     * The reason that this appointment is being scheduled. This is more clinical than administrative.
923     */
924    @Child(name = "reason", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
925    @Description(shortDefinition="Reason this appointment is scheduled", formalDefinition="The reason that this appointment is being scheduled. This is more clinical than administrative." )
926    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/encounter-reason")
927    protected List<CodeableConcept> reason;
928
929    /**
930     * Reason the appointment has been scheduled to take place, as specified using information from another resource. When the patient arrives and the encounter begins it may be used as the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.
931     */
932    @Child(name = "indication", type = {Condition.class, Procedure.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
933    @Description(shortDefinition="Reason the appointment is to takes place (resource)", formalDefinition="Reason the appointment has been scheduled to take place, as specified using information from another resource. When the patient arrives and the encounter begins it may be used as the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure." )
934    protected List<Reference> indication;
935    /**
936     * The actual objects that are the target of the reference (Reason the appointment has been scheduled to take place, as specified using information from another resource. When the patient arrives and the encounter begins it may be used as the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.)
937     */
938    protected List<Resource> indicationTarget;
939
940
941    /**
942     * The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority).
943     */
944    @Child(name = "priority", type = {UnsignedIntType.class}, order=8, min=0, max=1, modifier=false, summary=false)
945    @Description(shortDefinition="Used to make informed decisions if needing to re-prioritize", formalDefinition="The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority)." )
946    protected UnsignedIntType priority;
947
948    /**
949     * The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.
950     */
951    @Child(name = "description", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=false)
952    @Description(shortDefinition="Shown on a subject line in a meeting request, or appointment list", formalDefinition="The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field." )
953    protected StringType description;
954
955    /**
956     * Additional information to support the appointment provided when making the appointment.
957     */
958    @Child(name = "supportingInformation", type = {Reference.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
959    @Description(shortDefinition="Additional information to support the appointment", formalDefinition="Additional information to support the appointment provided when making the appointment." )
960    protected List<Reference> supportingInformation;
961    /**
962     * The actual objects that are the target of the reference (Additional information to support the appointment provided when making the appointment.)
963     */
964    protected List<Resource> supportingInformationTarget;
965
966
967    /**
968     * Date/Time that the appointment is to take place.
969     */
970    @Child(name = "start", type = {InstantType.class}, order=11, min=0, max=1, modifier=false, summary=true)
971    @Description(shortDefinition="When appointment is to take place", formalDefinition="Date/Time that the appointment is to take place." )
972    protected InstantType start;
973
974    /**
975     * Date/Time that the appointment is to conclude.
976     */
977    @Child(name = "end", type = {InstantType.class}, order=12, min=0, max=1, modifier=false, summary=true)
978    @Description(shortDefinition="When appointment is to conclude", formalDefinition="Date/Time that the appointment is to conclude." )
979    protected InstantType end;
980
981    /**
982     * Number of minutes that the appointment is to take. This can be less than the duration between the start and end times (where actual time of appointment is only an estimate or is a planned appointment request).
983     */
984    @Child(name = "minutesDuration", type = {PositiveIntType.class}, order=13, min=0, max=1, modifier=false, summary=false)
985    @Description(shortDefinition="Can be less than start/end (e.g. estimate)", formalDefinition="Number of minutes that the appointment is to take. This can be less than the duration between the start and end times (where actual time of appointment is only an estimate or is a planned appointment request)." )
986    protected PositiveIntType minutesDuration;
987
988    /**
989     * The slots from the participants' schedules that will be filled by the appointment.
990     */
991    @Child(name = "slot", type = {Slot.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
992    @Description(shortDefinition="The slots that this appointment is filling", formalDefinition="The slots from the participants' schedules that will be filled by the appointment." )
993    protected List<Reference> slot;
994    /**
995     * The actual objects that are the target of the reference (The slots from the participants' schedules that will be filled by the appointment.)
996     */
997    protected List<Slot> slotTarget;
998
999
1000    /**
1001     * The date that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment.
1002     */
1003    @Child(name = "created", type = {DateTimeType.class}, order=15, min=0, max=1, modifier=false, summary=false)
1004    @Description(shortDefinition="The date that this appointment was initially created", formalDefinition="The date that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment." )
1005    protected DateTimeType created;
1006
1007    /**
1008     * Additional comments about the appointment.
1009     */
1010    @Child(name = "comment", type = {StringType.class}, order=16, min=0, max=1, modifier=false, summary=false)
1011    @Description(shortDefinition="Additional comments", formalDefinition="Additional comments about the appointment." )
1012    protected StringType comment;
1013
1014    /**
1015     * The referral request this appointment is allocated to assess (incoming referral).
1016     */
1017    @Child(name = "incomingReferral", type = {ReferralRequest.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1018    @Description(shortDefinition="The ReferralRequest provided as information to allocate to the Encounter", formalDefinition="The referral request this appointment is allocated to assess (incoming referral)." )
1019    protected List<Reference> incomingReferral;
1020    /**
1021     * The actual objects that are the target of the reference (The referral request this appointment is allocated to assess (incoming referral).)
1022     */
1023    protected List<ReferralRequest> incomingReferralTarget;
1024
1025
1026    /**
1027     * List of participants involved in the appointment.
1028     */
1029    @Child(name = "participant", type = {}, order=18, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1030    @Description(shortDefinition="Participants involved in appointment", formalDefinition="List of participants involved in the appointment." )
1031    protected List<AppointmentParticipantComponent> participant;
1032
1033    /**
1034     * A set of date ranges (potentially including times) that the appointment is preferred to be scheduled within. When using these values, the minutes duration should be provided to indicate the length of the appointment to fill and populate the start/end times for the actual allocated time.
1035     */
1036    @Child(name = "requestedPeriod", type = {Period.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1037    @Description(shortDefinition="Potential date/time interval(s) requested to allocate the appointment within", formalDefinition="A set of date ranges (potentially including times) that the appointment is preferred to be scheduled within. When using these values, the minutes duration should be provided to indicate the length of the appointment to fill and populate the start/end times for the actual allocated time." )
1038    protected List<Period> requestedPeriod;
1039
1040    private static final long serialVersionUID = -1589372810L;
1041
1042  /**
1043   * Constructor
1044   */
1045    public Appointment() {
1046      super();
1047    }
1048
1049  /**
1050   * Constructor
1051   */
1052    public Appointment(Enumeration<AppointmentStatus> status) {
1053      super();
1054      this.status = status;
1055    }
1056
1057    /**
1058     * @return {@link #identifier} (This records identifiers associated with this appointment concern that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).)
1059     */
1060    public List<Identifier> getIdentifier() { 
1061      if (this.identifier == null)
1062        this.identifier = new ArrayList<Identifier>();
1063      return this.identifier;
1064    }
1065
1066    /**
1067     * @return Returns a reference to <code>this</code> for easy method chaining
1068     */
1069    public Appointment setIdentifier(List<Identifier> theIdentifier) { 
1070      this.identifier = theIdentifier;
1071      return this;
1072    }
1073
1074    public boolean hasIdentifier() { 
1075      if (this.identifier == null)
1076        return false;
1077      for (Identifier item : this.identifier)
1078        if (!item.isEmpty())
1079          return true;
1080      return false;
1081    }
1082
1083    public Identifier addIdentifier() { //3
1084      Identifier t = new Identifier();
1085      if (this.identifier == null)
1086        this.identifier = new ArrayList<Identifier>();
1087      this.identifier.add(t);
1088      return t;
1089    }
1090
1091    public Appointment addIdentifier(Identifier t) { //3
1092      if (t == null)
1093        return this;
1094      if (this.identifier == null)
1095        this.identifier = new ArrayList<Identifier>();
1096      this.identifier.add(t);
1097      return this;
1098    }
1099
1100    /**
1101     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
1102     */
1103    public Identifier getIdentifierFirstRep() { 
1104      if (getIdentifier().isEmpty()) {
1105        addIdentifier();
1106      }
1107      return getIdentifier().get(0);
1108    }
1109
1110    /**
1111     * @return {@link #status} (The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1112     */
1113    public Enumeration<AppointmentStatus> getStatusElement() { 
1114      if (this.status == null)
1115        if (Configuration.errorOnAutoCreate())
1116          throw new Error("Attempt to auto-create Appointment.status");
1117        else if (Configuration.doAutoCreate())
1118          this.status = new Enumeration<AppointmentStatus>(new AppointmentStatusEnumFactory()); // bb
1119      return this.status;
1120    }
1121
1122    public boolean hasStatusElement() { 
1123      return this.status != null && !this.status.isEmpty();
1124    }
1125
1126    public boolean hasStatus() { 
1127      return this.status != null && !this.status.isEmpty();
1128    }
1129
1130    /**
1131     * @param value {@link #status} (The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1132     */
1133    public Appointment setStatusElement(Enumeration<AppointmentStatus> value) { 
1134      this.status = value;
1135      return this;
1136    }
1137
1138    /**
1139     * @return The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.
1140     */
1141    public AppointmentStatus getStatus() { 
1142      return this.status == null ? null : this.status.getValue();
1143    }
1144
1145    /**
1146     * @param value The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.
1147     */
1148    public Appointment setStatus(AppointmentStatus value) { 
1149        if (this.status == null)
1150          this.status = new Enumeration<AppointmentStatus>(new AppointmentStatusEnumFactory());
1151        this.status.setValue(value);
1152      return this;
1153    }
1154
1155    /**
1156     * @return {@link #serviceCategory} (A broad categorisation of the service that is to be performed during this appointment.)
1157     */
1158    public CodeableConcept getServiceCategory() { 
1159      if (this.serviceCategory == null)
1160        if (Configuration.errorOnAutoCreate())
1161          throw new Error("Attempt to auto-create Appointment.serviceCategory");
1162        else if (Configuration.doAutoCreate())
1163          this.serviceCategory = new CodeableConcept(); // cc
1164      return this.serviceCategory;
1165    }
1166
1167    public boolean hasServiceCategory() { 
1168      return this.serviceCategory != null && !this.serviceCategory.isEmpty();
1169    }
1170
1171    /**
1172     * @param value {@link #serviceCategory} (A broad categorisation of the service that is to be performed during this appointment.)
1173     */
1174    public Appointment setServiceCategory(CodeableConcept value)  { 
1175      this.serviceCategory = value;
1176      return this;
1177    }
1178
1179    /**
1180     * @return {@link #serviceType} (The specific service that is to be performed during this appointment.)
1181     */
1182    public List<CodeableConcept> getServiceType() { 
1183      if (this.serviceType == null)
1184        this.serviceType = new ArrayList<CodeableConcept>();
1185      return this.serviceType;
1186    }
1187
1188    /**
1189     * @return Returns a reference to <code>this</code> for easy method chaining
1190     */
1191    public Appointment setServiceType(List<CodeableConcept> theServiceType) { 
1192      this.serviceType = theServiceType;
1193      return this;
1194    }
1195
1196    public boolean hasServiceType() { 
1197      if (this.serviceType == null)
1198        return false;
1199      for (CodeableConcept item : this.serviceType)
1200        if (!item.isEmpty())
1201          return true;
1202      return false;
1203    }
1204
1205    public CodeableConcept addServiceType() { //3
1206      CodeableConcept t = new CodeableConcept();
1207      if (this.serviceType == null)
1208        this.serviceType = new ArrayList<CodeableConcept>();
1209      this.serviceType.add(t);
1210      return t;
1211    }
1212
1213    public Appointment addServiceType(CodeableConcept t) { //3
1214      if (t == null)
1215        return this;
1216      if (this.serviceType == null)
1217        this.serviceType = new ArrayList<CodeableConcept>();
1218      this.serviceType.add(t);
1219      return this;
1220    }
1221
1222    /**
1223     * @return The first repetition of repeating field {@link #serviceType}, creating it if it does not already exist
1224     */
1225    public CodeableConcept getServiceTypeFirstRep() { 
1226      if (getServiceType().isEmpty()) {
1227        addServiceType();
1228      }
1229      return getServiceType().get(0);
1230    }
1231
1232    /**
1233     * @return {@link #specialty} (The specialty of a practitioner that would be required to perform the service requested in this appointment.)
1234     */
1235    public List<CodeableConcept> getSpecialty() { 
1236      if (this.specialty == null)
1237        this.specialty = new ArrayList<CodeableConcept>();
1238      return this.specialty;
1239    }
1240
1241    /**
1242     * @return Returns a reference to <code>this</code> for easy method chaining
1243     */
1244    public Appointment setSpecialty(List<CodeableConcept> theSpecialty) { 
1245      this.specialty = theSpecialty;
1246      return this;
1247    }
1248
1249    public boolean hasSpecialty() { 
1250      if (this.specialty == null)
1251        return false;
1252      for (CodeableConcept item : this.specialty)
1253        if (!item.isEmpty())
1254          return true;
1255      return false;
1256    }
1257
1258    public CodeableConcept addSpecialty() { //3
1259      CodeableConcept t = new CodeableConcept();
1260      if (this.specialty == null)
1261        this.specialty = new ArrayList<CodeableConcept>();
1262      this.specialty.add(t);
1263      return t;
1264    }
1265
1266    public Appointment addSpecialty(CodeableConcept t) { //3
1267      if (t == null)
1268        return this;
1269      if (this.specialty == null)
1270        this.specialty = new ArrayList<CodeableConcept>();
1271      this.specialty.add(t);
1272      return this;
1273    }
1274
1275    /**
1276     * @return The first repetition of repeating field {@link #specialty}, creating it if it does not already exist
1277     */
1278    public CodeableConcept getSpecialtyFirstRep() { 
1279      if (getSpecialty().isEmpty()) {
1280        addSpecialty();
1281      }
1282      return getSpecialty().get(0);
1283    }
1284
1285    /**
1286     * @return {@link #appointmentType} (The style of appointment or patient that has been booked in the slot (not service type).)
1287     */
1288    public CodeableConcept getAppointmentType() { 
1289      if (this.appointmentType == null)
1290        if (Configuration.errorOnAutoCreate())
1291          throw new Error("Attempt to auto-create Appointment.appointmentType");
1292        else if (Configuration.doAutoCreate())
1293          this.appointmentType = new CodeableConcept(); // cc
1294      return this.appointmentType;
1295    }
1296
1297    public boolean hasAppointmentType() { 
1298      return this.appointmentType != null && !this.appointmentType.isEmpty();
1299    }
1300
1301    /**
1302     * @param value {@link #appointmentType} (The style of appointment or patient that has been booked in the slot (not service type).)
1303     */
1304    public Appointment setAppointmentType(CodeableConcept value)  { 
1305      this.appointmentType = value;
1306      return this;
1307    }
1308
1309    /**
1310     * @return {@link #reason} (The reason that this appointment is being scheduled. This is more clinical than administrative.)
1311     */
1312    public List<CodeableConcept> getReason() { 
1313      if (this.reason == null)
1314        this.reason = new ArrayList<CodeableConcept>();
1315      return this.reason;
1316    }
1317
1318    /**
1319     * @return Returns a reference to <code>this</code> for easy method chaining
1320     */
1321    public Appointment setReason(List<CodeableConcept> theReason) { 
1322      this.reason = theReason;
1323      return this;
1324    }
1325
1326    public boolean hasReason() { 
1327      if (this.reason == null)
1328        return false;
1329      for (CodeableConcept item : this.reason)
1330        if (!item.isEmpty())
1331          return true;
1332      return false;
1333    }
1334
1335    public CodeableConcept addReason() { //3
1336      CodeableConcept t = new CodeableConcept();
1337      if (this.reason == null)
1338        this.reason = new ArrayList<CodeableConcept>();
1339      this.reason.add(t);
1340      return t;
1341    }
1342
1343    public Appointment addReason(CodeableConcept t) { //3
1344      if (t == null)
1345        return this;
1346      if (this.reason == null)
1347        this.reason = new ArrayList<CodeableConcept>();
1348      this.reason.add(t);
1349      return this;
1350    }
1351
1352    /**
1353     * @return The first repetition of repeating field {@link #reason}, creating it if it does not already exist
1354     */
1355    public CodeableConcept getReasonFirstRep() { 
1356      if (getReason().isEmpty()) {
1357        addReason();
1358      }
1359      return getReason().get(0);
1360    }
1361
1362    /**
1363     * @return {@link #indication} (Reason the appointment has been scheduled to take place, as specified using information from another resource. When the patient arrives and the encounter begins it may be used as the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.)
1364     */
1365    public List<Reference> getIndication() { 
1366      if (this.indication == null)
1367        this.indication = new ArrayList<Reference>();
1368      return this.indication;
1369    }
1370
1371    /**
1372     * @return Returns a reference to <code>this</code> for easy method chaining
1373     */
1374    public Appointment setIndication(List<Reference> theIndication) { 
1375      this.indication = theIndication;
1376      return this;
1377    }
1378
1379    public boolean hasIndication() { 
1380      if (this.indication == null)
1381        return false;
1382      for (Reference item : this.indication)
1383        if (!item.isEmpty())
1384          return true;
1385      return false;
1386    }
1387
1388    public Reference addIndication() { //3
1389      Reference t = new Reference();
1390      if (this.indication == null)
1391        this.indication = new ArrayList<Reference>();
1392      this.indication.add(t);
1393      return t;
1394    }
1395
1396    public Appointment addIndication(Reference t) { //3
1397      if (t == null)
1398        return this;
1399      if (this.indication == null)
1400        this.indication = new ArrayList<Reference>();
1401      this.indication.add(t);
1402      return this;
1403    }
1404
1405    /**
1406     * @return The first repetition of repeating field {@link #indication}, creating it if it does not already exist
1407     */
1408    public Reference getIndicationFirstRep() { 
1409      if (getIndication().isEmpty()) {
1410        addIndication();
1411      }
1412      return getIndication().get(0);
1413    }
1414
1415    /**
1416     * @deprecated Use Reference#setResource(IBaseResource) instead
1417     */
1418    @Deprecated
1419    public List<Resource> getIndicationTarget() { 
1420      if (this.indicationTarget == null)
1421        this.indicationTarget = new ArrayList<Resource>();
1422      return this.indicationTarget;
1423    }
1424
1425    /**
1426     * @return {@link #priority} (The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority).). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value
1427     */
1428    public UnsignedIntType getPriorityElement() { 
1429      if (this.priority == null)
1430        if (Configuration.errorOnAutoCreate())
1431          throw new Error("Attempt to auto-create Appointment.priority");
1432        else if (Configuration.doAutoCreate())
1433          this.priority = new UnsignedIntType(); // bb
1434      return this.priority;
1435    }
1436
1437    public boolean hasPriorityElement() { 
1438      return this.priority != null && !this.priority.isEmpty();
1439    }
1440
1441    public boolean hasPriority() { 
1442      return this.priority != null && !this.priority.isEmpty();
1443    }
1444
1445    /**
1446     * @param value {@link #priority} (The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority).). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value
1447     */
1448    public Appointment setPriorityElement(UnsignedIntType value) { 
1449      this.priority = value;
1450      return this;
1451    }
1452
1453    /**
1454     * @return The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority).
1455     */
1456    public int getPriority() { 
1457      return this.priority == null || this.priority.isEmpty() ? 0 : this.priority.getValue();
1458    }
1459
1460    /**
1461     * @param value The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority).
1462     */
1463    public Appointment setPriority(int value) { 
1464        if (this.priority == null)
1465          this.priority = new UnsignedIntType();
1466        this.priority.setValue(value);
1467      return this;
1468    }
1469
1470    /**
1471     * @return {@link #description} (The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1472     */
1473    public StringType getDescriptionElement() { 
1474      if (this.description == null)
1475        if (Configuration.errorOnAutoCreate())
1476          throw new Error("Attempt to auto-create Appointment.description");
1477        else if (Configuration.doAutoCreate())
1478          this.description = new StringType(); // bb
1479      return this.description;
1480    }
1481
1482    public boolean hasDescriptionElement() { 
1483      return this.description != null && !this.description.isEmpty();
1484    }
1485
1486    public boolean hasDescription() { 
1487      return this.description != null && !this.description.isEmpty();
1488    }
1489
1490    /**
1491     * @param value {@link #description} (The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1492     */
1493    public Appointment setDescriptionElement(StringType value) { 
1494      this.description = value;
1495      return this;
1496    }
1497
1498    /**
1499     * @return The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.
1500     */
1501    public String getDescription() { 
1502      return this.description == null ? null : this.description.getValue();
1503    }
1504
1505    /**
1506     * @param value The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.
1507     */
1508    public Appointment setDescription(String value) { 
1509      if (Utilities.noString(value))
1510        this.description = null;
1511      else {
1512        if (this.description == null)
1513          this.description = new StringType();
1514        this.description.setValue(value);
1515      }
1516      return this;
1517    }
1518
1519    /**
1520     * @return {@link #supportingInformation} (Additional information to support the appointment provided when making the appointment.)
1521     */
1522    public List<Reference> getSupportingInformation() { 
1523      if (this.supportingInformation == null)
1524        this.supportingInformation = new ArrayList<Reference>();
1525      return this.supportingInformation;
1526    }
1527
1528    /**
1529     * @return Returns a reference to <code>this</code> for easy method chaining
1530     */
1531    public Appointment setSupportingInformation(List<Reference> theSupportingInformation) { 
1532      this.supportingInformation = theSupportingInformation;
1533      return this;
1534    }
1535
1536    public boolean hasSupportingInformation() { 
1537      if (this.supportingInformation == null)
1538        return false;
1539      for (Reference item : this.supportingInformation)
1540        if (!item.isEmpty())
1541          return true;
1542      return false;
1543    }
1544
1545    public Reference addSupportingInformation() { //3
1546      Reference t = new Reference();
1547      if (this.supportingInformation == null)
1548        this.supportingInformation = new ArrayList<Reference>();
1549      this.supportingInformation.add(t);
1550      return t;
1551    }
1552
1553    public Appointment addSupportingInformation(Reference t) { //3
1554      if (t == null)
1555        return this;
1556      if (this.supportingInformation == null)
1557        this.supportingInformation = new ArrayList<Reference>();
1558      this.supportingInformation.add(t);
1559      return this;
1560    }
1561
1562    /**
1563     * @return The first repetition of repeating field {@link #supportingInformation}, creating it if it does not already exist
1564     */
1565    public Reference getSupportingInformationFirstRep() { 
1566      if (getSupportingInformation().isEmpty()) {
1567        addSupportingInformation();
1568      }
1569      return getSupportingInformation().get(0);
1570    }
1571
1572    /**
1573     * @deprecated Use Reference#setResource(IBaseResource) instead
1574     */
1575    @Deprecated
1576    public List<Resource> getSupportingInformationTarget() { 
1577      if (this.supportingInformationTarget == null)
1578        this.supportingInformationTarget = new ArrayList<Resource>();
1579      return this.supportingInformationTarget;
1580    }
1581
1582    /**
1583     * @return {@link #start} (Date/Time that the appointment is to take place.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value
1584     */
1585    public InstantType getStartElement() { 
1586      if (this.start == null)
1587        if (Configuration.errorOnAutoCreate())
1588          throw new Error("Attempt to auto-create Appointment.start");
1589        else if (Configuration.doAutoCreate())
1590          this.start = new InstantType(); // bb
1591      return this.start;
1592    }
1593
1594    public boolean hasStartElement() { 
1595      return this.start != null && !this.start.isEmpty();
1596    }
1597
1598    public boolean hasStart() { 
1599      return this.start != null && !this.start.isEmpty();
1600    }
1601
1602    /**
1603     * @param value {@link #start} (Date/Time that the appointment is to take place.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value
1604     */
1605    public Appointment setStartElement(InstantType value) { 
1606      this.start = value;
1607      return this;
1608    }
1609
1610    /**
1611     * @return Date/Time that the appointment is to take place.
1612     */
1613    public Date getStart() { 
1614      return this.start == null ? null : this.start.getValue();
1615    }
1616
1617    /**
1618     * @param value Date/Time that the appointment is to take place.
1619     */
1620    public Appointment setStart(Date value) { 
1621      if (value == null)
1622        this.start = null;
1623      else {
1624        if (this.start == null)
1625          this.start = new InstantType();
1626        this.start.setValue(value);
1627      }
1628      return this;
1629    }
1630
1631    /**
1632     * @return {@link #end} (Date/Time that the appointment is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value
1633     */
1634    public InstantType getEndElement() { 
1635      if (this.end == null)
1636        if (Configuration.errorOnAutoCreate())
1637          throw new Error("Attempt to auto-create Appointment.end");
1638        else if (Configuration.doAutoCreate())
1639          this.end = new InstantType(); // bb
1640      return this.end;
1641    }
1642
1643    public boolean hasEndElement() { 
1644      return this.end != null && !this.end.isEmpty();
1645    }
1646
1647    public boolean hasEnd() { 
1648      return this.end != null && !this.end.isEmpty();
1649    }
1650
1651    /**
1652     * @param value {@link #end} (Date/Time that the appointment is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value
1653     */
1654    public Appointment setEndElement(InstantType value) { 
1655      this.end = value;
1656      return this;
1657    }
1658
1659    /**
1660     * @return Date/Time that the appointment is to conclude.
1661     */
1662    public Date getEnd() { 
1663      return this.end == null ? null : this.end.getValue();
1664    }
1665
1666    /**
1667     * @param value Date/Time that the appointment is to conclude.
1668     */
1669    public Appointment setEnd(Date value) { 
1670      if (value == null)
1671        this.end = null;
1672      else {
1673        if (this.end == null)
1674          this.end = new InstantType();
1675        this.end.setValue(value);
1676      }
1677      return this;
1678    }
1679
1680    /**
1681     * @return {@link #minutesDuration} (Number of minutes that the appointment is to take. This can be less than the duration between the start and end times (where actual time of appointment is only an estimate or is a planned appointment request).). This is the underlying object with id, value and extensions. The accessor "getMinutesDuration" gives direct access to the value
1682     */
1683    public PositiveIntType getMinutesDurationElement() { 
1684      if (this.minutesDuration == null)
1685        if (Configuration.errorOnAutoCreate())
1686          throw new Error("Attempt to auto-create Appointment.minutesDuration");
1687        else if (Configuration.doAutoCreate())
1688          this.minutesDuration = new PositiveIntType(); // bb
1689      return this.minutesDuration;
1690    }
1691
1692    public boolean hasMinutesDurationElement() { 
1693      return this.minutesDuration != null && !this.minutesDuration.isEmpty();
1694    }
1695
1696    public boolean hasMinutesDuration() { 
1697      return this.minutesDuration != null && !this.minutesDuration.isEmpty();
1698    }
1699
1700    /**
1701     * @param value {@link #minutesDuration} (Number of minutes that the appointment is to take. This can be less than the duration between the start and end times (where actual time of appointment is only an estimate or is a planned appointment request).). This is the underlying object with id, value and extensions. The accessor "getMinutesDuration" gives direct access to the value
1702     */
1703    public Appointment setMinutesDurationElement(PositiveIntType value) { 
1704      this.minutesDuration = value;
1705      return this;
1706    }
1707
1708    /**
1709     * @return Number of minutes that the appointment is to take. This can be less than the duration between the start and end times (where actual time of appointment is only an estimate or is a planned appointment request).
1710     */
1711    public int getMinutesDuration() { 
1712      return this.minutesDuration == null || this.minutesDuration.isEmpty() ? 0 : this.minutesDuration.getValue();
1713    }
1714
1715    /**
1716     * @param value Number of minutes that the appointment is to take. This can be less than the duration between the start and end times (where actual time of appointment is only an estimate or is a planned appointment request).
1717     */
1718    public Appointment setMinutesDuration(int value) { 
1719        if (this.minutesDuration == null)
1720          this.minutesDuration = new PositiveIntType();
1721        this.minutesDuration.setValue(value);
1722      return this;
1723    }
1724
1725    /**
1726     * @return {@link #slot} (The slots from the participants' schedules that will be filled by the appointment.)
1727     */
1728    public List<Reference> getSlot() { 
1729      if (this.slot == null)
1730        this.slot = new ArrayList<Reference>();
1731      return this.slot;
1732    }
1733
1734    /**
1735     * @return Returns a reference to <code>this</code> for easy method chaining
1736     */
1737    public Appointment setSlot(List<Reference> theSlot) { 
1738      this.slot = theSlot;
1739      return this;
1740    }
1741
1742    public boolean hasSlot() { 
1743      if (this.slot == null)
1744        return false;
1745      for (Reference item : this.slot)
1746        if (!item.isEmpty())
1747          return true;
1748      return false;
1749    }
1750
1751    public Reference addSlot() { //3
1752      Reference t = new Reference();
1753      if (this.slot == null)
1754        this.slot = new ArrayList<Reference>();
1755      this.slot.add(t);
1756      return t;
1757    }
1758
1759    public Appointment addSlot(Reference t) { //3
1760      if (t == null)
1761        return this;
1762      if (this.slot == null)
1763        this.slot = new ArrayList<Reference>();
1764      this.slot.add(t);
1765      return this;
1766    }
1767
1768    /**
1769     * @return The first repetition of repeating field {@link #slot}, creating it if it does not already exist
1770     */
1771    public Reference getSlotFirstRep() { 
1772      if (getSlot().isEmpty()) {
1773        addSlot();
1774      }
1775      return getSlot().get(0);
1776    }
1777
1778    /**
1779     * @deprecated Use Reference#setResource(IBaseResource) instead
1780     */
1781    @Deprecated
1782    public List<Slot> getSlotTarget() { 
1783      if (this.slotTarget == null)
1784        this.slotTarget = new ArrayList<Slot>();
1785      return this.slotTarget;
1786    }
1787
1788    /**
1789     * @deprecated Use Reference#setResource(IBaseResource) instead
1790     */
1791    @Deprecated
1792    public Slot addSlotTarget() { 
1793      Slot r = new Slot();
1794      if (this.slotTarget == null)
1795        this.slotTarget = new ArrayList<Slot>();
1796      this.slotTarget.add(r);
1797      return r;
1798    }
1799
1800    /**
1801     * @return {@link #created} (The date that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
1802     */
1803    public DateTimeType getCreatedElement() { 
1804      if (this.created == null)
1805        if (Configuration.errorOnAutoCreate())
1806          throw new Error("Attempt to auto-create Appointment.created");
1807        else if (Configuration.doAutoCreate())
1808          this.created = new DateTimeType(); // bb
1809      return this.created;
1810    }
1811
1812    public boolean hasCreatedElement() { 
1813      return this.created != null && !this.created.isEmpty();
1814    }
1815
1816    public boolean hasCreated() { 
1817      return this.created != null && !this.created.isEmpty();
1818    }
1819
1820    /**
1821     * @param value {@link #created} (The date that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
1822     */
1823    public Appointment setCreatedElement(DateTimeType value) { 
1824      this.created = value;
1825      return this;
1826    }
1827
1828    /**
1829     * @return The date that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment.
1830     */
1831    public Date getCreated() { 
1832      return this.created == null ? null : this.created.getValue();
1833    }
1834
1835    /**
1836     * @param value The date that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment.
1837     */
1838    public Appointment setCreated(Date value) { 
1839      if (value == null)
1840        this.created = null;
1841      else {
1842        if (this.created == null)
1843          this.created = new DateTimeType();
1844        this.created.setValue(value);
1845      }
1846      return this;
1847    }
1848
1849    /**
1850     * @return {@link #comment} (Additional comments about the appointment.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value
1851     */
1852    public StringType getCommentElement() { 
1853      if (this.comment == null)
1854        if (Configuration.errorOnAutoCreate())
1855          throw new Error("Attempt to auto-create Appointment.comment");
1856        else if (Configuration.doAutoCreate())
1857          this.comment = new StringType(); // bb
1858      return this.comment;
1859    }
1860
1861    public boolean hasCommentElement() { 
1862      return this.comment != null && !this.comment.isEmpty();
1863    }
1864
1865    public boolean hasComment() { 
1866      return this.comment != null && !this.comment.isEmpty();
1867    }
1868
1869    /**
1870     * @param value {@link #comment} (Additional comments about the appointment.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value
1871     */
1872    public Appointment setCommentElement(StringType value) { 
1873      this.comment = value;
1874      return this;
1875    }
1876
1877    /**
1878     * @return Additional comments about the appointment.
1879     */
1880    public String getComment() { 
1881      return this.comment == null ? null : this.comment.getValue();
1882    }
1883
1884    /**
1885     * @param value Additional comments about the appointment.
1886     */
1887    public Appointment setComment(String value) { 
1888      if (Utilities.noString(value))
1889        this.comment = null;
1890      else {
1891        if (this.comment == null)
1892          this.comment = new StringType();
1893        this.comment.setValue(value);
1894      }
1895      return this;
1896    }
1897
1898    /**
1899     * @return {@link #incomingReferral} (The referral request this appointment is allocated to assess (incoming referral).)
1900     */
1901    public List<Reference> getIncomingReferral() { 
1902      if (this.incomingReferral == null)
1903        this.incomingReferral = new ArrayList<Reference>();
1904      return this.incomingReferral;
1905    }
1906
1907    /**
1908     * @return Returns a reference to <code>this</code> for easy method chaining
1909     */
1910    public Appointment setIncomingReferral(List<Reference> theIncomingReferral) { 
1911      this.incomingReferral = theIncomingReferral;
1912      return this;
1913    }
1914
1915    public boolean hasIncomingReferral() { 
1916      if (this.incomingReferral == null)
1917        return false;
1918      for (Reference item : this.incomingReferral)
1919        if (!item.isEmpty())
1920          return true;
1921      return false;
1922    }
1923
1924    public Reference addIncomingReferral() { //3
1925      Reference t = new Reference();
1926      if (this.incomingReferral == null)
1927        this.incomingReferral = new ArrayList<Reference>();
1928      this.incomingReferral.add(t);
1929      return t;
1930    }
1931
1932    public Appointment addIncomingReferral(Reference t) { //3
1933      if (t == null)
1934        return this;
1935      if (this.incomingReferral == null)
1936        this.incomingReferral = new ArrayList<Reference>();
1937      this.incomingReferral.add(t);
1938      return this;
1939    }
1940
1941    /**
1942     * @return The first repetition of repeating field {@link #incomingReferral}, creating it if it does not already exist
1943     */
1944    public Reference getIncomingReferralFirstRep() { 
1945      if (getIncomingReferral().isEmpty()) {
1946        addIncomingReferral();
1947      }
1948      return getIncomingReferral().get(0);
1949    }
1950
1951    /**
1952     * @deprecated Use Reference#setResource(IBaseResource) instead
1953     */
1954    @Deprecated
1955    public List<ReferralRequest> getIncomingReferralTarget() { 
1956      if (this.incomingReferralTarget == null)
1957        this.incomingReferralTarget = new ArrayList<ReferralRequest>();
1958      return this.incomingReferralTarget;
1959    }
1960
1961    /**
1962     * @deprecated Use Reference#setResource(IBaseResource) instead
1963     */
1964    @Deprecated
1965    public ReferralRequest addIncomingReferralTarget() { 
1966      ReferralRequest r = new ReferralRequest();
1967      if (this.incomingReferralTarget == null)
1968        this.incomingReferralTarget = new ArrayList<ReferralRequest>();
1969      this.incomingReferralTarget.add(r);
1970      return r;
1971    }
1972
1973    /**
1974     * @return {@link #participant} (List of participants involved in the appointment.)
1975     */
1976    public List<AppointmentParticipantComponent> getParticipant() { 
1977      if (this.participant == null)
1978        this.participant = new ArrayList<AppointmentParticipantComponent>();
1979      return this.participant;
1980    }
1981
1982    /**
1983     * @return Returns a reference to <code>this</code> for easy method chaining
1984     */
1985    public Appointment setParticipant(List<AppointmentParticipantComponent> theParticipant) { 
1986      this.participant = theParticipant;
1987      return this;
1988    }
1989
1990    public boolean hasParticipant() { 
1991      if (this.participant == null)
1992        return false;
1993      for (AppointmentParticipantComponent item : this.participant)
1994        if (!item.isEmpty())
1995          return true;
1996      return false;
1997    }
1998
1999    public AppointmentParticipantComponent addParticipant() { //3
2000      AppointmentParticipantComponent t = new AppointmentParticipantComponent();
2001      if (this.participant == null)
2002        this.participant = new ArrayList<AppointmentParticipantComponent>();
2003      this.participant.add(t);
2004      return t;
2005    }
2006
2007    public Appointment addParticipant(AppointmentParticipantComponent t) { //3
2008      if (t == null)
2009        return this;
2010      if (this.participant == null)
2011        this.participant = new ArrayList<AppointmentParticipantComponent>();
2012      this.participant.add(t);
2013      return this;
2014    }
2015
2016    /**
2017     * @return The first repetition of repeating field {@link #participant}, creating it if it does not already exist
2018     */
2019    public AppointmentParticipantComponent getParticipantFirstRep() { 
2020      if (getParticipant().isEmpty()) {
2021        addParticipant();
2022      }
2023      return getParticipant().get(0);
2024    }
2025
2026    /**
2027     * @return {@link #requestedPeriod} (A set of date ranges (potentially including times) that the appointment is preferred to be scheduled within. When using these values, the minutes duration should be provided to indicate the length of the appointment to fill and populate the start/end times for the actual allocated time.)
2028     */
2029    public List<Period> getRequestedPeriod() { 
2030      if (this.requestedPeriod == null)
2031        this.requestedPeriod = new ArrayList<Period>();
2032      return this.requestedPeriod;
2033    }
2034
2035    /**
2036     * @return Returns a reference to <code>this</code> for easy method chaining
2037     */
2038    public Appointment setRequestedPeriod(List<Period> theRequestedPeriod) { 
2039      this.requestedPeriod = theRequestedPeriod;
2040      return this;
2041    }
2042
2043    public boolean hasRequestedPeriod() { 
2044      if (this.requestedPeriod == null)
2045        return false;
2046      for (Period item : this.requestedPeriod)
2047        if (!item.isEmpty())
2048          return true;
2049      return false;
2050    }
2051
2052    public Period addRequestedPeriod() { //3
2053      Period t = new Period();
2054      if (this.requestedPeriod == null)
2055        this.requestedPeriod = new ArrayList<Period>();
2056      this.requestedPeriod.add(t);
2057      return t;
2058    }
2059
2060    public Appointment addRequestedPeriod(Period t) { //3
2061      if (t == null)
2062        return this;
2063      if (this.requestedPeriod == null)
2064        this.requestedPeriod = new ArrayList<Period>();
2065      this.requestedPeriod.add(t);
2066      return this;
2067    }
2068
2069    /**
2070     * @return The first repetition of repeating field {@link #requestedPeriod}, creating it if it does not already exist
2071     */
2072    public Period getRequestedPeriodFirstRep() { 
2073      if (getRequestedPeriod().isEmpty()) {
2074        addRequestedPeriod();
2075      }
2076      return getRequestedPeriod().get(0);
2077    }
2078
2079      protected void listChildren(List<Property> children) {
2080        super.listChildren(children);
2081        children.add(new Property("identifier", "Identifier", "This records identifiers associated with this appointment concern that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier));
2082        children.add(new Property("status", "code", "The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.", 0, 1, status));
2083        children.add(new Property("serviceCategory", "CodeableConcept", "A broad categorisation of the service that is to be performed during this appointment.", 0, 1, serviceCategory));
2084        children.add(new Property("serviceType", "CodeableConcept", "The specific service that is to be performed during this appointment.", 0, java.lang.Integer.MAX_VALUE, serviceType));
2085        children.add(new Property("specialty", "CodeableConcept", "The specialty of a practitioner that would be required to perform the service requested in this appointment.", 0, java.lang.Integer.MAX_VALUE, specialty));
2086        children.add(new Property("appointmentType", "CodeableConcept", "The style of appointment or patient that has been booked in the slot (not service type).", 0, 1, appointmentType));
2087        children.add(new Property("reason", "CodeableConcept", "The reason that this appointment is being scheduled. This is more clinical than administrative.", 0, java.lang.Integer.MAX_VALUE, reason));
2088        children.add(new Property("indication", "Reference(Condition|Procedure)", "Reason the appointment has been scheduled to take place, as specified using information from another resource. When the patient arrives and the encounter begins it may be used as the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.", 0, java.lang.Integer.MAX_VALUE, indication));
2089        children.add(new Property("priority", "unsignedInt", "The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority).", 0, 1, priority));
2090        children.add(new Property("description", "string", "The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.", 0, 1, description));
2091        children.add(new Property("supportingInformation", "Reference(Any)", "Additional information to support the appointment provided when making the appointment.", 0, java.lang.Integer.MAX_VALUE, supportingInformation));
2092        children.add(new Property("start", "instant", "Date/Time that the appointment is to take place.", 0, 1, start));
2093        children.add(new Property("end", "instant", "Date/Time that the appointment is to conclude.", 0, 1, end));
2094        children.add(new Property("minutesDuration", "positiveInt", "Number of minutes that the appointment is to take. This can be less than the duration between the start and end times (where actual time of appointment is only an estimate or is a planned appointment request).", 0, 1, minutesDuration));
2095        children.add(new Property("slot", "Reference(Slot)", "The slots from the participants' schedules that will be filled by the appointment.", 0, java.lang.Integer.MAX_VALUE, slot));
2096        children.add(new Property("created", "dateTime", "The date that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment.", 0, 1, created));
2097        children.add(new Property("comment", "string", "Additional comments about the appointment.", 0, 1, comment));
2098        children.add(new Property("incomingReferral", "Reference(ReferralRequest)", "The referral request this appointment is allocated to assess (incoming referral).", 0, java.lang.Integer.MAX_VALUE, incomingReferral));
2099        children.add(new Property("participant", "", "List of participants involved in the appointment.", 0, java.lang.Integer.MAX_VALUE, participant));
2100        children.add(new Property("requestedPeriod", "Period", "A set of date ranges (potentially including times) that the appointment is preferred to be scheduled within. When using these values, the minutes duration should be provided to indicate the length of the appointment to fill and populate the start/end times for the actual allocated time.", 0, java.lang.Integer.MAX_VALUE, requestedPeriod));
2101      }
2102
2103      @Override
2104      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2105        switch (_hash) {
2106        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "This records identifiers associated with this appointment concern that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier);
2107        case -892481550: /*status*/  return new Property("status", "code", "The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.", 0, 1, status);
2108        case 1281188563: /*serviceCategory*/  return new Property("serviceCategory", "CodeableConcept", "A broad categorisation of the service that is to be performed during this appointment.", 0, 1, serviceCategory);
2109        case -1928370289: /*serviceType*/  return new Property("serviceType", "CodeableConcept", "The specific service that is to be performed during this appointment.", 0, java.lang.Integer.MAX_VALUE, serviceType);
2110        case -1694759682: /*specialty*/  return new Property("specialty", "CodeableConcept", "The specialty of a practitioner that would be required to perform the service requested in this appointment.", 0, java.lang.Integer.MAX_VALUE, specialty);
2111        case -1596426375: /*appointmentType*/  return new Property("appointmentType", "CodeableConcept", "The style of appointment or patient that has been booked in the slot (not service type).", 0, 1, appointmentType);
2112        case -934964668: /*reason*/  return new Property("reason", "CodeableConcept", "The reason that this appointment is being scheduled. This is more clinical than administrative.", 0, java.lang.Integer.MAX_VALUE, reason);
2113        case -597168804: /*indication*/  return new Property("indication", "Reference(Condition|Procedure)", "Reason the appointment has been scheduled to take place, as specified using information from another resource. When the patient arrives and the encounter begins it may be used as the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.", 0, java.lang.Integer.MAX_VALUE, indication);
2114        case -1165461084: /*priority*/  return new Property("priority", "unsignedInt", "The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority).", 0, 1, priority);
2115        case -1724546052: /*description*/  return new Property("description", "string", "The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.", 0, 1, description);
2116        case -1248768647: /*supportingInformation*/  return new Property("supportingInformation", "Reference(Any)", "Additional information to support the appointment provided when making the appointment.", 0, java.lang.Integer.MAX_VALUE, supportingInformation);
2117        case 109757538: /*start*/  return new Property("start", "instant", "Date/Time that the appointment is to take place.", 0, 1, start);
2118        case 100571: /*end*/  return new Property("end", "instant", "Date/Time that the appointment is to conclude.", 0, 1, end);
2119        case -413630573: /*minutesDuration*/  return new Property("minutesDuration", "positiveInt", "Number of minutes that the appointment is to take. This can be less than the duration between the start and end times (where actual time of appointment is only an estimate or is a planned appointment request).", 0, 1, minutesDuration);
2120        case 3533310: /*slot*/  return new Property("slot", "Reference(Slot)", "The slots from the participants' schedules that will be filled by the appointment.", 0, java.lang.Integer.MAX_VALUE, slot);
2121        case 1028554472: /*created*/  return new Property("created", "dateTime", "The date that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment.", 0, 1, created);
2122        case 950398559: /*comment*/  return new Property("comment", "string", "Additional comments about the appointment.", 0, 1, comment);
2123        case -1258204701: /*incomingReferral*/  return new Property("incomingReferral", "Reference(ReferralRequest)", "The referral request this appointment is allocated to assess (incoming referral).", 0, java.lang.Integer.MAX_VALUE, incomingReferral);
2124        case 767422259: /*participant*/  return new Property("participant", "", "List of participants involved in the appointment.", 0, java.lang.Integer.MAX_VALUE, participant);
2125        case -897241393: /*requestedPeriod*/  return new Property("requestedPeriod", "Period", "A set of date ranges (potentially including times) that the appointment is preferred to be scheduled within. When using these values, the minutes duration should be provided to indicate the length of the appointment to fill and populate the start/end times for the actual allocated time.", 0, java.lang.Integer.MAX_VALUE, requestedPeriod);
2126        default: return super.getNamedProperty(_hash, _name, _checkValid);
2127        }
2128
2129      }
2130
2131      @Override
2132      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2133        switch (hash) {
2134        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2135        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<AppointmentStatus>
2136        case 1281188563: /*serviceCategory*/ return this.serviceCategory == null ? new Base[0] : new Base[] {this.serviceCategory}; // CodeableConcept
2137        case -1928370289: /*serviceType*/ return this.serviceType == null ? new Base[0] : this.serviceType.toArray(new Base[this.serviceType.size()]); // CodeableConcept
2138        case -1694759682: /*specialty*/ return this.specialty == null ? new Base[0] : this.specialty.toArray(new Base[this.specialty.size()]); // CodeableConcept
2139        case -1596426375: /*appointmentType*/ return this.appointmentType == null ? new Base[0] : new Base[] {this.appointmentType}; // CodeableConcept
2140        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableConcept
2141        case -597168804: /*indication*/ return this.indication == null ? new Base[0] : this.indication.toArray(new Base[this.indication.size()]); // Reference
2142        case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // UnsignedIntType
2143        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
2144        case -1248768647: /*supportingInformation*/ return this.supportingInformation == null ? new Base[0] : this.supportingInformation.toArray(new Base[this.supportingInformation.size()]); // Reference
2145        case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // InstantType
2146        case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // InstantType
2147        case -413630573: /*minutesDuration*/ return this.minutesDuration == null ? new Base[0] : new Base[] {this.minutesDuration}; // PositiveIntType
2148        case 3533310: /*slot*/ return this.slot == null ? new Base[0] : this.slot.toArray(new Base[this.slot.size()]); // Reference
2149        case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType
2150        case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType
2151        case -1258204701: /*incomingReferral*/ return this.incomingReferral == null ? new Base[0] : this.incomingReferral.toArray(new Base[this.incomingReferral.size()]); // Reference
2152        case 767422259: /*participant*/ return this.participant == null ? new Base[0] : this.participant.toArray(new Base[this.participant.size()]); // AppointmentParticipantComponent
2153        case -897241393: /*requestedPeriod*/ return this.requestedPeriod == null ? new Base[0] : this.requestedPeriod.toArray(new Base[this.requestedPeriod.size()]); // Period
2154        default: return super.getProperty(hash, name, checkValid);
2155        }
2156
2157      }
2158
2159      @Override
2160      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2161        switch (hash) {
2162        case -1618432855: // identifier
2163          this.getIdentifier().add(castToIdentifier(value)); // Identifier
2164          return value;
2165        case -892481550: // status
2166          value = new AppointmentStatusEnumFactory().fromType(castToCode(value));
2167          this.status = (Enumeration) value; // Enumeration<AppointmentStatus>
2168          return value;
2169        case 1281188563: // serviceCategory
2170          this.serviceCategory = castToCodeableConcept(value); // CodeableConcept
2171          return value;
2172        case -1928370289: // serviceType
2173          this.getServiceType().add(castToCodeableConcept(value)); // CodeableConcept
2174          return value;
2175        case -1694759682: // specialty
2176          this.getSpecialty().add(castToCodeableConcept(value)); // CodeableConcept
2177          return value;
2178        case -1596426375: // appointmentType
2179          this.appointmentType = castToCodeableConcept(value); // CodeableConcept
2180          return value;
2181        case -934964668: // reason
2182          this.getReason().add(castToCodeableConcept(value)); // CodeableConcept
2183          return value;
2184        case -597168804: // indication
2185          this.getIndication().add(castToReference(value)); // Reference
2186          return value;
2187        case -1165461084: // priority
2188          this.priority = castToUnsignedInt(value); // UnsignedIntType
2189          return value;
2190        case -1724546052: // description
2191          this.description = castToString(value); // StringType
2192          return value;
2193        case -1248768647: // supportingInformation
2194          this.getSupportingInformation().add(castToReference(value)); // Reference
2195          return value;
2196        case 109757538: // start
2197          this.start = castToInstant(value); // InstantType
2198          return value;
2199        case 100571: // end
2200          this.end = castToInstant(value); // InstantType
2201          return value;
2202        case -413630573: // minutesDuration
2203          this.minutesDuration = castToPositiveInt(value); // PositiveIntType
2204          return value;
2205        case 3533310: // slot
2206          this.getSlot().add(castToReference(value)); // Reference
2207          return value;
2208        case 1028554472: // created
2209          this.created = castToDateTime(value); // DateTimeType
2210          return value;
2211        case 950398559: // comment
2212          this.comment = castToString(value); // StringType
2213          return value;
2214        case -1258204701: // incomingReferral
2215          this.getIncomingReferral().add(castToReference(value)); // Reference
2216          return value;
2217        case 767422259: // participant
2218          this.getParticipant().add((AppointmentParticipantComponent) value); // AppointmentParticipantComponent
2219          return value;
2220        case -897241393: // requestedPeriod
2221          this.getRequestedPeriod().add(castToPeriod(value)); // Period
2222          return value;
2223        default: return super.setProperty(hash, name, value);
2224        }
2225
2226      }
2227
2228      @Override
2229      public Base setProperty(String name, Base value) throws FHIRException {
2230        if (name.equals("identifier")) {
2231          this.getIdentifier().add(castToIdentifier(value));
2232        } else if (name.equals("status")) {
2233          value = new AppointmentStatusEnumFactory().fromType(castToCode(value));
2234          this.status = (Enumeration) value; // Enumeration<AppointmentStatus>
2235        } else if (name.equals("serviceCategory")) {
2236          this.serviceCategory = castToCodeableConcept(value); // CodeableConcept
2237        } else if (name.equals("serviceType")) {
2238          this.getServiceType().add(castToCodeableConcept(value));
2239        } else if (name.equals("specialty")) {
2240          this.getSpecialty().add(castToCodeableConcept(value));
2241        } else if (name.equals("appointmentType")) {
2242          this.appointmentType = castToCodeableConcept(value); // CodeableConcept
2243        } else if (name.equals("reason")) {
2244          this.getReason().add(castToCodeableConcept(value));
2245        } else if (name.equals("indication")) {
2246          this.getIndication().add(castToReference(value));
2247        } else if (name.equals("priority")) {
2248          this.priority = castToUnsignedInt(value); // UnsignedIntType
2249        } else if (name.equals("description")) {
2250          this.description = castToString(value); // StringType
2251        } else if (name.equals("supportingInformation")) {
2252          this.getSupportingInformation().add(castToReference(value));
2253        } else if (name.equals("start")) {
2254          this.start = castToInstant(value); // InstantType
2255        } else if (name.equals("end")) {
2256          this.end = castToInstant(value); // InstantType
2257        } else if (name.equals("minutesDuration")) {
2258          this.minutesDuration = castToPositiveInt(value); // PositiveIntType
2259        } else if (name.equals("slot")) {
2260          this.getSlot().add(castToReference(value));
2261        } else if (name.equals("created")) {
2262          this.created = castToDateTime(value); // DateTimeType
2263        } else if (name.equals("comment")) {
2264          this.comment = castToString(value); // StringType
2265        } else if (name.equals("incomingReferral")) {
2266          this.getIncomingReferral().add(castToReference(value));
2267        } else if (name.equals("participant")) {
2268          this.getParticipant().add((AppointmentParticipantComponent) value);
2269        } else if (name.equals("requestedPeriod")) {
2270          this.getRequestedPeriod().add(castToPeriod(value));
2271        } else
2272          return super.setProperty(name, value);
2273        return value;
2274      }
2275
2276      @Override
2277      public Base makeProperty(int hash, String name) throws FHIRException {
2278        switch (hash) {
2279        case -1618432855:  return addIdentifier(); 
2280        case -892481550:  return getStatusElement();
2281        case 1281188563:  return getServiceCategory(); 
2282        case -1928370289:  return addServiceType(); 
2283        case -1694759682:  return addSpecialty(); 
2284        case -1596426375:  return getAppointmentType(); 
2285        case -934964668:  return addReason(); 
2286        case -597168804:  return addIndication(); 
2287        case -1165461084:  return getPriorityElement();
2288        case -1724546052:  return getDescriptionElement();
2289        case -1248768647:  return addSupportingInformation(); 
2290        case 109757538:  return getStartElement();
2291        case 100571:  return getEndElement();
2292        case -413630573:  return getMinutesDurationElement();
2293        case 3533310:  return addSlot(); 
2294        case 1028554472:  return getCreatedElement();
2295        case 950398559:  return getCommentElement();
2296        case -1258204701:  return addIncomingReferral(); 
2297        case 767422259:  return addParticipant(); 
2298        case -897241393:  return addRequestedPeriod(); 
2299        default: return super.makeProperty(hash, name);
2300        }
2301
2302      }
2303
2304      @Override
2305      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2306        switch (hash) {
2307        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2308        case -892481550: /*status*/ return new String[] {"code"};
2309        case 1281188563: /*serviceCategory*/ return new String[] {"CodeableConcept"};
2310        case -1928370289: /*serviceType*/ return new String[] {"CodeableConcept"};
2311        case -1694759682: /*specialty*/ return new String[] {"CodeableConcept"};
2312        case -1596426375: /*appointmentType*/ return new String[] {"CodeableConcept"};
2313        case -934964668: /*reason*/ return new String[] {"CodeableConcept"};
2314        case -597168804: /*indication*/ return new String[] {"Reference"};
2315        case -1165461084: /*priority*/ return new String[] {"unsignedInt"};
2316        case -1724546052: /*description*/ return new String[] {"string"};
2317        case -1248768647: /*supportingInformation*/ return new String[] {"Reference"};
2318        case 109757538: /*start*/ return new String[] {"instant"};
2319        case 100571: /*end*/ return new String[] {"instant"};
2320        case -413630573: /*minutesDuration*/ return new String[] {"positiveInt"};
2321        case 3533310: /*slot*/ return new String[] {"Reference"};
2322        case 1028554472: /*created*/ return new String[] {"dateTime"};
2323        case 950398559: /*comment*/ return new String[] {"string"};
2324        case -1258204701: /*incomingReferral*/ return new String[] {"Reference"};
2325        case 767422259: /*participant*/ return new String[] {};
2326        case -897241393: /*requestedPeriod*/ return new String[] {"Period"};
2327        default: return super.getTypesForProperty(hash, name);
2328        }
2329
2330      }
2331
2332      @Override
2333      public Base addChild(String name) throws FHIRException {
2334        if (name.equals("identifier")) {
2335          return addIdentifier();
2336        }
2337        else if (name.equals("status")) {
2338          throw new FHIRException("Cannot call addChild on a primitive type Appointment.status");
2339        }
2340        else if (name.equals("serviceCategory")) {
2341          this.serviceCategory = new CodeableConcept();
2342          return this.serviceCategory;
2343        }
2344        else if (name.equals("serviceType")) {
2345          return addServiceType();
2346        }
2347        else if (name.equals("specialty")) {
2348          return addSpecialty();
2349        }
2350        else if (name.equals("appointmentType")) {
2351          this.appointmentType = new CodeableConcept();
2352          return this.appointmentType;
2353        }
2354        else if (name.equals("reason")) {
2355          return addReason();
2356        }
2357        else if (name.equals("indication")) {
2358          return addIndication();
2359        }
2360        else if (name.equals("priority")) {
2361          throw new FHIRException("Cannot call addChild on a primitive type Appointment.priority");
2362        }
2363        else if (name.equals("description")) {
2364          throw new FHIRException("Cannot call addChild on a primitive type Appointment.description");
2365        }
2366        else if (name.equals("supportingInformation")) {
2367          return addSupportingInformation();
2368        }
2369        else if (name.equals("start")) {
2370          throw new FHIRException("Cannot call addChild on a primitive type Appointment.start");
2371        }
2372        else if (name.equals("end")) {
2373          throw new FHIRException("Cannot call addChild on a primitive type Appointment.end");
2374        }
2375        else if (name.equals("minutesDuration")) {
2376          throw new FHIRException("Cannot call addChild on a primitive type Appointment.minutesDuration");
2377        }
2378        else if (name.equals("slot")) {
2379          return addSlot();
2380        }
2381        else if (name.equals("created")) {
2382          throw new FHIRException("Cannot call addChild on a primitive type Appointment.created");
2383        }
2384        else if (name.equals("comment")) {
2385          throw new FHIRException("Cannot call addChild on a primitive type Appointment.comment");
2386        }
2387        else if (name.equals("incomingReferral")) {
2388          return addIncomingReferral();
2389        }
2390        else if (name.equals("participant")) {
2391          return addParticipant();
2392        }
2393        else if (name.equals("requestedPeriod")) {
2394          return addRequestedPeriod();
2395        }
2396        else
2397          return super.addChild(name);
2398      }
2399
2400  public String fhirType() {
2401    return "Appointment";
2402
2403  }
2404
2405      public Appointment copy() {
2406        Appointment dst = new Appointment();
2407        copyValues(dst);
2408        if (identifier != null) {
2409          dst.identifier = new ArrayList<Identifier>();
2410          for (Identifier i : identifier)
2411            dst.identifier.add(i.copy());
2412        };
2413        dst.status = status == null ? null : status.copy();
2414        dst.serviceCategory = serviceCategory == null ? null : serviceCategory.copy();
2415        if (serviceType != null) {
2416          dst.serviceType = new ArrayList<CodeableConcept>();
2417          for (CodeableConcept i : serviceType)
2418            dst.serviceType.add(i.copy());
2419        };
2420        if (specialty != null) {
2421          dst.specialty = new ArrayList<CodeableConcept>();
2422          for (CodeableConcept i : specialty)
2423            dst.specialty.add(i.copy());
2424        };
2425        dst.appointmentType = appointmentType == null ? null : appointmentType.copy();
2426        if (reason != null) {
2427          dst.reason = new ArrayList<CodeableConcept>();
2428          for (CodeableConcept i : reason)
2429            dst.reason.add(i.copy());
2430        };
2431        if (indication != null) {
2432          dst.indication = new ArrayList<Reference>();
2433          for (Reference i : indication)
2434            dst.indication.add(i.copy());
2435        };
2436        dst.priority = priority == null ? null : priority.copy();
2437        dst.description = description == null ? null : description.copy();
2438        if (supportingInformation != null) {
2439          dst.supportingInformation = new ArrayList<Reference>();
2440          for (Reference i : supportingInformation)
2441            dst.supportingInformation.add(i.copy());
2442        };
2443        dst.start = start == null ? null : start.copy();
2444        dst.end = end == null ? null : end.copy();
2445        dst.minutesDuration = minutesDuration == null ? null : minutesDuration.copy();
2446        if (slot != null) {
2447          dst.slot = new ArrayList<Reference>();
2448          for (Reference i : slot)
2449            dst.slot.add(i.copy());
2450        };
2451        dst.created = created == null ? null : created.copy();
2452        dst.comment = comment == null ? null : comment.copy();
2453        if (incomingReferral != null) {
2454          dst.incomingReferral = new ArrayList<Reference>();
2455          for (Reference i : incomingReferral)
2456            dst.incomingReferral.add(i.copy());
2457        };
2458        if (participant != null) {
2459          dst.participant = new ArrayList<AppointmentParticipantComponent>();
2460          for (AppointmentParticipantComponent i : participant)
2461            dst.participant.add(i.copy());
2462        };
2463        if (requestedPeriod != null) {
2464          dst.requestedPeriod = new ArrayList<Period>();
2465          for (Period i : requestedPeriod)
2466            dst.requestedPeriod.add(i.copy());
2467        };
2468        return dst;
2469      }
2470
2471      protected Appointment typedCopy() {
2472        return copy();
2473      }
2474
2475      @Override
2476      public boolean equalsDeep(Base other_) {
2477        if (!super.equalsDeep(other_))
2478          return false;
2479        if (!(other_ instanceof Appointment))
2480          return false;
2481        Appointment o = (Appointment) other_;
2482        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(serviceCategory, o.serviceCategory, true)
2483           && compareDeep(serviceType, o.serviceType, true) && compareDeep(specialty, o.specialty, true) && compareDeep(appointmentType, o.appointmentType, true)
2484           && compareDeep(reason, o.reason, true) && compareDeep(indication, o.indication, true) && compareDeep(priority, o.priority, true)
2485           && compareDeep(description, o.description, true) && compareDeep(supportingInformation, o.supportingInformation, true)
2486           && compareDeep(start, o.start, true) && compareDeep(end, o.end, true) && compareDeep(minutesDuration, o.minutesDuration, true)
2487           && compareDeep(slot, o.slot, true) && compareDeep(created, o.created, true) && compareDeep(comment, o.comment, true)
2488           && compareDeep(incomingReferral, o.incomingReferral, true) && compareDeep(participant, o.participant, true)
2489           && compareDeep(requestedPeriod, o.requestedPeriod, true);
2490      }
2491
2492      @Override
2493      public boolean equalsShallow(Base other_) {
2494        if (!super.equalsShallow(other_))
2495          return false;
2496        if (!(other_ instanceof Appointment))
2497          return false;
2498        Appointment o = (Appointment) other_;
2499        return compareValues(status, o.status, true) && compareValues(priority, o.priority, true) && compareValues(description, o.description, true)
2500           && compareValues(start, o.start, true) && compareValues(end, o.end, true) && compareValues(minutesDuration, o.minutesDuration, true)
2501           && compareValues(created, o.created, true) && compareValues(comment, o.comment, true);
2502      }
2503
2504      public boolean isEmpty() {
2505        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, serviceCategory
2506          , serviceType, specialty, appointmentType, reason, indication, priority, description
2507          , supportingInformation, start, end, minutesDuration, slot, created, comment, incomingReferral
2508          , participant, requestedPeriod);
2509      }
2510
2511  @Override
2512  public ResourceType getResourceType() {
2513    return ResourceType.Appointment;
2514   }
2515
2516 /**
2517   * Search parameter: <b>date</b>
2518   * <p>
2519   * Description: <b>Appointment date/time.</b><br>
2520   * Type: <b>date</b><br>
2521   * Path: <b>Appointment.start</b><br>
2522   * </p>
2523   */
2524  @SearchParamDefinition(name="date", path="Appointment.start", description="Appointment date/time.", type="date" )
2525  public static final String SP_DATE = "date";
2526 /**
2527   * <b>Fluent Client</b> search parameter constant for <b>date</b>
2528   * <p>
2529   * Description: <b>Appointment date/time.</b><br>
2530   * Type: <b>date</b><br>
2531   * Path: <b>Appointment.start</b><br>
2532   * </p>
2533   */
2534  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
2535
2536 /**
2537   * Search parameter: <b>actor</b>
2538   * <p>
2539   * Description: <b>Any one of the individuals participating in the appointment</b><br>
2540   * Type: <b>reference</b><br>
2541   * Path: <b>Appointment.participant.actor</b><br>
2542   * </p>
2543   */
2544  @SearchParamDefinition(name="actor", path="Appointment.participant.actor", description="Any one of the individuals participating in the appointment", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Device"), @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, HealthcareService.class, Location.class, Patient.class, Practitioner.class, RelatedPerson.class } )
2545  public static final String SP_ACTOR = "actor";
2546 /**
2547   * <b>Fluent Client</b> search parameter constant for <b>actor</b>
2548   * <p>
2549   * Description: <b>Any one of the individuals participating in the appointment</b><br>
2550   * Type: <b>reference</b><br>
2551   * Path: <b>Appointment.participant.actor</b><br>
2552   * </p>
2553   */
2554  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ACTOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ACTOR);
2555
2556/**
2557   * Constant for fluent queries to be used to add include statements. Specifies
2558   * the path value of "<b>Appointment:actor</b>".
2559   */
2560  public static final ca.uhn.fhir.model.api.Include INCLUDE_ACTOR = new ca.uhn.fhir.model.api.Include("Appointment:actor").toLocked();
2561
2562 /**
2563   * Search parameter: <b>identifier</b>
2564   * <p>
2565   * Description: <b>An Identifier of the Appointment</b><br>
2566   * Type: <b>token</b><br>
2567   * Path: <b>Appointment.identifier</b><br>
2568   * </p>
2569   */
2570  @SearchParamDefinition(name="identifier", path="Appointment.identifier", description="An Identifier of the Appointment", type="token" )
2571  public static final String SP_IDENTIFIER = "identifier";
2572 /**
2573   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2574   * <p>
2575   * Description: <b>An Identifier of the Appointment</b><br>
2576   * Type: <b>token</b><br>
2577   * Path: <b>Appointment.identifier</b><br>
2578   * </p>
2579   */
2580  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2581
2582 /**
2583   * Search parameter: <b>practitioner</b>
2584   * <p>
2585   * Description: <b>One of the individuals of the appointment is this practitioner</b><br>
2586   * Type: <b>reference</b><br>
2587   * Path: <b>Appointment.participant.actor</b><br>
2588   * </p>
2589   */
2590  @SearchParamDefinition(name="practitioner", path="Appointment.participant.actor", description="One of the individuals of the appointment is this practitioner", type="reference", target={Practitioner.class } )
2591  public static final String SP_PRACTITIONER = "practitioner";
2592 /**
2593   * <b>Fluent Client</b> search parameter constant for <b>practitioner</b>
2594   * <p>
2595   * Description: <b>One of the individuals of the appointment is this practitioner</b><br>
2596   * Type: <b>reference</b><br>
2597   * Path: <b>Appointment.participant.actor</b><br>
2598   * </p>
2599   */
2600  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRACTITIONER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRACTITIONER);
2601
2602/**
2603   * Constant for fluent queries to be used to add include statements. Specifies
2604   * the path value of "<b>Appointment:practitioner</b>".
2605   */
2606  public static final ca.uhn.fhir.model.api.Include INCLUDE_PRACTITIONER = new ca.uhn.fhir.model.api.Include("Appointment:practitioner").toLocked();
2607
2608 /**
2609   * Search parameter: <b>incomingreferral</b>
2610   * <p>
2611   * Description: <b>The ReferralRequest provided as information to allocate to the Encounter</b><br>
2612   * Type: <b>reference</b><br>
2613   * Path: <b>Appointment.incomingReferral</b><br>
2614   * </p>
2615   */
2616  @SearchParamDefinition(name="incomingreferral", path="Appointment.incomingReferral", description="The ReferralRequest provided as information to allocate to the Encounter", type="reference", target={ReferralRequest.class } )
2617  public static final String SP_INCOMINGREFERRAL = "incomingreferral";
2618 /**
2619   * <b>Fluent Client</b> search parameter constant for <b>incomingreferral</b>
2620   * <p>
2621   * Description: <b>The ReferralRequest provided as information to allocate to the Encounter</b><br>
2622   * Type: <b>reference</b><br>
2623   * Path: <b>Appointment.incomingReferral</b><br>
2624   * </p>
2625   */
2626  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INCOMINGREFERRAL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INCOMINGREFERRAL);
2627
2628/**
2629   * Constant for fluent queries to be used to add include statements. Specifies
2630   * the path value of "<b>Appointment:incomingreferral</b>".
2631   */
2632  public static final ca.uhn.fhir.model.api.Include INCLUDE_INCOMINGREFERRAL = new ca.uhn.fhir.model.api.Include("Appointment:incomingreferral").toLocked();
2633
2634 /**
2635   * Search parameter: <b>part-status</b>
2636   * <p>
2637   * Description: <b>The Participation status of the subject, or other participant on the appointment. Can be used to locate participants that have not responded to meeting requests.</b><br>
2638   * Type: <b>token</b><br>
2639   * Path: <b>Appointment.participant.status</b><br>
2640   * </p>
2641   */
2642  @SearchParamDefinition(name="part-status", path="Appointment.participant.status", description="The Participation status of the subject, or other participant on the appointment. Can be used to locate participants that have not responded to meeting requests.", type="token" )
2643  public static final String SP_PART_STATUS = "part-status";
2644 /**
2645   * <b>Fluent Client</b> search parameter constant for <b>part-status</b>
2646   * <p>
2647   * Description: <b>The Participation status of the subject, or other participant on the appointment. Can be used to locate participants that have not responded to meeting requests.</b><br>
2648   * Type: <b>token</b><br>
2649   * Path: <b>Appointment.participant.status</b><br>
2650   * </p>
2651   */
2652  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PART_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PART_STATUS);
2653
2654 /**
2655   * Search parameter: <b>patient</b>
2656   * <p>
2657   * Description: <b>One of the individuals of the appointment is this patient</b><br>
2658   * Type: <b>reference</b><br>
2659   * Path: <b>Appointment.participant.actor</b><br>
2660   * </p>
2661   */
2662  @SearchParamDefinition(name="patient", path="Appointment.participant.actor", description="One of the individuals of the appointment is this patient", type="reference", target={Patient.class } )
2663  public static final String SP_PATIENT = "patient";
2664 /**
2665   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2666   * <p>
2667   * Description: <b>One of the individuals of the appointment is this patient</b><br>
2668   * Type: <b>reference</b><br>
2669   * Path: <b>Appointment.participant.actor</b><br>
2670   * </p>
2671   */
2672  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
2673
2674/**
2675   * Constant for fluent queries to be used to add include statements. Specifies
2676   * the path value of "<b>Appointment:patient</b>".
2677   */
2678  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Appointment:patient").toLocked();
2679
2680 /**
2681   * Search parameter: <b>appointment-type</b>
2682   * <p>
2683   * Description: <b>The style of appointment or patient that has been booked in the slot (not service type)</b><br>
2684   * Type: <b>token</b><br>
2685   * Path: <b>Appointment.appointmentType</b><br>
2686   * </p>
2687   */
2688  @SearchParamDefinition(name="appointment-type", path="Appointment.appointmentType", description="The style of appointment or patient that has been booked in the slot (not service type)", type="token" )
2689  public static final String SP_APPOINTMENT_TYPE = "appointment-type";
2690 /**
2691   * <b>Fluent Client</b> search parameter constant for <b>appointment-type</b>
2692   * <p>
2693   * Description: <b>The style of appointment or patient that has been booked in the slot (not service type)</b><br>
2694   * Type: <b>token</b><br>
2695   * Path: <b>Appointment.appointmentType</b><br>
2696   * </p>
2697   */
2698  public static final ca.uhn.fhir.rest.gclient.TokenClientParam APPOINTMENT_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_APPOINTMENT_TYPE);
2699
2700 /**
2701   * Search parameter: <b>service-type</b>
2702   * <p>
2703   * Description: <b>The specific service that is to be performed during this appointment</b><br>
2704   * Type: <b>token</b><br>
2705   * Path: <b>Appointment.serviceType</b><br>
2706   * </p>
2707   */
2708  @SearchParamDefinition(name="service-type", path="Appointment.serviceType", description="The specific service that is to be performed during this appointment", type="token" )
2709  public static final String SP_SERVICE_TYPE = "service-type";
2710 /**
2711   * <b>Fluent Client</b> search parameter constant for <b>service-type</b>
2712   * <p>
2713   * Description: <b>The specific service that is to be performed during this appointment</b><br>
2714   * Type: <b>token</b><br>
2715   * Path: <b>Appointment.serviceType</b><br>
2716   * </p>
2717   */
2718  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SERVICE_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SERVICE_TYPE);
2719
2720 /**
2721   * Search parameter: <b>location</b>
2722   * <p>
2723   * Description: <b>This location is listed in the participants of the appointment</b><br>
2724   * Type: <b>reference</b><br>
2725   * Path: <b>Appointment.participant.actor</b><br>
2726   * </p>
2727   */
2728  @SearchParamDefinition(name="location", path="Appointment.participant.actor", description="This location is listed in the participants of the appointment", type="reference", target={Location.class } )
2729  public static final String SP_LOCATION = "location";
2730 /**
2731   * <b>Fluent Client</b> search parameter constant for <b>location</b>
2732   * <p>
2733   * Description: <b>This location is listed in the participants of the appointment</b><br>
2734   * Type: <b>reference</b><br>
2735   * Path: <b>Appointment.participant.actor</b><br>
2736   * </p>
2737   */
2738  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION);
2739
2740/**
2741   * Constant for fluent queries to be used to add include statements. Specifies
2742   * the path value of "<b>Appointment:location</b>".
2743   */
2744  public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("Appointment:location").toLocked();
2745
2746 /**
2747   * Search parameter: <b>status</b>
2748   * <p>
2749   * Description: <b>The overall status of the appointment</b><br>
2750   * Type: <b>token</b><br>
2751   * Path: <b>Appointment.status</b><br>
2752   * </p>
2753   */
2754  @SearchParamDefinition(name="status", path="Appointment.status", description="The overall status of the appointment", type="token" )
2755  public static final String SP_STATUS = "status";
2756 /**
2757   * <b>Fluent Client</b> search parameter constant for <b>status</b>
2758   * <p>
2759   * Description: <b>The overall status of the appointment</b><br>
2760   * Type: <b>token</b><br>
2761   * Path: <b>Appointment.status</b><br>
2762   * </p>
2763   */
2764  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
2765
2766
2767}
2768