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