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