001package org.hl7.fhir.r5.model;
002
003
004/*
005 * #%L
006 * org.hl7.fhir.r5
007 * %%
008 * Copyright (C) 2014 - 2019 Health Level 7
009 * %%
010 * Licensed under the Apache License, Version 2.0 (the \"License\");
011 * you may not use this file except in compliance with the License.
012 * You may obtain a copy of the License at
013 * 
014 *      http://www.apache.org/licenses/LICENSE-2.0
015 * 
016 * Unless required by applicable law or agreed to in writing, software
017 * distributed under the License is distributed on an \"AS IS\" BASIS,
018 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
019 * See the License for the specific language governing permissions and
020 * limitations under the License.
021 * #L%
022 */
023
024/*
025  Copyright (c) 2011+, HL7, Inc.
026  All rights reserved.
027  
028  Redistribution and use in source and binary forms, with or without modification, \
029  are permitted provided that the following conditions are met:
030  
031   * Redistributions of source code must retain the above copyright notice, this \
032     list of conditions and the following disclaimer.
033   * Redistributions in binary form must reproduce the above copyright notice, \
034     this list of conditions and the following disclaimer in the documentation \
035     and/or other materials provided with the distribution.
036   * Neither the name of HL7 nor the names of its contributors may be used to 
037     endorse or promote products derived from this software without specific 
038     prior written permission.
039  
040  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
041  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
042  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
043  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
044  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
045  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
046  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
047  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
048  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
049  POSSIBILITY OF SUCH DAMAGE.
050  */
051
052// Generated on Tue, Dec 31, 2019 12:12+1100 for FHIR vcurrent
053
054import java.util.ArrayList;
055import java.util.Date;
056import java.util.List;
057import org.hl7.fhir.utilities.Utilities;
058import org.hl7.fhir.r5.model.Enumerations.*;
059import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
060import org.hl7.fhir.exceptions.FHIRException;
061import org.hl7.fhir.instance.model.api.ICompositeType;
062import ca.uhn.fhir.model.api.annotation.ResourceDef;
063import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
064import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
065import ca.uhn.fhir.model.api.annotation.Child;
066import ca.uhn.fhir.model.api.annotation.ChildOrder;
067import ca.uhn.fhir.model.api.annotation.Description;
068import ca.uhn.fhir.model.api.annotation.Block;
069
070/**
071 * An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency communication to a provider/reporter in response to a case report for a reportable condition.
072 */
073@ResourceDef(name="Communication", profile="http://hl7.org/fhir/StructureDefinition/Communication")
074public class Communication extends DomainResource {
075
076    @Block()
077    public static class CommunicationPayloadComponent extends BackboneElement implements IBaseBackboneElement {
078        /**
079         * A communicated content (or for multi-part communications, one portion of the communication).
080         */
081        @Child(name = "content", type = {Attachment.class, Reference.class, CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
082        @Description(shortDefinition="Message part content", formalDefinition="A communicated content (or for multi-part communications, one portion of the communication)." )
083        protected DataType content;
084
085        private static final long serialVersionUID = -1954179063L;
086
087    /**
088     * Constructor
089     */
090      public CommunicationPayloadComponent() {
091        super();
092      }
093
094    /**
095     * Constructor
096     */
097      public CommunicationPayloadComponent(DataType content) {
098        super();
099        this.setContent(content);
100      }
101
102        /**
103         * @return {@link #content} (A communicated content (or for multi-part communications, one portion of the communication).)
104         */
105        public DataType getContent() { 
106          return this.content;
107        }
108
109        /**
110         * @return {@link #content} (A communicated content (or for multi-part communications, one portion of the communication).)
111         */
112        public Attachment getContentAttachment() throws FHIRException { 
113          if (this.content == null)
114            this.content = new Attachment();
115          if (!(this.content instanceof Attachment))
116            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered");
117          return (Attachment) this.content;
118        }
119
120        public boolean hasContentAttachment() { 
121          return this != null && this.content instanceof Attachment;
122        }
123
124        /**
125         * @return {@link #content} (A communicated content (or for multi-part communications, one portion of the communication).)
126         */
127        public Reference getContentReference() throws FHIRException { 
128          if (this.content == null)
129            this.content = new Reference();
130          if (!(this.content instanceof Reference))
131            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered");
132          return (Reference) this.content;
133        }
134
135        public boolean hasContentReference() { 
136          return this != null && this.content instanceof Reference;
137        }
138
139        /**
140         * @return {@link #content} (A communicated content (or for multi-part communications, one portion of the communication).)
141         */
142        public CodeableConcept getContentCodeableConcept() throws FHIRException { 
143          if (this.content == null)
144            this.content = new CodeableConcept();
145          if (!(this.content instanceof CodeableConcept))
146            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.content.getClass().getName()+" was encountered");
147          return (CodeableConcept) this.content;
148        }
149
150        public boolean hasContentCodeableConcept() { 
151          return this != null && this.content instanceof CodeableConcept;
152        }
153
154        public boolean hasContent() { 
155          return this.content != null && !this.content.isEmpty();
156        }
157
158        /**
159         * @param value {@link #content} (A communicated content (or for multi-part communications, one portion of the communication).)
160         */
161        public CommunicationPayloadComponent setContent(DataType value) { 
162          if (value != null && !(value instanceof Attachment || value instanceof Reference || value instanceof CodeableConcept))
163            throw new Error("Not the right type for Communication.payload.content[x]: "+value.fhirType());
164          this.content = value;
165          return this;
166        }
167
168        protected void listChildren(List<Property> children) {
169          super.listChildren(children);
170          children.add(new Property("content[x]", "Attachment|Reference(Any)|CodeableConcept", "A communicated content (or for multi-part communications, one portion of the communication).", 0, 1, content));
171        }
172
173        @Override
174        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
175          switch (_hash) {
176          case 264548711: /*content[x]*/  return new Property("content[x]", "Attachment|Reference(Any)|CodeableConcept", "A communicated content (or for multi-part communications, one portion of the communication).", 0, 1, content);
177          case 951530617: /*content*/  return new Property("content[x]", "Attachment|Reference(Any)|CodeableConcept", "A communicated content (or for multi-part communications, one portion of the communication).", 0, 1, content);
178          case -702028164: /*contentAttachment*/  return new Property("content[x]", "Attachment", "A communicated content (or for multi-part communications, one portion of the communication).", 0, 1, content);
179          case 1193747154: /*contentReference*/  return new Property("content[x]", "Reference(Any)", "A communicated content (or for multi-part communications, one portion of the communication).", 0, 1, content);
180          case 1554698728: /*contentCodeableConcept*/  return new Property("content[x]", "CodeableConcept", "A communicated content (or for multi-part communications, one portion of the communication).", 0, 1, content);
181          default: return super.getNamedProperty(_hash, _name, _checkValid);
182          }
183
184        }
185
186      @Override
187      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
188        switch (hash) {
189        case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // DataType
190        default: return super.getProperty(hash, name, checkValid);
191        }
192
193      }
194
195      @Override
196      public Base setProperty(int hash, String name, Base value) throws FHIRException {
197        switch (hash) {
198        case 951530617: // content
199          this.content = TypeConvertor.castToType(value); // DataType
200          return value;
201        default: return super.setProperty(hash, name, value);
202        }
203
204      }
205
206      @Override
207      public Base setProperty(String name, Base value) throws FHIRException {
208        if (name.equals("content[x]")) {
209          this.content = TypeConvertor.castToType(value); // DataType
210        } else
211          return super.setProperty(name, value);
212        return value;
213      }
214
215      @Override
216      public Base makeProperty(int hash, String name) throws FHIRException {
217        switch (hash) {
218        case 264548711:  return getContent();
219        case 951530617:  return getContent();
220        default: return super.makeProperty(hash, name);
221        }
222
223      }
224
225      @Override
226      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
227        switch (hash) {
228        case 951530617: /*content*/ return new String[] {"Attachment", "Reference", "CodeableConcept"};
229        default: return super.getTypesForProperty(hash, name);
230        }
231
232      }
233
234      @Override
235      public Base addChild(String name) throws FHIRException {
236        if (name.equals("contentAttachment")) {
237          this.content = new Attachment();
238          return this.content;
239        }
240        else if (name.equals("contentReference")) {
241          this.content = new Reference();
242          return this.content;
243        }
244        else if (name.equals("contentCodeableConcept")) {
245          this.content = new CodeableConcept();
246          return this.content;
247        }
248        else
249          return super.addChild(name);
250      }
251
252      public CommunicationPayloadComponent copy() {
253        CommunicationPayloadComponent dst = new CommunicationPayloadComponent();
254        copyValues(dst);
255        return dst;
256      }
257
258      public void copyValues(CommunicationPayloadComponent dst) {
259        super.copyValues(dst);
260        dst.content = content == null ? null : content.copy();
261      }
262
263      @Override
264      public boolean equalsDeep(Base other_) {
265        if (!super.equalsDeep(other_))
266          return false;
267        if (!(other_ instanceof CommunicationPayloadComponent))
268          return false;
269        CommunicationPayloadComponent o = (CommunicationPayloadComponent) other_;
270        return compareDeep(content, o.content, true);
271      }
272
273      @Override
274      public boolean equalsShallow(Base other_) {
275        if (!super.equalsShallow(other_))
276          return false;
277        if (!(other_ instanceof CommunicationPayloadComponent))
278          return false;
279        CommunicationPayloadComponent o = (CommunicationPayloadComponent) other_;
280        return true;
281      }
282
283      public boolean isEmpty() {
284        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(content);
285      }
286
287  public String fhirType() {
288    return "Communication.payload";
289
290  }
291
292  }
293
294    /**
295     * Business identifiers assigned to this communication by the performer or other systems which remain constant as the resource is updated and propagates from server to server.
296     */
297    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
298    @Description(shortDefinition="Unique identifier", formalDefinition="Business identifiers assigned to this communication by the performer or other systems which remain constant as the resource is updated and propagates from server to server." )
299    protected List<Identifier> identifier;
300
301    /**
302     * The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.
303     */
304    @Child(name = "instantiatesCanonical", type = {CanonicalType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
305    @Description(shortDefinition="Instantiates FHIR protocol or definition", formalDefinition="The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication." )
306    protected List<CanonicalType> instantiatesCanonical;
307
308    /**
309     * The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.
310     */
311    @Child(name = "instantiatesUri", type = {UriType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
312    @Description(shortDefinition="Instantiates external protocol or definition", formalDefinition="The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication." )
313    protected List<UriType> instantiatesUri;
314
315    /**
316     * An order, proposal or plan fulfilled in whole or in part by this Communication.
317     */
318    @Child(name = "basedOn", type = {Reference.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
319    @Description(shortDefinition="Request fulfilled by this communication", formalDefinition="An order, proposal or plan fulfilled in whole or in part by this Communication." )
320    protected List<Reference> basedOn;
321
322    /**
323     * A larger event (e.g. Communication, Procedure) of which this particular communication is a component or step.
324     */
325    @Child(name = "partOf", type = {Reference.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
326    @Description(shortDefinition="Part of referenced event (e.g. Communication, Procedure)", formalDefinition="A larger event (e.g. Communication, Procedure) of which this particular communication is a component or step." )
327    protected List<Reference> partOf;
328
329    /**
330     * Prior communication that this communication is in response to.
331     */
332    @Child(name = "inResponseTo", type = {Communication.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
333    @Description(shortDefinition="Reply to", formalDefinition="Prior communication that this communication is in response to." )
334    protected List<Reference> inResponseTo;
335
336    /**
337     * The status of the transmission.
338     */
339    @Child(name = "status", type = {CodeType.class}, order=6, min=1, max=1, modifier=true, summary=true)
340    @Description(shortDefinition="preparation | in-progress | not-done | on-hold | stopped | completed | entered-in-error | unknown", formalDefinition="The status of the transmission." )
341    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/event-status")
342    protected Enumeration<EventStatus> status;
343
344    /**
345     * Captures the reason for the current state of the Communication.
346     */
347    @Child(name = "statusReason", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=true)
348    @Description(shortDefinition="Reason for current status", formalDefinition="Captures the reason for the current state of the Communication." )
349    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/communication-not-done-reason")
350    protected CodeableConcept statusReason;
351
352    /**
353     * The type of message conveyed such as alert, notification, reminder, instruction, etc.
354     */
355    @Child(name = "category", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
356    @Description(shortDefinition="Message category", formalDefinition="The type of message conveyed such as alert, notification, reminder, instruction, etc." )
357    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/communication-category")
358    protected List<CodeableConcept> category;
359
360    /**
361     * Characterizes how quickly the planned or in progress communication must be addressed. Includes concepts such as stat, urgent, routine.
362     */
363    @Child(name = "priority", type = {CodeType.class}, order=9, min=0, max=1, modifier=false, summary=true)
364    @Description(shortDefinition="routine | urgent | asap | stat", formalDefinition="Characterizes how quickly the planned or in progress communication must be addressed. Includes concepts such as stat, urgent, routine." )
365    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/request-priority")
366    protected Enumeration<RequestPriority> priority;
367
368    /**
369     * A channel that was used for this communication (e.g. email, fax).
370     */
371    @Child(name = "medium", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
372    @Description(shortDefinition="A channel of communication", formalDefinition="A channel that was used for this communication (e.g. email, fax)." )
373    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://terminology.hl7.org/ValueSet/v3-ParticipationMode")
374    protected List<CodeableConcept> medium;
375
376    /**
377     * The patient or group that was the focus of this communication.
378     */
379    @Child(name = "subject", type = {Patient.class, Group.class}, order=11, min=0, max=1, modifier=false, summary=true)
380    @Description(shortDefinition="Focus of message", formalDefinition="The patient or group that was the focus of this communication." )
381    protected Reference subject;
382
383    /**
384     * Description of the purpose/content, similar to a subject line in an email.
385     */
386    @Child(name = "topic", type = {CodeableConcept.class}, order=12, min=0, max=1, modifier=false, summary=false)
387    @Description(shortDefinition="Description of the purpose/content", formalDefinition="Description of the purpose/content, similar to a subject line in an email." )
388    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/communication-topic")
389    protected CodeableConcept topic;
390
391    /**
392     * Other resources that pertain to this communication and to which this communication should be associated.
393     */
394    @Child(name = "about", type = {Reference.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
395    @Description(shortDefinition="Resources that pertain to this communication", formalDefinition="Other resources that pertain to this communication and to which this communication should be associated." )
396    protected List<Reference> about;
397
398    /**
399     * The Encounter during which this Communication was created or to which the creation of this record is tightly associated.
400     */
401    @Child(name = "encounter", type = {Encounter.class}, order=14, min=0, max=1, modifier=false, summary=true)
402    @Description(shortDefinition="The Encounter during which this Communication was created", formalDefinition="The Encounter during which this Communication was created or to which the creation of this record is tightly associated." )
403    protected Reference encounter;
404
405    /**
406     * The time when this communication was sent.
407     */
408    @Child(name = "sent", type = {DateTimeType.class}, order=15, min=0, max=1, modifier=false, summary=false)
409    @Description(shortDefinition="When sent", formalDefinition="The time when this communication was sent." )
410    protected DateTimeType sent;
411
412    /**
413     * The time when this communication arrived at the destination.
414     */
415    @Child(name = "received", type = {DateTimeType.class}, order=16, min=0, max=1, modifier=false, summary=false)
416    @Description(shortDefinition="When received", formalDefinition="The time when this communication arrived at the destination." )
417    protected DateTimeType received;
418
419    /**
420     * The entity (e.g. person, organization, clinical information system, care team or device) which is the target of the communication.
421     */
422    @Child(name = "recipient", type = {CareTeam.class, Device.class, Group.class, HealthcareService.class, Location.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class, Endpoint.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
423    @Description(shortDefinition="Who the information is shared with", formalDefinition="The entity (e.g. person, organization, clinical information system, care team or device) which is the target of the communication." )
424    protected List<Reference> recipient;
425
426    /**
427     * The entity (e.g. person, organization, clinical information system, or device) which is the source of the communication.
428     */
429    @Child(name = "sender", type = {Device.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class, HealthcareService.class, Endpoint.class}, order=18, min=0, max=1, modifier=false, summary=false)
430    @Description(shortDefinition="Who shares the information", formalDefinition="The entity (e.g. person, organization, clinical information system, or device) which is the source of the communication." )
431    protected Reference sender;
432
433    /**
434     * The reason or justification for the communication.
435     */
436    @Child(name = "reason", type = {CodeableReference.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
437    @Description(shortDefinition="Indication for message", formalDefinition="The reason or justification for the communication." )
438    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/clinical-findings")
439    protected List<CodeableReference> reason;
440
441    /**
442     * Text, attachment(s), or resource(s) that was communicated to the recipient.
443     */
444    @Child(name = "payload", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
445    @Description(shortDefinition="Message payload", formalDefinition="Text, attachment(s), or resource(s) that was communicated to the recipient." )
446    protected List<CommunicationPayloadComponent> payload;
447
448    /**
449     * Additional notes or commentary about the communication by the sender, receiver or other interested parties.
450     */
451    @Child(name = "note", type = {Annotation.class}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
452    @Description(shortDefinition="Comments made about the communication", formalDefinition="Additional notes or commentary about the communication by the sender, receiver or other interested parties." )
453    protected List<Annotation> note;
454
455    private static final long serialVersionUID = 1848181185L;
456
457  /**
458   * Constructor
459   */
460    public Communication() {
461      super();
462    }
463
464  /**
465   * Constructor
466   */
467    public Communication(EventStatus status) {
468      super();
469      this.setStatus(status);
470    }
471
472    /**
473     * @return {@link #identifier} (Business identifiers assigned to this communication by the performer or other systems which remain constant as the resource is updated and propagates from server to server.)
474     */
475    public List<Identifier> getIdentifier() { 
476      if (this.identifier == null)
477        this.identifier = new ArrayList<Identifier>();
478      return this.identifier;
479    }
480
481    /**
482     * @return Returns a reference to <code>this</code> for easy method chaining
483     */
484    public Communication setIdentifier(List<Identifier> theIdentifier) { 
485      this.identifier = theIdentifier;
486      return this;
487    }
488
489    public boolean hasIdentifier() { 
490      if (this.identifier == null)
491        return false;
492      for (Identifier item : this.identifier)
493        if (!item.isEmpty())
494          return true;
495      return false;
496    }
497
498    public Identifier addIdentifier() { //3
499      Identifier t = new Identifier();
500      if (this.identifier == null)
501        this.identifier = new ArrayList<Identifier>();
502      this.identifier.add(t);
503      return t;
504    }
505
506    public Communication addIdentifier(Identifier t) { //3
507      if (t == null)
508        return this;
509      if (this.identifier == null)
510        this.identifier = new ArrayList<Identifier>();
511      this.identifier.add(t);
512      return this;
513    }
514
515    /**
516     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
517     */
518    public Identifier getIdentifierFirstRep() { 
519      if (getIdentifier().isEmpty()) {
520        addIdentifier();
521      }
522      return getIdentifier().get(0);
523    }
524
525    /**
526     * @return {@link #instantiatesCanonical} (The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.)
527     */
528    public List<CanonicalType> getInstantiatesCanonical() { 
529      if (this.instantiatesCanonical == null)
530        this.instantiatesCanonical = new ArrayList<CanonicalType>();
531      return this.instantiatesCanonical;
532    }
533
534    /**
535     * @return Returns a reference to <code>this</code> for easy method chaining
536     */
537    public Communication setInstantiatesCanonical(List<CanonicalType> theInstantiatesCanonical) { 
538      this.instantiatesCanonical = theInstantiatesCanonical;
539      return this;
540    }
541
542    public boolean hasInstantiatesCanonical() { 
543      if (this.instantiatesCanonical == null)
544        return false;
545      for (CanonicalType item : this.instantiatesCanonical)
546        if (!item.isEmpty())
547          return true;
548      return false;
549    }
550
551    /**
552     * @return {@link #instantiatesCanonical} (The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.)
553     */
554    public CanonicalType addInstantiatesCanonicalElement() {//2 
555      CanonicalType t = new CanonicalType();
556      if (this.instantiatesCanonical == null)
557        this.instantiatesCanonical = new ArrayList<CanonicalType>();
558      this.instantiatesCanonical.add(t);
559      return t;
560    }
561
562    /**
563     * @param value {@link #instantiatesCanonical} (The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.)
564     */
565    public Communication addInstantiatesCanonical(String value) { //1
566      CanonicalType t = new CanonicalType();
567      t.setValue(value);
568      if (this.instantiatesCanonical == null)
569        this.instantiatesCanonical = new ArrayList<CanonicalType>();
570      this.instantiatesCanonical.add(t);
571      return this;
572    }
573
574    /**
575     * @param value {@link #instantiatesCanonical} (The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.)
576     */
577    public boolean hasInstantiatesCanonical(String value) { 
578      if (this.instantiatesCanonical == null)
579        return false;
580      for (CanonicalType v : this.instantiatesCanonical)
581        if (v.getValue().equals(value)) // canonical
582          return true;
583      return false;
584    }
585
586    /**
587     * @return {@link #instantiatesUri} (The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.)
588     */
589    public List<UriType> getInstantiatesUri() { 
590      if (this.instantiatesUri == null)
591        this.instantiatesUri = new ArrayList<UriType>();
592      return this.instantiatesUri;
593    }
594
595    /**
596     * @return Returns a reference to <code>this</code> for easy method chaining
597     */
598    public Communication setInstantiatesUri(List<UriType> theInstantiatesUri) { 
599      this.instantiatesUri = theInstantiatesUri;
600      return this;
601    }
602
603    public boolean hasInstantiatesUri() { 
604      if (this.instantiatesUri == null)
605        return false;
606      for (UriType item : this.instantiatesUri)
607        if (!item.isEmpty())
608          return true;
609      return false;
610    }
611
612    /**
613     * @return {@link #instantiatesUri} (The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.)
614     */
615    public UriType addInstantiatesUriElement() {//2 
616      UriType t = new UriType();
617      if (this.instantiatesUri == null)
618        this.instantiatesUri = new ArrayList<UriType>();
619      this.instantiatesUri.add(t);
620      return t;
621    }
622
623    /**
624     * @param value {@link #instantiatesUri} (The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.)
625     */
626    public Communication addInstantiatesUri(String value) { //1
627      UriType t = new UriType();
628      t.setValue(value);
629      if (this.instantiatesUri == null)
630        this.instantiatesUri = new ArrayList<UriType>();
631      this.instantiatesUri.add(t);
632      return this;
633    }
634
635    /**
636     * @param value {@link #instantiatesUri} (The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.)
637     */
638    public boolean hasInstantiatesUri(String value) { 
639      if (this.instantiatesUri == null)
640        return false;
641      for (UriType v : this.instantiatesUri)
642        if (v.getValue().equals(value)) // uri
643          return true;
644      return false;
645    }
646
647    /**
648     * @return {@link #basedOn} (An order, proposal or plan fulfilled in whole or in part by this Communication.)
649     */
650    public List<Reference> getBasedOn() { 
651      if (this.basedOn == null)
652        this.basedOn = new ArrayList<Reference>();
653      return this.basedOn;
654    }
655
656    /**
657     * @return Returns a reference to <code>this</code> for easy method chaining
658     */
659    public Communication setBasedOn(List<Reference> theBasedOn) { 
660      this.basedOn = theBasedOn;
661      return this;
662    }
663
664    public boolean hasBasedOn() { 
665      if (this.basedOn == null)
666        return false;
667      for (Reference item : this.basedOn)
668        if (!item.isEmpty())
669          return true;
670      return false;
671    }
672
673    public Reference addBasedOn() { //3
674      Reference t = new Reference();
675      if (this.basedOn == null)
676        this.basedOn = new ArrayList<Reference>();
677      this.basedOn.add(t);
678      return t;
679    }
680
681    public Communication addBasedOn(Reference t) { //3
682      if (t == null)
683        return this;
684      if (this.basedOn == null)
685        this.basedOn = new ArrayList<Reference>();
686      this.basedOn.add(t);
687      return this;
688    }
689
690    /**
691     * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist {3}
692     */
693    public Reference getBasedOnFirstRep() { 
694      if (getBasedOn().isEmpty()) {
695        addBasedOn();
696      }
697      return getBasedOn().get(0);
698    }
699
700    /**
701     * @return {@link #partOf} (A larger event (e.g. Communication, Procedure) of which this particular communication is a component or step.)
702     */
703    public List<Reference> getPartOf() { 
704      if (this.partOf == null)
705        this.partOf = new ArrayList<Reference>();
706      return this.partOf;
707    }
708
709    /**
710     * @return Returns a reference to <code>this</code> for easy method chaining
711     */
712    public Communication setPartOf(List<Reference> thePartOf) { 
713      this.partOf = thePartOf;
714      return this;
715    }
716
717    public boolean hasPartOf() { 
718      if (this.partOf == null)
719        return false;
720      for (Reference item : this.partOf)
721        if (!item.isEmpty())
722          return true;
723      return false;
724    }
725
726    public Reference addPartOf() { //3
727      Reference t = new Reference();
728      if (this.partOf == null)
729        this.partOf = new ArrayList<Reference>();
730      this.partOf.add(t);
731      return t;
732    }
733
734    public Communication addPartOf(Reference t) { //3
735      if (t == null)
736        return this;
737      if (this.partOf == null)
738        this.partOf = new ArrayList<Reference>();
739      this.partOf.add(t);
740      return this;
741    }
742
743    /**
744     * @return The first repetition of repeating field {@link #partOf}, creating it if it does not already exist {3}
745     */
746    public Reference getPartOfFirstRep() { 
747      if (getPartOf().isEmpty()) {
748        addPartOf();
749      }
750      return getPartOf().get(0);
751    }
752
753    /**
754     * @return {@link #inResponseTo} (Prior communication that this communication is in response to.)
755     */
756    public List<Reference> getInResponseTo() { 
757      if (this.inResponseTo == null)
758        this.inResponseTo = new ArrayList<Reference>();
759      return this.inResponseTo;
760    }
761
762    /**
763     * @return Returns a reference to <code>this</code> for easy method chaining
764     */
765    public Communication setInResponseTo(List<Reference> theInResponseTo) { 
766      this.inResponseTo = theInResponseTo;
767      return this;
768    }
769
770    public boolean hasInResponseTo() { 
771      if (this.inResponseTo == null)
772        return false;
773      for (Reference item : this.inResponseTo)
774        if (!item.isEmpty())
775          return true;
776      return false;
777    }
778
779    public Reference addInResponseTo() { //3
780      Reference t = new Reference();
781      if (this.inResponseTo == null)
782        this.inResponseTo = new ArrayList<Reference>();
783      this.inResponseTo.add(t);
784      return t;
785    }
786
787    public Communication addInResponseTo(Reference t) { //3
788      if (t == null)
789        return this;
790      if (this.inResponseTo == null)
791        this.inResponseTo = new ArrayList<Reference>();
792      this.inResponseTo.add(t);
793      return this;
794    }
795
796    /**
797     * @return The first repetition of repeating field {@link #inResponseTo}, creating it if it does not already exist {3}
798     */
799    public Reference getInResponseToFirstRep() { 
800      if (getInResponseTo().isEmpty()) {
801        addInResponseTo();
802      }
803      return getInResponseTo().get(0);
804    }
805
806    /**
807     * @return {@link #status} (The status of the transmission.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
808     */
809    public Enumeration<EventStatus> getStatusElement() { 
810      if (this.status == null)
811        if (Configuration.errorOnAutoCreate())
812          throw new Error("Attempt to auto-create Communication.status");
813        else if (Configuration.doAutoCreate())
814          this.status = new Enumeration<EventStatus>(new EventStatusEnumFactory()); // bb
815      return this.status;
816    }
817
818    public boolean hasStatusElement() { 
819      return this.status != null && !this.status.isEmpty();
820    }
821
822    public boolean hasStatus() { 
823      return this.status != null && !this.status.isEmpty();
824    }
825
826    /**
827     * @param value {@link #status} (The status of the transmission.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
828     */
829    public Communication setStatusElement(Enumeration<EventStatus> value) { 
830      this.status = value;
831      return this;
832    }
833
834    /**
835     * @return The status of the transmission.
836     */
837    public EventStatus getStatus() { 
838      return this.status == null ? null : this.status.getValue();
839    }
840
841    /**
842     * @param value The status of the transmission.
843     */
844    public Communication setStatus(EventStatus value) { 
845        if (this.status == null)
846          this.status = new Enumeration<EventStatus>(new EventStatusEnumFactory());
847        this.status.setValue(value);
848      return this;
849    }
850
851    /**
852     * @return {@link #statusReason} (Captures the reason for the current state of the Communication.)
853     */
854    public CodeableConcept getStatusReason() { 
855      if (this.statusReason == null)
856        if (Configuration.errorOnAutoCreate())
857          throw new Error("Attempt to auto-create Communication.statusReason");
858        else if (Configuration.doAutoCreate())
859          this.statusReason = new CodeableConcept(); // cc
860      return this.statusReason;
861    }
862
863    public boolean hasStatusReason() { 
864      return this.statusReason != null && !this.statusReason.isEmpty();
865    }
866
867    /**
868     * @param value {@link #statusReason} (Captures the reason for the current state of the Communication.)
869     */
870    public Communication setStatusReason(CodeableConcept value) { 
871      this.statusReason = value;
872      return this;
873    }
874
875    /**
876     * @return {@link #category} (The type of message conveyed such as alert, notification, reminder, instruction, etc.)
877     */
878    public List<CodeableConcept> getCategory() { 
879      if (this.category == null)
880        this.category = new ArrayList<CodeableConcept>();
881      return this.category;
882    }
883
884    /**
885     * @return Returns a reference to <code>this</code> for easy method chaining
886     */
887    public Communication setCategory(List<CodeableConcept> theCategory) { 
888      this.category = theCategory;
889      return this;
890    }
891
892    public boolean hasCategory() { 
893      if (this.category == null)
894        return false;
895      for (CodeableConcept item : this.category)
896        if (!item.isEmpty())
897          return true;
898      return false;
899    }
900
901    public CodeableConcept addCategory() { //3
902      CodeableConcept t = new CodeableConcept();
903      if (this.category == null)
904        this.category = new ArrayList<CodeableConcept>();
905      this.category.add(t);
906      return t;
907    }
908
909    public Communication addCategory(CodeableConcept t) { //3
910      if (t == null)
911        return this;
912      if (this.category == null)
913        this.category = new ArrayList<CodeableConcept>();
914      this.category.add(t);
915      return this;
916    }
917
918    /**
919     * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist {3}
920     */
921    public CodeableConcept getCategoryFirstRep() { 
922      if (getCategory().isEmpty()) {
923        addCategory();
924      }
925      return getCategory().get(0);
926    }
927
928    /**
929     * @return {@link #priority} (Characterizes how quickly the planned or in progress communication must be addressed. Includes concepts such as stat, urgent, routine.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value
930     */
931    public Enumeration<RequestPriority> getPriorityElement() { 
932      if (this.priority == null)
933        if (Configuration.errorOnAutoCreate())
934          throw new Error("Attempt to auto-create Communication.priority");
935        else if (Configuration.doAutoCreate())
936          this.priority = new Enumeration<RequestPriority>(new RequestPriorityEnumFactory()); // bb
937      return this.priority;
938    }
939
940    public boolean hasPriorityElement() { 
941      return this.priority != null && !this.priority.isEmpty();
942    }
943
944    public boolean hasPriority() { 
945      return this.priority != null && !this.priority.isEmpty();
946    }
947
948    /**
949     * @param value {@link #priority} (Characterizes how quickly the planned or in progress communication must be addressed. Includes concepts such as stat, urgent, routine.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value
950     */
951    public Communication setPriorityElement(Enumeration<RequestPriority> value) { 
952      this.priority = value;
953      return this;
954    }
955
956    /**
957     * @return Characterizes how quickly the planned or in progress communication must be addressed. Includes concepts such as stat, urgent, routine.
958     */
959    public RequestPriority getPriority() { 
960      return this.priority == null ? null : this.priority.getValue();
961    }
962
963    /**
964     * @param value Characterizes how quickly the planned or in progress communication must be addressed. Includes concepts such as stat, urgent, routine.
965     */
966    public Communication setPriority(RequestPriority value) { 
967      if (value == null)
968        this.priority = null;
969      else {
970        if (this.priority == null)
971          this.priority = new Enumeration<RequestPriority>(new RequestPriorityEnumFactory());
972        this.priority.setValue(value);
973      }
974      return this;
975    }
976
977    /**
978     * @return {@link #medium} (A channel that was used for this communication (e.g. email, fax).)
979     */
980    public List<CodeableConcept> getMedium() { 
981      if (this.medium == null)
982        this.medium = new ArrayList<CodeableConcept>();
983      return this.medium;
984    }
985
986    /**
987     * @return Returns a reference to <code>this</code> for easy method chaining
988     */
989    public Communication setMedium(List<CodeableConcept> theMedium) { 
990      this.medium = theMedium;
991      return this;
992    }
993
994    public boolean hasMedium() { 
995      if (this.medium == null)
996        return false;
997      for (CodeableConcept item : this.medium)
998        if (!item.isEmpty())
999          return true;
1000      return false;
1001    }
1002
1003    public CodeableConcept addMedium() { //3
1004      CodeableConcept t = new CodeableConcept();
1005      if (this.medium == null)
1006        this.medium = new ArrayList<CodeableConcept>();
1007      this.medium.add(t);
1008      return t;
1009    }
1010
1011    public Communication addMedium(CodeableConcept t) { //3
1012      if (t == null)
1013        return this;
1014      if (this.medium == null)
1015        this.medium = new ArrayList<CodeableConcept>();
1016      this.medium.add(t);
1017      return this;
1018    }
1019
1020    /**
1021     * @return The first repetition of repeating field {@link #medium}, creating it if it does not already exist {3}
1022     */
1023    public CodeableConcept getMediumFirstRep() { 
1024      if (getMedium().isEmpty()) {
1025        addMedium();
1026      }
1027      return getMedium().get(0);
1028    }
1029
1030    /**
1031     * @return {@link #subject} (The patient or group that was the focus of this communication.)
1032     */
1033    public Reference getSubject() { 
1034      if (this.subject == null)
1035        if (Configuration.errorOnAutoCreate())
1036          throw new Error("Attempt to auto-create Communication.subject");
1037        else if (Configuration.doAutoCreate())
1038          this.subject = new Reference(); // cc
1039      return this.subject;
1040    }
1041
1042    public boolean hasSubject() { 
1043      return this.subject != null && !this.subject.isEmpty();
1044    }
1045
1046    /**
1047     * @param value {@link #subject} (The patient or group that was the focus of this communication.)
1048     */
1049    public Communication setSubject(Reference value) { 
1050      this.subject = value;
1051      return this;
1052    }
1053
1054    /**
1055     * @return {@link #topic} (Description of the purpose/content, similar to a subject line in an email.)
1056     */
1057    public CodeableConcept getTopic() { 
1058      if (this.topic == null)
1059        if (Configuration.errorOnAutoCreate())
1060          throw new Error("Attempt to auto-create Communication.topic");
1061        else if (Configuration.doAutoCreate())
1062          this.topic = new CodeableConcept(); // cc
1063      return this.topic;
1064    }
1065
1066    public boolean hasTopic() { 
1067      return this.topic != null && !this.topic.isEmpty();
1068    }
1069
1070    /**
1071     * @param value {@link #topic} (Description of the purpose/content, similar to a subject line in an email.)
1072     */
1073    public Communication setTopic(CodeableConcept value) { 
1074      this.topic = value;
1075      return this;
1076    }
1077
1078    /**
1079     * @return {@link #about} (Other resources that pertain to this communication and to which this communication should be associated.)
1080     */
1081    public List<Reference> getAbout() { 
1082      if (this.about == null)
1083        this.about = new ArrayList<Reference>();
1084      return this.about;
1085    }
1086
1087    /**
1088     * @return Returns a reference to <code>this</code> for easy method chaining
1089     */
1090    public Communication setAbout(List<Reference> theAbout) { 
1091      this.about = theAbout;
1092      return this;
1093    }
1094
1095    public boolean hasAbout() { 
1096      if (this.about == null)
1097        return false;
1098      for (Reference item : this.about)
1099        if (!item.isEmpty())
1100          return true;
1101      return false;
1102    }
1103
1104    public Reference addAbout() { //3
1105      Reference t = new Reference();
1106      if (this.about == null)
1107        this.about = new ArrayList<Reference>();
1108      this.about.add(t);
1109      return t;
1110    }
1111
1112    public Communication addAbout(Reference t) { //3
1113      if (t == null)
1114        return this;
1115      if (this.about == null)
1116        this.about = new ArrayList<Reference>();
1117      this.about.add(t);
1118      return this;
1119    }
1120
1121    /**
1122     * @return The first repetition of repeating field {@link #about}, creating it if it does not already exist {3}
1123     */
1124    public Reference getAboutFirstRep() { 
1125      if (getAbout().isEmpty()) {
1126        addAbout();
1127      }
1128      return getAbout().get(0);
1129    }
1130
1131    /**
1132     * @return {@link #encounter} (The Encounter during which this Communication was created or to which the creation of this record is tightly associated.)
1133     */
1134    public Reference getEncounter() { 
1135      if (this.encounter == null)
1136        if (Configuration.errorOnAutoCreate())
1137          throw new Error("Attempt to auto-create Communication.encounter");
1138        else if (Configuration.doAutoCreate())
1139          this.encounter = new Reference(); // cc
1140      return this.encounter;
1141    }
1142
1143    public boolean hasEncounter() { 
1144      return this.encounter != null && !this.encounter.isEmpty();
1145    }
1146
1147    /**
1148     * @param value {@link #encounter} (The Encounter during which this Communication was created or to which the creation of this record is tightly associated.)
1149     */
1150    public Communication setEncounter(Reference value) { 
1151      this.encounter = value;
1152      return this;
1153    }
1154
1155    /**
1156     * @return {@link #sent} (The time when this communication was sent.). This is the underlying object with id, value and extensions. The accessor "getSent" gives direct access to the value
1157     */
1158    public DateTimeType getSentElement() { 
1159      if (this.sent == null)
1160        if (Configuration.errorOnAutoCreate())
1161          throw new Error("Attempt to auto-create Communication.sent");
1162        else if (Configuration.doAutoCreate())
1163          this.sent = new DateTimeType(); // bb
1164      return this.sent;
1165    }
1166
1167    public boolean hasSentElement() { 
1168      return this.sent != null && !this.sent.isEmpty();
1169    }
1170
1171    public boolean hasSent() { 
1172      return this.sent != null && !this.sent.isEmpty();
1173    }
1174
1175    /**
1176     * @param value {@link #sent} (The time when this communication was sent.). This is the underlying object with id, value and extensions. The accessor "getSent" gives direct access to the value
1177     */
1178    public Communication setSentElement(DateTimeType value) { 
1179      this.sent = value;
1180      return this;
1181    }
1182
1183    /**
1184     * @return The time when this communication was sent.
1185     */
1186    public Date getSent() { 
1187      return this.sent == null ? null : this.sent.getValue();
1188    }
1189
1190    /**
1191     * @param value The time when this communication was sent.
1192     */
1193    public Communication setSent(Date value) { 
1194      if (value == null)
1195        this.sent = null;
1196      else {
1197        if (this.sent == null)
1198          this.sent = new DateTimeType();
1199        this.sent.setValue(value);
1200      }
1201      return this;
1202    }
1203
1204    /**
1205     * @return {@link #received} (The time when this communication arrived at the destination.). This is the underlying object with id, value and extensions. The accessor "getReceived" gives direct access to the value
1206     */
1207    public DateTimeType getReceivedElement() { 
1208      if (this.received == null)
1209        if (Configuration.errorOnAutoCreate())
1210          throw new Error("Attempt to auto-create Communication.received");
1211        else if (Configuration.doAutoCreate())
1212          this.received = new DateTimeType(); // bb
1213      return this.received;
1214    }
1215
1216    public boolean hasReceivedElement() { 
1217      return this.received != null && !this.received.isEmpty();
1218    }
1219
1220    public boolean hasReceived() { 
1221      return this.received != null && !this.received.isEmpty();
1222    }
1223
1224    /**
1225     * @param value {@link #received} (The time when this communication arrived at the destination.). This is the underlying object with id, value and extensions. The accessor "getReceived" gives direct access to the value
1226     */
1227    public Communication setReceivedElement(DateTimeType value) { 
1228      this.received = value;
1229      return this;
1230    }
1231
1232    /**
1233     * @return The time when this communication arrived at the destination.
1234     */
1235    public Date getReceived() { 
1236      return this.received == null ? null : this.received.getValue();
1237    }
1238
1239    /**
1240     * @param value The time when this communication arrived at the destination.
1241     */
1242    public Communication setReceived(Date value) { 
1243      if (value == null)
1244        this.received = null;
1245      else {
1246        if (this.received == null)
1247          this.received = new DateTimeType();
1248        this.received.setValue(value);
1249      }
1250      return this;
1251    }
1252
1253    /**
1254     * @return {@link #recipient} (The entity (e.g. person, organization, clinical information system, care team or device) which is the target of the communication.)
1255     */
1256    public List<Reference> getRecipient() { 
1257      if (this.recipient == null)
1258        this.recipient = new ArrayList<Reference>();
1259      return this.recipient;
1260    }
1261
1262    /**
1263     * @return Returns a reference to <code>this</code> for easy method chaining
1264     */
1265    public Communication setRecipient(List<Reference> theRecipient) { 
1266      this.recipient = theRecipient;
1267      return this;
1268    }
1269
1270    public boolean hasRecipient() { 
1271      if (this.recipient == null)
1272        return false;
1273      for (Reference item : this.recipient)
1274        if (!item.isEmpty())
1275          return true;
1276      return false;
1277    }
1278
1279    public Reference addRecipient() { //3
1280      Reference t = new Reference();
1281      if (this.recipient == null)
1282        this.recipient = new ArrayList<Reference>();
1283      this.recipient.add(t);
1284      return t;
1285    }
1286
1287    public Communication addRecipient(Reference t) { //3
1288      if (t == null)
1289        return this;
1290      if (this.recipient == null)
1291        this.recipient = new ArrayList<Reference>();
1292      this.recipient.add(t);
1293      return this;
1294    }
1295
1296    /**
1297     * @return The first repetition of repeating field {@link #recipient}, creating it if it does not already exist {3}
1298     */
1299    public Reference getRecipientFirstRep() { 
1300      if (getRecipient().isEmpty()) {
1301        addRecipient();
1302      }
1303      return getRecipient().get(0);
1304    }
1305
1306    /**
1307     * @return {@link #sender} (The entity (e.g. person, organization, clinical information system, or device) which is the source of the communication.)
1308     */
1309    public Reference getSender() { 
1310      if (this.sender == null)
1311        if (Configuration.errorOnAutoCreate())
1312          throw new Error("Attempt to auto-create Communication.sender");
1313        else if (Configuration.doAutoCreate())
1314          this.sender = new Reference(); // cc
1315      return this.sender;
1316    }
1317
1318    public boolean hasSender() { 
1319      return this.sender != null && !this.sender.isEmpty();
1320    }
1321
1322    /**
1323     * @param value {@link #sender} (The entity (e.g. person, organization, clinical information system, or device) which is the source of the communication.)
1324     */
1325    public Communication setSender(Reference value) { 
1326      this.sender = value;
1327      return this;
1328    }
1329
1330    /**
1331     * @return {@link #reason} (The reason or justification for the communication.)
1332     */
1333    public List<CodeableReference> getReason() { 
1334      if (this.reason == null)
1335        this.reason = new ArrayList<CodeableReference>();
1336      return this.reason;
1337    }
1338
1339    /**
1340     * @return Returns a reference to <code>this</code> for easy method chaining
1341     */
1342    public Communication setReason(List<CodeableReference> theReason) { 
1343      this.reason = theReason;
1344      return this;
1345    }
1346
1347    public boolean hasReason() { 
1348      if (this.reason == null)
1349        return false;
1350      for (CodeableReference item : this.reason)
1351        if (!item.isEmpty())
1352          return true;
1353      return false;
1354    }
1355
1356    public CodeableReference addReason() { //3
1357      CodeableReference t = new CodeableReference();
1358      if (this.reason == null)
1359        this.reason = new ArrayList<CodeableReference>();
1360      this.reason.add(t);
1361      return t;
1362    }
1363
1364    public Communication addReason(CodeableReference t) { //3
1365      if (t == null)
1366        return this;
1367      if (this.reason == null)
1368        this.reason = new ArrayList<CodeableReference>();
1369      this.reason.add(t);
1370      return this;
1371    }
1372
1373    /**
1374     * @return The first repetition of repeating field {@link #reason}, creating it if it does not already exist {3}
1375     */
1376    public CodeableReference getReasonFirstRep() { 
1377      if (getReason().isEmpty()) {
1378        addReason();
1379      }
1380      return getReason().get(0);
1381    }
1382
1383    /**
1384     * @return {@link #payload} (Text, attachment(s), or resource(s) that was communicated to the recipient.)
1385     */
1386    public List<CommunicationPayloadComponent> getPayload() { 
1387      if (this.payload == null)
1388        this.payload = new ArrayList<CommunicationPayloadComponent>();
1389      return this.payload;
1390    }
1391
1392    /**
1393     * @return Returns a reference to <code>this</code> for easy method chaining
1394     */
1395    public Communication setPayload(List<CommunicationPayloadComponent> thePayload) { 
1396      this.payload = thePayload;
1397      return this;
1398    }
1399
1400    public boolean hasPayload() { 
1401      if (this.payload == null)
1402        return false;
1403      for (CommunicationPayloadComponent item : this.payload)
1404        if (!item.isEmpty())
1405          return true;
1406      return false;
1407    }
1408
1409    public CommunicationPayloadComponent addPayload() { //3
1410      CommunicationPayloadComponent t = new CommunicationPayloadComponent();
1411      if (this.payload == null)
1412        this.payload = new ArrayList<CommunicationPayloadComponent>();
1413      this.payload.add(t);
1414      return t;
1415    }
1416
1417    public Communication addPayload(CommunicationPayloadComponent t) { //3
1418      if (t == null)
1419        return this;
1420      if (this.payload == null)
1421        this.payload = new ArrayList<CommunicationPayloadComponent>();
1422      this.payload.add(t);
1423      return this;
1424    }
1425
1426    /**
1427     * @return The first repetition of repeating field {@link #payload}, creating it if it does not already exist {3}
1428     */
1429    public CommunicationPayloadComponent getPayloadFirstRep() { 
1430      if (getPayload().isEmpty()) {
1431        addPayload();
1432      }
1433      return getPayload().get(0);
1434    }
1435
1436    /**
1437     * @return {@link #note} (Additional notes or commentary about the communication by the sender, receiver or other interested parties.)
1438     */
1439    public List<Annotation> getNote() { 
1440      if (this.note == null)
1441        this.note = new ArrayList<Annotation>();
1442      return this.note;
1443    }
1444
1445    /**
1446     * @return Returns a reference to <code>this</code> for easy method chaining
1447     */
1448    public Communication setNote(List<Annotation> theNote) { 
1449      this.note = theNote;
1450      return this;
1451    }
1452
1453    public boolean hasNote() { 
1454      if (this.note == null)
1455        return false;
1456      for (Annotation item : this.note)
1457        if (!item.isEmpty())
1458          return true;
1459      return false;
1460    }
1461
1462    public Annotation addNote() { //3
1463      Annotation t = new Annotation();
1464      if (this.note == null)
1465        this.note = new ArrayList<Annotation>();
1466      this.note.add(t);
1467      return t;
1468    }
1469
1470    public Communication addNote(Annotation t) { //3
1471      if (t == null)
1472        return this;
1473      if (this.note == null)
1474        this.note = new ArrayList<Annotation>();
1475      this.note.add(t);
1476      return this;
1477    }
1478
1479    /**
1480     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
1481     */
1482    public Annotation getNoteFirstRep() { 
1483      if (getNote().isEmpty()) {
1484        addNote();
1485      }
1486      return getNote().get(0);
1487    }
1488
1489      protected void listChildren(List<Property> children) {
1490        super.listChildren(children);
1491        children.add(new Property("identifier", "Identifier", "Business identifiers assigned to this communication by the performer or other systems which remain constant as the resource is updated and propagates from server to server.", 0, java.lang.Integer.MAX_VALUE, identifier));
1492        children.add(new Property("instantiatesCanonical", "canonical(PlanDefinition|ActivityDefinition|Measure|OperationDefinition|Questionnaire)", "The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.", 0, java.lang.Integer.MAX_VALUE, instantiatesCanonical));
1493        children.add(new Property("instantiatesUri", "uri", "The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.", 0, java.lang.Integer.MAX_VALUE, instantiatesUri));
1494        children.add(new Property("basedOn", "Reference(Any)", "An order, proposal or plan fulfilled in whole or in part by this Communication.", 0, java.lang.Integer.MAX_VALUE, basedOn));
1495        children.add(new Property("partOf", "Reference(Any)", "A larger event (e.g. Communication, Procedure) of which this particular communication is a component or step.", 0, java.lang.Integer.MAX_VALUE, partOf));
1496        children.add(new Property("inResponseTo", "Reference(Communication)", "Prior communication that this communication is in response to.", 0, java.lang.Integer.MAX_VALUE, inResponseTo));
1497        children.add(new Property("status", "code", "The status of the transmission.", 0, 1, status));
1498        children.add(new Property("statusReason", "CodeableConcept", "Captures the reason for the current state of the Communication.", 0, 1, statusReason));
1499        children.add(new Property("category", "CodeableConcept", "The type of message conveyed such as alert, notification, reminder, instruction, etc.", 0, java.lang.Integer.MAX_VALUE, category));
1500        children.add(new Property("priority", "code", "Characterizes how quickly the planned or in progress communication must be addressed. Includes concepts such as stat, urgent, routine.", 0, 1, priority));
1501        children.add(new Property("medium", "CodeableConcept", "A channel that was used for this communication (e.g. email, fax).", 0, java.lang.Integer.MAX_VALUE, medium));
1502        children.add(new Property("subject", "Reference(Patient|Group)", "The patient or group that was the focus of this communication.", 0, 1, subject));
1503        children.add(new Property("topic", "CodeableConcept", "Description of the purpose/content, similar to a subject line in an email.", 0, 1, topic));
1504        children.add(new Property("about", "Reference(Any)", "Other resources that pertain to this communication and to which this communication should be associated.", 0, java.lang.Integer.MAX_VALUE, about));
1505        children.add(new Property("encounter", "Reference(Encounter)", "The Encounter during which this Communication was created or to which the creation of this record is tightly associated.", 0, 1, encounter));
1506        children.add(new Property("sent", "dateTime", "The time when this communication was sent.", 0, 1, sent));
1507        children.add(new Property("received", "dateTime", "The time when this communication arrived at the destination.", 0, 1, received));
1508        children.add(new Property("recipient", "Reference(CareTeam|Device|Group|HealthcareService|Location|Organization|Patient|Practitioner|PractitionerRole|RelatedPerson|Endpoint)", "The entity (e.g. person, organization, clinical information system, care team or device) which is the target of the communication.", 0, java.lang.Integer.MAX_VALUE, recipient));
1509        children.add(new Property("sender", "Reference(Device|Organization|Patient|Practitioner|PractitionerRole|RelatedPerson|HealthcareService|Endpoint)", "The entity (e.g. person, organization, clinical information system, or device) which is the source of the communication.", 0, 1, sender));
1510        children.add(new Property("reason", "CodeableReference(Any)", "The reason or justification for the communication.", 0, java.lang.Integer.MAX_VALUE, reason));
1511        children.add(new Property("payload", "", "Text, attachment(s), or resource(s) that was communicated to the recipient.", 0, java.lang.Integer.MAX_VALUE, payload));
1512        children.add(new Property("note", "Annotation", "Additional notes or commentary about the communication by the sender, receiver or other interested parties.", 0, java.lang.Integer.MAX_VALUE, note));
1513      }
1514
1515      @Override
1516      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1517        switch (_hash) {
1518        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Business identifiers assigned to this communication by the performer or other systems which remain constant as the resource is updated and propagates from server to server.", 0, java.lang.Integer.MAX_VALUE, identifier);
1519        case 8911915: /*instantiatesCanonical*/  return new Property("instantiatesCanonical", "canonical(PlanDefinition|ActivityDefinition|Measure|OperationDefinition|Questionnaire)", "The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.", 0, java.lang.Integer.MAX_VALUE, instantiatesCanonical);
1520        case -1926393373: /*instantiatesUri*/  return new Property("instantiatesUri", "uri", "The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.", 0, java.lang.Integer.MAX_VALUE, instantiatesUri);
1521        case -332612366: /*basedOn*/  return new Property("basedOn", "Reference(Any)", "An order, proposal or plan fulfilled in whole or in part by this Communication.", 0, java.lang.Integer.MAX_VALUE, basedOn);
1522        case -995410646: /*partOf*/  return new Property("partOf", "Reference(Any)", "A larger event (e.g. Communication, Procedure) of which this particular communication is a component or step.", 0, java.lang.Integer.MAX_VALUE, partOf);
1523        case 1932956065: /*inResponseTo*/  return new Property("inResponseTo", "Reference(Communication)", "Prior communication that this communication is in response to.", 0, java.lang.Integer.MAX_VALUE, inResponseTo);
1524        case -892481550: /*status*/  return new Property("status", "code", "The status of the transmission.", 0, 1, status);
1525        case 2051346646: /*statusReason*/  return new Property("statusReason", "CodeableConcept", "Captures the reason for the current state of the Communication.", 0, 1, statusReason);
1526        case 50511102: /*category*/  return new Property("category", "CodeableConcept", "The type of message conveyed such as alert, notification, reminder, instruction, etc.", 0, java.lang.Integer.MAX_VALUE, category);
1527        case -1165461084: /*priority*/  return new Property("priority", "code", "Characterizes how quickly the planned or in progress communication must be addressed. Includes concepts such as stat, urgent, routine.", 0, 1, priority);
1528        case -1078030475: /*medium*/  return new Property("medium", "CodeableConcept", "A channel that was used for this communication (e.g. email, fax).", 0, java.lang.Integer.MAX_VALUE, medium);
1529        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group)", "The patient or group that was the focus of this communication.", 0, 1, subject);
1530        case 110546223: /*topic*/  return new Property("topic", "CodeableConcept", "Description of the purpose/content, similar to a subject line in an email.", 0, 1, topic);
1531        case 92611469: /*about*/  return new Property("about", "Reference(Any)", "Other resources that pertain to this communication and to which this communication should be associated.", 0, java.lang.Integer.MAX_VALUE, about);
1532        case 1524132147: /*encounter*/  return new Property("encounter", "Reference(Encounter)", "The Encounter during which this Communication was created or to which the creation of this record is tightly associated.", 0, 1, encounter);
1533        case 3526552: /*sent*/  return new Property("sent", "dateTime", "The time when this communication was sent.", 0, 1, sent);
1534        case -808719903: /*received*/  return new Property("received", "dateTime", "The time when this communication arrived at the destination.", 0, 1, received);
1535        case 820081177: /*recipient*/  return new Property("recipient", "Reference(CareTeam|Device|Group|HealthcareService|Location|Organization|Patient|Practitioner|PractitionerRole|RelatedPerson|Endpoint)", "The entity (e.g. person, organization, clinical information system, care team or device) which is the target of the communication.", 0, java.lang.Integer.MAX_VALUE, recipient);
1536        case -905962955: /*sender*/  return new Property("sender", "Reference(Device|Organization|Patient|Practitioner|PractitionerRole|RelatedPerson|HealthcareService|Endpoint)", "The entity (e.g. person, organization, clinical information system, or device) which is the source of the communication.", 0, 1, sender);
1537        case -934964668: /*reason*/  return new Property("reason", "CodeableReference(Any)", "The reason or justification for the communication.", 0, java.lang.Integer.MAX_VALUE, reason);
1538        case -786701938: /*payload*/  return new Property("payload", "", "Text, attachment(s), or resource(s) that was communicated to the recipient.", 0, java.lang.Integer.MAX_VALUE, payload);
1539        case 3387378: /*note*/  return new Property("note", "Annotation", "Additional notes or commentary about the communication by the sender, receiver or other interested parties.", 0, java.lang.Integer.MAX_VALUE, note);
1540        default: return super.getNamedProperty(_hash, _name, _checkValid);
1541        }
1542
1543      }
1544
1545      @Override
1546      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1547        switch (hash) {
1548        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1549        case 8911915: /*instantiatesCanonical*/ return this.instantiatesCanonical == null ? new Base[0] : this.instantiatesCanonical.toArray(new Base[this.instantiatesCanonical.size()]); // CanonicalType
1550        case -1926393373: /*instantiatesUri*/ return this.instantiatesUri == null ? new Base[0] : this.instantiatesUri.toArray(new Base[this.instantiatesUri.size()]); // UriType
1551        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
1552        case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : this.partOf.toArray(new Base[this.partOf.size()]); // Reference
1553        case 1932956065: /*inResponseTo*/ return this.inResponseTo == null ? new Base[0] : this.inResponseTo.toArray(new Base[this.inResponseTo.size()]); // Reference
1554        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<EventStatus>
1555        case 2051346646: /*statusReason*/ return this.statusReason == null ? new Base[0] : new Base[] {this.statusReason}; // CodeableConcept
1556        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
1557        case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Enumeration<RequestPriority>
1558        case -1078030475: /*medium*/ return this.medium == null ? new Base[0] : this.medium.toArray(new Base[this.medium.size()]); // CodeableConcept
1559        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
1560        case 110546223: /*topic*/ return this.topic == null ? new Base[0] : new Base[] {this.topic}; // CodeableConcept
1561        case 92611469: /*about*/ return this.about == null ? new Base[0] : this.about.toArray(new Base[this.about.size()]); // Reference
1562        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference
1563        case 3526552: /*sent*/ return this.sent == null ? new Base[0] : new Base[] {this.sent}; // DateTimeType
1564        case -808719903: /*received*/ return this.received == null ? new Base[0] : new Base[] {this.received}; // DateTimeType
1565        case 820081177: /*recipient*/ return this.recipient == null ? new Base[0] : this.recipient.toArray(new Base[this.recipient.size()]); // Reference
1566        case -905962955: /*sender*/ return this.sender == null ? new Base[0] : new Base[] {this.sender}; // Reference
1567        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableReference
1568        case -786701938: /*payload*/ return this.payload == null ? new Base[0] : this.payload.toArray(new Base[this.payload.size()]); // CommunicationPayloadComponent
1569        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
1570        default: return super.getProperty(hash, name, checkValid);
1571        }
1572
1573      }
1574
1575      @Override
1576      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1577        switch (hash) {
1578        case -1618432855: // identifier
1579          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
1580          return value;
1581        case 8911915: // instantiatesCanonical
1582          this.getInstantiatesCanonical().add(TypeConvertor.castToCanonical(value)); // CanonicalType
1583          return value;
1584        case -1926393373: // instantiatesUri
1585          this.getInstantiatesUri().add(TypeConvertor.castToUri(value)); // UriType
1586          return value;
1587        case -332612366: // basedOn
1588          this.getBasedOn().add(TypeConvertor.castToReference(value)); // Reference
1589          return value;
1590        case -995410646: // partOf
1591          this.getPartOf().add(TypeConvertor.castToReference(value)); // Reference
1592          return value;
1593        case 1932956065: // inResponseTo
1594          this.getInResponseTo().add(TypeConvertor.castToReference(value)); // Reference
1595          return value;
1596        case -892481550: // status
1597          value = new EventStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
1598          this.status = (Enumeration) value; // Enumeration<EventStatus>
1599          return value;
1600        case 2051346646: // statusReason
1601          this.statusReason = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1602          return value;
1603        case 50511102: // category
1604          this.getCategory().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1605          return value;
1606        case -1165461084: // priority
1607          value = new RequestPriorityEnumFactory().fromType(TypeConvertor.castToCode(value));
1608          this.priority = (Enumeration) value; // Enumeration<RequestPriority>
1609          return value;
1610        case -1078030475: // medium
1611          this.getMedium().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1612          return value;
1613        case -1867885268: // subject
1614          this.subject = TypeConvertor.castToReference(value); // Reference
1615          return value;
1616        case 110546223: // topic
1617          this.topic = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1618          return value;
1619        case 92611469: // about
1620          this.getAbout().add(TypeConvertor.castToReference(value)); // Reference
1621          return value;
1622        case 1524132147: // encounter
1623          this.encounter = TypeConvertor.castToReference(value); // Reference
1624          return value;
1625        case 3526552: // sent
1626          this.sent = TypeConvertor.castToDateTime(value); // DateTimeType
1627          return value;
1628        case -808719903: // received
1629          this.received = TypeConvertor.castToDateTime(value); // DateTimeType
1630          return value;
1631        case 820081177: // recipient
1632          this.getRecipient().add(TypeConvertor.castToReference(value)); // Reference
1633          return value;
1634        case -905962955: // sender
1635          this.sender = TypeConvertor.castToReference(value); // Reference
1636          return value;
1637        case -934964668: // reason
1638          this.getReason().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference
1639          return value;
1640        case -786701938: // payload
1641          this.getPayload().add((CommunicationPayloadComponent) value); // CommunicationPayloadComponent
1642          return value;
1643        case 3387378: // note
1644          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
1645          return value;
1646        default: return super.setProperty(hash, name, value);
1647        }
1648
1649      }
1650
1651      @Override
1652      public Base setProperty(String name, Base value) throws FHIRException {
1653        if (name.equals("identifier")) {
1654          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
1655        } else if (name.equals("instantiatesCanonical")) {
1656          this.getInstantiatesCanonical().add(TypeConvertor.castToCanonical(value));
1657        } else if (name.equals("instantiatesUri")) {
1658          this.getInstantiatesUri().add(TypeConvertor.castToUri(value));
1659        } else if (name.equals("basedOn")) {
1660          this.getBasedOn().add(TypeConvertor.castToReference(value));
1661        } else if (name.equals("partOf")) {
1662          this.getPartOf().add(TypeConvertor.castToReference(value));
1663        } else if (name.equals("inResponseTo")) {
1664          this.getInResponseTo().add(TypeConvertor.castToReference(value));
1665        } else if (name.equals("status")) {
1666          value = new EventStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
1667          this.status = (Enumeration) value; // Enumeration<EventStatus>
1668        } else if (name.equals("statusReason")) {
1669          this.statusReason = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1670        } else if (name.equals("category")) {
1671          this.getCategory().add(TypeConvertor.castToCodeableConcept(value));
1672        } else if (name.equals("priority")) {
1673          value = new RequestPriorityEnumFactory().fromType(TypeConvertor.castToCode(value));
1674          this.priority = (Enumeration) value; // Enumeration<RequestPriority>
1675        } else if (name.equals("medium")) {
1676          this.getMedium().add(TypeConvertor.castToCodeableConcept(value));
1677        } else if (name.equals("subject")) {
1678          this.subject = TypeConvertor.castToReference(value); // Reference
1679        } else if (name.equals("topic")) {
1680          this.topic = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1681        } else if (name.equals("about")) {
1682          this.getAbout().add(TypeConvertor.castToReference(value));
1683        } else if (name.equals("encounter")) {
1684          this.encounter = TypeConvertor.castToReference(value); // Reference
1685        } else if (name.equals("sent")) {
1686          this.sent = TypeConvertor.castToDateTime(value); // DateTimeType
1687        } else if (name.equals("received")) {
1688          this.received = TypeConvertor.castToDateTime(value); // DateTimeType
1689        } else if (name.equals("recipient")) {
1690          this.getRecipient().add(TypeConvertor.castToReference(value));
1691        } else if (name.equals("sender")) {
1692          this.sender = TypeConvertor.castToReference(value); // Reference
1693        } else if (name.equals("reason")) {
1694          this.getReason().add(TypeConvertor.castToCodeableReference(value));
1695        } else if (name.equals("payload")) {
1696          this.getPayload().add((CommunicationPayloadComponent) value);
1697        } else if (name.equals("note")) {
1698          this.getNote().add(TypeConvertor.castToAnnotation(value));
1699        } else
1700          return super.setProperty(name, value);
1701        return value;
1702      }
1703
1704      @Override
1705      public Base makeProperty(int hash, String name) throws FHIRException {
1706        switch (hash) {
1707        case -1618432855:  return addIdentifier(); 
1708        case 8911915:  return addInstantiatesCanonicalElement();
1709        case -1926393373:  return addInstantiatesUriElement();
1710        case -332612366:  return addBasedOn(); 
1711        case -995410646:  return addPartOf(); 
1712        case 1932956065:  return addInResponseTo(); 
1713        case -892481550:  return getStatusElement();
1714        case 2051346646:  return getStatusReason();
1715        case 50511102:  return addCategory(); 
1716        case -1165461084:  return getPriorityElement();
1717        case -1078030475:  return addMedium(); 
1718        case -1867885268:  return getSubject();
1719        case 110546223:  return getTopic();
1720        case 92611469:  return addAbout(); 
1721        case 1524132147:  return getEncounter();
1722        case 3526552:  return getSentElement();
1723        case -808719903:  return getReceivedElement();
1724        case 820081177:  return addRecipient(); 
1725        case -905962955:  return getSender();
1726        case -934964668:  return addReason(); 
1727        case -786701938:  return addPayload(); 
1728        case 3387378:  return addNote(); 
1729        default: return super.makeProperty(hash, name);
1730        }
1731
1732      }
1733
1734      @Override
1735      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1736        switch (hash) {
1737        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1738        case 8911915: /*instantiatesCanonical*/ return new String[] {"canonical"};
1739        case -1926393373: /*instantiatesUri*/ return new String[] {"uri"};
1740        case -332612366: /*basedOn*/ return new String[] {"Reference"};
1741        case -995410646: /*partOf*/ return new String[] {"Reference"};
1742        case 1932956065: /*inResponseTo*/ return new String[] {"Reference"};
1743        case -892481550: /*status*/ return new String[] {"code"};
1744        case 2051346646: /*statusReason*/ return new String[] {"CodeableConcept"};
1745        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
1746        case -1165461084: /*priority*/ return new String[] {"code"};
1747        case -1078030475: /*medium*/ return new String[] {"CodeableConcept"};
1748        case -1867885268: /*subject*/ return new String[] {"Reference"};
1749        case 110546223: /*topic*/ return new String[] {"CodeableConcept"};
1750        case 92611469: /*about*/ return new String[] {"Reference"};
1751        case 1524132147: /*encounter*/ return new String[] {"Reference"};
1752        case 3526552: /*sent*/ return new String[] {"dateTime"};
1753        case -808719903: /*received*/ return new String[] {"dateTime"};
1754        case 820081177: /*recipient*/ return new String[] {"Reference"};
1755        case -905962955: /*sender*/ return new String[] {"Reference"};
1756        case -934964668: /*reason*/ return new String[] {"CodeableReference"};
1757        case -786701938: /*payload*/ return new String[] {};
1758        case 3387378: /*note*/ return new String[] {"Annotation"};
1759        default: return super.getTypesForProperty(hash, name);
1760        }
1761
1762      }
1763
1764      @Override
1765      public Base addChild(String name) throws FHIRException {
1766        if (name.equals("identifier")) {
1767          return addIdentifier();
1768        }
1769        else if (name.equals("instantiatesCanonical")) {
1770          throw new FHIRException("Cannot call addChild on a primitive type Communication.instantiatesCanonical");
1771        }
1772        else if (name.equals("instantiatesUri")) {
1773          throw new FHIRException("Cannot call addChild on a primitive type Communication.instantiatesUri");
1774        }
1775        else if (name.equals("basedOn")) {
1776          return addBasedOn();
1777        }
1778        else if (name.equals("partOf")) {
1779          return addPartOf();
1780        }
1781        else if (name.equals("inResponseTo")) {
1782          return addInResponseTo();
1783        }
1784        else if (name.equals("status")) {
1785          throw new FHIRException("Cannot call addChild on a primitive type Communication.status");
1786        }
1787        else if (name.equals("statusReason")) {
1788          this.statusReason = new CodeableConcept();
1789          return this.statusReason;
1790        }
1791        else if (name.equals("category")) {
1792          return addCategory();
1793        }
1794        else if (name.equals("priority")) {
1795          throw new FHIRException("Cannot call addChild on a primitive type Communication.priority");
1796        }
1797        else if (name.equals("medium")) {
1798          return addMedium();
1799        }
1800        else if (name.equals("subject")) {
1801          this.subject = new Reference();
1802          return this.subject;
1803        }
1804        else if (name.equals("topic")) {
1805          this.topic = new CodeableConcept();
1806          return this.topic;
1807        }
1808        else if (name.equals("about")) {
1809          return addAbout();
1810        }
1811        else if (name.equals("encounter")) {
1812          this.encounter = new Reference();
1813          return this.encounter;
1814        }
1815        else if (name.equals("sent")) {
1816          throw new FHIRException("Cannot call addChild on a primitive type Communication.sent");
1817        }
1818        else if (name.equals("received")) {
1819          throw new FHIRException("Cannot call addChild on a primitive type Communication.received");
1820        }
1821        else if (name.equals("recipient")) {
1822          return addRecipient();
1823        }
1824        else if (name.equals("sender")) {
1825          this.sender = new Reference();
1826          return this.sender;
1827        }
1828        else if (name.equals("reason")) {
1829          return addReason();
1830        }
1831        else if (name.equals("payload")) {
1832          return addPayload();
1833        }
1834        else if (name.equals("note")) {
1835          return addNote();
1836        }
1837        else
1838          return super.addChild(name);
1839      }
1840
1841  public String fhirType() {
1842    return "Communication";
1843
1844  }
1845
1846      public Communication copy() {
1847        Communication dst = new Communication();
1848        copyValues(dst);
1849        return dst;
1850      }
1851
1852      public void copyValues(Communication dst) {
1853        super.copyValues(dst);
1854        if (identifier != null) {
1855          dst.identifier = new ArrayList<Identifier>();
1856          for (Identifier i : identifier)
1857            dst.identifier.add(i.copy());
1858        };
1859        if (instantiatesCanonical != null) {
1860          dst.instantiatesCanonical = new ArrayList<CanonicalType>();
1861          for (CanonicalType i : instantiatesCanonical)
1862            dst.instantiatesCanonical.add(i.copy());
1863        };
1864        if (instantiatesUri != null) {
1865          dst.instantiatesUri = new ArrayList<UriType>();
1866          for (UriType i : instantiatesUri)
1867            dst.instantiatesUri.add(i.copy());
1868        };
1869        if (basedOn != null) {
1870          dst.basedOn = new ArrayList<Reference>();
1871          for (Reference i : basedOn)
1872            dst.basedOn.add(i.copy());
1873        };
1874        if (partOf != null) {
1875          dst.partOf = new ArrayList<Reference>();
1876          for (Reference i : partOf)
1877            dst.partOf.add(i.copy());
1878        };
1879        if (inResponseTo != null) {
1880          dst.inResponseTo = new ArrayList<Reference>();
1881          for (Reference i : inResponseTo)
1882            dst.inResponseTo.add(i.copy());
1883        };
1884        dst.status = status == null ? null : status.copy();
1885        dst.statusReason = statusReason == null ? null : statusReason.copy();
1886        if (category != null) {
1887          dst.category = new ArrayList<CodeableConcept>();
1888          for (CodeableConcept i : category)
1889            dst.category.add(i.copy());
1890        };
1891        dst.priority = priority == null ? null : priority.copy();
1892        if (medium != null) {
1893          dst.medium = new ArrayList<CodeableConcept>();
1894          for (CodeableConcept i : medium)
1895            dst.medium.add(i.copy());
1896        };
1897        dst.subject = subject == null ? null : subject.copy();
1898        dst.topic = topic == null ? null : topic.copy();
1899        if (about != null) {
1900          dst.about = new ArrayList<Reference>();
1901          for (Reference i : about)
1902            dst.about.add(i.copy());
1903        };
1904        dst.encounter = encounter == null ? null : encounter.copy();
1905        dst.sent = sent == null ? null : sent.copy();
1906        dst.received = received == null ? null : received.copy();
1907        if (recipient != null) {
1908          dst.recipient = new ArrayList<Reference>();
1909          for (Reference i : recipient)
1910            dst.recipient.add(i.copy());
1911        };
1912        dst.sender = sender == null ? null : sender.copy();
1913        if (reason != null) {
1914          dst.reason = new ArrayList<CodeableReference>();
1915          for (CodeableReference i : reason)
1916            dst.reason.add(i.copy());
1917        };
1918        if (payload != null) {
1919          dst.payload = new ArrayList<CommunicationPayloadComponent>();
1920          for (CommunicationPayloadComponent i : payload)
1921            dst.payload.add(i.copy());
1922        };
1923        if (note != null) {
1924          dst.note = new ArrayList<Annotation>();
1925          for (Annotation i : note)
1926            dst.note.add(i.copy());
1927        };
1928      }
1929
1930      protected Communication typedCopy() {
1931        return copy();
1932      }
1933
1934      @Override
1935      public boolean equalsDeep(Base other_) {
1936        if (!super.equalsDeep(other_))
1937          return false;
1938        if (!(other_ instanceof Communication))
1939          return false;
1940        Communication o = (Communication) other_;
1941        return compareDeep(identifier, o.identifier, true) && compareDeep(instantiatesCanonical, o.instantiatesCanonical, true)
1942           && compareDeep(instantiatesUri, o.instantiatesUri, true) && compareDeep(basedOn, o.basedOn, true)
1943           && compareDeep(partOf, o.partOf, true) && compareDeep(inResponseTo, o.inResponseTo, true) && compareDeep(status, o.status, true)
1944           && compareDeep(statusReason, o.statusReason, true) && compareDeep(category, o.category, true) && compareDeep(priority, o.priority, true)
1945           && compareDeep(medium, o.medium, true) && compareDeep(subject, o.subject, true) && compareDeep(topic, o.topic, true)
1946           && compareDeep(about, o.about, true) && compareDeep(encounter, o.encounter, true) && compareDeep(sent, o.sent, true)
1947           && compareDeep(received, o.received, true) && compareDeep(recipient, o.recipient, true) && compareDeep(sender, o.sender, true)
1948           && compareDeep(reason, o.reason, true) && compareDeep(payload, o.payload, true) && compareDeep(note, o.note, true)
1949          ;
1950      }
1951
1952      @Override
1953      public boolean equalsShallow(Base other_) {
1954        if (!super.equalsShallow(other_))
1955          return false;
1956        if (!(other_ instanceof Communication))
1957          return false;
1958        Communication o = (Communication) other_;
1959        return compareValues(instantiatesCanonical, o.instantiatesCanonical, true) && compareValues(instantiatesUri, o.instantiatesUri, true)
1960           && compareValues(status, o.status, true) && compareValues(priority, o.priority, true) && compareValues(sent, o.sent, true)
1961           && compareValues(received, o.received, true);
1962      }
1963
1964      public boolean isEmpty() {
1965        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, instantiatesCanonical
1966          , instantiatesUri, basedOn, partOf, inResponseTo, status, statusReason, category
1967          , priority, medium, subject, topic, about, encounter, sent, received, recipient
1968          , sender, reason, payload, note);
1969      }
1970
1971  @Override
1972  public ResourceType getResourceType() {
1973    return ResourceType.Communication;
1974   }
1975
1976 /**
1977   * Search parameter: <b>based-on</b>
1978   * <p>
1979   * Description: <b>Request fulfilled by this communication</b><br>
1980   * Type: <b>reference</b><br>
1981   * Path: <b>Communication.basedOn</b><br>
1982   * </p>
1983   */
1984  @SearchParamDefinition(name="based-on", path="Communication.basedOn", description="Request fulfilled by this communication", type="reference", target={Account.class, ActivityDefinition.class, AdministrableProductDefinition.class, AdverseEvent.class, AllergyIntolerance.class, Appointment.class, AppointmentResponse.class, AuditEvent.class, Basic.class, Binary.class, BiologicallyDerivedProduct.class, BodyStructure.class, Bundle.class, CapabilityStatement.class, CapabilityStatement2.class, CarePlan.class, CareTeam.class, CatalogEntry.class, ChargeItem.class, ChargeItemDefinition.class, Claim.class, ClaimResponse.class, ClinicalImpression.class, ClinicalUseIssue.class, CodeSystem.class, Communication.class, CommunicationRequest.class, CompartmentDefinition.class, Composition.class, ConceptMap.class, Condition.class, ConditionDefinition.class, Consent.class, Contract.class, Coverage.class, CoverageEligibilityRequest.class, CoverageEligibilityResponse.class, DetectedIssue.class, Device.class, DeviceDefinition.class, DeviceMetric.class, DeviceRequest.class, DeviceUseStatement.class, DiagnosticReport.class, DocumentManifest.class, DocumentReference.class, Encounter.class, Endpoint.class, EnrollmentRequest.class, EnrollmentResponse.class, EpisodeOfCare.class, EventDefinition.class, Evidence.class, EvidenceVariable.class, ExampleScenario.class, ExplanationOfBenefit.class, FamilyMemberHistory.class, Flag.class, Goal.class, GraphDefinition.class, Group.class, GuidanceResponse.class, HealthcareService.class, ImagingStudy.class, Immunization.class, ImmunizationEvaluation.class, ImmunizationRecommendation.class, ImplementationGuide.class, Ingredient.class, InsurancePlan.class, Invoice.class, Library.class, Linkage.class, ListResource.class, Location.class, ManufacturedItemDefinition.class, Measure.class, MeasureReport.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationUsage.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.class, NutritionIntake.class, NutritionOrder.class, Observation.class, ObservationDefinition.class, OperationDefinition.class, OperationOutcome.class, Organization.class, OrganizationAffiliation.class, PackagedProductDefinition.class, Patient.class, PaymentNotice.class, PaymentReconciliation.class, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestGroup.class, ResearchStudy.class, ResearchSubject.class, RiskAssessment.class, Schedule.class, SearchParameter.class, ServiceRequest.class, Slot.class, Specimen.class, SpecimenDefinition.class, StructureDefinition.class, StructureMap.class, Subscription.class, Substance.class, SubstanceDefinition.class, SubstanceNucleicAcid.class, SubstancePolymer.class, SubstanceProtein.class, SubstanceReferenceInformation.class, SubstanceSourceMaterial.class, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestReport.class, TestScript.class, Topic.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
1985  public static final String SP_BASED_ON = "based-on";
1986 /**
1987   * <b>Fluent Client</b> search parameter constant for <b>based-on</b>
1988   * <p>
1989   * Description: <b>Request fulfilled by this communication</b><br>
1990   * Type: <b>reference</b><br>
1991   * Path: <b>Communication.basedOn</b><br>
1992   * </p>
1993   */
1994  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASED_ON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BASED_ON);
1995
1996/**
1997   * Constant for fluent queries to be used to add include statements. Specifies
1998   * the path value of "<b>Communication:based-on</b>".
1999   */
2000  public static final ca.uhn.fhir.model.api.Include INCLUDE_BASED_ON = new ca.uhn.fhir.model.api.Include("Communication:based-on").toLocked();
2001
2002 /**
2003   * Search parameter: <b>category</b>
2004   * <p>
2005   * Description: <b>Message category</b><br>
2006   * Type: <b>token</b><br>
2007   * Path: <b>Communication.category</b><br>
2008   * </p>
2009   */
2010  @SearchParamDefinition(name="category", path="Communication.category", description="Message category", type="token" )
2011  public static final String SP_CATEGORY = "category";
2012 /**
2013   * <b>Fluent Client</b> search parameter constant for <b>category</b>
2014   * <p>
2015   * Description: <b>Message category</b><br>
2016   * Type: <b>token</b><br>
2017   * Path: <b>Communication.category</b><br>
2018   * </p>
2019   */
2020  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY);
2021
2022 /**
2023   * Search parameter: <b>encounter</b>
2024   * <p>
2025   * Description: <b>The Encounter during which this Communication was created</b><br>
2026   * Type: <b>reference</b><br>
2027   * Path: <b>Communication.encounter</b><br>
2028   * </p>
2029   */
2030  @SearchParamDefinition(name="encounter", path="Communication.encounter", description="The Encounter during which this Communication was created", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Encounter") }, target={Encounter.class } )
2031  public static final String SP_ENCOUNTER = "encounter";
2032 /**
2033   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
2034   * <p>
2035   * Description: <b>The Encounter during which this Communication was created</b><br>
2036   * Type: <b>reference</b><br>
2037   * Path: <b>Communication.encounter</b><br>
2038   * </p>
2039   */
2040  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER);
2041
2042/**
2043   * Constant for fluent queries to be used to add include statements. Specifies
2044   * the path value of "<b>Communication:encounter</b>".
2045   */
2046  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("Communication:encounter").toLocked();
2047
2048 /**
2049   * Search parameter: <b>identifier</b>
2050   * <p>
2051   * Description: <b>Unique identifier</b><br>
2052   * Type: <b>token</b><br>
2053   * Path: <b>Communication.identifier</b><br>
2054   * </p>
2055   */
2056  @SearchParamDefinition(name="identifier", path="Communication.identifier", description="Unique identifier", type="token" )
2057  public static final String SP_IDENTIFIER = "identifier";
2058 /**
2059   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2060   * <p>
2061   * Description: <b>Unique identifier</b><br>
2062   * Type: <b>token</b><br>
2063   * Path: <b>Communication.identifier</b><br>
2064   * </p>
2065   */
2066  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2067
2068 /**
2069   * Search parameter: <b>instantiates-canonical</b>
2070   * <p>
2071   * Description: <b>Instantiates FHIR protocol or definition</b><br>
2072   * Type: <b>reference</b><br>
2073   * Path: <b>Communication.instantiatesCanonical</b><br>
2074   * </p>
2075   */
2076  @SearchParamDefinition(name="instantiates-canonical", path="Communication.instantiatesCanonical", description="Instantiates FHIR protocol or definition", type="reference", target={ActivityDefinition.class, Measure.class, OperationDefinition.class, PlanDefinition.class, Questionnaire.class } )
2077  public static final String SP_INSTANTIATES_CANONICAL = "instantiates-canonical";
2078 /**
2079   * <b>Fluent Client</b> search parameter constant for <b>instantiates-canonical</b>
2080   * <p>
2081   * Description: <b>Instantiates FHIR protocol or definition</b><br>
2082   * Type: <b>reference</b><br>
2083   * Path: <b>Communication.instantiatesCanonical</b><br>
2084   * </p>
2085   */
2086  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INSTANTIATES_CANONICAL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INSTANTIATES_CANONICAL);
2087
2088/**
2089   * Constant for fluent queries to be used to add include statements. Specifies
2090   * the path value of "<b>Communication:instantiates-canonical</b>".
2091   */
2092  public static final ca.uhn.fhir.model.api.Include INCLUDE_INSTANTIATES_CANONICAL = new ca.uhn.fhir.model.api.Include("Communication:instantiates-canonical").toLocked();
2093
2094 /**
2095   * Search parameter: <b>instantiates-uri</b>
2096   * <p>
2097   * Description: <b>Instantiates external protocol or definition</b><br>
2098   * Type: <b>uri</b><br>
2099   * Path: <b>Communication.instantiatesUri</b><br>
2100   * </p>
2101   */
2102  @SearchParamDefinition(name="instantiates-uri", path="Communication.instantiatesUri", description="Instantiates external protocol or definition", type="uri" )
2103  public static final String SP_INSTANTIATES_URI = "instantiates-uri";
2104 /**
2105   * <b>Fluent Client</b> search parameter constant for <b>instantiates-uri</b>
2106   * <p>
2107   * Description: <b>Instantiates external protocol or definition</b><br>
2108   * Type: <b>uri</b><br>
2109   * Path: <b>Communication.instantiatesUri</b><br>
2110   * </p>
2111   */
2112  public static final ca.uhn.fhir.rest.gclient.UriClientParam INSTANTIATES_URI = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_INSTANTIATES_URI);
2113
2114 /**
2115   * Search parameter: <b>medium</b>
2116   * <p>
2117   * Description: <b>A channel of communication</b><br>
2118   * Type: <b>token</b><br>
2119   * Path: <b>Communication.medium</b><br>
2120   * </p>
2121   */
2122  @SearchParamDefinition(name="medium", path="Communication.medium", description="A channel of communication", type="token" )
2123  public static final String SP_MEDIUM = "medium";
2124 /**
2125   * <b>Fluent Client</b> search parameter constant for <b>medium</b>
2126   * <p>
2127   * Description: <b>A channel of communication</b><br>
2128   * Type: <b>token</b><br>
2129   * Path: <b>Communication.medium</b><br>
2130   * </p>
2131   */
2132  public static final ca.uhn.fhir.rest.gclient.TokenClientParam MEDIUM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_MEDIUM);
2133
2134 /**
2135   * Search parameter: <b>part-of</b>
2136   * <p>
2137   * Description: <b>Part of referenced event (e.g. Communication, Procedure)</b><br>
2138   * Type: <b>reference</b><br>
2139   * Path: <b>Communication.partOf</b><br>
2140   * </p>
2141   */
2142  @SearchParamDefinition(name="part-of", path="Communication.partOf", description="Part of referenced event (e.g. Communication, Procedure)", type="reference", target={Account.class, ActivityDefinition.class, AdministrableProductDefinition.class, AdverseEvent.class, AllergyIntolerance.class, Appointment.class, AppointmentResponse.class, AuditEvent.class, Basic.class, Binary.class, BiologicallyDerivedProduct.class, BodyStructure.class, Bundle.class, CapabilityStatement.class, CapabilityStatement2.class, CarePlan.class, CareTeam.class, CatalogEntry.class, ChargeItem.class, ChargeItemDefinition.class, Claim.class, ClaimResponse.class, ClinicalImpression.class, ClinicalUseIssue.class, CodeSystem.class, Communication.class, CommunicationRequest.class, CompartmentDefinition.class, Composition.class, ConceptMap.class, Condition.class, ConditionDefinition.class, Consent.class, Contract.class, Coverage.class, CoverageEligibilityRequest.class, CoverageEligibilityResponse.class, DetectedIssue.class, Device.class, DeviceDefinition.class, DeviceMetric.class, DeviceRequest.class, DeviceUseStatement.class, DiagnosticReport.class, DocumentManifest.class, DocumentReference.class, Encounter.class, Endpoint.class, EnrollmentRequest.class, EnrollmentResponse.class, EpisodeOfCare.class, EventDefinition.class, Evidence.class, EvidenceVariable.class, ExampleScenario.class, ExplanationOfBenefit.class, FamilyMemberHistory.class, Flag.class, Goal.class, GraphDefinition.class, Group.class, GuidanceResponse.class, HealthcareService.class, ImagingStudy.class, Immunization.class, ImmunizationEvaluation.class, ImmunizationRecommendation.class, ImplementationGuide.class, Ingredient.class, InsurancePlan.class, Invoice.class, Library.class, Linkage.class, ListResource.class, Location.class, ManufacturedItemDefinition.class, Measure.class, MeasureReport.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationUsage.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.class, NutritionIntake.class, NutritionOrder.class, Observation.class, ObservationDefinition.class, OperationDefinition.class, OperationOutcome.class, Organization.class, OrganizationAffiliation.class, PackagedProductDefinition.class, Patient.class, PaymentNotice.class, PaymentReconciliation.class, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestGroup.class, ResearchStudy.class, ResearchSubject.class, RiskAssessment.class, Schedule.class, SearchParameter.class, ServiceRequest.class, Slot.class, Specimen.class, SpecimenDefinition.class, StructureDefinition.class, StructureMap.class, Subscription.class, Substance.class, SubstanceDefinition.class, SubstanceNucleicAcid.class, SubstancePolymer.class, SubstanceProtein.class, SubstanceReferenceInformation.class, SubstanceSourceMaterial.class, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestReport.class, TestScript.class, Topic.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
2143  public static final String SP_PART_OF = "part-of";
2144 /**
2145   * <b>Fluent Client</b> search parameter constant for <b>part-of</b>
2146   * <p>
2147   * Description: <b>Part of referenced event (e.g. Communication, Procedure)</b><br>
2148   * Type: <b>reference</b><br>
2149   * Path: <b>Communication.partOf</b><br>
2150   * </p>
2151   */
2152  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PART_OF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PART_OF);
2153
2154/**
2155   * Constant for fluent queries to be used to add include statements. Specifies
2156   * the path value of "<b>Communication:part-of</b>".
2157   */
2158  public static final ca.uhn.fhir.model.api.Include INCLUDE_PART_OF = new ca.uhn.fhir.model.api.Include("Communication:part-of").toLocked();
2159
2160 /**
2161   * Search parameter: <b>patient</b>
2162   * <p>
2163   * Description: <b>Focus of message</b><br>
2164   * Type: <b>reference</b><br>
2165   * Path: <b>Communication.subject.where(resolve() is Patient)</b><br>
2166   * </p>
2167   */
2168  @SearchParamDefinition(name="patient", path="Communication.subject.where(resolve() is Patient)", description="Focus of message", type="reference", target={Patient.class } )
2169  public static final String SP_PATIENT = "patient";
2170 /**
2171   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2172   * <p>
2173   * Description: <b>Focus of message</b><br>
2174   * Type: <b>reference</b><br>
2175   * Path: <b>Communication.subject.where(resolve() is Patient)</b><br>
2176   * </p>
2177   */
2178  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
2179
2180/**
2181   * Constant for fluent queries to be used to add include statements. Specifies
2182   * the path value of "<b>Communication:patient</b>".
2183   */
2184  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Communication:patient").toLocked();
2185
2186 /**
2187   * Search parameter: <b>received</b>
2188   * <p>
2189   * Description: <b>When received</b><br>
2190   * Type: <b>date</b><br>
2191   * Path: <b>Communication.received</b><br>
2192   * </p>
2193   */
2194  @SearchParamDefinition(name="received", path="Communication.received", description="When received", type="date" )
2195  public static final String SP_RECEIVED = "received";
2196 /**
2197   * <b>Fluent Client</b> search parameter constant for <b>received</b>
2198   * <p>
2199   * Description: <b>When received</b><br>
2200   * Type: <b>date</b><br>
2201   * Path: <b>Communication.received</b><br>
2202   * </p>
2203   */
2204  public static final ca.uhn.fhir.rest.gclient.DateClientParam RECEIVED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_RECEIVED);
2205
2206 /**
2207   * Search parameter: <b>recipient</b>
2208   * <p>
2209   * Description: <b>Who the information is shared with</b><br>
2210   * Type: <b>reference</b><br>
2211   * Path: <b>Communication.recipient</b><br>
2212   * </p>
2213   */
2214  @SearchParamDefinition(name="recipient", path="Communication.recipient", description="Who the information is shared with", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for RelatedPerson"), @ca.uhn.fhir.model.api.annotation.Compartment(name="EXAMPLE") }, target={CareTeam.class, Device.class, Endpoint.class, Group.class, HealthcareService.class, Location.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
2215  public static final String SP_RECIPIENT = "recipient";
2216 /**
2217   * <b>Fluent Client</b> search parameter constant for <b>recipient</b>
2218   * <p>
2219   * Description: <b>Who the information is shared with</b><br>
2220   * Type: <b>reference</b><br>
2221   * Path: <b>Communication.recipient</b><br>
2222   * </p>
2223   */
2224  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RECIPIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RECIPIENT);
2225
2226/**
2227   * Constant for fluent queries to be used to add include statements. Specifies
2228   * the path value of "<b>Communication:recipient</b>".
2229   */
2230  public static final ca.uhn.fhir.model.api.Include INCLUDE_RECIPIENT = new ca.uhn.fhir.model.api.Include("Communication:recipient").toLocked();
2231
2232 /**
2233   * Search parameter: <b>sender</b>
2234   * <p>
2235   * Description: <b>Who shares the information</b><br>
2236   * Type: <b>reference</b><br>
2237   * Path: <b>Communication.sender</b><br>
2238   * </p>
2239   */
2240  @SearchParamDefinition(name="sender", path="Communication.sender", description="Who shares the information", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for RelatedPerson"), @ca.uhn.fhir.model.api.annotation.Compartment(name="EXAMPLE") }, target={Device.class, Endpoint.class, HealthcareService.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
2241  public static final String SP_SENDER = "sender";
2242 /**
2243   * <b>Fluent Client</b> search parameter constant for <b>sender</b>
2244   * <p>
2245   * Description: <b>Who shares the information</b><br>
2246   * Type: <b>reference</b><br>
2247   * Path: <b>Communication.sender</b><br>
2248   * </p>
2249   */
2250  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SENDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SENDER);
2251
2252/**
2253   * Constant for fluent queries to be used to add include statements. Specifies
2254   * the path value of "<b>Communication:sender</b>".
2255   */
2256  public static final ca.uhn.fhir.model.api.Include INCLUDE_SENDER = new ca.uhn.fhir.model.api.Include("Communication:sender").toLocked();
2257
2258 /**
2259   * Search parameter: <b>sent</b>
2260   * <p>
2261   * Description: <b>When sent</b><br>
2262   * Type: <b>date</b><br>
2263   * Path: <b>Communication.sent</b><br>
2264   * </p>
2265   */
2266  @SearchParamDefinition(name="sent", path="Communication.sent", description="When sent", type="date" )
2267  public static final String SP_SENT = "sent";
2268 /**
2269   * <b>Fluent Client</b> search parameter constant for <b>sent</b>
2270   * <p>
2271   * Description: <b>When sent</b><br>
2272   * Type: <b>date</b><br>
2273   * Path: <b>Communication.sent</b><br>
2274   * </p>
2275   */
2276  public static final ca.uhn.fhir.rest.gclient.DateClientParam SENT = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_SENT);
2277
2278 /**
2279   * Search parameter: <b>status</b>
2280   * <p>
2281   * Description: <b>preparation | in-progress | not-done | on-hold | stopped | completed | entered-in-error | unknown</b><br>
2282   * Type: <b>token</b><br>
2283   * Path: <b>Communication.status</b><br>
2284   * </p>
2285   */
2286  @SearchParamDefinition(name="status", path="Communication.status", description="preparation | in-progress | not-done | on-hold | stopped | completed | entered-in-error | unknown", type="token" )
2287  public static final String SP_STATUS = "status";
2288 /**
2289   * <b>Fluent Client</b> search parameter constant for <b>status</b>
2290   * <p>
2291   * Description: <b>preparation | in-progress | not-done | on-hold | stopped | completed | entered-in-error | unknown</b><br>
2292   * Type: <b>token</b><br>
2293   * Path: <b>Communication.status</b><br>
2294   * </p>
2295   */
2296  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
2297
2298 /**
2299   * Search parameter: <b>subject</b>
2300   * <p>
2301   * Description: <b>Focus of message</b><br>
2302   * Type: <b>reference</b><br>
2303   * Path: <b>Communication.subject</b><br>
2304   * </p>
2305   */
2306  @SearchParamDefinition(name="subject", path="Communication.subject", description="Focus of message", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient") }, target={Group.class, Patient.class } )
2307  public static final String SP_SUBJECT = "subject";
2308 /**
2309   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
2310   * <p>
2311   * Description: <b>Focus of message</b><br>
2312   * Type: <b>reference</b><br>
2313   * Path: <b>Communication.subject</b><br>
2314   * </p>
2315   */
2316  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
2317
2318/**
2319   * Constant for fluent queries to be used to add include statements. Specifies
2320   * the path value of "<b>Communication:subject</b>".
2321   */
2322  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Communication:subject").toLocked();
2323
2324 /**
2325   * Search parameter: <b>topic</b>
2326   * <p>
2327   * Description: <b>Description of the purpose/content</b><br>
2328   * Type: <b>token</b><br>
2329   * Path: <b>Communication.topic</b><br>
2330   * </p>
2331   */
2332  @SearchParamDefinition(name="topic", path="Communication.topic", description="Description of the purpose/content", type="token" )
2333  public static final String SP_TOPIC = "topic";
2334 /**
2335   * <b>Fluent Client</b> search parameter constant for <b>topic</b>
2336   * <p>
2337   * Description: <b>Description of the purpose/content</b><br>
2338   * Type: <b>token</b><br>
2339   * Path: <b>Communication.topic</b><br>
2340   * </p>
2341   */
2342  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TOPIC = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TOPIC);
2343
2344
2345}
2346