001package org.hl7.fhir.dstu2016may.model;
002
003
004
005
006/*
007  Copyright (c) 2011+, HL7, Inc.
008  All rights reserved.
009  
010  Redistribution and use in source and binary forms, with or without modification, 
011  are permitted provided that the following conditions are met:
012  
013   * Redistributions of source code must retain the above copyright notice, this 
014     list of conditions and the following disclaimer.
015   * Redistributions in binary form must reproduce the above copyright notice, 
016     this list of conditions and the following disclaimer in the documentation 
017     and/or other materials provided with the distribution.
018   * Neither the name of HL7 nor the names of its contributors may be used to 
019     endorse or promote products derived from this software without specific 
020     prior written permission.
021  
022  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
023  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
024  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
025  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
026  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
027  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
028  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
029  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
030  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
031  POSSIBILITY OF SUCH DAMAGE.
032  
033*/
034
035// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0
036import java.util.ArrayList;
037import java.util.Date;
038import java.util.List;
039
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.utilities.Utilities;
042
043import ca.uhn.fhir.model.api.annotation.Child;
044import ca.uhn.fhir.model.api.annotation.Description;
045import ca.uhn.fhir.model.api.annotation.ResourceDef;
046import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
047/**
048 * A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection.
049 */
050@ResourceDef(name="AppointmentResponse", profile="http://hl7.org/fhir/Profile/AppointmentResponse")
051public class AppointmentResponse extends DomainResource {
052
053    /**
054     * This records identifiers associated with this appointment response 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.
055     */
056    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
057    @Description(shortDefinition="External Ids for this item", formalDefinition="This records identifiers associated with this appointment response 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." )
058    protected List<Identifier> identifier;
059
060    /**
061     * Appointment that this response is replying to.
062     */
063    @Child(name = "appointment", type = {Appointment.class}, order=1, min=1, max=1, modifier=false, summary=true)
064    @Description(shortDefinition="Appointment this response relates to", formalDefinition="Appointment that this response is replying to." )
065    protected Reference appointment;
066
067    /**
068     * The actual object that is the target of the reference (Appointment that this response is replying to.)
069     */
070    protected Appointment appointmentTarget;
071
072    /**
073     * Date/Time that the appointment is to take place, or requested new start time.
074     */
075    @Child(name = "start", type = {InstantType.class}, order=2, min=0, max=1, modifier=false, summary=false)
076    @Description(shortDefinition="Time from appointment, or requested new start time", formalDefinition="Date/Time that the appointment is to take place, or requested new start time." )
077    protected InstantType start;
078
079    /**
080     * This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time.
081     */
082    @Child(name = "end", type = {InstantType.class}, order=3, min=0, max=1, modifier=false, summary=false)
083    @Description(shortDefinition="Time from appointment, or requested new end time", formalDefinition="This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time." )
084    protected InstantType end;
085
086    /**
087     * Role of participant in the appointment.
088     */
089    @Child(name = "participantType", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
090    @Description(shortDefinition="Role of participant in the appointment", formalDefinition="Role of participant in the appointment." )
091    protected List<CodeableConcept> participantType;
092
093    /**
094     * A Person, Location/HealthcareService or Device that is participating in the appointment.
095     */
096    @Child(name = "actor", type = {Patient.class, Practitioner.class, RelatedPerson.class, Device.class, HealthcareService.class, Location.class}, order=5, min=0, max=1, modifier=false, summary=true)
097    @Description(shortDefinition="Person, Location/HealthcareService or Device", formalDefinition="A Person, Location/HealthcareService or Device that is participating in the appointment." )
098    protected Reference actor;
099
100    /**
101     * The actual object that is the target of the reference (A Person, Location/HealthcareService or Device that is participating in the appointment.)
102     */
103    protected Resource actorTarget;
104
105    /**
106     * Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty.
107     */
108    @Child(name = "participantStatus", type = {CodeType.class}, order=6, min=1, max=1, modifier=true, summary=true)
109    @Description(shortDefinition="accepted | declined | tentative | in-process | completed | needs-action", formalDefinition="Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty." )
110    protected CodeType participantStatus;
111
112    /**
113     * Additional comments about the appointment.
114     */
115    @Child(name = "comment", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=false)
116    @Description(shortDefinition="Additional comments", formalDefinition="Additional comments about the appointment." )
117    protected StringType comment;
118
119    private static final long serialVersionUID = -1645343660L;
120
121  /**
122   * Constructor
123   */
124    public AppointmentResponse() {
125      super();
126    }
127
128  /**
129   * Constructor
130   */
131    public AppointmentResponse(Reference appointment, CodeType participantStatus) {
132      super();
133      this.appointment = appointment;
134      this.participantStatus = participantStatus;
135    }
136
137    /**
138     * @return {@link #identifier} (This records identifiers associated with this appointment response 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.)
139     */
140    public List<Identifier> getIdentifier() { 
141      if (this.identifier == null)
142        this.identifier = new ArrayList<Identifier>();
143      return this.identifier;
144    }
145
146    public boolean hasIdentifier() { 
147      if (this.identifier == null)
148        return false;
149      for (Identifier item : this.identifier)
150        if (!item.isEmpty())
151          return true;
152      return false;
153    }
154
155    /**
156     * @return {@link #identifier} (This records identifiers associated with this appointment response 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.)
157     */
158    // syntactic sugar
159    public Identifier addIdentifier() { //3
160      Identifier t = new Identifier();
161      if (this.identifier == null)
162        this.identifier = new ArrayList<Identifier>();
163      this.identifier.add(t);
164      return t;
165    }
166
167    // syntactic sugar
168    public AppointmentResponse addIdentifier(Identifier t) { //3
169      if (t == null)
170        return this;
171      if (this.identifier == null)
172        this.identifier = new ArrayList<Identifier>();
173      this.identifier.add(t);
174      return this;
175    }
176
177    /**
178     * @return {@link #appointment} (Appointment that this response is replying to.)
179     */
180    public Reference getAppointment() { 
181      if (this.appointment == null)
182        if (Configuration.errorOnAutoCreate())
183          throw new Error("Attempt to auto-create AppointmentResponse.appointment");
184        else if (Configuration.doAutoCreate())
185          this.appointment = new Reference(); // cc
186      return this.appointment;
187    }
188
189    public boolean hasAppointment() { 
190      return this.appointment != null && !this.appointment.isEmpty();
191    }
192
193    /**
194     * @param value {@link #appointment} (Appointment that this response is replying to.)
195     */
196    public AppointmentResponse setAppointment(Reference value) { 
197      this.appointment = value;
198      return this;
199    }
200
201    /**
202     * @return {@link #appointment} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Appointment that this response is replying to.)
203     */
204    public Appointment getAppointmentTarget() { 
205      if (this.appointmentTarget == null)
206        if (Configuration.errorOnAutoCreate())
207          throw new Error("Attempt to auto-create AppointmentResponse.appointment");
208        else if (Configuration.doAutoCreate())
209          this.appointmentTarget = new Appointment(); // aa
210      return this.appointmentTarget;
211    }
212
213    /**
214     * @param value {@link #appointment} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Appointment that this response is replying to.)
215     */
216    public AppointmentResponse setAppointmentTarget(Appointment value) { 
217      this.appointmentTarget = value;
218      return this;
219    }
220
221    /**
222     * @return {@link #start} (Date/Time that the appointment is to take place, or requested new start time.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value
223     */
224    public InstantType getStartElement() { 
225      if (this.start == null)
226        if (Configuration.errorOnAutoCreate())
227          throw new Error("Attempt to auto-create AppointmentResponse.start");
228        else if (Configuration.doAutoCreate())
229          this.start = new InstantType(); // bb
230      return this.start;
231    }
232
233    public boolean hasStartElement() { 
234      return this.start != null && !this.start.isEmpty();
235    }
236
237    public boolean hasStart() { 
238      return this.start != null && !this.start.isEmpty();
239    }
240
241    /**
242     * @param value {@link #start} (Date/Time that the appointment is to take place, or requested new start time.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value
243     */
244    public AppointmentResponse setStartElement(InstantType value) { 
245      this.start = value;
246      return this;
247    }
248
249    /**
250     * @return Date/Time that the appointment is to take place, or requested new start time.
251     */
252    public Date getStart() { 
253      return this.start == null ? null : this.start.getValue();
254    }
255
256    /**
257     * @param value Date/Time that the appointment is to take place, or requested new start time.
258     */
259    public AppointmentResponse setStart(Date value) { 
260      if (value == null)
261        this.start = null;
262      else {
263        if (this.start == null)
264          this.start = new InstantType();
265        this.start.setValue(value);
266      }
267      return this;
268    }
269
270    /**
271     * @return {@link #end} (This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value
272     */
273    public InstantType getEndElement() { 
274      if (this.end == null)
275        if (Configuration.errorOnAutoCreate())
276          throw new Error("Attempt to auto-create AppointmentResponse.end");
277        else if (Configuration.doAutoCreate())
278          this.end = new InstantType(); // bb
279      return this.end;
280    }
281
282    public boolean hasEndElement() { 
283      return this.end != null && !this.end.isEmpty();
284    }
285
286    public boolean hasEnd() { 
287      return this.end != null && !this.end.isEmpty();
288    }
289
290    /**
291     * @param value {@link #end} (This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value
292     */
293    public AppointmentResponse setEndElement(InstantType value) { 
294      this.end = value;
295      return this;
296    }
297
298    /**
299     * @return This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time.
300     */
301    public Date getEnd() { 
302      return this.end == null ? null : this.end.getValue();
303    }
304
305    /**
306     * @param value This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time.
307     */
308    public AppointmentResponse setEnd(Date value) { 
309      if (value == null)
310        this.end = null;
311      else {
312        if (this.end == null)
313          this.end = new InstantType();
314        this.end.setValue(value);
315      }
316      return this;
317    }
318
319    /**
320     * @return {@link #participantType} (Role of participant in the appointment.)
321     */
322    public List<CodeableConcept> getParticipantType() { 
323      if (this.participantType == null)
324        this.participantType = new ArrayList<CodeableConcept>();
325      return this.participantType;
326    }
327
328    public boolean hasParticipantType() { 
329      if (this.participantType == null)
330        return false;
331      for (CodeableConcept item : this.participantType)
332        if (!item.isEmpty())
333          return true;
334      return false;
335    }
336
337    /**
338     * @return {@link #participantType} (Role of participant in the appointment.)
339     */
340    // syntactic sugar
341    public CodeableConcept addParticipantType() { //3
342      CodeableConcept t = new CodeableConcept();
343      if (this.participantType == null)
344        this.participantType = new ArrayList<CodeableConcept>();
345      this.participantType.add(t);
346      return t;
347    }
348
349    // syntactic sugar
350    public AppointmentResponse addParticipantType(CodeableConcept t) { //3
351      if (t == null)
352        return this;
353      if (this.participantType == null)
354        this.participantType = new ArrayList<CodeableConcept>();
355      this.participantType.add(t);
356      return this;
357    }
358
359    /**
360     * @return {@link #actor} (A Person, Location/HealthcareService or Device that is participating in the appointment.)
361     */
362    public Reference getActor() { 
363      if (this.actor == null)
364        if (Configuration.errorOnAutoCreate())
365          throw new Error("Attempt to auto-create AppointmentResponse.actor");
366        else if (Configuration.doAutoCreate())
367          this.actor = new Reference(); // cc
368      return this.actor;
369    }
370
371    public boolean hasActor() { 
372      return this.actor != null && !this.actor.isEmpty();
373    }
374
375    /**
376     * @param value {@link #actor} (A Person, Location/HealthcareService or Device that is participating in the appointment.)
377     */
378    public AppointmentResponse setActor(Reference value) { 
379      this.actor = value;
380      return this;
381    }
382
383    /**
384     * @return {@link #actor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A Person, Location/HealthcareService or Device that is participating in the appointment.)
385     */
386    public Resource getActorTarget() { 
387      return this.actorTarget;
388    }
389
390    /**
391     * @param value {@link #actor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A Person, Location/HealthcareService or Device that is participating in the appointment.)
392     */
393    public AppointmentResponse setActorTarget(Resource value) { 
394      this.actorTarget = value;
395      return this;
396    }
397
398    /**
399     * @return {@link #participantStatus} (Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty.). This is the underlying object with id, value and extensions. The accessor "getParticipantStatus" gives direct access to the value
400     */
401    public CodeType getParticipantStatusElement() { 
402      if (this.participantStatus == null)
403        if (Configuration.errorOnAutoCreate())
404          throw new Error("Attempt to auto-create AppointmentResponse.participantStatus");
405        else if (Configuration.doAutoCreate())
406          this.participantStatus = new CodeType(); // bb
407      return this.participantStatus;
408    }
409
410    public boolean hasParticipantStatusElement() { 
411      return this.participantStatus != null && !this.participantStatus.isEmpty();
412    }
413
414    public boolean hasParticipantStatus() { 
415      return this.participantStatus != null && !this.participantStatus.isEmpty();
416    }
417
418    /**
419     * @param value {@link #participantStatus} (Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty.). This is the underlying object with id, value and extensions. The accessor "getParticipantStatus" gives direct access to the value
420     */
421    public AppointmentResponse setParticipantStatusElement(CodeType value) { 
422      this.participantStatus = value;
423      return this;
424    }
425
426    /**
427     * @return Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty.
428     */
429    public String getParticipantStatus() { 
430      return this.participantStatus == null ? null : this.participantStatus.getValue();
431    }
432
433    /**
434     * @param value Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty.
435     */
436    public AppointmentResponse setParticipantStatus(String value) { 
437        if (this.participantStatus == null)
438          this.participantStatus = new CodeType();
439        this.participantStatus.setValue(value);
440      return this;
441    }
442
443    /**
444     * @return {@link #comment} (Additional comments about the appointment.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value
445     */
446    public StringType getCommentElement() { 
447      if (this.comment == null)
448        if (Configuration.errorOnAutoCreate())
449          throw new Error("Attempt to auto-create AppointmentResponse.comment");
450        else if (Configuration.doAutoCreate())
451          this.comment = new StringType(); // bb
452      return this.comment;
453    }
454
455    public boolean hasCommentElement() { 
456      return this.comment != null && !this.comment.isEmpty();
457    }
458
459    public boolean hasComment() { 
460      return this.comment != null && !this.comment.isEmpty();
461    }
462
463    /**
464     * @param value {@link #comment} (Additional comments about the appointment.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value
465     */
466    public AppointmentResponse setCommentElement(StringType value) { 
467      this.comment = value;
468      return this;
469    }
470
471    /**
472     * @return Additional comments about the appointment.
473     */
474    public String getComment() { 
475      return this.comment == null ? null : this.comment.getValue();
476    }
477
478    /**
479     * @param value Additional comments about the appointment.
480     */
481    public AppointmentResponse setComment(String value) { 
482      if (Utilities.noString(value))
483        this.comment = null;
484      else {
485        if (this.comment == null)
486          this.comment = new StringType();
487        this.comment.setValue(value);
488      }
489      return this;
490    }
491
492      protected void listChildren(List<Property> childrenList) {
493        super.listChildren(childrenList);
494        childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this appointment response 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.", 0, java.lang.Integer.MAX_VALUE, identifier));
495        childrenList.add(new Property("appointment", "Reference(Appointment)", "Appointment that this response is replying to.", 0, java.lang.Integer.MAX_VALUE, appointment));
496        childrenList.add(new Property("start", "instant", "Date/Time that the appointment is to take place, or requested new start time.", 0, java.lang.Integer.MAX_VALUE, start));
497        childrenList.add(new Property("end", "instant", "This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time.", 0, java.lang.Integer.MAX_VALUE, end));
498        childrenList.add(new Property("participantType", "CodeableConcept", "Role of participant in the appointment.", 0, java.lang.Integer.MAX_VALUE, participantType));
499        childrenList.add(new Property("actor", "Reference(Patient|Practitioner|RelatedPerson|Device|HealthcareService|Location)", "A Person, Location/HealthcareService or Device that is participating in the appointment.", 0, java.lang.Integer.MAX_VALUE, actor));
500        childrenList.add(new Property("participantStatus", "code", "Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty.", 0, java.lang.Integer.MAX_VALUE, participantStatus));
501        childrenList.add(new Property("comment", "string", "Additional comments about the appointment.", 0, java.lang.Integer.MAX_VALUE, comment));
502      }
503
504      @Override
505      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
506        switch (hash) {
507        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
508        case -1474995297: /*appointment*/ return this.appointment == null ? new Base[0] : new Base[] {this.appointment}; // Reference
509        case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // InstantType
510        case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // InstantType
511        case 841294093: /*participantType*/ return this.participantType == null ? new Base[0] : this.participantType.toArray(new Base[this.participantType.size()]); // CodeableConcept
512        case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference
513        case 996096261: /*participantStatus*/ return this.participantStatus == null ? new Base[0] : new Base[] {this.participantStatus}; // CodeType
514        case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType
515        default: return super.getProperty(hash, name, checkValid);
516        }
517
518      }
519
520      @Override
521      public void setProperty(int hash, String name, Base value) throws FHIRException {
522        switch (hash) {
523        case -1618432855: // identifier
524          this.getIdentifier().add(castToIdentifier(value)); // Identifier
525          break;
526        case -1474995297: // appointment
527          this.appointment = castToReference(value); // Reference
528          break;
529        case 109757538: // start
530          this.start = castToInstant(value); // InstantType
531          break;
532        case 100571: // end
533          this.end = castToInstant(value); // InstantType
534          break;
535        case 841294093: // participantType
536          this.getParticipantType().add(castToCodeableConcept(value)); // CodeableConcept
537          break;
538        case 92645877: // actor
539          this.actor = castToReference(value); // Reference
540          break;
541        case 996096261: // participantStatus
542          this.participantStatus = castToCode(value); // CodeType
543          break;
544        case 950398559: // comment
545          this.comment = castToString(value); // StringType
546          break;
547        default: super.setProperty(hash, name, value);
548        }
549
550      }
551
552      @Override
553      public void setProperty(String name, Base value) throws FHIRException {
554        if (name.equals("identifier"))
555          this.getIdentifier().add(castToIdentifier(value));
556        else if (name.equals("appointment"))
557          this.appointment = castToReference(value); // Reference
558        else if (name.equals("start"))
559          this.start = castToInstant(value); // InstantType
560        else if (name.equals("end"))
561          this.end = castToInstant(value); // InstantType
562        else if (name.equals("participantType"))
563          this.getParticipantType().add(castToCodeableConcept(value));
564        else if (name.equals("actor"))
565          this.actor = castToReference(value); // Reference
566        else if (name.equals("participantStatus"))
567          this.participantStatus = castToCode(value); // CodeType
568        else if (name.equals("comment"))
569          this.comment = castToString(value); // StringType
570        else
571          super.setProperty(name, value);
572      }
573
574      @Override
575      public Base makeProperty(int hash, String name) throws FHIRException {
576        switch (hash) {
577        case -1618432855:  return addIdentifier(); // Identifier
578        case -1474995297:  return getAppointment(); // Reference
579        case 109757538: throw new FHIRException("Cannot make property start as it is not a complex type"); // InstantType
580        case 100571: throw new FHIRException("Cannot make property end as it is not a complex type"); // InstantType
581        case 841294093:  return addParticipantType(); // CodeableConcept
582        case 92645877:  return getActor(); // Reference
583        case 996096261: throw new FHIRException("Cannot make property participantStatus as it is not a complex type"); // CodeType
584        case 950398559: throw new FHIRException("Cannot make property comment as it is not a complex type"); // StringType
585        default: return super.makeProperty(hash, name);
586        }
587
588      }
589
590      @Override
591      public Base addChild(String name) throws FHIRException {
592        if (name.equals("identifier")) {
593          return addIdentifier();
594        }
595        else if (name.equals("appointment")) {
596          this.appointment = new Reference();
597          return this.appointment;
598        }
599        else if (name.equals("start")) {
600          throw new FHIRException("Cannot call addChild on a primitive type AppointmentResponse.start");
601        }
602        else if (name.equals("end")) {
603          throw new FHIRException("Cannot call addChild on a primitive type AppointmentResponse.end");
604        }
605        else if (name.equals("participantType")) {
606          return addParticipantType();
607        }
608        else if (name.equals("actor")) {
609          this.actor = new Reference();
610          return this.actor;
611        }
612        else if (name.equals("participantStatus")) {
613          throw new FHIRException("Cannot call addChild on a primitive type AppointmentResponse.participantStatus");
614        }
615        else if (name.equals("comment")) {
616          throw new FHIRException("Cannot call addChild on a primitive type AppointmentResponse.comment");
617        }
618        else
619          return super.addChild(name);
620      }
621
622  public String fhirType() {
623    return "AppointmentResponse";
624
625  }
626
627      public AppointmentResponse copy() {
628        AppointmentResponse dst = new AppointmentResponse();
629        copyValues(dst);
630        if (identifier != null) {
631          dst.identifier = new ArrayList<Identifier>();
632          for (Identifier i : identifier)
633            dst.identifier.add(i.copy());
634        };
635        dst.appointment = appointment == null ? null : appointment.copy();
636        dst.start = start == null ? null : start.copy();
637        dst.end = end == null ? null : end.copy();
638        if (participantType != null) {
639          dst.participantType = new ArrayList<CodeableConcept>();
640          for (CodeableConcept i : participantType)
641            dst.participantType.add(i.copy());
642        };
643        dst.actor = actor == null ? null : actor.copy();
644        dst.participantStatus = participantStatus == null ? null : participantStatus.copy();
645        dst.comment = comment == null ? null : comment.copy();
646        return dst;
647      }
648
649      protected AppointmentResponse typedCopy() {
650        return copy();
651      }
652
653      @Override
654      public boolean equalsDeep(Base other) {
655        if (!super.equalsDeep(other))
656          return false;
657        if (!(other instanceof AppointmentResponse))
658          return false;
659        AppointmentResponse o = (AppointmentResponse) other;
660        return compareDeep(identifier, o.identifier, true) && compareDeep(appointment, o.appointment, true)
661           && compareDeep(start, o.start, true) && compareDeep(end, o.end, true) && compareDeep(participantType, o.participantType, true)
662           && compareDeep(actor, o.actor, true) && compareDeep(participantStatus, o.participantStatus, true)
663           && compareDeep(comment, o.comment, true);
664      }
665
666      @Override
667      public boolean equalsShallow(Base other) {
668        if (!super.equalsShallow(other))
669          return false;
670        if (!(other instanceof AppointmentResponse))
671          return false;
672        AppointmentResponse o = (AppointmentResponse) other;
673        return compareValues(start, o.start, true) && compareValues(end, o.end, true) && compareValues(participantStatus, o.participantStatus, true)
674           && compareValues(comment, o.comment, true);
675      }
676
677      public boolean isEmpty() {
678        return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (appointment == null || appointment.isEmpty())
679           && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) && (participantType == null || participantType.isEmpty())
680           && (actor == null || actor.isEmpty()) && (participantStatus == null || participantStatus.isEmpty())
681           && (comment == null || comment.isEmpty());
682      }
683
684  @Override
685  public ResourceType getResourceType() {
686    return ResourceType.AppointmentResponse;
687   }
688
689 /**
690   * Search parameter: <b>patient</b>
691   * <p>
692   * Description: <b>This Response is for this Patient</b><br>
693   * Type: <b>reference</b><br>
694   * Path: <b>AppointmentResponse.actor</b><br>
695   * </p>
696   */
697  @SearchParamDefinition(name="patient", path="AppointmentResponse.actor", description="This Response is for this Patient", type="reference" )
698  public static final String SP_PATIENT = "patient";
699 /**
700   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
701   * <p>
702   * Description: <b>This Response is for this Patient</b><br>
703   * Type: <b>reference</b><br>
704   * Path: <b>AppointmentResponse.actor</b><br>
705   * </p>
706   */
707  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
708
709/**
710   * Constant for fluent queries to be used to add include statements. Specifies
711   * the path value of "<b>AppointmentResponse:patient</b>".
712   */
713  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("AppointmentResponse:patient").toLocked();
714
715 /**
716   * Search parameter: <b>practitioner</b>
717   * <p>
718   * Description: <b>This Response is for this Practitioner</b><br>
719   * Type: <b>reference</b><br>
720   * Path: <b>AppointmentResponse.actor</b><br>
721   * </p>
722   */
723  @SearchParamDefinition(name="practitioner", path="AppointmentResponse.actor", description="This Response is for this Practitioner", type="reference" )
724  public static final String SP_PRACTITIONER = "practitioner";
725 /**
726   * <b>Fluent Client</b> search parameter constant for <b>practitioner</b>
727   * <p>
728   * Description: <b>This Response is for this Practitioner</b><br>
729   * Type: <b>reference</b><br>
730   * Path: <b>AppointmentResponse.actor</b><br>
731   * </p>
732   */
733  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRACTITIONER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRACTITIONER);
734
735/**
736   * Constant for fluent queries to be used to add include statements. Specifies
737   * the path value of "<b>AppointmentResponse:practitioner</b>".
738   */
739  public static final ca.uhn.fhir.model.api.Include INCLUDE_PRACTITIONER = new ca.uhn.fhir.model.api.Include("AppointmentResponse:practitioner").toLocked();
740
741 /**
742   * Search parameter: <b>location</b>
743   * <p>
744   * Description: <b>This Response is for this Location</b><br>
745   * Type: <b>reference</b><br>
746   * Path: <b>AppointmentResponse.actor</b><br>
747   * </p>
748   */
749  @SearchParamDefinition(name="location", path="AppointmentResponse.actor", description="This Response is for this Location", type="reference" )
750  public static final String SP_LOCATION = "location";
751 /**
752   * <b>Fluent Client</b> search parameter constant for <b>location</b>
753   * <p>
754   * Description: <b>This Response is for this Location</b><br>
755   * Type: <b>reference</b><br>
756   * Path: <b>AppointmentResponse.actor</b><br>
757   * </p>
758   */
759  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION);
760
761/**
762   * Constant for fluent queries to be used to add include statements. Specifies
763   * the path value of "<b>AppointmentResponse:location</b>".
764   */
765  public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("AppointmentResponse:location").toLocked();
766
767 /**
768   * Search parameter: <b>part-status</b>
769   * <p>
770   * Description: <b>The participants acceptance status for this appointment</b><br>
771   * Type: <b>token</b><br>
772   * Path: <b>AppointmentResponse.participantStatus</b><br>
773   * </p>
774   */
775  @SearchParamDefinition(name="part-status", path="AppointmentResponse.participantStatus", description="The participants acceptance status for this appointment", type="token" )
776  public static final String SP_PART_STATUS = "part-status";
777 /**
778   * <b>Fluent Client</b> search parameter constant for <b>part-status</b>
779   * <p>
780   * Description: <b>The participants acceptance status for this appointment</b><br>
781   * Type: <b>token</b><br>
782   * Path: <b>AppointmentResponse.participantStatus</b><br>
783   * </p>
784   */
785  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PART_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PART_STATUS);
786
787 /**
788   * Search parameter: <b>actor</b>
789   * <p>
790   * Description: <b>The Person, Location/HealthcareService or Device that this appointment response replies for</b><br>
791   * Type: <b>reference</b><br>
792   * Path: <b>AppointmentResponse.actor</b><br>
793   * </p>
794   */
795  @SearchParamDefinition(name="actor", path="AppointmentResponse.actor", description="The Person, Location/HealthcareService or Device that this appointment response replies for", type="reference" )
796  public static final String SP_ACTOR = "actor";
797 /**
798   * <b>Fluent Client</b> search parameter constant for <b>actor</b>
799   * <p>
800   * Description: <b>The Person, Location/HealthcareService or Device that this appointment response replies for</b><br>
801   * Type: <b>reference</b><br>
802   * Path: <b>AppointmentResponse.actor</b><br>
803   * </p>
804   */
805  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ACTOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ACTOR);
806
807/**
808   * Constant for fluent queries to be used to add include statements. Specifies
809   * the path value of "<b>AppointmentResponse:actor</b>".
810   */
811  public static final ca.uhn.fhir.model.api.Include INCLUDE_ACTOR = new ca.uhn.fhir.model.api.Include("AppointmentResponse:actor").toLocked();
812
813 /**
814   * Search parameter: <b>identifier</b>
815   * <p>
816   * Description: <b>An Identifier in this appointment response</b><br>
817   * Type: <b>token</b><br>
818   * Path: <b>AppointmentResponse.identifier</b><br>
819   * </p>
820   */
821  @SearchParamDefinition(name="identifier", path="AppointmentResponse.identifier", description="An Identifier in this appointment response", type="token" )
822  public static final String SP_IDENTIFIER = "identifier";
823 /**
824   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
825   * <p>
826   * Description: <b>An Identifier in this appointment response</b><br>
827   * Type: <b>token</b><br>
828   * Path: <b>AppointmentResponse.identifier</b><br>
829   * </p>
830   */
831  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
832
833 /**
834   * Search parameter: <b>appointment</b>
835   * <p>
836   * Description: <b>The appointment that the response is attached to</b><br>
837   * Type: <b>reference</b><br>
838   * Path: <b>AppointmentResponse.appointment</b><br>
839   * </p>
840   */
841  @SearchParamDefinition(name="appointment", path="AppointmentResponse.appointment", description="The appointment that the response is attached to", type="reference" )
842  public static final String SP_APPOINTMENT = "appointment";
843 /**
844   * <b>Fluent Client</b> search parameter constant for <b>appointment</b>
845   * <p>
846   * Description: <b>The appointment that the response is attached to</b><br>
847   * Type: <b>reference</b><br>
848   * Path: <b>AppointmentResponse.appointment</b><br>
849   * </p>
850   */
851  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam APPOINTMENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_APPOINTMENT);
852
853/**
854   * Constant for fluent queries to be used to add include statements. Specifies
855   * the path value of "<b>AppointmentResponse:appointment</b>".
856   */
857  public static final ca.uhn.fhir.model.api.Include INCLUDE_APPOINTMENT = new ca.uhn.fhir.model.api.Include("AppointmentResponse:appointment").toLocked();
858
859
860}