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