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