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 Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
033import java.util.ArrayList;
034import java.util.Date;
035import java.util.List;
036
037import org.hl7.fhir.exceptions.FHIRException;
038import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
039import org.hl7.fhir.utilities.Utilities;
040
041import ca.uhn.fhir.model.api.annotation.Block;
042import ca.uhn.fhir.model.api.annotation.Child;
043import ca.uhn.fhir.model.api.annotation.Description;
044import ca.uhn.fhir.model.api.annotation.ResourceDef;
045import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
046
047/**
048 * A booking of a healthcare event among patient(s), practitioner(s), related
049 * person(s) and/or device(s) for a specific date/time. This may result in one
050 * or more Encounter(s).
051 */
052@ResourceDef(name = "Appointment", profile = "http://hl7.org/fhir/StructureDefinition/Appointment")
053public class Appointment extends DomainResource {
054
055  public enum AppointmentStatus {
056    /**
057     * None of the participant(s) have finalized their acceptance of the appointment
058     * request, and the start/end time might not be set yet.
059     */
060    PROPOSED,
061    /**
062     * Some or all of the participant(s) have not finalized their acceptance of the
063     * appointment request.
064     */
065    PENDING,
066    /**
067     * All participant(s) have been considered and the appointment is confirmed to
068     * go ahead at the date/times specified.
069     */
070    BOOKED,
071    /**
072     * The patient/patients has/have arrived and is/are waiting to be seen.
073     */
074    ARRIVED,
075    /**
076     * The planning stages of the appointment are now complete, the encounter
077     * resource will exist and will track further status changes. Note that an
078     * encounter may exist before the appointment status is fulfilled for many
079     * reasons.
080     */
081    FULFILLED,
082    /**
083     * The appointment has been cancelled.
084     */
085    CANCELLED,
086    /**
087     * Some or all of the participant(s) have not/did not appear for the appointment
088     * (usually the patient).
089     */
090    NOSHOW,
091    /**
092     * This instance should not have been part of this patient's medical record.
093     */
094    ENTEREDINERROR,
095    /**
096     * When checked in, all pre-encounter administrative work is complete, and the
097     * encounter may begin. (where multiple patients are involved, they are all
098     * present).
099     */
100    CHECKEDIN,
101    /**
102     * The appointment has been placed on a waitlist, to be scheduled/confirmed in
103     * the future when a slot/service is available. A specific time might or might
104     * not be pre-allocated.
105     */
106    WAITLIST,
107    /**
108     * added to help the parsers with the generic types
109     */
110    NULL;
111
112    public static AppointmentStatus fromCode(String codeString) throws FHIRException {
113      if (codeString == null || "".equals(codeString))
114        return null;
115      if ("proposed".equals(codeString))
116        return PROPOSED;
117      if ("pending".equals(codeString))
118        return PENDING;
119      if ("booked".equals(codeString))
120        return BOOKED;
121      if ("arrived".equals(codeString))
122        return ARRIVED;
123      if ("fulfilled".equals(codeString))
124        return FULFILLED;
125      if ("cancelled".equals(codeString))
126        return CANCELLED;
127      if ("noshow".equals(codeString))
128        return NOSHOW;
129      if ("entered-in-error".equals(codeString))
130        return ENTEREDINERROR;
131      if ("checked-in".equals(codeString))
132        return CHECKEDIN;
133      if ("waitlist".equals(codeString))
134        return WAITLIST;
135      if (Configuration.isAcceptInvalidEnums())
136        return null;
137      else
138        throw new FHIRException("Unknown AppointmentStatus code '" + codeString + "'");
139    }
140
141    public String toCode() {
142      switch (this) {
143      case PROPOSED:
144        return "proposed";
145      case PENDING:
146        return "pending";
147      case BOOKED:
148        return "booked";
149      case ARRIVED:
150        return "arrived";
151      case FULFILLED:
152        return "fulfilled";
153      case CANCELLED:
154        return "cancelled";
155      case NOSHOW:
156        return "noshow";
157      case ENTEREDINERROR:
158        return "entered-in-error";
159      case CHECKEDIN:
160        return "checked-in";
161      case WAITLIST:
162        return "waitlist";
163      case NULL:
164        return null;
165      default:
166        return "?";
167      }
168    }
169
170    public String getSystem() {
171      switch (this) {
172      case PROPOSED:
173        return "http://hl7.org/fhir/appointmentstatus";
174      case PENDING:
175        return "http://hl7.org/fhir/appointmentstatus";
176      case BOOKED:
177        return "http://hl7.org/fhir/appointmentstatus";
178      case ARRIVED:
179        return "http://hl7.org/fhir/appointmentstatus";
180      case FULFILLED:
181        return "http://hl7.org/fhir/appointmentstatus";
182      case CANCELLED:
183        return "http://hl7.org/fhir/appointmentstatus";
184      case NOSHOW:
185        return "http://hl7.org/fhir/appointmentstatus";
186      case ENTEREDINERROR:
187        return "http://hl7.org/fhir/appointmentstatus";
188      case CHECKEDIN:
189        return "http://hl7.org/fhir/appointmentstatus";
190      case WAITLIST:
191        return "http://hl7.org/fhir/appointmentstatus";
192      case NULL:
193        return null;
194      default:
195        return "?";
196      }
197    }
198
199    public String getDefinition() {
200      switch (this) {
201      case PROPOSED:
202        return "None of the participant(s) have finalized their acceptance of the appointment request, and the start/end time might not be set yet.";
203      case PENDING:
204        return "Some or all of the participant(s) have not finalized their acceptance of the appointment request.";
205      case BOOKED:
206        return "All participant(s) have been considered and the appointment is confirmed to go ahead at the date/times specified.";
207      case ARRIVED:
208        return "The patient/patients has/have arrived and is/are waiting to be seen.";
209      case FULFILLED:
210        return "The planning stages of the appointment are now complete, the encounter resource will exist and will track further status changes. Note that an encounter may exist before the appointment status is fulfilled for many reasons.";
211      case CANCELLED:
212        return "The appointment has been cancelled.";
213      case NOSHOW:
214        return "Some or all of the participant(s) have not/did not appear for the appointment (usually the patient).";
215      case ENTEREDINERROR:
216        return "This instance should not have been part of this patient's medical record.";
217      case CHECKEDIN:
218        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).";
219      case WAITLIST:
220        return "The appointment has been placed on a waitlist, to be scheduled/confirmed in the future when a slot/service is available.\nA specific time might or might not be pre-allocated.";
221      case NULL:
222        return null;
223      default:
224        return "?";
225      }
226    }
227
228    public String getDisplay() {
229      switch (this) {
230      case PROPOSED:
231        return "Proposed";
232      case PENDING:
233        return "Pending";
234      case BOOKED:
235        return "Booked";
236      case ARRIVED:
237        return "Arrived";
238      case FULFILLED:
239        return "Fulfilled";
240      case CANCELLED:
241        return "Cancelled";
242      case NOSHOW:
243        return "No Show";
244      case ENTEREDINERROR:
245        return "Entered in error";
246      case CHECKEDIN:
247        return "Checked In";
248      case WAITLIST:
249        return "Waitlisted";
250      case NULL:
251        return null;
252      default:
253        return "?";
254      }
255    }
256  }
257
258  public static class AppointmentStatusEnumFactory implements EnumFactory<AppointmentStatus> {
259    public AppointmentStatus fromCode(String codeString) throws IllegalArgumentException {
260      if (codeString == null || "".equals(codeString))
261        if (codeString == null || "".equals(codeString))
262          return null;
263      if ("proposed".equals(codeString))
264        return AppointmentStatus.PROPOSED;
265      if ("pending".equals(codeString))
266        return AppointmentStatus.PENDING;
267      if ("booked".equals(codeString))
268        return AppointmentStatus.BOOKED;
269      if ("arrived".equals(codeString))
270        return AppointmentStatus.ARRIVED;
271      if ("fulfilled".equals(codeString))
272        return AppointmentStatus.FULFILLED;
273      if ("cancelled".equals(codeString))
274        return AppointmentStatus.CANCELLED;
275      if ("noshow".equals(codeString))
276        return AppointmentStatus.NOSHOW;
277      if ("entered-in-error".equals(codeString))
278        return AppointmentStatus.ENTEREDINERROR;
279      if ("checked-in".equals(codeString))
280        return AppointmentStatus.CHECKEDIN;
281      if ("waitlist".equals(codeString))
282        return AppointmentStatus.WAITLIST;
283      throw new IllegalArgumentException("Unknown AppointmentStatus code '" + codeString + "'");
284    }
285
286    public Enumeration<AppointmentStatus> fromType(PrimitiveType<?> code) throws FHIRException {
287      if (code == null)
288        return null;
289      if (code.isEmpty())
290        return new Enumeration<AppointmentStatus>(this, AppointmentStatus.NULL, code);
291      String codeString = code.asStringValue();
292      if (codeString == null || "".equals(codeString))
293        return new Enumeration<AppointmentStatus>(this, AppointmentStatus.NULL, code);
294      if ("proposed".equals(codeString))
295        return new Enumeration<AppointmentStatus>(this, AppointmentStatus.PROPOSED, code);
296      if ("pending".equals(codeString))
297        return new Enumeration<AppointmentStatus>(this, AppointmentStatus.PENDING, code);
298      if ("booked".equals(codeString))
299        return new Enumeration<AppointmentStatus>(this, AppointmentStatus.BOOKED, code);
300      if ("arrived".equals(codeString))
301        return new Enumeration<AppointmentStatus>(this, AppointmentStatus.ARRIVED, code);
302      if ("fulfilled".equals(codeString))
303        return new Enumeration<AppointmentStatus>(this, AppointmentStatus.FULFILLED, code);
304      if ("cancelled".equals(codeString))
305        return new Enumeration<AppointmentStatus>(this, AppointmentStatus.CANCELLED, code);
306      if ("noshow".equals(codeString))
307        return new Enumeration<AppointmentStatus>(this, AppointmentStatus.NOSHOW, code);
308      if ("entered-in-error".equals(codeString))
309        return new Enumeration<AppointmentStatus>(this, AppointmentStatus.ENTEREDINERROR, code);
310      if ("checked-in".equals(codeString))
311        return new Enumeration<AppointmentStatus>(this, AppointmentStatus.CHECKEDIN, code);
312      if ("waitlist".equals(codeString))
313        return new Enumeration<AppointmentStatus>(this, AppointmentStatus.WAITLIST, code);
314      throw new FHIRException("Unknown AppointmentStatus code '" + codeString + "'");
315    }
316
317    public String toCode(AppointmentStatus code) {
318      if (code == AppointmentStatus.PROPOSED)
319        return "proposed";
320      if (code == AppointmentStatus.PENDING)
321        return "pending";
322      if (code == AppointmentStatus.BOOKED)
323        return "booked";
324      if (code == AppointmentStatus.ARRIVED)
325        return "arrived";
326      if (code == AppointmentStatus.FULFILLED)
327        return "fulfilled";
328      if (code == AppointmentStatus.CANCELLED)
329        return "cancelled";
330      if (code == AppointmentStatus.NOSHOW)
331        return "noshow";
332      if (code == AppointmentStatus.ENTEREDINERROR)
333        return "entered-in-error";
334      if (code == AppointmentStatus.CHECKEDIN)
335        return "checked-in";
336      if (code == AppointmentStatus.WAITLIST)
337        return "waitlist";
338      return "?";
339    }
340
341    public String toSystem(AppointmentStatus code) {
342      return code.getSystem();
343    }
344  }
345
346  public enum ParticipantRequired {
347    /**
348     * The participant is required to attend the appointment.
349     */
350    REQUIRED,
351    /**
352     * The participant may optionally attend the appointment.
353     */
354    OPTIONAL,
355    /**
356     * The participant is excluded from the appointment, and might not be informed
357     * of the appointment taking place. (Appointment is about them, not for them -
358     * such as 2 doctors discussing results about a patient's test).
359     */
360    INFORMATIONONLY,
361    /**
362     * added to help the parsers with the generic types
363     */
364    NULL;
365
366    public static ParticipantRequired fromCode(String codeString) throws FHIRException {
367      if (codeString == null || "".equals(codeString))
368        return null;
369      if ("required".equals(codeString))
370        return REQUIRED;
371      if ("optional".equals(codeString))
372        return OPTIONAL;
373      if ("information-only".equals(codeString))
374        return INFORMATIONONLY;
375      if (Configuration.isAcceptInvalidEnums())
376        return null;
377      else
378        throw new FHIRException("Unknown ParticipantRequired code '" + codeString + "'");
379    }
380
381    public String toCode() {
382      switch (this) {
383      case REQUIRED:
384        return "required";
385      case OPTIONAL:
386        return "optional";
387      case INFORMATIONONLY:
388        return "information-only";
389      case NULL:
390        return null;
391      default:
392        return "?";
393      }
394    }
395
396    public String getSystem() {
397      switch (this) {
398      case REQUIRED:
399        return "http://hl7.org/fhir/participantrequired";
400      case OPTIONAL:
401        return "http://hl7.org/fhir/participantrequired";
402      case INFORMATIONONLY:
403        return "http://hl7.org/fhir/participantrequired";
404      case NULL:
405        return null;
406      default:
407        return "?";
408      }
409    }
410
411    public String getDefinition() {
412      switch (this) {
413      case REQUIRED:
414        return "The participant is required to attend the appointment.";
415      case OPTIONAL:
416        return "The participant may optionally attend the appointment.";
417      case INFORMATIONONLY:
418        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).";
419      case NULL:
420        return null;
421      default:
422        return "?";
423      }
424    }
425
426    public String getDisplay() {
427      switch (this) {
428      case REQUIRED:
429        return "Required";
430      case OPTIONAL:
431        return "Optional";
432      case INFORMATIONONLY:
433        return "Information Only";
434      case NULL:
435        return null;
436      default:
437        return "?";
438      }
439    }
440  }
441
442  public static class ParticipantRequiredEnumFactory implements EnumFactory<ParticipantRequired> {
443    public ParticipantRequired fromCode(String codeString) throws IllegalArgumentException {
444      if (codeString == null || "".equals(codeString))
445        if (codeString == null || "".equals(codeString))
446          return null;
447      if ("required".equals(codeString))
448        return ParticipantRequired.REQUIRED;
449      if ("optional".equals(codeString))
450        return ParticipantRequired.OPTIONAL;
451      if ("information-only".equals(codeString))
452        return ParticipantRequired.INFORMATIONONLY;
453      throw new IllegalArgumentException("Unknown ParticipantRequired code '" + codeString + "'");
454    }
455
456    public Enumeration<ParticipantRequired> fromType(PrimitiveType<?> code) throws FHIRException {
457      if (code == null)
458        return null;
459      if (code.isEmpty())
460        return new Enumeration<ParticipantRequired>(this, ParticipantRequired.NULL, code);
461      String codeString = code.asStringValue();
462      if (codeString == null || "".equals(codeString))
463        return new Enumeration<ParticipantRequired>(this, ParticipantRequired.NULL, code);
464      if ("required".equals(codeString))
465        return new Enumeration<ParticipantRequired>(this, ParticipantRequired.REQUIRED, code);
466      if ("optional".equals(codeString))
467        return new Enumeration<ParticipantRequired>(this, ParticipantRequired.OPTIONAL, code);
468      if ("information-only".equals(codeString))
469        return new Enumeration<ParticipantRequired>(this, ParticipantRequired.INFORMATIONONLY, code);
470      throw new FHIRException("Unknown ParticipantRequired code '" + codeString + "'");
471    }
472
473    public String toCode(ParticipantRequired code) {
474      if (code == ParticipantRequired.REQUIRED)
475        return "required";
476      if (code == ParticipantRequired.OPTIONAL)
477        return "optional";
478      if (code == ParticipantRequired.INFORMATIONONLY)
479        return "information-only";
480      return "?";
481    }
482
483    public String toSystem(ParticipantRequired code) {
484      return code.getSystem();
485    }
486  }
487
488  public enum ParticipationStatus {
489    /**
490     * The participant has accepted the appointment.
491     */
492    ACCEPTED,
493    /**
494     * The participant has declined the appointment and will not participate in the
495     * appointment.
496     */
497    DECLINED,
498    /**
499     * The participant has tentatively accepted the appointment. This could be
500     * automatically created by a system and requires further processing before it
501     * can be accepted. There is no commitment that attendance will occur.
502     */
503    TENTATIVE,
504    /**
505     * The participant needs to indicate if they accept the appointment by changing
506     * this status to one of the other statuses.
507     */
508    NEEDSACTION,
509    /**
510     * added to help the parsers with the generic types
511     */
512    NULL;
513
514    public static ParticipationStatus fromCode(String codeString) throws FHIRException {
515      if (codeString == null || "".equals(codeString))
516        return null;
517      if ("accepted".equals(codeString))
518        return ACCEPTED;
519      if ("declined".equals(codeString))
520        return DECLINED;
521      if ("tentative".equals(codeString))
522        return TENTATIVE;
523      if ("needs-action".equals(codeString))
524        return NEEDSACTION;
525      if (Configuration.isAcceptInvalidEnums())
526        return null;
527      else
528        throw new FHIRException("Unknown ParticipationStatus code '" + codeString + "'");
529    }
530
531    public String toCode() {
532      switch (this) {
533      case ACCEPTED:
534        return "accepted";
535      case DECLINED:
536        return "declined";
537      case TENTATIVE:
538        return "tentative";
539      case NEEDSACTION:
540        return "needs-action";
541      case NULL:
542        return null;
543      default:
544        return "?";
545      }
546    }
547
548    public String getSystem() {
549      switch (this) {
550      case ACCEPTED:
551        return "http://hl7.org/fhir/participationstatus";
552      case DECLINED:
553        return "http://hl7.org/fhir/participationstatus";
554      case TENTATIVE:
555        return "http://hl7.org/fhir/participationstatus";
556      case NEEDSACTION:
557        return "http://hl7.org/fhir/participationstatus";
558      case NULL:
559        return null;
560      default:
561        return "?";
562      }
563    }
564
565    public String getDefinition() {
566      switch (this) {
567      case ACCEPTED:
568        return "The participant has accepted the appointment.";
569      case DECLINED:
570        return "The participant has declined the appointment and will not participate in the appointment.";
571      case TENTATIVE:
572        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.";
573      case NEEDSACTION:
574        return "The participant needs to indicate if they accept the appointment by changing this status to one of the other statuses.";
575      case NULL:
576        return null;
577      default:
578        return "?";
579      }
580    }
581
582    public String getDisplay() {
583      switch (this) {
584      case ACCEPTED:
585        return "Accepted";
586      case DECLINED:
587        return "Declined";
588      case TENTATIVE:
589        return "Tentative";
590      case NEEDSACTION:
591        return "Needs Action";
592      case NULL:
593        return null;
594      default:
595        return "?";
596      }
597    }
598  }
599
600  public static class ParticipationStatusEnumFactory implements EnumFactory<ParticipationStatus> {
601    public ParticipationStatus fromCode(String codeString) throws IllegalArgumentException {
602      if (codeString == null || "".equals(codeString))
603        if (codeString == null || "".equals(codeString))
604          return null;
605      if ("accepted".equals(codeString))
606        return ParticipationStatus.ACCEPTED;
607      if ("declined".equals(codeString))
608        return ParticipationStatus.DECLINED;
609      if ("tentative".equals(codeString))
610        return ParticipationStatus.TENTATIVE;
611      if ("needs-action".equals(codeString))
612        return ParticipationStatus.NEEDSACTION;
613      throw new IllegalArgumentException("Unknown ParticipationStatus code '" + codeString + "'");
614    }
615
616    public Enumeration<ParticipationStatus> fromType(PrimitiveType<?> code) throws FHIRException {
617      if (code == null)
618        return null;
619      if (code.isEmpty())
620        return new Enumeration<ParticipationStatus>(this, ParticipationStatus.NULL, code);
621      String codeString = code.asStringValue();
622      if (codeString == null || "".equals(codeString))
623        return new Enumeration<ParticipationStatus>(this, ParticipationStatus.NULL, code);
624      if ("accepted".equals(codeString))
625        return new Enumeration<ParticipationStatus>(this, ParticipationStatus.ACCEPTED, code);
626      if ("declined".equals(codeString))
627        return new Enumeration<ParticipationStatus>(this, ParticipationStatus.DECLINED, code);
628      if ("tentative".equals(codeString))
629        return new Enumeration<ParticipationStatus>(this, ParticipationStatus.TENTATIVE, code);
630      if ("needs-action".equals(codeString))
631        return new Enumeration<ParticipationStatus>(this, ParticipationStatus.NEEDSACTION, code);
632      throw new FHIRException("Unknown ParticipationStatus code '" + codeString + "'");
633    }
634
635    public String toCode(ParticipationStatus code) {
636      if (code == ParticipationStatus.ACCEPTED)
637        return "accepted";
638      if (code == ParticipationStatus.DECLINED)
639        return "declined";
640      if (code == ParticipationStatus.TENTATIVE)
641        return "tentative";
642      if (code == ParticipationStatus.NEEDSACTION)
643        return "needs-action";
644      return "?";
645    }
646
647    public String toSystem(ParticipationStatus code) {
648      return code.getSystem();
649    }
650  }
651
652  @Block()
653  public static class AppointmentParticipantComponent extends BackboneElement implements IBaseBackboneElement {
654    /**
655     * Role of participant in the appointment.
656     */
657    @Child(name = "type", type = {
658        CodeableConcept.class }, order = 1, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
659    @Description(shortDefinition = "Role of participant in the appointment", formalDefinition = "Role of participant in the appointment.")
660    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/encounter-participant-type")
661    protected List<CodeableConcept> type;
662
663    /**
664     * A Person, Location/HealthcareService or Device that is participating in the
665     * appointment.
666     */
667    @Child(name = "actor", type = { Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class,
668        Device.class, HealthcareService.class,
669        Location.class }, order = 2, min = 0, max = 1, modifier = false, summary = true)
670    @Description(shortDefinition = "Person, Location/HealthcareService or Device", formalDefinition = "A Person, Location/HealthcareService or Device that is participating in the appointment.")
671    protected Reference actor;
672
673    /**
674     * The actual object that is the target of the reference (A Person,
675     * Location/HealthcareService or Device that is participating in the
676     * appointment.)
677     */
678    protected Resource actorTarget;
679
680    /**
681     * Whether this participant is required to be present at the meeting. This
682     * covers a use-case where two doctors need to meet to discuss the results for a
683     * specific patient, and the patient is not required to be present.
684     */
685    @Child(name = "required", type = { CodeType.class }, order = 3, min = 0, max = 1, modifier = false, summary = true)
686    @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.")
687    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/participantrequired")
688    protected Enumeration<ParticipantRequired> required;
689
690    /**
691     * Participation status of the actor.
692     */
693    @Child(name = "status", type = { CodeType.class }, order = 4, min = 1, max = 1, modifier = false, summary = true)
694    @Description(shortDefinition = "accepted | declined | tentative | needs-action", formalDefinition = "Participation status of the actor.")
695    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/participationstatus")
696    protected Enumeration<ParticipationStatus> status;
697
698    /**
699     * Participation period of the actor.
700     */
701    @Child(name = "period", type = { Period.class }, order = 5, min = 0, max = 1, modifier = false, summary = false)
702    @Description(shortDefinition = "Participation period of the actor", formalDefinition = "Participation period of the actor.")
703    protected Period period;
704
705    private static final long serialVersionUID = -1939292177L;
706
707    /**
708     * Constructor
709     */
710    public AppointmentParticipantComponent() {
711      super();
712    }
713
714    /**
715     * Constructor
716     */
717    public AppointmentParticipantComponent(Enumeration<ParticipationStatus> status) {
718      super();
719      this.status = status;
720    }
721
722    /**
723     * @return {@link #type} (Role of participant in the appointment.)
724     */
725    public List<CodeableConcept> getType() {
726      if (this.type == null)
727        this.type = new ArrayList<CodeableConcept>();
728      return this.type;
729    }
730
731    /**
732     * @return Returns a reference to <code>this</code> for easy method chaining
733     */
734    public AppointmentParticipantComponent setType(List<CodeableConcept> theType) {
735      this.type = theType;
736      return this;
737    }
738
739    public boolean hasType() {
740      if (this.type == null)
741        return false;
742      for (CodeableConcept item : this.type)
743        if (!item.isEmpty())
744          return true;
745      return false;
746    }
747
748    public CodeableConcept addType() { // 3
749      CodeableConcept t = new CodeableConcept();
750      if (this.type == null)
751        this.type = new ArrayList<CodeableConcept>();
752      this.type.add(t);
753      return t;
754    }
755
756    public AppointmentParticipantComponent addType(CodeableConcept t) { // 3
757      if (t == null)
758        return this;
759      if (this.type == null)
760        this.type = new ArrayList<CodeableConcept>();
761      this.type.add(t);
762      return this;
763    }
764
765    /**
766     * @return The first repetition of repeating field {@link #type}, creating it if
767     *         it does not already exist
768     */
769    public CodeableConcept getTypeFirstRep() {
770      if (getType().isEmpty()) {
771        addType();
772      }
773      return getType().get(0);
774    }
775
776    /**
777     * @return {@link #actor} (A Person, Location/HealthcareService or Device that
778     *         is participating in the appointment.)
779     */
780    public Reference getActor() {
781      if (this.actor == null)
782        if (Configuration.errorOnAutoCreate())
783          throw new Error("Attempt to auto-create AppointmentParticipantComponent.actor");
784        else if (Configuration.doAutoCreate())
785          this.actor = new Reference(); // cc
786      return this.actor;
787    }
788
789    public boolean hasActor() {
790      return this.actor != null && !this.actor.isEmpty();
791    }
792
793    /**
794     * @param value {@link #actor} (A Person, Location/HealthcareService or Device
795     *              that is participating in the appointment.)
796     */
797    public AppointmentParticipantComponent setActor(Reference value) {
798      this.actor = value;
799      return this;
800    }
801
802    /**
803     * @return {@link #actor} The actual object that is the target of the reference.
804     *         The reference library doesn't populate this, but you can use it to
805     *         hold the resource if you resolve it. (A Person,
806     *         Location/HealthcareService or Device that is participating in the
807     *         appointment.)
808     */
809    public Resource getActorTarget() {
810      return this.actorTarget;
811    }
812
813    /**
814     * @param value {@link #actor} The actual object that is the target of the
815     *              reference. The reference library doesn't use these, but you can
816     *              use it to hold the resource if you resolve it. (A Person,
817     *              Location/HealthcareService or Device that is participating in
818     *              the appointment.)
819     */
820    public AppointmentParticipantComponent setActorTarget(Resource value) {
821      this.actorTarget = value;
822      return this;
823    }
824
825    /**
826     * @return {@link #required} (Whether this participant is required to be present
827     *         at the meeting. This covers a use-case where two doctors need to meet
828     *         to discuss the results for a specific patient, and the patient is not
829     *         required to be present.). This is the underlying object with id,
830     *         value and extensions. The accessor "getRequired" gives direct access
831     *         to the value
832     */
833    public Enumeration<ParticipantRequired> getRequiredElement() {
834      if (this.required == null)
835        if (Configuration.errorOnAutoCreate())
836          throw new Error("Attempt to auto-create AppointmentParticipantComponent.required");
837        else if (Configuration.doAutoCreate())
838          this.required = new Enumeration<ParticipantRequired>(new ParticipantRequiredEnumFactory()); // bb
839      return this.required;
840    }
841
842    public boolean hasRequiredElement() {
843      return this.required != null && !this.required.isEmpty();
844    }
845
846    public boolean hasRequired() {
847      return this.required != null && !this.required.isEmpty();
848    }
849
850    /**
851     * @param value {@link #required} (Whether this participant is required to be
852     *              present at the meeting. This covers a use-case where two doctors
853     *              need to meet to discuss the results for a specific patient, and
854     *              the patient is not required to be present.). This is the
855     *              underlying object with id, value and extensions. The accessor
856     *              "getRequired" gives direct access to the value
857     */
858    public AppointmentParticipantComponent setRequiredElement(Enumeration<ParticipantRequired> value) {
859      this.required = value;
860      return this;
861    }
862
863    /**
864     * @return Whether this participant is required to be present at the meeting.
865     *         This covers a use-case where two doctors need to meet to discuss the
866     *         results for a specific patient, and the patient is not required to be
867     *         present.
868     */
869    public ParticipantRequired getRequired() {
870      return this.required == null ? null : this.required.getValue();
871    }
872
873    /**
874     * @param value Whether this participant is required to be present at the
875     *              meeting. This covers a use-case where two doctors need to meet
876     *              to discuss the results for a specific patient, and the patient
877     *              is not required to be present.
878     */
879    public AppointmentParticipantComponent setRequired(ParticipantRequired value) {
880      if (value == null)
881        this.required = null;
882      else {
883        if (this.required == null)
884          this.required = new Enumeration<ParticipantRequired>(new ParticipantRequiredEnumFactory());
885        this.required.setValue(value);
886      }
887      return this;
888    }
889
890    /**
891     * @return {@link #status} (Participation status of the actor.). This is the
892     *         underlying object with id, value and extensions. The accessor
893     *         "getStatus" gives direct access to the value
894     */
895    public Enumeration<ParticipationStatus> getStatusElement() {
896      if (this.status == null)
897        if (Configuration.errorOnAutoCreate())
898          throw new Error("Attempt to auto-create AppointmentParticipantComponent.status");
899        else if (Configuration.doAutoCreate())
900          this.status = new Enumeration<ParticipationStatus>(new ParticipationStatusEnumFactory()); // bb
901      return this.status;
902    }
903
904    public boolean hasStatusElement() {
905      return this.status != null && !this.status.isEmpty();
906    }
907
908    public boolean hasStatus() {
909      return this.status != null && !this.status.isEmpty();
910    }
911
912    /**
913     * @param value {@link #status} (Participation status of the actor.). This is
914     *              the underlying object with id, value and extensions. The
915     *              accessor "getStatus" gives direct access to the value
916     */
917    public AppointmentParticipantComponent setStatusElement(Enumeration<ParticipationStatus> value) {
918      this.status = value;
919      return this;
920    }
921
922    /**
923     * @return Participation status of the actor.
924     */
925    public ParticipationStatus getStatus() {
926      return this.status == null ? null : this.status.getValue();
927    }
928
929    /**
930     * @param value Participation status of the actor.
931     */
932    public AppointmentParticipantComponent setStatus(ParticipationStatus value) {
933      if (this.status == null)
934        this.status = new Enumeration<ParticipationStatus>(new ParticipationStatusEnumFactory());
935      this.status.setValue(value);
936      return this;
937    }
938
939    /**
940     * @return {@link #period} (Participation period of the actor.)
941     */
942    public Period getPeriod() {
943      if (this.period == null)
944        if (Configuration.errorOnAutoCreate())
945          throw new Error("Attempt to auto-create AppointmentParticipantComponent.period");
946        else if (Configuration.doAutoCreate())
947          this.period = new Period(); // cc
948      return this.period;
949    }
950
951    public boolean hasPeriod() {
952      return this.period != null && !this.period.isEmpty();
953    }
954
955    /**
956     * @param value {@link #period} (Participation period of the actor.)
957     */
958    public AppointmentParticipantComponent setPeriod(Period value) {
959      this.period = value;
960      return this;
961    }
962
963    protected void listChildren(List<Property> children) {
964      super.listChildren(children);
965      children.add(new Property("type", "CodeableConcept", "Role of participant in the appointment.", 0,
966          java.lang.Integer.MAX_VALUE, type));
967      children.add(new Property("actor",
968          "Reference(Patient|Practitioner|PractitionerRole|RelatedPerson|Device|HealthcareService|Location)",
969          "A Person, Location/HealthcareService or Device that is participating in the appointment.", 0, 1, actor));
970      children.add(new Property("required", "code",
971          "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.",
972          0, 1, required));
973      children.add(new Property("status", "code", "Participation status of the actor.", 0, 1, status));
974      children.add(new Property("period", "Period", "Participation period of the actor.", 0, 1, period));
975    }
976
977    @Override
978    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
979      switch (_hash) {
980      case 3575610:
981        /* type */ return new Property("type", "CodeableConcept", "Role of participant in the appointment.", 0,
982            java.lang.Integer.MAX_VALUE, type);
983      case 92645877:
984        /* actor */ return new Property("actor",
985            "Reference(Patient|Practitioner|PractitionerRole|RelatedPerson|Device|HealthcareService|Location)",
986            "A Person, Location/HealthcareService or Device that is participating in the appointment.", 0, 1, actor);
987      case -393139297:
988        /* required */ return new Property("required", "code",
989            "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.",
990            0, 1, required);
991      case -892481550:
992        /* status */ return new Property("status", "code", "Participation status of the actor.", 0, 1, status);
993      case -991726143:
994        /* period */ return new Property("period", "Period", "Participation period of the actor.", 0, 1, period);
995      default:
996        return super.getNamedProperty(_hash, _name, _checkValid);
997      }
998
999    }
1000
1001    @Override
1002    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1003      switch (hash) {
1004      case 3575610:
1005        /* type */ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept
1006      case 92645877:
1007        /* actor */ return this.actor == null ? new Base[0] : new Base[] { this.actor }; // Reference
1008      case -393139297:
1009        /* required */ return this.required == null ? new Base[0] : new Base[] { this.required }; // Enumeration<ParticipantRequired>
1010      case -892481550:
1011        /* status */ return this.status == null ? new Base[0] : new Base[] { this.status }; // Enumeration<ParticipationStatus>
1012      case -991726143:
1013        /* period */ return this.period == null ? new Base[0] : new Base[] { this.period }; // Period
1014      default:
1015        return super.getProperty(hash, name, checkValid);
1016      }
1017
1018    }
1019
1020    @Override
1021    public Base setProperty(int hash, String name, Base value) throws FHIRException {
1022      switch (hash) {
1023      case 3575610: // type
1024        this.getType().add(castToCodeableConcept(value)); // CodeableConcept
1025        return value;
1026      case 92645877: // actor
1027        this.actor = castToReference(value); // Reference
1028        return value;
1029      case -393139297: // required
1030        value = new ParticipantRequiredEnumFactory().fromType(castToCode(value));
1031        this.required = (Enumeration) value; // Enumeration<ParticipantRequired>
1032        return value;
1033      case -892481550: // status
1034        value = new ParticipationStatusEnumFactory().fromType(castToCode(value));
1035        this.status = (Enumeration) value; // Enumeration<ParticipationStatus>
1036        return value;
1037      case -991726143: // period
1038        this.period = castToPeriod(value); // Period
1039        return value;
1040      default:
1041        return super.setProperty(hash, name, value);
1042      }
1043
1044    }
1045
1046    @Override
1047    public Base setProperty(String name, Base value) throws FHIRException {
1048      if (name.equals("type")) {
1049        this.getType().add(castToCodeableConcept(value));
1050      } else if (name.equals("actor")) {
1051        this.actor = castToReference(value); // Reference
1052      } else if (name.equals("required")) {
1053        value = new ParticipantRequiredEnumFactory().fromType(castToCode(value));
1054        this.required = (Enumeration) value; // Enumeration<ParticipantRequired>
1055      } else if (name.equals("status")) {
1056        value = new ParticipationStatusEnumFactory().fromType(castToCode(value));
1057        this.status = (Enumeration) value; // Enumeration<ParticipationStatus>
1058      } else if (name.equals("period")) {
1059        this.period = castToPeriod(value); // Period
1060      } else
1061        return super.setProperty(name, value);
1062      return value;
1063    }
1064
1065    @Override
1066    public Base makeProperty(int hash, String name) throws FHIRException {
1067      switch (hash) {
1068      case 3575610:
1069        return addType();
1070      case 92645877:
1071        return getActor();
1072      case -393139297:
1073        return getRequiredElement();
1074      case -892481550:
1075        return getStatusElement();
1076      case -991726143:
1077        return getPeriod();
1078      default:
1079        return super.makeProperty(hash, name);
1080      }
1081
1082    }
1083
1084    @Override
1085    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1086      switch (hash) {
1087      case 3575610:
1088        /* type */ return new String[] { "CodeableConcept" };
1089      case 92645877:
1090        /* actor */ return new String[] { "Reference" };
1091      case -393139297:
1092        /* required */ return new String[] { "code" };
1093      case -892481550:
1094        /* status */ return new String[] { "code" };
1095      case -991726143:
1096        /* period */ return new String[] { "Period" };
1097      default:
1098        return super.getTypesForProperty(hash, name);
1099      }
1100
1101    }
1102
1103    @Override
1104    public Base addChild(String name) throws FHIRException {
1105      if (name.equals("type")) {
1106        return addType();
1107      } else if (name.equals("actor")) {
1108        this.actor = new Reference();
1109        return this.actor;
1110      } else if (name.equals("required")) {
1111        throw new FHIRException("Cannot call addChild on a singleton property Appointment.required");
1112      } else if (name.equals("status")) {
1113        throw new FHIRException("Cannot call addChild on a singleton property Appointment.status");
1114      } else if (name.equals("period")) {
1115        this.period = new Period();
1116        return this.period;
1117      } else
1118        return super.addChild(name);
1119    }
1120
1121    public AppointmentParticipantComponent copy() {
1122      AppointmentParticipantComponent dst = new AppointmentParticipantComponent();
1123      copyValues(dst);
1124      return dst;
1125    }
1126
1127    public void copyValues(AppointmentParticipantComponent dst) {
1128      super.copyValues(dst);
1129      if (type != null) {
1130        dst.type = new ArrayList<CodeableConcept>();
1131        for (CodeableConcept i : type)
1132          dst.type.add(i.copy());
1133      }
1134      ;
1135      dst.actor = actor == null ? null : actor.copy();
1136      dst.required = required == null ? null : required.copy();
1137      dst.status = status == null ? null : status.copy();
1138      dst.period = period == null ? null : period.copy();
1139    }
1140
1141    @Override
1142    public boolean equalsDeep(Base other_) {
1143      if (!super.equalsDeep(other_))
1144        return false;
1145      if (!(other_ instanceof AppointmentParticipantComponent))
1146        return false;
1147      AppointmentParticipantComponent o = (AppointmentParticipantComponent) other_;
1148      return compareDeep(type, o.type, true) && compareDeep(actor, o.actor, true)
1149          && compareDeep(required, o.required, true) && compareDeep(status, o.status, true)
1150          && compareDeep(period, o.period, true);
1151    }
1152
1153    @Override
1154    public boolean equalsShallow(Base other_) {
1155      if (!super.equalsShallow(other_))
1156        return false;
1157      if (!(other_ instanceof AppointmentParticipantComponent))
1158        return false;
1159      AppointmentParticipantComponent o = (AppointmentParticipantComponent) other_;
1160      return compareValues(required, o.required, true) && compareValues(status, o.status, true);
1161    }
1162
1163    public boolean isEmpty() {
1164      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, actor, required, status, period);
1165    }
1166
1167    public String fhirType() {
1168      return "Appointment.participant";
1169
1170    }
1171
1172  }
1173
1174  /**
1175   * This records identifiers associated with this appointment concern that are
1176   * defined by business processes and/or used to refer to it when a direct URL
1177   * reference to the resource itself is not appropriate (e.g. in CDA documents,
1178   * or in written / printed documentation).
1179   */
1180  @Child(name = "identifier", type = {
1181      Identifier.class }, order = 0, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
1182  @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).")
1183  protected List<Identifier> identifier;
1184
1185  /**
1186   * The overall status of the Appointment. Each of the participants has their own
1187   * participation status which indicates their involvement in the process,
1188   * however this status indicates the shared status.
1189   */
1190  @Child(name = "status", type = { CodeType.class }, order = 1, min = 1, max = 1, modifier = true, summary = true)
1191  @Description(shortDefinition = "proposed | pending | booked | arrived | fulfilled | cancelled | noshow | entered-in-error | checked-in | waitlist", 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.")
1192  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/appointmentstatus")
1193  protected Enumeration<AppointmentStatus> status;
1194
1195  /**
1196   * The coded reason for the appointment being cancelled. This is often used in
1197   * reporting/billing/futher processing to determine if further actions are
1198   * required, or specific fees apply.
1199   */
1200  @Child(name = "cancelationReason", type = {
1201      CodeableConcept.class }, order = 2, min = 0, max = 1, modifier = false, summary = true)
1202  @Description(shortDefinition = "The coded reason for the appointment being cancelled", formalDefinition = "The coded reason for the appointment being cancelled. This is often used in reporting/billing/futher processing to determine if further actions are required, or specific fees apply.")
1203  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/appointment-cancellation-reason")
1204  protected CodeableConcept cancelationReason;
1205
1206  /**
1207   * A broad categorization of the service that is to be performed during this
1208   * appointment.
1209   */
1210  @Child(name = "serviceCategory", type = {
1211      CodeableConcept.class }, order = 3, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
1212  @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.")
1213  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/service-category")
1214  protected List<CodeableConcept> serviceCategory;
1215
1216  /**
1217   * The specific service that is to be performed during this appointment.
1218   */
1219  @Child(name = "serviceType", type = {
1220      CodeableConcept.class }, order = 4, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
1221  @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.")
1222  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/service-type")
1223  protected List<CodeableConcept> serviceType;
1224
1225  /**
1226   * The specialty of a practitioner that would be required to perform the service
1227   * requested in this appointment.
1228   */
1229  @Child(name = "specialty", type = {
1230      CodeableConcept.class }, order = 5, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
1231  @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.")
1232  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/c80-practice-codes")
1233  protected List<CodeableConcept> specialty;
1234
1235  /**
1236   * The style of appointment or patient that has been booked in the slot (not
1237   * service type).
1238   */
1239  @Child(name = "appointmentType", type = {
1240      CodeableConcept.class }, order = 6, min = 0, max = 1, modifier = false, summary = true)
1241  @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).")
1242  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://terminology.hl7.org/ValueSet/v2-0276")
1243  protected CodeableConcept appointmentType;
1244
1245  /**
1246   * The coded reason that this appointment is being scheduled. This is more
1247   * clinical than administrative.
1248   */
1249  @Child(name = "reasonCode", type = {
1250      CodeableConcept.class }, order = 7, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
1251  @Description(shortDefinition = "Coded reason this appointment is scheduled", formalDefinition = "The coded reason that this appointment is being scheduled. This is more clinical than administrative.")
1252  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/encounter-reason")
1253  protected List<CodeableConcept> reasonCode;
1254
1255  /**
1256   * Reason the appointment has been scheduled to take place, as specified using
1257   * information from another resource. When the patient arrives and the encounter
1258   * begins it may be used as the admission diagnosis. The indication will
1259   * typically be a Condition (with other resources referenced in the
1260   * evidence.detail), or a Procedure.
1261   */
1262  @Child(name = "reasonReference", type = { Condition.class, Procedure.class, Observation.class,
1263      ImmunizationRecommendation.class }, order = 8, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1264  @Description(shortDefinition = "Reason the appointment is to take 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.")
1265  protected List<Reference> reasonReference;
1266  /**
1267   * The actual objects that are the target of the reference (Reason the
1268   * appointment has been scheduled to take place, as specified using information
1269   * from another resource. When the patient arrives and the encounter begins it
1270   * may be used as the admission diagnosis. The indication will typically be a
1271   * Condition (with other resources referenced in the evidence.detail), or a
1272   * Procedure.)
1273   */
1274  protected List<Resource> reasonReferenceTarget;
1275
1276  /**
1277   * The priority of the appointment. Can be used to make informed decisions if
1278   * needing to re-prioritize appointments. (The iCal Standard specifies 0 as
1279   * undefined, 1 as highest, 9 as lowest priority).
1280   */
1281  @Child(name = "priority", type = {
1282      UnsignedIntType.class }, order = 9, min = 0, max = 1, modifier = false, summary = false)
1283  @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).")
1284  protected UnsignedIntType priority;
1285
1286  /**
1287   * The brief description of the appointment as would be shown on a subject line
1288   * in a meeting request, or appointment list. Detailed or expanded information
1289   * should be put in the comment field.
1290   */
1291  @Child(name = "description", type = {
1292      StringType.class }, order = 10, min = 0, max = 1, modifier = false, summary = false)
1293  @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.")
1294  protected StringType description;
1295
1296  /**
1297   * Additional information to support the appointment provided when making the
1298   * appointment.
1299   */
1300  @Child(name = "supportingInformation", type = {
1301      Reference.class }, order = 11, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1302  @Description(shortDefinition = "Additional information to support the appointment", formalDefinition = "Additional information to support the appointment provided when making the appointment.")
1303  protected List<Reference> supportingInformation;
1304  /**
1305   * The actual objects that are the target of the reference (Additional
1306   * information to support the appointment provided when making the appointment.)
1307   */
1308  protected List<Resource> supportingInformationTarget;
1309
1310  /**
1311   * Date/Time that the appointment is to take place.
1312   */
1313  @Child(name = "start", type = { InstantType.class }, order = 12, min = 0, max = 1, modifier = false, summary = true)
1314  @Description(shortDefinition = "When appointment is to take place", formalDefinition = "Date/Time that the appointment is to take place.")
1315  protected InstantType start;
1316
1317  /**
1318   * Date/Time that the appointment is to conclude.
1319   */
1320  @Child(name = "end", type = { InstantType.class }, order = 13, min = 0, max = 1, modifier = false, summary = true)
1321  @Description(shortDefinition = "When appointment is to conclude", formalDefinition = "Date/Time that the appointment is to conclude.")
1322  protected InstantType end;
1323
1324  /**
1325   * Number of minutes that the appointment is to take. This can be less than the
1326   * duration between the start and end times. For example, where the actual time
1327   * of appointment is only an estimate or if a 30 minute appointment is being
1328   * requested, but any time would work. Also, if there is, for example, a planned
1329   * 15 minute break in the middle of a long appointment, the duration may be 15
1330   * minutes less than the difference between the start and end.
1331   */
1332  @Child(name = "minutesDuration", type = {
1333      PositiveIntType.class }, order = 14, min = 0, max = 1, modifier = false, summary = false)
1334  @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.")
1335  protected PositiveIntType minutesDuration;
1336
1337  /**
1338   * The slots from the participants' schedules that will be filled by the
1339   * appointment.
1340   */
1341  @Child(name = "slot", type = {
1342      Slot.class }, order = 15, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1343  @Description(shortDefinition = "The slots that this appointment is filling", formalDefinition = "The slots from the participants' schedules that will be filled by the appointment.")
1344  protected List<Reference> slot;
1345  /**
1346   * The actual objects that are the target of the reference (The slots from the
1347   * participants' schedules that will be filled by the appointment.)
1348   */
1349  protected List<Slot> slotTarget;
1350
1351  /**
1352   * The date that this appointment was initially created. This could be different
1353   * to the meta.lastModified value on the initial entry, as this could have been
1354   * before the resource was created on the FHIR server, and should remain
1355   * unchanged over the lifespan of the appointment.
1356   */
1357  @Child(name = "created", type = {
1358      DateTimeType.class }, order = 16, min = 0, max = 1, modifier = false, summary = false)
1359  @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.")
1360  protected DateTimeType created;
1361
1362  /**
1363   * Additional comments about the appointment.
1364   */
1365  @Child(name = "comment", type = { StringType.class }, order = 17, min = 0, max = 1, modifier = false, summary = false)
1366  @Description(shortDefinition = "Additional comments", formalDefinition = "Additional comments about the appointment.")
1367  protected StringType comment;
1368
1369  /**
1370   * While Appointment.comment contains information for internal use,
1371   * Appointment.patientInstructions is used to capture patient facing information
1372   * about the Appointment (e.g. please bring your referral or fast from 8pm night
1373   * before).
1374   */
1375  @Child(name = "patientInstruction", type = {
1376      StringType.class }, order = 18, min = 0, max = 1, modifier = false, summary = false)
1377  @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).")
1378  protected StringType patientInstruction;
1379
1380  /**
1381   * The service request this appointment is allocated to assess (e.g. incoming
1382   * referral or procedure request).
1383   */
1384  @Child(name = "basedOn", type = {
1385      ServiceRequest.class }, order = 19, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1386  @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).")
1387  protected List<Reference> basedOn;
1388  /**
1389   * The actual objects that are the target of the reference (The service request
1390   * this appointment is allocated to assess (e.g. incoming referral or procedure
1391   * request).)
1392   */
1393  protected List<ServiceRequest> basedOnTarget;
1394
1395  /**
1396   * List of participants involved in the appointment.
1397   */
1398  @Child(name = "participant", type = {}, order = 20, min = 1, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1399  @Description(shortDefinition = "Participants involved in appointment", formalDefinition = "List of participants involved in the appointment.")
1400  protected List<AppointmentParticipantComponent> participant;
1401
1402  /**
1403   * A set of date ranges (potentially including times) that the appointment is
1404   * preferred to be scheduled within.
1405   * 
1406   * The duration (usually in minutes) could also be provided to indicate the
1407   * length of the appointment to fill and populate the start/end times for the
1408   * actual allocated time. However, in other situations the duration may be
1409   * calculated by the scheduling system.
1410   */
1411  @Child(name = "requestedPeriod", type = {
1412      Period.class }, order = 21, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1413  @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.\n\nThe duration (usually in minutes) could also be provided to indicate the length of the appointment to fill and populate the start/end times for the actual allocated time. However, in other situations the duration may be calculated by the scheduling system.")
1414  protected List<Period> requestedPeriod;
1415
1416  private static final long serialVersionUID = -1096822339L;
1417
1418  /**
1419   * Constructor
1420   */
1421  public Appointment() {
1422    super();
1423  }
1424
1425  /**
1426   * Constructor
1427   */
1428  public Appointment(Enumeration<AppointmentStatus> status) {
1429    super();
1430    this.status = status;
1431  }
1432
1433  /**
1434   * @return {@link #identifier} (This records identifiers associated with this
1435   *         appointment concern that are defined by business processes and/or
1436   *         used to refer to it when a direct URL reference to the resource
1437   *         itself is not appropriate (e.g. in CDA documents, or in written /
1438   *         printed documentation).)
1439   */
1440  public List<Identifier> getIdentifier() {
1441    if (this.identifier == null)
1442      this.identifier = new ArrayList<Identifier>();
1443    return this.identifier;
1444  }
1445
1446  /**
1447   * @return Returns a reference to <code>this</code> for easy method chaining
1448   */
1449  public Appointment setIdentifier(List<Identifier> theIdentifier) {
1450    this.identifier = theIdentifier;
1451    return this;
1452  }
1453
1454  public boolean hasIdentifier() {
1455    if (this.identifier == null)
1456      return false;
1457    for (Identifier item : this.identifier)
1458      if (!item.isEmpty())
1459        return true;
1460    return false;
1461  }
1462
1463  public Identifier addIdentifier() { // 3
1464    Identifier t = new Identifier();
1465    if (this.identifier == null)
1466      this.identifier = new ArrayList<Identifier>();
1467    this.identifier.add(t);
1468    return t;
1469  }
1470
1471  public Appointment addIdentifier(Identifier t) { // 3
1472    if (t == null)
1473      return this;
1474    if (this.identifier == null)
1475      this.identifier = new ArrayList<Identifier>();
1476    this.identifier.add(t);
1477    return this;
1478  }
1479
1480  /**
1481   * @return The first repetition of repeating field {@link #identifier}, creating
1482   *         it if it does not already exist
1483   */
1484  public Identifier getIdentifierFirstRep() {
1485    if (getIdentifier().isEmpty()) {
1486      addIdentifier();
1487    }
1488    return getIdentifier().get(0);
1489  }
1490
1491  /**
1492   * @return {@link #status} (The overall status of the Appointment. Each of the
1493   *         participants has their own participation status which indicates their
1494   *         involvement in the process, however this status indicates the shared
1495   *         status.). This is the underlying object with id, value and
1496   *         extensions. The accessor "getStatus" gives direct access to the value
1497   */
1498  public Enumeration<AppointmentStatus> getStatusElement() {
1499    if (this.status == null)
1500      if (Configuration.errorOnAutoCreate())
1501        throw new Error("Attempt to auto-create Appointment.status");
1502      else if (Configuration.doAutoCreate())
1503        this.status = new Enumeration<AppointmentStatus>(new AppointmentStatusEnumFactory()); // bb
1504    return this.status;
1505  }
1506
1507  public boolean hasStatusElement() {
1508    return this.status != null && !this.status.isEmpty();
1509  }
1510
1511  public boolean hasStatus() {
1512    return this.status != null && !this.status.isEmpty();
1513  }
1514
1515  /**
1516   * @param value {@link #status} (The overall status of the Appointment. Each of
1517   *              the participants has their own participation status which
1518   *              indicates their involvement in the process, however this status
1519   *              indicates the shared status.). This is the underlying object
1520   *              with id, value and extensions. The accessor "getStatus" gives
1521   *              direct access to the value
1522   */
1523  public Appointment setStatusElement(Enumeration<AppointmentStatus> value) {
1524    this.status = value;
1525    return this;
1526  }
1527
1528  /**
1529   * @return The overall status of the Appointment. Each of the participants has
1530   *         their own participation status which indicates their involvement in
1531   *         the process, however this status indicates the shared status.
1532   */
1533  public AppointmentStatus getStatus() {
1534    return this.status == null ? null : this.status.getValue();
1535  }
1536
1537  /**
1538   * @param value The overall status of the Appointment. Each of the participants
1539   *              has their own participation status which indicates their
1540   *              involvement in the process, however this status indicates the
1541   *              shared status.
1542   */
1543  public Appointment setStatus(AppointmentStatus value) {
1544    if (this.status == null)
1545      this.status = new Enumeration<AppointmentStatus>(new AppointmentStatusEnumFactory());
1546    this.status.setValue(value);
1547    return this;
1548  }
1549
1550  /**
1551   * @return {@link #cancelationReason} (The coded reason for the appointment
1552   *         being cancelled. This is often used in reporting/billing/futher
1553   *         processing to determine if further actions are required, or specific
1554   *         fees apply.)
1555   */
1556  public CodeableConcept getCancelationReason() {
1557    if (this.cancelationReason == null)
1558      if (Configuration.errorOnAutoCreate())
1559        throw new Error("Attempt to auto-create Appointment.cancelationReason");
1560      else if (Configuration.doAutoCreate())
1561        this.cancelationReason = new CodeableConcept(); // cc
1562    return this.cancelationReason;
1563  }
1564
1565  public boolean hasCancelationReason() {
1566    return this.cancelationReason != null && !this.cancelationReason.isEmpty();
1567  }
1568
1569  /**
1570   * @param value {@link #cancelationReason} (The coded reason for the appointment
1571   *              being cancelled. This is often used in reporting/billing/futher
1572   *              processing to determine if further actions are required, or
1573   *              specific fees apply.)
1574   */
1575  public Appointment setCancelationReason(CodeableConcept value) {
1576    this.cancelationReason = value;
1577    return this;
1578  }
1579
1580  /**
1581   * @return {@link #serviceCategory} (A broad categorization of the service that
1582   *         is to be performed during this appointment.)
1583   */
1584  public List<CodeableConcept> getServiceCategory() {
1585    if (this.serviceCategory == null)
1586      this.serviceCategory = new ArrayList<CodeableConcept>();
1587    return this.serviceCategory;
1588  }
1589
1590  /**
1591   * @return Returns a reference to <code>this</code> for easy method chaining
1592   */
1593  public Appointment setServiceCategory(List<CodeableConcept> theServiceCategory) {
1594    this.serviceCategory = theServiceCategory;
1595    return this;
1596  }
1597
1598  public boolean hasServiceCategory() {
1599    if (this.serviceCategory == null)
1600      return false;
1601    for (CodeableConcept item : this.serviceCategory)
1602      if (!item.isEmpty())
1603        return true;
1604    return false;
1605  }
1606
1607  public CodeableConcept addServiceCategory() { // 3
1608    CodeableConcept t = new CodeableConcept();
1609    if (this.serviceCategory == null)
1610      this.serviceCategory = new ArrayList<CodeableConcept>();
1611    this.serviceCategory.add(t);
1612    return t;
1613  }
1614
1615  public Appointment addServiceCategory(CodeableConcept t) { // 3
1616    if (t == null)
1617      return this;
1618    if (this.serviceCategory == null)
1619      this.serviceCategory = new ArrayList<CodeableConcept>();
1620    this.serviceCategory.add(t);
1621    return this;
1622  }
1623
1624  /**
1625   * @return The first repetition of repeating field {@link #serviceCategory},
1626   *         creating it if it does not already exist
1627   */
1628  public CodeableConcept getServiceCategoryFirstRep() {
1629    if (getServiceCategory().isEmpty()) {
1630      addServiceCategory();
1631    }
1632    return getServiceCategory().get(0);
1633  }
1634
1635  /**
1636   * @return {@link #serviceType} (The specific service that is to be performed
1637   *         during this appointment.)
1638   */
1639  public List<CodeableConcept> getServiceType() {
1640    if (this.serviceType == null)
1641      this.serviceType = new ArrayList<CodeableConcept>();
1642    return this.serviceType;
1643  }
1644
1645  /**
1646   * @return Returns a reference to <code>this</code> for easy method chaining
1647   */
1648  public Appointment setServiceType(List<CodeableConcept> theServiceType) {
1649    this.serviceType = theServiceType;
1650    return this;
1651  }
1652
1653  public boolean hasServiceType() {
1654    if (this.serviceType == null)
1655      return false;
1656    for (CodeableConcept item : this.serviceType)
1657      if (!item.isEmpty())
1658        return true;
1659    return false;
1660  }
1661
1662  public CodeableConcept addServiceType() { // 3
1663    CodeableConcept t = new CodeableConcept();
1664    if (this.serviceType == null)
1665      this.serviceType = new ArrayList<CodeableConcept>();
1666    this.serviceType.add(t);
1667    return t;
1668  }
1669
1670  public Appointment addServiceType(CodeableConcept t) { // 3
1671    if (t == null)
1672      return this;
1673    if (this.serviceType == null)
1674      this.serviceType = new ArrayList<CodeableConcept>();
1675    this.serviceType.add(t);
1676    return this;
1677  }
1678
1679  /**
1680   * @return The first repetition of repeating field {@link #serviceType},
1681   *         creating it if it does not already exist
1682   */
1683  public CodeableConcept getServiceTypeFirstRep() {
1684    if (getServiceType().isEmpty()) {
1685      addServiceType();
1686    }
1687    return getServiceType().get(0);
1688  }
1689
1690  /**
1691   * @return {@link #specialty} (The specialty of a practitioner that would be
1692   *         required to perform the service requested in this appointment.)
1693   */
1694  public List<CodeableConcept> getSpecialty() {
1695    if (this.specialty == null)
1696      this.specialty = new ArrayList<CodeableConcept>();
1697    return this.specialty;
1698  }
1699
1700  /**
1701   * @return Returns a reference to <code>this</code> for easy method chaining
1702   */
1703  public Appointment setSpecialty(List<CodeableConcept> theSpecialty) {
1704    this.specialty = theSpecialty;
1705    return this;
1706  }
1707
1708  public boolean hasSpecialty() {
1709    if (this.specialty == null)
1710      return false;
1711    for (CodeableConcept item : this.specialty)
1712      if (!item.isEmpty())
1713        return true;
1714    return false;
1715  }
1716
1717  public CodeableConcept addSpecialty() { // 3
1718    CodeableConcept t = new CodeableConcept();
1719    if (this.specialty == null)
1720      this.specialty = new ArrayList<CodeableConcept>();
1721    this.specialty.add(t);
1722    return t;
1723  }
1724
1725  public Appointment addSpecialty(CodeableConcept t) { // 3
1726    if (t == null)
1727      return this;
1728    if (this.specialty == null)
1729      this.specialty = new ArrayList<CodeableConcept>();
1730    this.specialty.add(t);
1731    return this;
1732  }
1733
1734  /**
1735   * @return The first repetition of repeating field {@link #specialty}, creating
1736   *         it if it does not already exist
1737   */
1738  public CodeableConcept getSpecialtyFirstRep() {
1739    if (getSpecialty().isEmpty()) {
1740      addSpecialty();
1741    }
1742    return getSpecialty().get(0);
1743  }
1744
1745  /**
1746   * @return {@link #appointmentType} (The style of appointment or patient that
1747   *         has been booked in the slot (not service type).)
1748   */
1749  public CodeableConcept getAppointmentType() {
1750    if (this.appointmentType == null)
1751      if (Configuration.errorOnAutoCreate())
1752        throw new Error("Attempt to auto-create Appointment.appointmentType");
1753      else if (Configuration.doAutoCreate())
1754        this.appointmentType = new CodeableConcept(); // cc
1755    return this.appointmentType;
1756  }
1757
1758  public boolean hasAppointmentType() {
1759    return this.appointmentType != null && !this.appointmentType.isEmpty();
1760  }
1761
1762  /**
1763   * @param value {@link #appointmentType} (The style of appointment or patient
1764   *              that has been booked in the slot (not service type).)
1765   */
1766  public Appointment setAppointmentType(CodeableConcept value) {
1767    this.appointmentType = value;
1768    return this;
1769  }
1770
1771  /**
1772   * @return {@link #reasonCode} (The coded reason that this appointment is being
1773   *         scheduled. This is more clinical than administrative.)
1774   */
1775  public List<CodeableConcept> getReasonCode() {
1776    if (this.reasonCode == null)
1777      this.reasonCode = new ArrayList<CodeableConcept>();
1778    return this.reasonCode;
1779  }
1780
1781  /**
1782   * @return Returns a reference to <code>this</code> for easy method chaining
1783   */
1784  public Appointment setReasonCode(List<CodeableConcept> theReasonCode) {
1785    this.reasonCode = theReasonCode;
1786    return this;
1787  }
1788
1789  public boolean hasReasonCode() {
1790    if (this.reasonCode == null)
1791      return false;
1792    for (CodeableConcept item : this.reasonCode)
1793      if (!item.isEmpty())
1794        return true;
1795    return false;
1796  }
1797
1798  public CodeableConcept addReasonCode() { // 3
1799    CodeableConcept t = new CodeableConcept();
1800    if (this.reasonCode == null)
1801      this.reasonCode = new ArrayList<CodeableConcept>();
1802    this.reasonCode.add(t);
1803    return t;
1804  }
1805
1806  public Appointment addReasonCode(CodeableConcept t) { // 3
1807    if (t == null)
1808      return this;
1809    if (this.reasonCode == null)
1810      this.reasonCode = new ArrayList<CodeableConcept>();
1811    this.reasonCode.add(t);
1812    return this;
1813  }
1814
1815  /**
1816   * @return The first repetition of repeating field {@link #reasonCode}, creating
1817   *         it if it does not already exist
1818   */
1819  public CodeableConcept getReasonCodeFirstRep() {
1820    if (getReasonCode().isEmpty()) {
1821      addReasonCode();
1822    }
1823    return getReasonCode().get(0);
1824  }
1825
1826  /**
1827   * @return {@link #reasonReference} (Reason the appointment has been scheduled
1828   *         to take place, as specified using information from another resource.
1829   *         When the patient arrives and the encounter begins it may be used as
1830   *         the admission diagnosis. The indication will typically be a Condition
1831   *         (with other resources referenced in the evidence.detail), or a
1832   *         Procedure.)
1833   */
1834  public List<Reference> getReasonReference() {
1835    if (this.reasonReference == null)
1836      this.reasonReference = new ArrayList<Reference>();
1837    return this.reasonReference;
1838  }
1839
1840  /**
1841   * @return Returns a reference to <code>this</code> for easy method chaining
1842   */
1843  public Appointment setReasonReference(List<Reference> theReasonReference) {
1844    this.reasonReference = theReasonReference;
1845    return this;
1846  }
1847
1848  public boolean hasReasonReference() {
1849    if (this.reasonReference == null)
1850      return false;
1851    for (Reference item : this.reasonReference)
1852      if (!item.isEmpty())
1853        return true;
1854    return false;
1855  }
1856
1857  public Reference addReasonReference() { // 3
1858    Reference t = new Reference();
1859    if (this.reasonReference == null)
1860      this.reasonReference = new ArrayList<Reference>();
1861    this.reasonReference.add(t);
1862    return t;
1863  }
1864
1865  public Appointment addReasonReference(Reference t) { // 3
1866    if (t == null)
1867      return this;
1868    if (this.reasonReference == null)
1869      this.reasonReference = new ArrayList<Reference>();
1870    this.reasonReference.add(t);
1871    return this;
1872  }
1873
1874  /**
1875   * @return The first repetition of repeating field {@link #reasonReference},
1876   *         creating it if it does not already exist
1877   */
1878  public Reference getReasonReferenceFirstRep() {
1879    if (getReasonReference().isEmpty()) {
1880      addReasonReference();
1881    }
1882    return getReasonReference().get(0);
1883  }
1884
1885  /**
1886   * @deprecated Use Reference#setResource(IBaseResource) instead
1887   */
1888  @Deprecated
1889  public List<Resource> getReasonReferenceTarget() {
1890    if (this.reasonReferenceTarget == null)
1891      this.reasonReferenceTarget = new ArrayList<Resource>();
1892    return this.reasonReferenceTarget;
1893  }
1894
1895  /**
1896   * @return {@link #priority} (The priority of the appointment. Can be used to
1897   *         make informed decisions if needing to re-prioritize appointments.
1898   *         (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as
1899   *         lowest priority).). This is the underlying object with id, value and
1900   *         extensions. The accessor "getPriority" gives direct access to the
1901   *         value
1902   */
1903  public UnsignedIntType getPriorityElement() {
1904    if (this.priority == null)
1905      if (Configuration.errorOnAutoCreate())
1906        throw new Error("Attempt to auto-create Appointment.priority");
1907      else if (Configuration.doAutoCreate())
1908        this.priority = new UnsignedIntType(); // bb
1909    return this.priority;
1910  }
1911
1912  public boolean hasPriorityElement() {
1913    return this.priority != null && !this.priority.isEmpty();
1914  }
1915
1916  public boolean hasPriority() {
1917    return this.priority != null && !this.priority.isEmpty();
1918  }
1919
1920  /**
1921   * @param value {@link #priority} (The priority of the appointment. Can be used
1922   *              to make informed decisions if needing to re-prioritize
1923   *              appointments. (The iCal Standard specifies 0 as undefined, 1 as
1924   *              highest, 9 as lowest priority).). This is the underlying object
1925   *              with id, value and extensions. The accessor "getPriority" gives
1926   *              direct access to the value
1927   */
1928  public Appointment setPriorityElement(UnsignedIntType value) {
1929    this.priority = value;
1930    return this;
1931  }
1932
1933  /**
1934   * @return The priority of the appointment. Can be used to make informed
1935   *         decisions if needing to re-prioritize appointments. (The iCal
1936   *         Standard specifies 0 as undefined, 1 as highest, 9 as lowest
1937   *         priority).
1938   */
1939  public int getPriority() {
1940    return this.priority == null || this.priority.isEmpty() ? 0 : this.priority.getValue();
1941  }
1942
1943  /**
1944   * @param value The priority of the appointment. Can be used to make informed
1945   *              decisions if needing to re-prioritize appointments. (The iCal
1946   *              Standard specifies 0 as undefined, 1 as highest, 9 as lowest
1947   *              priority).
1948   */
1949  public Appointment setPriority(int value) {
1950    if (this.priority == null)
1951      this.priority = new UnsignedIntType();
1952    this.priority.setValue(value);
1953    return this;
1954  }
1955
1956  /**
1957   * @return {@link #description} (The brief description of the appointment as
1958   *         would be shown on a subject line in a meeting request, or appointment
1959   *         list. Detailed or expanded information should be put in the comment
1960   *         field.). This is the underlying object with id, value and extensions.
1961   *         The accessor "getDescription" gives direct access to the value
1962   */
1963  public StringType getDescriptionElement() {
1964    if (this.description == null)
1965      if (Configuration.errorOnAutoCreate())
1966        throw new Error("Attempt to auto-create Appointment.description");
1967      else if (Configuration.doAutoCreate())
1968        this.description = new StringType(); // bb
1969    return this.description;
1970  }
1971
1972  public boolean hasDescriptionElement() {
1973    return this.description != null && !this.description.isEmpty();
1974  }
1975
1976  public boolean hasDescription() {
1977    return this.description != null && !this.description.isEmpty();
1978  }
1979
1980  /**
1981   * @param value {@link #description} (The brief description of the appointment
1982   *              as would be shown on a subject line in a meeting request, or
1983   *              appointment list. Detailed or expanded information should be put
1984   *              in the comment field.). This is the underlying object with id,
1985   *              value and extensions. The accessor "getDescription" gives direct
1986   *              access to the value
1987   */
1988  public Appointment setDescriptionElement(StringType value) {
1989    this.description = value;
1990    return this;
1991  }
1992
1993  /**
1994   * @return The brief description of the appointment as would be shown on a
1995   *         subject line in a meeting request, or appointment list. Detailed or
1996   *         expanded information should be put in the comment field.
1997   */
1998  public String getDescription() {
1999    return this.description == null ? null : this.description.getValue();
2000  }
2001
2002  /**
2003   * @param value The brief description of the appointment as would be shown on a
2004   *              subject line in a meeting request, or appointment list. Detailed
2005   *              or expanded information should be put in the comment field.
2006   */
2007  public Appointment setDescription(String value) {
2008    if (Utilities.noString(value))
2009      this.description = null;
2010    else {
2011      if (this.description == null)
2012        this.description = new StringType();
2013      this.description.setValue(value);
2014    }
2015    return this;
2016  }
2017
2018  /**
2019   * @return {@link #supportingInformation} (Additional information to support the
2020   *         appointment provided when making the appointment.)
2021   */
2022  public List<Reference> getSupportingInformation() {
2023    if (this.supportingInformation == null)
2024      this.supportingInformation = new ArrayList<Reference>();
2025    return this.supportingInformation;
2026  }
2027
2028  /**
2029   * @return Returns a reference to <code>this</code> for easy method chaining
2030   */
2031  public Appointment setSupportingInformation(List<Reference> theSupportingInformation) {
2032    this.supportingInformation = theSupportingInformation;
2033    return this;
2034  }
2035
2036  public boolean hasSupportingInformation() {
2037    if (this.supportingInformation == null)
2038      return false;
2039    for (Reference item : this.supportingInformation)
2040      if (!item.isEmpty())
2041        return true;
2042    return false;
2043  }
2044
2045  public Reference addSupportingInformation() { // 3
2046    Reference t = new Reference();
2047    if (this.supportingInformation == null)
2048      this.supportingInformation = new ArrayList<Reference>();
2049    this.supportingInformation.add(t);
2050    return t;
2051  }
2052
2053  public Appointment addSupportingInformation(Reference t) { // 3
2054    if (t == null)
2055      return this;
2056    if (this.supportingInformation == null)
2057      this.supportingInformation = new ArrayList<Reference>();
2058    this.supportingInformation.add(t);
2059    return this;
2060  }
2061
2062  /**
2063   * @return The first repetition of repeating field
2064   *         {@link #supportingInformation}, creating it if it does not already
2065   *         exist
2066   */
2067  public Reference getSupportingInformationFirstRep() {
2068    if (getSupportingInformation().isEmpty()) {
2069      addSupportingInformation();
2070    }
2071    return getSupportingInformation().get(0);
2072  }
2073
2074  /**
2075   * @deprecated Use Reference#setResource(IBaseResource) instead
2076   */
2077  @Deprecated
2078  public List<Resource> getSupportingInformationTarget() {
2079    if (this.supportingInformationTarget == null)
2080      this.supportingInformationTarget = new ArrayList<Resource>();
2081    return this.supportingInformationTarget;
2082  }
2083
2084  /**
2085   * @return {@link #start} (Date/Time that the appointment is to take place.).
2086   *         This is the underlying object with id, value and extensions. The
2087   *         accessor "getStart" gives direct access to the value
2088   */
2089  public InstantType getStartElement() {
2090    if (this.start == null)
2091      if (Configuration.errorOnAutoCreate())
2092        throw new Error("Attempt to auto-create Appointment.start");
2093      else if (Configuration.doAutoCreate())
2094        this.start = new InstantType(); // bb
2095    return this.start;
2096  }
2097
2098  public boolean hasStartElement() {
2099    return this.start != null && !this.start.isEmpty();
2100  }
2101
2102  public boolean hasStart() {
2103    return this.start != null && !this.start.isEmpty();
2104  }
2105
2106  /**
2107   * @param value {@link #start} (Date/Time that the appointment is to take
2108   *              place.). This is the underlying object with id, value and
2109   *              extensions. The accessor "getStart" gives direct access to the
2110   *              value
2111   */
2112  public Appointment setStartElement(InstantType value) {
2113    this.start = value;
2114    return this;
2115  }
2116
2117  /**
2118   * @return Date/Time that the appointment is to take place.
2119   */
2120  public Date getStart() {
2121    return this.start == null ? null : this.start.getValue();
2122  }
2123
2124  /**
2125   * @param value Date/Time that the appointment is to take place.
2126   */
2127  public Appointment setStart(Date value) {
2128    if (value == null)
2129      this.start = null;
2130    else {
2131      if (this.start == null)
2132        this.start = new InstantType();
2133      this.start.setValue(value);
2134    }
2135    return this;
2136  }
2137
2138  /**
2139   * @return {@link #end} (Date/Time that the appointment is to conclude.). This
2140   *         is the underlying object with id, value and extensions. The accessor
2141   *         "getEnd" gives direct access to the value
2142   */
2143  public InstantType getEndElement() {
2144    if (this.end == null)
2145      if (Configuration.errorOnAutoCreate())
2146        throw new Error("Attempt to auto-create Appointment.end");
2147      else if (Configuration.doAutoCreate())
2148        this.end = new InstantType(); // bb
2149    return this.end;
2150  }
2151
2152  public boolean hasEndElement() {
2153    return this.end != null && !this.end.isEmpty();
2154  }
2155
2156  public boolean hasEnd() {
2157    return this.end != null && !this.end.isEmpty();
2158  }
2159
2160  /**
2161   * @param value {@link #end} (Date/Time that the appointment is to conclude.).
2162   *              This is the underlying object with id, value and extensions. The
2163   *              accessor "getEnd" gives direct access to the value
2164   */
2165  public Appointment setEndElement(InstantType value) {
2166    this.end = value;
2167    return this;
2168  }
2169
2170  /**
2171   * @return Date/Time that the appointment is to conclude.
2172   */
2173  public Date getEnd() {
2174    return this.end == null ? null : this.end.getValue();
2175  }
2176
2177  /**
2178   * @param value Date/Time that the appointment is to conclude.
2179   */
2180  public Appointment setEnd(Date value) {
2181    if (value == null)
2182      this.end = null;
2183    else {
2184      if (this.end == null)
2185        this.end = new InstantType();
2186      this.end.setValue(value);
2187    }
2188    return this;
2189  }
2190
2191  /**
2192   * @return {@link #minutesDuration} (Number of minutes that the appointment is
2193   *         to take. This can be less than the duration between the start and end
2194   *         times. For example, where the actual time of appointment is only an
2195   *         estimate or if a 30 minute appointment is being requested, but any
2196   *         time would work. Also, if there is, for example, a planned 15 minute
2197   *         break in the middle of a long appointment, the duration may be 15
2198   *         minutes less than the difference between the start and end.). This is
2199   *         the underlying object with id, value and extensions. The accessor
2200   *         "getMinutesDuration" gives direct access to the value
2201   */
2202  public PositiveIntType getMinutesDurationElement() {
2203    if (this.minutesDuration == null)
2204      if (Configuration.errorOnAutoCreate())
2205        throw new Error("Attempt to auto-create Appointment.minutesDuration");
2206      else if (Configuration.doAutoCreate())
2207        this.minutesDuration = new PositiveIntType(); // bb
2208    return this.minutesDuration;
2209  }
2210
2211  public boolean hasMinutesDurationElement() {
2212    return this.minutesDuration != null && !this.minutesDuration.isEmpty();
2213  }
2214
2215  public boolean hasMinutesDuration() {
2216    return this.minutesDuration != null && !this.minutesDuration.isEmpty();
2217  }
2218
2219  /**
2220   * @param value {@link #minutesDuration} (Number of minutes that the appointment
2221   *              is to take. This can be less than the duration between the start
2222   *              and end times. For example, where the actual time of appointment
2223   *              is only an estimate or if a 30 minute appointment is being
2224   *              requested, but any time would work. Also, if there is, for
2225   *              example, a planned 15 minute break in the middle of a long
2226   *              appointment, the duration may be 15 minutes less than the
2227   *              difference between the start and end.). This is the underlying
2228   *              object with id, value and extensions. The accessor
2229   *              "getMinutesDuration" gives direct access to the value
2230   */
2231  public Appointment setMinutesDurationElement(PositiveIntType value) {
2232    this.minutesDuration = value;
2233    return this;
2234  }
2235
2236  /**
2237   * @return Number of minutes that the appointment is to take. This can be less
2238   *         than the duration between the start and end times. For example, where
2239   *         the actual time of appointment is only an estimate or if a 30 minute
2240   *         appointment is being requested, but any time would work. Also, if
2241   *         there is, for example, a planned 15 minute break in the middle of a
2242   *         long appointment, the duration may be 15 minutes less than the
2243   *         difference between the start and end.
2244   */
2245  public int getMinutesDuration() {
2246    return this.minutesDuration == null || this.minutesDuration.isEmpty() ? 0 : this.minutesDuration.getValue();
2247  }
2248
2249  /**
2250   * @param value Number of minutes that the appointment is to take. This can be
2251   *              less than the duration between the start and end times. For
2252   *              example, where the actual time of appointment is only an
2253   *              estimate or if a 30 minute appointment is being requested, but
2254   *              any time would work. Also, if there is, for example, a planned
2255   *              15 minute break in the middle of a long appointment, the
2256   *              duration may be 15 minutes less than the difference between the
2257   *              start and end.
2258   */
2259  public Appointment setMinutesDuration(int value) {
2260    if (this.minutesDuration == null)
2261      this.minutesDuration = new PositiveIntType();
2262    this.minutesDuration.setValue(value);
2263    return this;
2264  }
2265
2266  /**
2267   * @return {@link #slot} (The slots from the participants' schedules that will
2268   *         be filled by the appointment.)
2269   */
2270  public List<Reference> getSlot() {
2271    if (this.slot == null)
2272      this.slot = new ArrayList<Reference>();
2273    return this.slot;
2274  }
2275
2276  /**
2277   * @return Returns a reference to <code>this</code> for easy method chaining
2278   */
2279  public Appointment setSlot(List<Reference> theSlot) {
2280    this.slot = theSlot;
2281    return this;
2282  }
2283
2284  public boolean hasSlot() {
2285    if (this.slot == null)
2286      return false;
2287    for (Reference item : this.slot)
2288      if (!item.isEmpty())
2289        return true;
2290    return false;
2291  }
2292
2293  public Reference addSlot() { // 3
2294    Reference t = new Reference();
2295    if (this.slot == null)
2296      this.slot = new ArrayList<Reference>();
2297    this.slot.add(t);
2298    return t;
2299  }
2300
2301  public Appointment addSlot(Reference t) { // 3
2302    if (t == null)
2303      return this;
2304    if (this.slot == null)
2305      this.slot = new ArrayList<Reference>();
2306    this.slot.add(t);
2307    return this;
2308  }
2309
2310  /**
2311   * @return The first repetition of repeating field {@link #slot}, creating it if
2312   *         it does not already exist
2313   */
2314  public Reference getSlotFirstRep() {
2315    if (getSlot().isEmpty()) {
2316      addSlot();
2317    }
2318    return getSlot().get(0);
2319  }
2320
2321  /**
2322   * @deprecated Use Reference#setResource(IBaseResource) instead
2323   */
2324  @Deprecated
2325  public List<Slot> getSlotTarget() {
2326    if (this.slotTarget == null)
2327      this.slotTarget = new ArrayList<Slot>();
2328    return this.slotTarget;
2329  }
2330
2331  /**
2332   * @deprecated Use Reference#setResource(IBaseResource) instead
2333   */
2334  @Deprecated
2335  public Slot addSlotTarget() {
2336    Slot r = new Slot();
2337    if (this.slotTarget == null)
2338      this.slotTarget = new ArrayList<Slot>();
2339    this.slotTarget.add(r);
2340    return r;
2341  }
2342
2343  /**
2344   * @return {@link #created} (The date that this appointment was initially
2345   *         created. This could be different to the meta.lastModified value on
2346   *         the initial entry, as this could have been before the resource was
2347   *         created on the FHIR server, and should remain unchanged over the
2348   *         lifespan of the appointment.). This is the underlying object with id,
2349   *         value and extensions. The accessor "getCreated" gives direct access
2350   *         to the value
2351   */
2352  public DateTimeType getCreatedElement() {
2353    if (this.created == null)
2354      if (Configuration.errorOnAutoCreate())
2355        throw new Error("Attempt to auto-create Appointment.created");
2356      else if (Configuration.doAutoCreate())
2357        this.created = new DateTimeType(); // bb
2358    return this.created;
2359  }
2360
2361  public boolean hasCreatedElement() {
2362    return this.created != null && !this.created.isEmpty();
2363  }
2364
2365  public boolean hasCreated() {
2366    return this.created != null && !this.created.isEmpty();
2367  }
2368
2369  /**
2370   * @param value {@link #created} (The date that this appointment was initially
2371   *              created. This could be different to the meta.lastModified value
2372   *              on the initial entry, as this could have been before the
2373   *              resource was created on the FHIR server, and should remain
2374   *              unchanged over the lifespan of the appointment.). This is the
2375   *              underlying object with id, value and extensions. The accessor
2376   *              "getCreated" gives direct access to the value
2377   */
2378  public Appointment setCreatedElement(DateTimeType value) {
2379    this.created = value;
2380    return this;
2381  }
2382
2383  /**
2384   * @return The date that this appointment was initially created. This could be
2385   *         different to the meta.lastModified value on the initial entry, as
2386   *         this could have been before the resource was created on the FHIR
2387   *         server, and should remain unchanged over the lifespan of the
2388   *         appointment.
2389   */
2390  public Date getCreated() {
2391    return this.created == null ? null : this.created.getValue();
2392  }
2393
2394  /**
2395   * @param value The date that this appointment was initially created. This could
2396   *              be different to the meta.lastModified value on the initial
2397   *              entry, as this could have been before the resource was created
2398   *              on the FHIR server, and should remain unchanged over the
2399   *              lifespan of the appointment.
2400   */
2401  public Appointment setCreated(Date value) {
2402    if (value == null)
2403      this.created = null;
2404    else {
2405      if (this.created == null)
2406        this.created = new DateTimeType();
2407      this.created.setValue(value);
2408    }
2409    return this;
2410  }
2411
2412  /**
2413   * @return {@link #comment} (Additional comments about the appointment.). This
2414   *         is the underlying object with id, value and extensions. The accessor
2415   *         "getComment" gives direct access to the value
2416   */
2417  public StringType getCommentElement() {
2418    if (this.comment == null)
2419      if (Configuration.errorOnAutoCreate())
2420        throw new Error("Attempt to auto-create Appointment.comment");
2421      else if (Configuration.doAutoCreate())
2422        this.comment = new StringType(); // bb
2423    return this.comment;
2424  }
2425
2426  public boolean hasCommentElement() {
2427    return this.comment != null && !this.comment.isEmpty();
2428  }
2429
2430  public boolean hasComment() {
2431    return this.comment != null && !this.comment.isEmpty();
2432  }
2433
2434  /**
2435   * @param value {@link #comment} (Additional comments about the appointment.).
2436   *              This is the underlying object with id, value and extensions. The
2437   *              accessor "getComment" gives direct access to the value
2438   */
2439  public Appointment setCommentElement(StringType value) {
2440    this.comment = value;
2441    return this;
2442  }
2443
2444  /**
2445   * @return Additional comments about the appointment.
2446   */
2447  public String getComment() {
2448    return this.comment == null ? null : this.comment.getValue();
2449  }
2450
2451  /**
2452   * @param value Additional comments about the appointment.
2453   */
2454  public Appointment setComment(String value) {
2455    if (Utilities.noString(value))
2456      this.comment = null;
2457    else {
2458      if (this.comment == null)
2459        this.comment = new StringType();
2460      this.comment.setValue(value);
2461    }
2462    return this;
2463  }
2464
2465  /**
2466   * @return {@link #patientInstruction} (While Appointment.comment contains
2467   *         information for internal use, Appointment.patientInstructions is used
2468   *         to capture patient facing information about the Appointment (e.g.
2469   *         please bring your referral or fast from 8pm night before).). This is
2470   *         the underlying object with id, value and extensions. The accessor
2471   *         "getPatientInstruction" gives direct access to the value
2472   */
2473  public StringType getPatientInstructionElement() {
2474    if (this.patientInstruction == null)
2475      if (Configuration.errorOnAutoCreate())
2476        throw new Error("Attempt to auto-create Appointment.patientInstruction");
2477      else if (Configuration.doAutoCreate())
2478        this.patientInstruction = new StringType(); // bb
2479    return this.patientInstruction;
2480  }
2481
2482  public boolean hasPatientInstructionElement() {
2483    return this.patientInstruction != null && !this.patientInstruction.isEmpty();
2484  }
2485
2486  public boolean hasPatientInstruction() {
2487    return this.patientInstruction != null && !this.patientInstruction.isEmpty();
2488  }
2489
2490  /**
2491   * @param value {@link #patientInstruction} (While Appointment.comment contains
2492   *              information for internal use, Appointment.patientInstructions is
2493   *              used to capture patient facing information about the Appointment
2494   *              (e.g. please bring your referral or fast from 8pm night
2495   *              before).). This is the underlying object with id, value and
2496   *              extensions. The accessor "getPatientInstruction" gives direct
2497   *              access to the value
2498   */
2499  public Appointment setPatientInstructionElement(StringType value) {
2500    this.patientInstruction = value;
2501    return this;
2502  }
2503
2504  /**
2505   * @return While Appointment.comment contains information for internal use,
2506   *         Appointment.patientInstructions is used to capture patient facing
2507   *         information about the Appointment (e.g. please bring your referral or
2508   *         fast from 8pm night before).
2509   */
2510  public String getPatientInstruction() {
2511    return this.patientInstruction == null ? null : this.patientInstruction.getValue();
2512  }
2513
2514  /**
2515   * @param value While Appointment.comment contains information for internal use,
2516   *              Appointment.patientInstructions is used to capture patient
2517   *              facing information about the Appointment (e.g. please bring your
2518   *              referral or fast from 8pm night before).
2519   */
2520  public Appointment setPatientInstruction(String value) {
2521    if (Utilities.noString(value))
2522      this.patientInstruction = null;
2523    else {
2524      if (this.patientInstruction == null)
2525        this.patientInstruction = new StringType();
2526      this.patientInstruction.setValue(value);
2527    }
2528    return this;
2529  }
2530
2531  /**
2532   * @return {@link #basedOn} (The service request this appointment is allocated
2533   *         to assess (e.g. incoming referral or procedure request).)
2534   */
2535  public List<Reference> getBasedOn() {
2536    if (this.basedOn == null)
2537      this.basedOn = new ArrayList<Reference>();
2538    return this.basedOn;
2539  }
2540
2541  /**
2542   * @return Returns a reference to <code>this</code> for easy method chaining
2543   */
2544  public Appointment setBasedOn(List<Reference> theBasedOn) {
2545    this.basedOn = theBasedOn;
2546    return this;
2547  }
2548
2549  public boolean hasBasedOn() {
2550    if (this.basedOn == null)
2551      return false;
2552    for (Reference item : this.basedOn)
2553      if (!item.isEmpty())
2554        return true;
2555    return false;
2556  }
2557
2558  public Reference addBasedOn() { // 3
2559    Reference t = new Reference();
2560    if (this.basedOn == null)
2561      this.basedOn = new ArrayList<Reference>();
2562    this.basedOn.add(t);
2563    return t;
2564  }
2565
2566  public Appointment addBasedOn(Reference t) { // 3
2567    if (t == null)
2568      return this;
2569    if (this.basedOn == null)
2570      this.basedOn = new ArrayList<Reference>();
2571    this.basedOn.add(t);
2572    return this;
2573  }
2574
2575  /**
2576   * @return The first repetition of repeating field {@link #basedOn}, creating it
2577   *         if it does not already exist
2578   */
2579  public Reference getBasedOnFirstRep() {
2580    if (getBasedOn().isEmpty()) {
2581      addBasedOn();
2582    }
2583    return getBasedOn().get(0);
2584  }
2585
2586  /**
2587   * @deprecated Use Reference#setResource(IBaseResource) instead
2588   */
2589  @Deprecated
2590  public List<ServiceRequest> getBasedOnTarget() {
2591    if (this.basedOnTarget == null)
2592      this.basedOnTarget = new ArrayList<ServiceRequest>();
2593    return this.basedOnTarget;
2594  }
2595
2596  /**
2597   * @deprecated Use Reference#setResource(IBaseResource) instead
2598   */
2599  @Deprecated
2600  public ServiceRequest addBasedOnTarget() {
2601    ServiceRequest r = new ServiceRequest();
2602    if (this.basedOnTarget == null)
2603      this.basedOnTarget = new ArrayList<ServiceRequest>();
2604    this.basedOnTarget.add(r);
2605    return r;
2606  }
2607
2608  /**
2609   * @return {@link #participant} (List of participants involved in the
2610   *         appointment.)
2611   */
2612  public List<AppointmentParticipantComponent> getParticipant() {
2613    if (this.participant == null)
2614      this.participant = new ArrayList<AppointmentParticipantComponent>();
2615    return this.participant;
2616  }
2617
2618  /**
2619   * @return Returns a reference to <code>this</code> for easy method chaining
2620   */
2621  public Appointment setParticipant(List<AppointmentParticipantComponent> theParticipant) {
2622    this.participant = theParticipant;
2623    return this;
2624  }
2625
2626  public boolean hasParticipant() {
2627    if (this.participant == null)
2628      return false;
2629    for (AppointmentParticipantComponent item : this.participant)
2630      if (!item.isEmpty())
2631        return true;
2632    return false;
2633  }
2634
2635  public AppointmentParticipantComponent addParticipant() { // 3
2636    AppointmentParticipantComponent t = new AppointmentParticipantComponent();
2637    if (this.participant == null)
2638      this.participant = new ArrayList<AppointmentParticipantComponent>();
2639    this.participant.add(t);
2640    return t;
2641  }
2642
2643  public Appointment addParticipant(AppointmentParticipantComponent t) { // 3
2644    if (t == null)
2645      return this;
2646    if (this.participant == null)
2647      this.participant = new ArrayList<AppointmentParticipantComponent>();
2648    this.participant.add(t);
2649    return this;
2650  }
2651
2652  /**
2653   * @return The first repetition of repeating field {@link #participant},
2654   *         creating it if it does not already exist
2655   */
2656  public AppointmentParticipantComponent getParticipantFirstRep() {
2657    if (getParticipant().isEmpty()) {
2658      addParticipant();
2659    }
2660    return getParticipant().get(0);
2661  }
2662
2663  /**
2664   * @return {@link #requestedPeriod} (A set of date ranges (potentially including
2665   *         times) that the appointment is preferred to be scheduled within.
2666   * 
2667   *         The duration (usually in minutes) could also be provided to indicate
2668   *         the length of the appointment to fill and populate the start/end
2669   *         times for the actual allocated time. However, in other situations the
2670   *         duration may be calculated by the scheduling system.)
2671   */
2672  public List<Period> getRequestedPeriod() {
2673    if (this.requestedPeriod == null)
2674      this.requestedPeriod = new ArrayList<Period>();
2675    return this.requestedPeriod;
2676  }
2677
2678  /**
2679   * @return Returns a reference to <code>this</code> for easy method chaining
2680   */
2681  public Appointment setRequestedPeriod(List<Period> theRequestedPeriod) {
2682    this.requestedPeriod = theRequestedPeriod;
2683    return this;
2684  }
2685
2686  public boolean hasRequestedPeriod() {
2687    if (this.requestedPeriod == null)
2688      return false;
2689    for (Period item : this.requestedPeriod)
2690      if (!item.isEmpty())
2691        return true;
2692    return false;
2693  }
2694
2695  public Period addRequestedPeriod() { // 3
2696    Period t = new Period();
2697    if (this.requestedPeriod == null)
2698      this.requestedPeriod = new ArrayList<Period>();
2699    this.requestedPeriod.add(t);
2700    return t;
2701  }
2702
2703  public Appointment addRequestedPeriod(Period t) { // 3
2704    if (t == null)
2705      return this;
2706    if (this.requestedPeriod == null)
2707      this.requestedPeriod = new ArrayList<Period>();
2708    this.requestedPeriod.add(t);
2709    return this;
2710  }
2711
2712  /**
2713   * @return The first repetition of repeating field {@link #requestedPeriod},
2714   *         creating it if it does not already exist
2715   */
2716  public Period getRequestedPeriodFirstRep() {
2717    if (getRequestedPeriod().isEmpty()) {
2718      addRequestedPeriod();
2719    }
2720    return getRequestedPeriod().get(0);
2721  }
2722
2723  protected void listChildren(List<Property> children) {
2724    super.listChildren(children);
2725    children.add(new Property("identifier", "Identifier",
2726        "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).",
2727        0, java.lang.Integer.MAX_VALUE, identifier));
2728    children.add(new Property("status", "code",
2729        "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.",
2730        0, 1, status));
2731    children.add(new Property("cancelationReason", "CodeableConcept",
2732        "The coded reason for the appointment being cancelled. This is often used in reporting/billing/futher processing to determine if further actions are required, or specific fees apply.",
2733        0, 1, cancelationReason));
2734    children.add(new Property("serviceCategory", "CodeableConcept",
2735        "A broad categorization of the service that is to be performed during this appointment.", 0,
2736        java.lang.Integer.MAX_VALUE, serviceCategory));
2737    children.add(new Property("serviceType", "CodeableConcept",
2738        "The specific service that is to be performed during this appointment.", 0, java.lang.Integer.MAX_VALUE,
2739        serviceType));
2740    children.add(new Property("specialty", "CodeableConcept",
2741        "The specialty of a practitioner that would be required to perform the service requested in this appointment.",
2742        0, java.lang.Integer.MAX_VALUE, specialty));
2743    children.add(new Property("appointmentType", "CodeableConcept",
2744        "The style of appointment or patient that has been booked in the slot (not service type).", 0, 1,
2745        appointmentType));
2746    children.add(new Property("reasonCode", "CodeableConcept",
2747        "The coded reason that this appointment is being scheduled. This is more clinical than administrative.", 0,
2748        java.lang.Integer.MAX_VALUE, reasonCode));
2749    children.add(new Property("reasonReference",
2750        "Reference(Condition|Procedure|Observation|ImmunizationRecommendation)",
2751        "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.",
2752        0, java.lang.Integer.MAX_VALUE, reasonReference));
2753    children.add(new Property("priority", "unsignedInt",
2754        "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).",
2755        0, 1, priority));
2756    children.add(new Property("description", "string",
2757        "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.",
2758        0, 1, description));
2759    children.add(new Property("supportingInformation", "Reference(Any)",
2760        "Additional information to support the appointment provided when making the appointment.", 0,
2761        java.lang.Integer.MAX_VALUE, supportingInformation));
2762    children.add(new Property("start", "instant", "Date/Time that the appointment is to take place.", 0, 1, start));
2763    children.add(new Property("end", "instant", "Date/Time that the appointment is to conclude.", 0, 1, end));
2764    children.add(new Property("minutesDuration", "positiveInt",
2765        "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.",
2766        0, 1, minutesDuration));
2767    children.add(new Property("slot", "Reference(Slot)",
2768        "The slots from the participants' schedules that will be filled by the appointment.", 0,
2769        java.lang.Integer.MAX_VALUE, slot));
2770    children.add(new Property("created", "dateTime",
2771        "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.",
2772        0, 1, created));
2773    children.add(new Property("comment", "string", "Additional comments about the appointment.", 0, 1, comment));
2774    children.add(new Property("patientInstruction", "string",
2775        "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).",
2776        0, 1, patientInstruction));
2777    children.add(new Property("basedOn", "Reference(ServiceRequest)",
2778        "The service request this appointment is allocated to assess (e.g. incoming referral or procedure request).", 0,
2779        java.lang.Integer.MAX_VALUE, basedOn));
2780    children.add(new Property("participant", "", "List of participants involved in the appointment.", 0,
2781        java.lang.Integer.MAX_VALUE, participant));
2782    children.add(new Property("requestedPeriod", "Period",
2783        "A set of date ranges (potentially including times) that the appointment is preferred to be scheduled within.\n\nThe duration (usually in minutes) could also be provided to indicate the length of the appointment to fill and populate the start/end times for the actual allocated time. However, in other situations the duration may be calculated by the scheduling system.",
2784        0, java.lang.Integer.MAX_VALUE, requestedPeriod));
2785  }
2786
2787  @Override
2788  public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2789    switch (_hash) {
2790    case -1618432855:
2791      /* identifier */ return new Property("identifier", "Identifier",
2792          "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).",
2793          0, java.lang.Integer.MAX_VALUE, identifier);
2794    case -892481550:
2795      /* status */ return new Property("status", "code",
2796          "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.",
2797          0, 1, status);
2798    case 987811551:
2799      /* cancelationReason */ return new Property("cancelationReason", "CodeableConcept",
2800          "The coded reason for the appointment being cancelled. This is often used in reporting/billing/futher processing to determine if further actions are required, or specific fees apply.",
2801          0, 1, cancelationReason);
2802    case 1281188563:
2803      /* serviceCategory */ return new Property("serviceCategory", "CodeableConcept",
2804          "A broad categorization of the service that is to be performed during this appointment.", 0,
2805          java.lang.Integer.MAX_VALUE, serviceCategory);
2806    case -1928370289:
2807      /* serviceType */ return new Property("serviceType", "CodeableConcept",
2808          "The specific service that is to be performed during this appointment.", 0, java.lang.Integer.MAX_VALUE,
2809          serviceType);
2810    case -1694759682:
2811      /* specialty */ return new Property("specialty", "CodeableConcept",
2812          "The specialty of a practitioner that would be required to perform the service requested in this appointment.",
2813          0, java.lang.Integer.MAX_VALUE, specialty);
2814    case -1596426375:
2815      /* appointmentType */ return new Property("appointmentType", "CodeableConcept",
2816          "The style of appointment or patient that has been booked in the slot (not service type).", 0, 1,
2817          appointmentType);
2818    case 722137681:
2819      /* reasonCode */ return new Property("reasonCode", "CodeableConcept",
2820          "The coded reason that this appointment is being scheduled. This is more clinical than administrative.", 0,
2821          java.lang.Integer.MAX_VALUE, reasonCode);
2822    case -1146218137:
2823      /* reasonReference */ return new Property("reasonReference",
2824          "Reference(Condition|Procedure|Observation|ImmunizationRecommendation)",
2825          "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.",
2826          0, java.lang.Integer.MAX_VALUE, reasonReference);
2827    case -1165461084:
2828      /* priority */ return new Property("priority", "unsignedInt",
2829          "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).",
2830          0, 1, priority);
2831    case -1724546052:
2832      /* description */ return new Property("description", "string",
2833          "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.",
2834          0, 1, description);
2835    case -1248768647:
2836      /* supportingInformation */ return new Property("supportingInformation", "Reference(Any)",
2837          "Additional information to support the appointment provided when making the appointment.", 0,
2838          java.lang.Integer.MAX_VALUE, supportingInformation);
2839    case 109757538:
2840      /* start */ return new Property("start", "instant", "Date/Time that the appointment is to take place.", 0, 1,
2841          start);
2842    case 100571:
2843      /* end */ return new Property("end", "instant", "Date/Time that the appointment is to conclude.", 0, 1, end);
2844    case -413630573:
2845      /* minutesDuration */ return new Property("minutesDuration", "positiveInt",
2846          "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.",
2847          0, 1, minutesDuration);
2848    case 3533310:
2849      /* slot */ return new Property("slot", "Reference(Slot)",
2850          "The slots from the participants' schedules that will be filled by the appointment.", 0,
2851          java.lang.Integer.MAX_VALUE, slot);
2852    case 1028554472:
2853      /* created */ return new Property("created", "dateTime",
2854          "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.",
2855          0, 1, created);
2856    case 950398559:
2857      /* comment */ return new Property("comment", "string", "Additional comments about the appointment.", 0, 1,
2858          comment);
2859    case 737543241:
2860      /* patientInstruction */ return new Property("patientInstruction", "string",
2861          "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).",
2862          0, 1, patientInstruction);
2863    case -332612366:
2864      /* basedOn */ return new Property("basedOn", "Reference(ServiceRequest)",
2865          "The service request this appointment is allocated to assess (e.g. incoming referral or procedure request).",
2866          0, java.lang.Integer.MAX_VALUE, basedOn);
2867    case 767422259:
2868      /* participant */ return new Property("participant", "", "List of participants involved in the appointment.", 0,
2869          java.lang.Integer.MAX_VALUE, participant);
2870    case -897241393:
2871      /* requestedPeriod */ return new Property("requestedPeriod", "Period",
2872          "A set of date ranges (potentially including times) that the appointment is preferred to be scheduled within.\n\nThe duration (usually in minutes) could also be provided to indicate the length of the appointment to fill and populate the start/end times for the actual allocated time. However, in other situations the duration may be calculated by the scheduling system.",
2873          0, java.lang.Integer.MAX_VALUE, requestedPeriod);
2874    default:
2875      return super.getNamedProperty(_hash, _name, _checkValid);
2876    }
2877
2878  }
2879
2880  @Override
2881  public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2882    switch (hash) {
2883    case -1618432855:
2884      /* identifier */ return this.identifier == null ? new Base[0]
2885          : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2886    case -892481550:
2887      /* status */ return this.status == null ? new Base[0] : new Base[] { this.status }; // Enumeration<AppointmentStatus>
2888    case 987811551:
2889      /* cancelationReason */ return this.cancelationReason == null ? new Base[0]
2890          : new Base[] { this.cancelationReason }; // CodeableConcept
2891    case 1281188563:
2892      /* serviceCategory */ return this.serviceCategory == null ? new Base[0]
2893          : this.serviceCategory.toArray(new Base[this.serviceCategory.size()]); // CodeableConcept
2894    case -1928370289:
2895      /* serviceType */ return this.serviceType == null ? new Base[0]
2896          : this.serviceType.toArray(new Base[this.serviceType.size()]); // CodeableConcept
2897    case -1694759682:
2898      /* specialty */ return this.specialty == null ? new Base[0]
2899          : this.specialty.toArray(new Base[this.specialty.size()]); // CodeableConcept
2900    case -1596426375:
2901      /* appointmentType */ return this.appointmentType == null ? new Base[0] : new Base[] { this.appointmentType }; // CodeableConcept
2902    case 722137681:
2903      /* reasonCode */ return this.reasonCode == null ? new Base[0]
2904          : this.reasonCode.toArray(new Base[this.reasonCode.size()]); // CodeableConcept
2905    case -1146218137:
2906      /* reasonReference */ return this.reasonReference == null ? new Base[0]
2907          : this.reasonReference.toArray(new Base[this.reasonReference.size()]); // Reference
2908    case -1165461084:
2909      /* priority */ return this.priority == null ? new Base[0] : new Base[] { this.priority }; // UnsignedIntType
2910    case -1724546052:
2911      /* description */ return this.description == null ? new Base[0] : new Base[] { this.description }; // StringType
2912    case -1248768647:
2913      /* supportingInformation */ return this.supportingInformation == null ? new Base[0]
2914          : this.supportingInformation.toArray(new Base[this.supportingInformation.size()]); // Reference
2915    case 109757538:
2916      /* start */ return this.start == null ? new Base[0] : new Base[] { this.start }; // InstantType
2917    case 100571:
2918      /* end */ return this.end == null ? new Base[0] : new Base[] { this.end }; // InstantType
2919    case -413630573:
2920      /* minutesDuration */ return this.minutesDuration == null ? new Base[0] : new Base[] { this.minutesDuration }; // PositiveIntType
2921    case 3533310:
2922      /* slot */ return this.slot == null ? new Base[0] : this.slot.toArray(new Base[this.slot.size()]); // Reference
2923    case 1028554472:
2924      /* created */ return this.created == null ? new Base[0] : new Base[] { this.created }; // DateTimeType
2925    case 950398559:
2926      /* comment */ return this.comment == null ? new Base[0] : new Base[] { this.comment }; // StringType
2927    case 737543241:
2928      /* patientInstruction */ return this.patientInstruction == null ? new Base[0]
2929          : new Base[] { this.patientInstruction }; // StringType
2930    case -332612366:
2931      /* basedOn */ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
2932    case 767422259:
2933      /* participant */ return this.participant == null ? new Base[0]
2934          : this.participant.toArray(new Base[this.participant.size()]); // AppointmentParticipantComponent
2935    case -897241393:
2936      /* requestedPeriod */ return this.requestedPeriod == null ? new Base[0]
2937          : this.requestedPeriod.toArray(new Base[this.requestedPeriod.size()]); // Period
2938    default:
2939      return super.getProperty(hash, name, checkValid);
2940    }
2941
2942  }
2943
2944  @Override
2945  public Base setProperty(int hash, String name, Base value) throws FHIRException {
2946    switch (hash) {
2947    case -1618432855: // identifier
2948      this.getIdentifier().add(castToIdentifier(value)); // Identifier
2949      return value;
2950    case -892481550: // status
2951      value = new AppointmentStatusEnumFactory().fromType(castToCode(value));
2952      this.status = (Enumeration) value; // Enumeration<AppointmentStatus>
2953      return value;
2954    case 987811551: // cancelationReason
2955      this.cancelationReason = castToCodeableConcept(value); // CodeableConcept
2956      return value;
2957    case 1281188563: // serviceCategory
2958      this.getServiceCategory().add(castToCodeableConcept(value)); // CodeableConcept
2959      return value;
2960    case -1928370289: // serviceType
2961      this.getServiceType().add(castToCodeableConcept(value)); // CodeableConcept
2962      return value;
2963    case -1694759682: // specialty
2964      this.getSpecialty().add(castToCodeableConcept(value)); // CodeableConcept
2965      return value;
2966    case -1596426375: // appointmentType
2967      this.appointmentType = castToCodeableConcept(value); // CodeableConcept
2968      return value;
2969    case 722137681: // reasonCode
2970      this.getReasonCode().add(castToCodeableConcept(value)); // CodeableConcept
2971      return value;
2972    case -1146218137: // reasonReference
2973      this.getReasonReference().add(castToReference(value)); // Reference
2974      return value;
2975    case -1165461084: // priority
2976      this.priority = castToUnsignedInt(value); // UnsignedIntType
2977      return value;
2978    case -1724546052: // description
2979      this.description = castToString(value); // StringType
2980      return value;
2981    case -1248768647: // supportingInformation
2982      this.getSupportingInformation().add(castToReference(value)); // Reference
2983      return value;
2984    case 109757538: // start
2985      this.start = castToInstant(value); // InstantType
2986      return value;
2987    case 100571: // end
2988      this.end = castToInstant(value); // InstantType
2989      return value;
2990    case -413630573: // minutesDuration
2991      this.minutesDuration = castToPositiveInt(value); // PositiveIntType
2992      return value;
2993    case 3533310: // slot
2994      this.getSlot().add(castToReference(value)); // Reference
2995      return value;
2996    case 1028554472: // created
2997      this.created = castToDateTime(value); // DateTimeType
2998      return value;
2999    case 950398559: // comment
3000      this.comment = castToString(value); // StringType
3001      return value;
3002    case 737543241: // patientInstruction
3003      this.patientInstruction = castToString(value); // StringType
3004      return value;
3005    case -332612366: // basedOn
3006      this.getBasedOn().add(castToReference(value)); // Reference
3007      return value;
3008    case 767422259: // participant
3009      this.getParticipant().add((AppointmentParticipantComponent) value); // AppointmentParticipantComponent
3010      return value;
3011    case -897241393: // requestedPeriod
3012      this.getRequestedPeriod().add(castToPeriod(value)); // Period
3013      return value;
3014    default:
3015      return super.setProperty(hash, name, value);
3016    }
3017
3018  }
3019
3020  @Override
3021  public Base setProperty(String name, Base value) throws FHIRException {
3022    if (name.equals("identifier")) {
3023      this.getIdentifier().add(castToIdentifier(value));
3024    } else if (name.equals("status")) {
3025      value = new AppointmentStatusEnumFactory().fromType(castToCode(value));
3026      this.status = (Enumeration) value; // Enumeration<AppointmentStatus>
3027    } else if (name.equals("cancelationReason")) {
3028      this.cancelationReason = castToCodeableConcept(value); // CodeableConcept
3029    } else if (name.equals("serviceCategory")) {
3030      this.getServiceCategory().add(castToCodeableConcept(value));
3031    } else if (name.equals("serviceType")) {
3032      this.getServiceType().add(castToCodeableConcept(value));
3033    } else if (name.equals("specialty")) {
3034      this.getSpecialty().add(castToCodeableConcept(value));
3035    } else if (name.equals("appointmentType")) {
3036      this.appointmentType = castToCodeableConcept(value); // CodeableConcept
3037    } else if (name.equals("reasonCode")) {
3038      this.getReasonCode().add(castToCodeableConcept(value));
3039    } else if (name.equals("reasonReference")) {
3040      this.getReasonReference().add(castToReference(value));
3041    } else if (name.equals("priority")) {
3042      this.priority = castToUnsignedInt(value); // UnsignedIntType
3043    } else if (name.equals("description")) {
3044      this.description = castToString(value); // StringType
3045    } else if (name.equals("supportingInformation")) {
3046      this.getSupportingInformation().add(castToReference(value));
3047    } else if (name.equals("start")) {
3048      this.start = castToInstant(value); // InstantType
3049    } else if (name.equals("end")) {
3050      this.end = castToInstant(value); // InstantType
3051    } else if (name.equals("minutesDuration")) {
3052      this.minutesDuration = castToPositiveInt(value); // PositiveIntType
3053    } else if (name.equals("slot")) {
3054      this.getSlot().add(castToReference(value));
3055    } else if (name.equals("created")) {
3056      this.created = castToDateTime(value); // DateTimeType
3057    } else if (name.equals("comment")) {
3058      this.comment = castToString(value); // StringType
3059    } else if (name.equals("patientInstruction")) {
3060      this.patientInstruction = castToString(value); // StringType
3061    } else if (name.equals("basedOn")) {
3062      this.getBasedOn().add(castToReference(value));
3063    } else if (name.equals("participant")) {
3064      this.getParticipant().add((AppointmentParticipantComponent) value);
3065    } else if (name.equals("requestedPeriod")) {
3066      this.getRequestedPeriod().add(castToPeriod(value));
3067    } else
3068      return super.setProperty(name, value);
3069    return value;
3070  }
3071
3072  @Override
3073  public Base makeProperty(int hash, String name) throws FHIRException {
3074    switch (hash) {
3075    case -1618432855:
3076      return addIdentifier();
3077    case -892481550:
3078      return getStatusElement();
3079    case 987811551:
3080      return getCancelationReason();
3081    case 1281188563:
3082      return addServiceCategory();
3083    case -1928370289:
3084      return addServiceType();
3085    case -1694759682:
3086      return addSpecialty();
3087    case -1596426375:
3088      return getAppointmentType();
3089    case 722137681:
3090      return addReasonCode();
3091    case -1146218137:
3092      return addReasonReference();
3093    case -1165461084:
3094      return getPriorityElement();
3095    case -1724546052:
3096      return getDescriptionElement();
3097    case -1248768647:
3098      return addSupportingInformation();
3099    case 109757538:
3100      return getStartElement();
3101    case 100571:
3102      return getEndElement();
3103    case -413630573:
3104      return getMinutesDurationElement();
3105    case 3533310:
3106      return addSlot();
3107    case 1028554472:
3108      return getCreatedElement();
3109    case 950398559:
3110      return getCommentElement();
3111    case 737543241:
3112      return getPatientInstructionElement();
3113    case -332612366:
3114      return addBasedOn();
3115    case 767422259:
3116      return addParticipant();
3117    case -897241393:
3118      return addRequestedPeriod();
3119    default:
3120      return super.makeProperty(hash, name);
3121    }
3122
3123  }
3124
3125  @Override
3126  public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3127    switch (hash) {
3128    case -1618432855:
3129      /* identifier */ return new String[] { "Identifier" };
3130    case -892481550:
3131      /* status */ return new String[] { "code" };
3132    case 987811551:
3133      /* cancelationReason */ return new String[] { "CodeableConcept" };
3134    case 1281188563:
3135      /* serviceCategory */ return new String[] { "CodeableConcept" };
3136    case -1928370289:
3137      /* serviceType */ return new String[] { "CodeableConcept" };
3138    case -1694759682:
3139      /* specialty */ return new String[] { "CodeableConcept" };
3140    case -1596426375:
3141      /* appointmentType */ return new String[] { "CodeableConcept" };
3142    case 722137681:
3143      /* reasonCode */ return new String[] { "CodeableConcept" };
3144    case -1146218137:
3145      /* reasonReference */ return new String[] { "Reference" };
3146    case -1165461084:
3147      /* priority */ return new String[] { "unsignedInt" };
3148    case -1724546052:
3149      /* description */ return new String[] { "string" };
3150    case -1248768647:
3151      /* supportingInformation */ return new String[] { "Reference" };
3152    case 109757538:
3153      /* start */ return new String[] { "instant" };
3154    case 100571:
3155      /* end */ return new String[] { "instant" };
3156    case -413630573:
3157      /* minutesDuration */ return new String[] { "positiveInt" };
3158    case 3533310:
3159      /* slot */ return new String[] { "Reference" };
3160    case 1028554472:
3161      /* created */ return new String[] { "dateTime" };
3162    case 950398559:
3163      /* comment */ return new String[] { "string" };
3164    case 737543241:
3165      /* patientInstruction */ return new String[] { "string" };
3166    case -332612366:
3167      /* basedOn */ return new String[] { "Reference" };
3168    case 767422259:
3169      /* participant */ return new String[] {};
3170    case -897241393:
3171      /* requestedPeriod */ return new String[] { "Period" };
3172    default:
3173      return super.getTypesForProperty(hash, name);
3174    }
3175
3176  }
3177
3178  @Override
3179  public Base addChild(String name) throws FHIRException {
3180    if (name.equals("identifier")) {
3181      return addIdentifier();
3182    } else if (name.equals("status")) {
3183      throw new FHIRException("Cannot call addChild on a singleton property Appointment.status");
3184    } else if (name.equals("cancelationReason")) {
3185      this.cancelationReason = new CodeableConcept();
3186      return this.cancelationReason;
3187    } else if (name.equals("serviceCategory")) {
3188      return addServiceCategory();
3189    } else if (name.equals("serviceType")) {
3190      return addServiceType();
3191    } else if (name.equals("specialty")) {
3192      return addSpecialty();
3193    } else if (name.equals("appointmentType")) {
3194      this.appointmentType = new CodeableConcept();
3195      return this.appointmentType;
3196    } else if (name.equals("reasonCode")) {
3197      return addReasonCode();
3198    } else if (name.equals("reasonReference")) {
3199      return addReasonReference();
3200    } else if (name.equals("priority")) {
3201      throw new FHIRException("Cannot call addChild on a singleton property Appointment.priority");
3202    } else if (name.equals("description")) {
3203      throw new FHIRException("Cannot call addChild on a singleton property Appointment.description");
3204    } else if (name.equals("supportingInformation")) {
3205      return addSupportingInformation();
3206    } else if (name.equals("start")) {
3207      throw new FHIRException("Cannot call addChild on a singleton property Appointment.start");
3208    } else if (name.equals("end")) {
3209      throw new FHIRException("Cannot call addChild on a singleton property Appointment.end");
3210    } else if (name.equals("minutesDuration")) {
3211      throw new FHIRException("Cannot call addChild on a singleton property Appointment.minutesDuration");
3212    } else if (name.equals("slot")) {
3213      return addSlot();
3214    } else if (name.equals("created")) {
3215      throw new FHIRException("Cannot call addChild on a singleton property Appointment.created");
3216    } else if (name.equals("comment")) {
3217      throw new FHIRException("Cannot call addChild on a singleton property Appointment.comment");
3218    } else if (name.equals("patientInstruction")) {
3219      throw new FHIRException("Cannot call addChild on a singleton property Appointment.patientInstruction");
3220    } else if (name.equals("basedOn")) {
3221      return addBasedOn();
3222    } else if (name.equals("participant")) {
3223      return addParticipant();
3224    } else if (name.equals("requestedPeriod")) {
3225      return addRequestedPeriod();
3226    } else
3227      return super.addChild(name);
3228  }
3229
3230  public String fhirType() {
3231    return "Appointment";
3232
3233  }
3234
3235  public Appointment copy() {
3236    Appointment dst = new Appointment();
3237    copyValues(dst);
3238    return dst;
3239  }
3240
3241  public void copyValues(Appointment dst) {
3242    super.copyValues(dst);
3243    if (identifier != null) {
3244      dst.identifier = new ArrayList<Identifier>();
3245      for (Identifier i : identifier)
3246        dst.identifier.add(i.copy());
3247    }
3248    ;
3249    dst.status = status == null ? null : status.copy();
3250    dst.cancelationReason = cancelationReason == null ? null : cancelationReason.copy();
3251    if (serviceCategory != null) {
3252      dst.serviceCategory = new ArrayList<CodeableConcept>();
3253      for (CodeableConcept i : serviceCategory)
3254        dst.serviceCategory.add(i.copy());
3255    }
3256    ;
3257    if (serviceType != null) {
3258      dst.serviceType = new ArrayList<CodeableConcept>();
3259      for (CodeableConcept i : serviceType)
3260        dst.serviceType.add(i.copy());
3261    }
3262    ;
3263    if (specialty != null) {
3264      dst.specialty = new ArrayList<CodeableConcept>();
3265      for (CodeableConcept i : specialty)
3266        dst.specialty.add(i.copy());
3267    }
3268    ;
3269    dst.appointmentType = appointmentType == null ? null : appointmentType.copy();
3270    if (reasonCode != null) {
3271      dst.reasonCode = new ArrayList<CodeableConcept>();
3272      for (CodeableConcept i : reasonCode)
3273        dst.reasonCode.add(i.copy());
3274    }
3275    ;
3276    if (reasonReference != null) {
3277      dst.reasonReference = new ArrayList<Reference>();
3278      for (Reference i : reasonReference)
3279        dst.reasonReference.add(i.copy());
3280    }
3281    ;
3282    dst.priority = priority == null ? null : priority.copy();
3283    dst.description = description == null ? null : description.copy();
3284    if (supportingInformation != null) {
3285      dst.supportingInformation = new ArrayList<Reference>();
3286      for (Reference i : supportingInformation)
3287        dst.supportingInformation.add(i.copy());
3288    }
3289    ;
3290    dst.start = start == null ? null : start.copy();
3291    dst.end = end == null ? null : end.copy();
3292    dst.minutesDuration = minutesDuration == null ? null : minutesDuration.copy();
3293    if (slot != null) {
3294      dst.slot = new ArrayList<Reference>();
3295      for (Reference i : slot)
3296        dst.slot.add(i.copy());
3297    }
3298    ;
3299    dst.created = created == null ? null : created.copy();
3300    dst.comment = comment == null ? null : comment.copy();
3301    dst.patientInstruction = patientInstruction == null ? null : patientInstruction.copy();
3302    if (basedOn != null) {
3303      dst.basedOn = new ArrayList<Reference>();
3304      for (Reference i : basedOn)
3305        dst.basedOn.add(i.copy());
3306    }
3307    ;
3308    if (participant != null) {
3309      dst.participant = new ArrayList<AppointmentParticipantComponent>();
3310      for (AppointmentParticipantComponent i : participant)
3311        dst.participant.add(i.copy());
3312    }
3313    ;
3314    if (requestedPeriod != null) {
3315      dst.requestedPeriod = new ArrayList<Period>();
3316      for (Period i : requestedPeriod)
3317        dst.requestedPeriod.add(i.copy());
3318    }
3319    ;
3320  }
3321
3322  protected Appointment typedCopy() {
3323    return copy();
3324  }
3325
3326  @Override
3327  public boolean equalsDeep(Base other_) {
3328    if (!super.equalsDeep(other_))
3329      return false;
3330    if (!(other_ instanceof Appointment))
3331      return false;
3332    Appointment o = (Appointment) other_;
3333    return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true)
3334        && compareDeep(cancelationReason, o.cancelationReason, true)
3335        && compareDeep(serviceCategory, o.serviceCategory, true) && compareDeep(serviceType, o.serviceType, true)
3336        && compareDeep(specialty, o.specialty, true) && compareDeep(appointmentType, o.appointmentType, true)
3337        && compareDeep(reasonCode, o.reasonCode, true) && compareDeep(reasonReference, o.reasonReference, true)
3338        && compareDeep(priority, o.priority, true) && compareDeep(description, o.description, true)
3339        && compareDeep(supportingInformation, o.supportingInformation, true) && compareDeep(start, o.start, true)
3340        && compareDeep(end, o.end, true) && compareDeep(minutesDuration, o.minutesDuration, true)
3341        && compareDeep(slot, o.slot, true) && compareDeep(created, o.created, true)
3342        && compareDeep(comment, o.comment, true) && compareDeep(patientInstruction, o.patientInstruction, true)
3343        && compareDeep(basedOn, o.basedOn, true) && compareDeep(participant, o.participant, true)
3344        && compareDeep(requestedPeriod, o.requestedPeriod, true);
3345  }
3346
3347  @Override
3348  public boolean equalsShallow(Base other_) {
3349    if (!super.equalsShallow(other_))
3350      return false;
3351    if (!(other_ instanceof Appointment))
3352      return false;
3353    Appointment o = (Appointment) other_;
3354    return compareValues(status, o.status, true) && compareValues(priority, o.priority, true)
3355        && compareValues(description, o.description, true) && compareValues(start, o.start, true)
3356        && compareValues(end, o.end, true) && compareValues(minutesDuration, o.minutesDuration, true)
3357        && compareValues(created, o.created, true) && compareValues(comment, o.comment, true)
3358        && compareValues(patientInstruction, o.patientInstruction, true);
3359  }
3360
3361  public boolean isEmpty() {
3362    return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, cancelationReason,
3363        serviceCategory, serviceType, specialty, appointmentType, reasonCode, reasonReference, priority, description,
3364        supportingInformation, start, end, minutesDuration, slot, created, comment, patientInstruction, basedOn,
3365        participant, requestedPeriod);
3366  }
3367
3368  @Override
3369  public ResourceType getResourceType() {
3370    return ResourceType.Appointment;
3371  }
3372
3373  /**
3374   * Search parameter: <b>date</b>
3375   * <p>
3376   * Description: <b>Appointment date/time.</b><br>
3377   * Type: <b>date</b><br>
3378   * Path: <b>Appointment.start</b><br>
3379   * </p>
3380   */
3381  @SearchParamDefinition(name = "date", path = "Appointment.start", description = "Appointment date/time.", type = "date")
3382  public static final String SP_DATE = "date";
3383  /**
3384   * <b>Fluent Client</b> search parameter constant for <b>date</b>
3385   * <p>
3386   * Description: <b>Appointment date/time.</b><br>
3387   * Type: <b>date</b><br>
3388   * Path: <b>Appointment.start</b><br>
3389   * </p>
3390   */
3391  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(
3392      SP_DATE);
3393
3394  /**
3395   * Search parameter: <b>identifier</b>
3396   * <p>
3397   * Description: <b>An Identifier of the Appointment</b><br>
3398   * Type: <b>token</b><br>
3399   * Path: <b>Appointment.identifier</b><br>
3400   * </p>
3401   */
3402  @SearchParamDefinition(name = "identifier", path = "Appointment.identifier", description = "An Identifier of the Appointment", type = "token")
3403  public static final String SP_IDENTIFIER = "identifier";
3404  /**
3405   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3406   * <p>
3407   * Description: <b>An Identifier of the Appointment</b><br>
3408   * Type: <b>token</b><br>
3409   * Path: <b>Appointment.identifier</b><br>
3410   * </p>
3411   */
3412  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3413      SP_IDENTIFIER);
3414
3415  /**
3416   * Search parameter: <b>specialty</b>
3417   * <p>
3418   * Description: <b>The specialty of a practitioner that would be required to
3419   * perform the service requested in this appointment</b><br>
3420   * Type: <b>token</b><br>
3421   * Path: <b>Appointment.specialty</b><br>
3422   * </p>
3423   */
3424  @SearchParamDefinition(name = "specialty", path = "Appointment.specialty", description = "The specialty of a practitioner that would be required to perform the service requested in this appointment", type = "token")
3425  public static final String SP_SPECIALTY = "specialty";
3426  /**
3427   * <b>Fluent Client</b> search parameter constant for <b>specialty</b>
3428   * <p>
3429   * Description: <b>The specialty of a practitioner that would be required to
3430   * perform the service requested in this appointment</b><br>
3431   * Type: <b>token</b><br>
3432   * Path: <b>Appointment.specialty</b><br>
3433   * </p>
3434   */
3435  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SPECIALTY = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3436      SP_SPECIALTY);
3437
3438  /**
3439   * Search parameter: <b>service-category</b>
3440   * <p>
3441   * Description: <b>A broad categorization of the service that is to be performed
3442   * during this appointment</b><br>
3443   * Type: <b>token</b><br>
3444   * Path: <b>Appointment.serviceCategory</b><br>
3445   * </p>
3446   */
3447  @SearchParamDefinition(name = "service-category", path = "Appointment.serviceCategory", description = "A broad categorization of the service that is to be performed during this appointment", type = "token")
3448  public static final String SP_SERVICE_CATEGORY = "service-category";
3449  /**
3450   * <b>Fluent Client</b> search parameter constant for <b>service-category</b>
3451   * <p>
3452   * Description: <b>A broad categorization of the service that is to be performed
3453   * during this appointment</b><br>
3454   * Type: <b>token</b><br>
3455   * Path: <b>Appointment.serviceCategory</b><br>
3456   * </p>
3457   */
3458  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SERVICE_CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3459      SP_SERVICE_CATEGORY);
3460
3461  /**
3462   * Search parameter: <b>practitioner</b>
3463   * <p>
3464   * Description: <b>One of the individuals of the appointment is this
3465   * practitioner</b><br>
3466   * Type: <b>reference</b><br>
3467   * Path: <b>Appointment.participant.actor</b><br>
3468   * </p>
3469   */
3470  @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 = {
3471      Practitioner.class })
3472  public static final String SP_PRACTITIONER = "practitioner";
3473  /**
3474   * <b>Fluent Client</b> search parameter constant for <b>practitioner</b>
3475   * <p>
3476   * Description: <b>One of the individuals of the appointment is this
3477   * practitioner</b><br>
3478   * Type: <b>reference</b><br>
3479   * Path: <b>Appointment.participant.actor</b><br>
3480   * </p>
3481   */
3482  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRACTITIONER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
3483      SP_PRACTITIONER);
3484
3485  /**
3486   * Constant for fluent queries to be used to add include statements. Specifies
3487   * the path value of "<b>Appointment:practitioner</b>".
3488   */
3489  public static final ca.uhn.fhir.model.api.Include INCLUDE_PRACTITIONER = new ca.uhn.fhir.model.api.Include(
3490      "Appointment:practitioner").toLocked();
3491
3492  /**
3493   * Search parameter: <b>part-status</b>
3494   * <p>
3495   * Description: <b>The Participation status of the subject, or other participant
3496   * on the appointment. Can be used to locate participants that have not
3497   * responded to meeting requests.</b><br>
3498   * Type: <b>token</b><br>
3499   * Path: <b>Appointment.participant.status</b><br>
3500   * </p>
3501   */
3502  @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")
3503  public static final String SP_PART_STATUS = "part-status";
3504  /**
3505   * <b>Fluent Client</b> search parameter constant for <b>part-status</b>
3506   * <p>
3507   * Description: <b>The Participation status of the subject, or other participant
3508   * on the appointment. Can be used to locate participants that have not
3509   * responded to meeting requests.</b><br>
3510   * Type: <b>token</b><br>
3511   * Path: <b>Appointment.participant.status</b><br>
3512   * </p>
3513   */
3514  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PART_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3515      SP_PART_STATUS);
3516
3517  /**
3518   * Search parameter: <b>appointment-type</b>
3519   * <p>
3520   * Description: <b>The style of appointment or patient that has been booked in
3521   * the slot (not service type)</b><br>
3522   * Type: <b>token</b><br>
3523   * Path: <b>Appointment.appointmentType</b><br>
3524   * </p>
3525   */
3526  @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")
3527  public static final String SP_APPOINTMENT_TYPE = "appointment-type";
3528  /**
3529   * <b>Fluent Client</b> search parameter constant for <b>appointment-type</b>
3530   * <p>
3531   * Description: <b>The style of appointment or patient that has been booked in
3532   * the slot (not service type)</b><br>
3533   * Type: <b>token</b><br>
3534   * Path: <b>Appointment.appointmentType</b><br>
3535   * </p>
3536   */
3537  public static final ca.uhn.fhir.rest.gclient.TokenClientParam APPOINTMENT_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3538      SP_APPOINTMENT_TYPE);
3539
3540  /**
3541   * Search parameter: <b>service-type</b>
3542   * <p>
3543   * Description: <b>The specific service that is to be performed during this
3544   * appointment</b><br>
3545   * Type: <b>token</b><br>
3546   * Path: <b>Appointment.serviceType</b><br>
3547   * </p>
3548   */
3549  @SearchParamDefinition(name = "service-type", path = "Appointment.serviceType", description = "The specific service that is to be performed during this appointment", type = "token")
3550  public static final String SP_SERVICE_TYPE = "service-type";
3551  /**
3552   * <b>Fluent Client</b> search parameter constant for <b>service-type</b>
3553   * <p>
3554   * Description: <b>The specific service that is to be performed during this
3555   * appointment</b><br>
3556   * Type: <b>token</b><br>
3557   * Path: <b>Appointment.serviceType</b><br>
3558   * </p>
3559   */
3560  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SERVICE_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3561      SP_SERVICE_TYPE);
3562
3563  /**
3564   * Search parameter: <b>slot</b>
3565   * <p>
3566   * Description: <b>The slots that this appointment is filling</b><br>
3567   * Type: <b>reference</b><br>
3568   * Path: <b>Appointment.slot</b><br>
3569   * </p>
3570   */
3571  @SearchParamDefinition(name = "slot", path = "Appointment.slot", description = "The slots that this appointment is filling", type = "reference", target = {
3572      Slot.class })
3573  public static final String SP_SLOT = "slot";
3574  /**
3575   * <b>Fluent Client</b> search parameter constant for <b>slot</b>
3576   * <p>
3577   * Description: <b>The slots that this appointment is filling</b><br>
3578   * Type: <b>reference</b><br>
3579   * Path: <b>Appointment.slot</b><br>
3580   * </p>
3581   */
3582  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SLOT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
3583      SP_SLOT);
3584
3585  /**
3586   * Constant for fluent queries to be used to add include statements. Specifies
3587   * the path value of "<b>Appointment:slot</b>".
3588   */
3589  public static final ca.uhn.fhir.model.api.Include INCLUDE_SLOT = new ca.uhn.fhir.model.api.Include("Appointment:slot")
3590      .toLocked();
3591
3592  /**
3593   * Search parameter: <b>reason-code</b>
3594   * <p>
3595   * Description: <b>Coded reason this appointment is scheduled</b><br>
3596   * Type: <b>token</b><br>
3597   * Path: <b>Appointment.reasonCode</b><br>
3598   * </p>
3599   */
3600  @SearchParamDefinition(name = "reason-code", path = "Appointment.reasonCode", description = "Coded reason this appointment is scheduled", type = "token")
3601  public static final String SP_REASON_CODE = "reason-code";
3602  /**
3603   * <b>Fluent Client</b> search parameter constant for <b>reason-code</b>
3604   * <p>
3605   * Description: <b>Coded reason this appointment is scheduled</b><br>
3606   * Type: <b>token</b><br>
3607   * Path: <b>Appointment.reasonCode</b><br>
3608   * </p>
3609   */
3610  public static final ca.uhn.fhir.rest.gclient.TokenClientParam REASON_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3611      SP_REASON_CODE);
3612
3613  /**
3614   * Search parameter: <b>actor</b>
3615   * <p>
3616   * Description: <b>Any one of the individuals participating in the
3617   * appointment</b><br>
3618   * Type: <b>reference</b><br>
3619   * Path: <b>Appointment.participant.actor</b><br>
3620   * </p>
3621   */
3622  @SearchParamDefinition(name = "actor", path = "Appointment.participant.actor", description = "Any one of the individuals participating in the appointment", type = "reference", providesMembershipIn = {
3623      @ca.uhn.fhir.model.api.annotation.Compartment(name = "Device"),
3624      @ca.uhn.fhir.model.api.annotation.Compartment(name = "Patient"),
3625      @ca.uhn.fhir.model.api.annotation.Compartment(name = "Practitioner"),
3626      @ca.uhn.fhir.model.api.annotation.Compartment(name = "RelatedPerson") }, target = { Device.class,
3627          HealthcareService.class, Location.class, Patient.class, Practitioner.class, PractitionerRole.class,
3628          RelatedPerson.class })
3629  public static final String SP_ACTOR = "actor";
3630  /**
3631   * <b>Fluent Client</b> search parameter constant for <b>actor</b>
3632   * <p>
3633   * Description: <b>Any one of the individuals participating in the
3634   * appointment</b><br>
3635   * Type: <b>reference</b><br>
3636   * Path: <b>Appointment.participant.actor</b><br>
3637   * </p>
3638   */
3639  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ACTOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
3640      SP_ACTOR);
3641
3642  /**
3643   * Constant for fluent queries to be used to add include statements. Specifies
3644   * the path value of "<b>Appointment:actor</b>".
3645   */
3646  public static final ca.uhn.fhir.model.api.Include INCLUDE_ACTOR = new ca.uhn.fhir.model.api.Include(
3647      "Appointment:actor").toLocked();
3648
3649  /**
3650   * Search parameter: <b>based-on</b>
3651   * <p>
3652   * Description: <b>The service request this appointment is allocated to
3653   * assess</b><br>
3654   * Type: <b>reference</b><br>
3655   * Path: <b>Appointment.basedOn</b><br>
3656   * </p>
3657   */
3658  @SearchParamDefinition(name = "based-on", path = "Appointment.basedOn", description = "The service request this appointment is allocated to assess", type = "reference", target = {
3659      ServiceRequest.class })
3660  public static final String SP_BASED_ON = "based-on";
3661  /**
3662   * <b>Fluent Client</b> search parameter constant for <b>based-on</b>
3663   * <p>
3664   * Description: <b>The service request this appointment is allocated to
3665   * assess</b><br>
3666   * Type: <b>reference</b><br>
3667   * Path: <b>Appointment.basedOn</b><br>
3668   * </p>
3669   */
3670  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASED_ON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
3671      SP_BASED_ON);
3672
3673  /**
3674   * Constant for fluent queries to be used to add include statements. Specifies
3675   * the path value of "<b>Appointment:based-on</b>".
3676   */
3677  public static final ca.uhn.fhir.model.api.Include INCLUDE_BASED_ON = new ca.uhn.fhir.model.api.Include(
3678      "Appointment:based-on").toLocked();
3679
3680  /**
3681   * Search parameter: <b>patient</b>
3682   * <p>
3683   * Description: <b>One of the individuals of the appointment is this
3684   * patient</b><br>
3685   * Type: <b>reference</b><br>
3686   * Path: <b>Appointment.participant.actor</b><br>
3687   * </p>
3688   */
3689  @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 = {
3690      Patient.class })
3691  public static final String SP_PATIENT = "patient";
3692  /**
3693   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
3694   * <p>
3695   * Description: <b>One of the individuals of the appointment is this
3696   * patient</b><br>
3697   * Type: <b>reference</b><br>
3698   * Path: <b>Appointment.participant.actor</b><br>
3699   * </p>
3700   */
3701  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
3702      SP_PATIENT);
3703
3704  /**
3705   * Constant for fluent queries to be used to add include statements. Specifies
3706   * the path value of "<b>Appointment:patient</b>".
3707   */
3708  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include(
3709      "Appointment:patient").toLocked();
3710
3711  /**
3712   * Search parameter: <b>reason-reference</b>
3713   * <p>
3714   * Description: <b>Reason the appointment is to take place (resource)</b><br>
3715   * Type: <b>reference</b><br>
3716   * Path: <b>Appointment.reasonReference</b><br>
3717   * </p>
3718   */
3719  @SearchParamDefinition(name = "reason-reference", path = "Appointment.reasonReference", description = "Reason the appointment is to take place (resource)", type = "reference", target = {
3720      Condition.class, ImmunizationRecommendation.class, Observation.class, Procedure.class })
3721  public static final String SP_REASON_REFERENCE = "reason-reference";
3722  /**
3723   * <b>Fluent Client</b> search parameter constant for <b>reason-reference</b>
3724   * <p>
3725   * Description: <b>Reason the appointment is to take place (resource)</b><br>
3726   * Type: <b>reference</b><br>
3727   * Path: <b>Appointment.reasonReference</b><br>
3728   * </p>
3729   */
3730  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REASON_REFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
3731      SP_REASON_REFERENCE);
3732
3733  /**
3734   * Constant for fluent queries to be used to add include statements. Specifies
3735   * the path value of "<b>Appointment:reason-reference</b>".
3736   */
3737  public static final ca.uhn.fhir.model.api.Include INCLUDE_REASON_REFERENCE = new ca.uhn.fhir.model.api.Include(
3738      "Appointment:reason-reference").toLocked();
3739
3740  /**
3741   * Search parameter: <b>supporting-info</b>
3742   * <p>
3743   * Description: <b>Additional information to support the appointment</b><br>
3744   * Type: <b>reference</b><br>
3745   * Path: <b>Appointment.supportingInformation</b><br>
3746   * </p>
3747   */
3748  @SearchParamDefinition(name = "supporting-info", path = "Appointment.supportingInformation", description = "Additional information to support the appointment", type = "reference")
3749  public static final String SP_SUPPORTING_INFO = "supporting-info";
3750  /**
3751   * <b>Fluent Client</b> search parameter constant for <b>supporting-info</b>
3752   * <p>
3753   * Description: <b>Additional information to support the appointment</b><br>
3754   * Type: <b>reference</b><br>
3755   * Path: <b>Appointment.supportingInformation</b><br>
3756   * </p>
3757   */
3758  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUPPORTING_INFO = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
3759      SP_SUPPORTING_INFO);
3760
3761  /**
3762   * Constant for fluent queries to be used to add include statements. Specifies
3763   * the path value of "<b>Appointment:supporting-info</b>".
3764   */
3765  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUPPORTING_INFO = new ca.uhn.fhir.model.api.Include(
3766      "Appointment:supporting-info").toLocked();
3767
3768  /**
3769   * Search parameter: <b>location</b>
3770   * <p>
3771   * Description: <b>This location is listed in the participants of the
3772   * appointment</b><br>
3773   * Type: <b>reference</b><br>
3774   * Path: <b>Appointment.participant.actor</b><br>
3775   * </p>
3776   */
3777  @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 = {
3778      Location.class })
3779  public static final String SP_LOCATION = "location";
3780  /**
3781   * <b>Fluent Client</b> search parameter constant for <b>location</b>
3782   * <p>
3783   * Description: <b>This location is listed in the participants of the
3784   * appointment</b><br>
3785   * Type: <b>reference</b><br>
3786   * Path: <b>Appointment.participant.actor</b><br>
3787   * </p>
3788   */
3789  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
3790      SP_LOCATION);
3791
3792  /**
3793   * Constant for fluent queries to be used to add include statements. Specifies
3794   * the path value of "<b>Appointment:location</b>".
3795   */
3796  public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include(
3797      "Appointment:location").toLocked();
3798
3799  /**
3800   * Search parameter: <b>status</b>
3801   * <p>
3802   * Description: <b>The overall status of the appointment</b><br>
3803   * Type: <b>token</b><br>
3804   * Path: <b>Appointment.status</b><br>
3805   * </p>
3806   */
3807  @SearchParamDefinition(name = "status", path = "Appointment.status", description = "The overall status of the appointment", type = "token")
3808  public static final String SP_STATUS = "status";
3809  /**
3810   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3811   * <p>
3812   * Description: <b>The overall status of the appointment</b><br>
3813   * Type: <b>token</b><br>
3814   * Path: <b>Appointment.status</b><br>
3815   * </p>
3816   */
3817  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3818      SP_STATUS);
3819
3820}