001package org.hl7.fhir.r4.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 Thu, Sep 13, 2018 09:04-0400 for FHIR v3.5.0
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/StructureDefinition/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 was terminated prior to any activity beyond preparation.  I.e. The 'main' activity has not yet begun.  The boundary between preparatory and the 'main' activity is context-specific.
062         */
063        NOTDONE, 
064        /**
065         * The event has been temporarily stopped but is expected to resume in the future.
066         */
067        ONHOLD, 
068        /**
069         * The event was terminated prior to the full completion of the intended activity but after at least some of the 'main' activity (beyond preparation) has occurred.
070         */
071        STOPPED, 
072        /**
073         * The event has now concluded.
074         */
075        COMPLETED, 
076        /**
077         * 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".).
078         */
079        ENTEREDINERROR, 
080        /**
081         * 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.
082         */
083        UNKNOWN, 
084        /**
085         * added to help the parsers with the generic types
086         */
087        NULL;
088        public static CommunicationStatus fromCode(String codeString) throws FHIRException {
089            if (codeString == null || "".equals(codeString))
090                return null;
091        if ("preparation".equals(codeString))
092          return PREPARATION;
093        if ("in-progress".equals(codeString))
094          return INPROGRESS;
095        if ("not-done".equals(codeString))
096          return NOTDONE;
097        if ("on-hold".equals(codeString))
098          return ONHOLD;
099        if ("stopped".equals(codeString))
100          return STOPPED;
101        if ("completed".equals(codeString))
102          return COMPLETED;
103        if ("entered-in-error".equals(codeString))
104          return ENTEREDINERROR;
105        if ("unknown".equals(codeString))
106          return UNKNOWN;
107        if (Configuration.isAcceptInvalidEnums())
108          return null;
109        else
110          throw new FHIRException("Unknown CommunicationStatus code '"+codeString+"'");
111        }
112        public String toCode() {
113          switch (this) {
114            case PREPARATION: return "preparation";
115            case INPROGRESS: return "in-progress";
116            case NOTDONE: return "not-done";
117            case ONHOLD: return "on-hold";
118            case STOPPED: return "stopped";
119            case COMPLETED: return "completed";
120            case ENTEREDINERROR: return "entered-in-error";
121            case UNKNOWN: return "unknown";
122            default: return "?";
123          }
124        }
125        public String getSystem() {
126          switch (this) {
127            case PREPARATION: return "http://hl7.org/fhir/event-status";
128            case INPROGRESS: return "http://hl7.org/fhir/event-status";
129            case NOTDONE: return "http://hl7.org/fhir/event-status";
130            case ONHOLD: return "http://hl7.org/fhir/event-status";
131            case STOPPED: return "http://hl7.org/fhir/event-status";
132            case COMPLETED: return "http://hl7.org/fhir/event-status";
133            case ENTEREDINERROR: return "http://hl7.org/fhir/event-status";
134            case UNKNOWN: return "http://hl7.org/fhir/event-status";
135            default: return "?";
136          }
137        }
138        public String getDefinition() {
139          switch (this) {
140            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.";
141            case INPROGRESS: return "The event is currently occurring.";
142            case NOTDONE: return "The event was terminated prior to any activity beyond preparation.  I.e. The 'main' activity has not yet begun.  The boundary between preparatory and the 'main' activity is context-specific.";
143            case ONHOLD: return "The event has been temporarily stopped but is expected to resume in the future.";
144            case STOPPED: return "The event was terminated prior to the full completion of the intended activity but after at least some of the 'main' activity (beyond preparation) has occurred.";
145            case COMPLETED: return "The event has now concluded.";
146            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\".).";
147            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.";
148            default: return "?";
149          }
150        }
151        public String getDisplay() {
152          switch (this) {
153            case PREPARATION: return "Preparation";
154            case INPROGRESS: return "In Progress";
155            case NOTDONE: return "Not Done";
156            case ONHOLD: return "On Hold";
157            case STOPPED: return "Stopped";
158            case COMPLETED: return "Completed";
159            case ENTEREDINERROR: return "Entered in Error";
160            case UNKNOWN: return "Unknown";
161            default: return "?";
162          }
163        }
164    }
165
166  public static class CommunicationStatusEnumFactory implements EnumFactory<CommunicationStatus> {
167    public CommunicationStatus fromCode(String codeString) throws IllegalArgumentException {
168      if (codeString == null || "".equals(codeString))
169            if (codeString == null || "".equals(codeString))
170                return null;
171        if ("preparation".equals(codeString))
172          return CommunicationStatus.PREPARATION;
173        if ("in-progress".equals(codeString))
174          return CommunicationStatus.INPROGRESS;
175        if ("not-done".equals(codeString))
176          return CommunicationStatus.NOTDONE;
177        if ("on-hold".equals(codeString))
178          return CommunicationStatus.ONHOLD;
179        if ("stopped".equals(codeString))
180          return CommunicationStatus.STOPPED;
181        if ("completed".equals(codeString))
182          return CommunicationStatus.COMPLETED;
183        if ("entered-in-error".equals(codeString))
184          return CommunicationStatus.ENTEREDINERROR;
185        if ("unknown".equals(codeString))
186          return CommunicationStatus.UNKNOWN;
187        throw new IllegalArgumentException("Unknown CommunicationStatus code '"+codeString+"'");
188        }
189        public Enumeration<CommunicationStatus> fromType(Base code) throws FHIRException {
190          if (code == null)
191            return null;
192          if (code.isEmpty())
193            return new Enumeration<CommunicationStatus>(this);
194          String codeString = ((PrimitiveType) code).asStringValue();
195          if (codeString == null || "".equals(codeString))
196            return null;
197        if ("preparation".equals(codeString))
198          return new Enumeration<CommunicationStatus>(this, CommunicationStatus.PREPARATION);
199        if ("in-progress".equals(codeString))
200          return new Enumeration<CommunicationStatus>(this, CommunicationStatus.INPROGRESS);
201        if ("not-done".equals(codeString))
202          return new Enumeration<CommunicationStatus>(this, CommunicationStatus.NOTDONE);
203        if ("on-hold".equals(codeString))
204          return new Enumeration<CommunicationStatus>(this, CommunicationStatus.ONHOLD);
205        if ("stopped".equals(codeString))
206          return new Enumeration<CommunicationStatus>(this, CommunicationStatus.STOPPED);
207        if ("completed".equals(codeString))
208          return new Enumeration<CommunicationStatus>(this, CommunicationStatus.COMPLETED);
209        if ("entered-in-error".equals(codeString))
210          return new Enumeration<CommunicationStatus>(this, CommunicationStatus.ENTEREDINERROR);
211        if ("unknown".equals(codeString))
212          return new Enumeration<CommunicationStatus>(this, CommunicationStatus.UNKNOWN);
213        throw new FHIRException("Unknown CommunicationStatus code '"+codeString+"'");
214        }
215    public String toCode(CommunicationStatus code) {
216      if (code == CommunicationStatus.PREPARATION)
217        return "preparation";
218      if (code == CommunicationStatus.INPROGRESS)
219        return "in-progress";
220      if (code == CommunicationStatus.NOTDONE)
221        return "not-done";
222      if (code == CommunicationStatus.ONHOLD)
223        return "on-hold";
224      if (code == CommunicationStatus.STOPPED)
225        return "stopped";
226      if (code == CommunicationStatus.COMPLETED)
227        return "completed";
228      if (code == CommunicationStatus.ENTEREDINERROR)
229        return "entered-in-error";
230      if (code == CommunicationStatus.UNKNOWN)
231        return "unknown";
232      return "?";
233      }
234    public String toSystem(CommunicationStatus code) {
235      return code.getSystem();
236      }
237    }
238
239    public enum CommunicationPriority {
240        /**
241         * The request has normal priority.
242         */
243        ROUTINE, 
244        /**
245         * The request should be actioned promptly - higher priority than routine.
246         */
247        URGENT, 
248        /**
249         * The request should be actioned as soon as possible - higher priority than urgent.
250         */
251        ASAP, 
252        /**
253         * The request should be actioned immediately - highest possible priority.  E.g. an emergency.
254         */
255        STAT, 
256        /**
257         * added to help the parsers with the generic types
258         */
259        NULL;
260        public static CommunicationPriority fromCode(String codeString) throws FHIRException {
261            if (codeString == null || "".equals(codeString))
262                return null;
263        if ("routine".equals(codeString))
264          return ROUTINE;
265        if ("urgent".equals(codeString))
266          return URGENT;
267        if ("asap".equals(codeString))
268          return ASAP;
269        if ("stat".equals(codeString))
270          return STAT;
271        if (Configuration.isAcceptInvalidEnums())
272          return null;
273        else
274          throw new FHIRException("Unknown CommunicationPriority code '"+codeString+"'");
275        }
276        public String toCode() {
277          switch (this) {
278            case ROUTINE: return "routine";
279            case URGENT: return "urgent";
280            case ASAP: return "asap";
281            case STAT: return "stat";
282            default: return "?";
283          }
284        }
285        public String getSystem() {
286          switch (this) {
287            case ROUTINE: return "http://hl7.org/fhir/request-priority";
288            case URGENT: return "http://hl7.org/fhir/request-priority";
289            case ASAP: return "http://hl7.org/fhir/request-priority";
290            case STAT: return "http://hl7.org/fhir/request-priority";
291            default: return "?";
292          }
293        }
294        public String getDefinition() {
295          switch (this) {
296            case ROUTINE: return "The request has normal priority.";
297            case URGENT: return "The request should be actioned promptly - higher priority than routine.";
298            case ASAP: return "The request should be actioned as soon as possible - higher priority than urgent.";
299            case STAT: return "The request should be actioned immediately - highest possible priority.  E.g. an emergency.";
300            default: return "?";
301          }
302        }
303        public String getDisplay() {
304          switch (this) {
305            case ROUTINE: return "Routine";
306            case URGENT: return "Urgent";
307            case ASAP: return "ASAP";
308            case STAT: return "STAT";
309            default: return "?";
310          }
311        }
312    }
313
314  public static class CommunicationPriorityEnumFactory implements EnumFactory<CommunicationPriority> {
315    public CommunicationPriority fromCode(String codeString) throws IllegalArgumentException {
316      if (codeString == null || "".equals(codeString))
317            if (codeString == null || "".equals(codeString))
318                return null;
319        if ("routine".equals(codeString))
320          return CommunicationPriority.ROUTINE;
321        if ("urgent".equals(codeString))
322          return CommunicationPriority.URGENT;
323        if ("asap".equals(codeString))
324          return CommunicationPriority.ASAP;
325        if ("stat".equals(codeString))
326          return CommunicationPriority.STAT;
327        throw new IllegalArgumentException("Unknown CommunicationPriority code '"+codeString+"'");
328        }
329        public Enumeration<CommunicationPriority> fromType(Base code) throws FHIRException {
330          if (code == null)
331            return null;
332          if (code.isEmpty())
333            return new Enumeration<CommunicationPriority>(this);
334          String codeString = ((PrimitiveType) code).asStringValue();
335          if (codeString == null || "".equals(codeString))
336            return null;
337        if ("routine".equals(codeString))
338          return new Enumeration<CommunicationPriority>(this, CommunicationPriority.ROUTINE);
339        if ("urgent".equals(codeString))
340          return new Enumeration<CommunicationPriority>(this, CommunicationPriority.URGENT);
341        if ("asap".equals(codeString))
342          return new Enumeration<CommunicationPriority>(this, CommunicationPriority.ASAP);
343        if ("stat".equals(codeString))
344          return new Enumeration<CommunicationPriority>(this, CommunicationPriority.STAT);
345        throw new FHIRException("Unknown CommunicationPriority code '"+codeString+"'");
346        }
347    public String toCode(CommunicationPriority code) {
348      if (code == CommunicationPriority.ROUTINE)
349        return "routine";
350      if (code == CommunicationPriority.URGENT)
351        return "urgent";
352      if (code == CommunicationPriority.ASAP)
353        return "asap";
354      if (code == CommunicationPriority.STAT)
355        return "stat";
356      return "?";
357      }
358    public String toSystem(CommunicationPriority code) {
359      return code.getSystem();
360      }
361    }
362
363    @Block()
364    public static class CommunicationPayloadComponent extends BackboneElement implements IBaseBackboneElement {
365        /**
366         * A communicated content (or for multi-part communications, one portion of the communication).
367         */
368        @Child(name = "content", type = {StringType.class, Attachment.class, Reference.class}, order=1, min=1, max=1, modifier=false, summary=false)
369        @Description(shortDefinition="Message part content", formalDefinition="A communicated content (or for multi-part communications, one portion of the communication)." )
370        protected Type content;
371
372        private static final long serialVersionUID = -1763459053L;
373
374    /**
375     * Constructor
376     */
377      public CommunicationPayloadComponent() {
378        super();
379      }
380
381    /**
382     * Constructor
383     */
384      public CommunicationPayloadComponent(Type content) {
385        super();
386        this.content = content;
387      }
388
389        /**
390         * @return {@link #content} (A communicated content (or for multi-part communications, one portion of the communication).)
391         */
392        public Type getContent() { 
393          return this.content;
394        }
395
396        /**
397         * @return {@link #content} (A communicated content (or for multi-part communications, one portion of the communication).)
398         */
399        public StringType getContentStringType() throws FHIRException { 
400          if (this.content == null)
401            return null;
402          if (!(this.content instanceof StringType))
403            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.content.getClass().getName()+" was encountered");
404          return (StringType) this.content;
405        }
406
407        public boolean hasContentStringType() { 
408          return this != null && this.content instanceof StringType;
409        }
410
411        /**
412         * @return {@link #content} (A communicated content (or for multi-part communications, one portion of the communication).)
413         */
414        public Attachment getContentAttachment() throws FHIRException { 
415          if (this.content == null)
416            return null;
417          if (!(this.content instanceof Attachment))
418            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered");
419          return (Attachment) this.content;
420        }
421
422        public boolean hasContentAttachment() { 
423          return this != null && this.content instanceof Attachment;
424        }
425
426        /**
427         * @return {@link #content} (A communicated content (or for multi-part communications, one portion of the communication).)
428         */
429        public Reference getContentReference() throws FHIRException { 
430          if (this.content == null)
431            return null;
432          if (!(this.content instanceof Reference))
433            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered");
434          return (Reference) this.content;
435        }
436
437        public boolean hasContentReference() { 
438          return this != null && this.content instanceof Reference;
439        }
440
441        public boolean hasContent() { 
442          return this.content != null && !this.content.isEmpty();
443        }
444
445        /**
446         * @param value {@link #content} (A communicated content (or for multi-part communications, one portion of the communication).)
447         */
448        public CommunicationPayloadComponent setContent(Type value) { 
449          if (value != null && !(value instanceof StringType || value instanceof Attachment || value instanceof Reference))
450            throw new Error("Not the right type for Communication.payload.content[x]: "+value.fhirType());
451          this.content = value;
452          return this;
453        }
454
455        protected void listChildren(List<Property> children) {
456          super.listChildren(children);
457          children.add(new Property("content[x]", "string|Attachment|Reference(Any)", "A communicated content (or for multi-part communications, one portion of the communication).", 0, 1, content));
458        }
459
460        @Override
461        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
462          switch (_hash) {
463          case 264548711: /*content[x]*/  return new Property("content[x]", "string|Attachment|Reference(Any)", "A communicated content (or for multi-part communications, one portion of the communication).", 0, 1, content);
464          case 951530617: /*content*/  return new Property("content[x]", "string|Attachment|Reference(Any)", "A communicated content (or for multi-part communications, one portion of the communication).", 0, 1, content);
465          case -326336022: /*contentString*/  return new Property("content[x]", "string|Attachment|Reference(Any)", "A communicated content (or for multi-part communications, one portion of the communication).", 0, 1, content);
466          case -702028164: /*contentAttachment*/  return new Property("content[x]", "string|Attachment|Reference(Any)", "A communicated content (or for multi-part communications, one portion of the communication).", 0, 1, content);
467          case 1193747154: /*contentReference*/  return new Property("content[x]", "string|Attachment|Reference(Any)", "A communicated content (or for multi-part communications, one portion of the communication).", 0, 1, content);
468          default: return super.getNamedProperty(_hash, _name, _checkValid);
469          }
470
471        }
472
473      @Override
474      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
475        switch (hash) {
476        case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Type
477        default: return super.getProperty(hash, name, checkValid);
478        }
479
480      }
481
482      @Override
483      public Base setProperty(int hash, String name, Base value) throws FHIRException {
484        switch (hash) {
485        case 951530617: // content
486          this.content = castToType(value); // Type
487          return value;
488        default: return super.setProperty(hash, name, value);
489        }
490
491      }
492
493      @Override
494      public Base setProperty(String name, Base value) throws FHIRException {
495        if (name.equals("content[x]")) {
496          this.content = castToType(value); // Type
497        } else
498          return super.setProperty(name, value);
499        return value;
500      }
501
502      @Override
503      public Base makeProperty(int hash, String name) throws FHIRException {
504        switch (hash) {
505        case 264548711:  return getContent(); 
506        case 951530617:  return getContent(); 
507        default: return super.makeProperty(hash, name);
508        }
509
510      }
511
512      @Override
513      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
514        switch (hash) {
515        case 951530617: /*content*/ return new String[] {"string", "Attachment", "Reference"};
516        default: return super.getTypesForProperty(hash, name);
517        }
518
519      }
520
521      @Override
522      public Base addChild(String name) throws FHIRException {
523        if (name.equals("contentString")) {
524          this.content = new StringType();
525          return this.content;
526        }
527        else if (name.equals("contentAttachment")) {
528          this.content = new Attachment();
529          return this.content;
530        }
531        else if (name.equals("contentReference")) {
532          this.content = new Reference();
533          return this.content;
534        }
535        else
536          return super.addChild(name);
537      }
538
539      public CommunicationPayloadComponent copy() {
540        CommunicationPayloadComponent dst = new CommunicationPayloadComponent();
541        copyValues(dst);
542        dst.content = content == null ? null : content.copy();
543        return dst;
544      }
545
546      @Override
547      public boolean equalsDeep(Base other_) {
548        if (!super.equalsDeep(other_))
549          return false;
550        if (!(other_ instanceof CommunicationPayloadComponent))
551          return false;
552        CommunicationPayloadComponent o = (CommunicationPayloadComponent) other_;
553        return compareDeep(content, o.content, true);
554      }
555
556      @Override
557      public boolean equalsShallow(Base other_) {
558        if (!super.equalsShallow(other_))
559          return false;
560        if (!(other_ instanceof CommunicationPayloadComponent))
561          return false;
562        CommunicationPayloadComponent o = (CommunicationPayloadComponent) other_;
563        return true;
564      }
565
566      public boolean isEmpty() {
567        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(content);
568      }
569
570  public String fhirType() {
571    return "Communication.payload";
572
573  }
574
575  }
576
577    /**
578     * Business identifiers assigned to this communication by the performer or other systems which remain constant as the resource is updated and propagates from server to server.
579     */
580    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
581    @Description(shortDefinition="Unique identifier", formalDefinition="Business identifiers assigned to this communication by the performer or other systems which remain constant as the resource is updated and propagates from server to server." )
582    protected List<Identifier> identifier;
583
584    /**
585     * The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.
586     */
587    @Child(name = "instantiatesCanonical", type = {CanonicalType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
588    @Description(shortDefinition="Instantiates FHIR protocol or definition", formalDefinition="The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication." )
589    protected List<CanonicalType> instantiatesCanonical;
590
591    /**
592     * The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.
593     */
594    @Child(name = "instantiatesUri", type = {UriType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
595    @Description(shortDefinition="Instantiates external protocol or definition", formalDefinition="The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication." )
596    protected List<UriType> instantiatesUri;
597
598    /**
599     * An order, proposal or plan fulfilled in whole or in part by this Communication.
600     */
601    @Child(name = "basedOn", type = {Reference.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
602    @Description(shortDefinition="Request fulfilled by this communication", formalDefinition="An order, proposal or plan fulfilled in whole or in part by this Communication." )
603    protected List<Reference> basedOn;
604    /**
605     * The actual objects that are the target of the reference (An order, proposal or plan fulfilled in whole or in part by this Communication.)
606     */
607    protected List<Resource> basedOnTarget;
608
609
610    /**
611     * Part of this action.
612     */
613    @Child(name = "partOf", type = {Reference.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
614    @Description(shortDefinition="Part of this action", formalDefinition="Part of this action." )
615    protected List<Reference> partOf;
616    /**
617     * The actual objects that are the target of the reference (Part of this action.)
618     */
619    protected List<Resource> partOfTarget;
620
621
622    /**
623     * Prior communication that this communication is in response to.
624     */
625    @Child(name = "inResponseTo", type = {Communication.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
626    @Description(shortDefinition="Reply to", formalDefinition="Prior communication that this communication is in response to." )
627    protected List<Reference> inResponseTo;
628    /**
629     * The actual objects that are the target of the reference (Prior communication that this communication is in response to.)
630     */
631    protected List<Communication> inResponseToTarget;
632
633
634    /**
635     * The status of the transmission.
636     */
637    @Child(name = "status", type = {CodeType.class}, order=6, min=1, max=1, modifier=true, summary=true)
638    @Description(shortDefinition="preparation | in-progress | not-done | suspended | aborted | completed | entered-in-error", formalDefinition="The status of the transmission." )
639    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/event-status")
640    protected Enumeration<CommunicationStatus> status;
641
642    /**
643     * Captures the reason for the current state of the Communication.
644     */
645    @Child(name = "statusReason", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=true)
646    @Description(shortDefinition="Reason for current status", formalDefinition="Captures the reason for the current state of the Communication." )
647    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/communication-not-done-reason")
648    protected CodeableConcept statusReason;
649
650    /**
651     * The type of message conveyed such as alert, notification, reminder, instruction, etc.
652     */
653    @Child(name = "category", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
654    @Description(shortDefinition="Message category", formalDefinition="The type of message conveyed such as alert, notification, reminder, instruction, etc." )
655    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/communication-category")
656    protected List<CodeableConcept> category;
657
658    /**
659     * Characterizes how quickly the planned or in progress communication must be addressed. Includes concepts such as stat, urgent, routine.
660     */
661    @Child(name = "priority", type = {CodeType.class}, order=9, min=0, max=1, modifier=false, summary=true)
662    @Description(shortDefinition="Message urgency", formalDefinition="Characterizes how quickly the planned or in progress communication must be addressed. Includes concepts such as stat, urgent, routine." )
663    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/request-priority")
664    protected Enumeration<CommunicationPriority> priority;
665
666    /**
667     * A channel that was used for this communication (e.g. email, fax).
668     */
669    @Child(name = "medium", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
670    @Description(shortDefinition="A channel of communication", formalDefinition="A channel that was used for this communication (e.g. email, fax)." )
671    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://terminology.hl7.org/ValueSet/v3-ParticipationMode")
672    protected List<CodeableConcept> medium;
673
674    /**
675     * The patient or group that was the focus of this communication.
676     */
677    @Child(name = "subject", type = {Patient.class, Group.class}, order=11, min=0, max=1, modifier=false, summary=true)
678    @Description(shortDefinition="Focus of message", formalDefinition="The patient or group that was the focus of this communication." )
679    protected Reference subject;
680
681    /**
682     * The actual object that is the target of the reference (The patient or group that was the focus of this communication.)
683     */
684    protected Resource subjectTarget;
685
686    /**
687     * Description of the purpose/content, similar to a subject line in an email.
688     */
689    @Child(name = "topic", type = {CodeableConcept.class}, order=12, min=0, max=1, modifier=false, summary=false)
690    @Description(shortDefinition="Description of the purpose/content", formalDefinition="Description of the purpose/content, similar to a subject line in an email." )
691    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/communication-topic")
692    protected CodeableConcept topic;
693
694    /**
695     * Other resources that pertain to this communication and to which this communication should be associated.
696     */
697    @Child(name = "about", type = {Reference.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
698    @Description(shortDefinition="Resources that pertain to this communication", formalDefinition="Other resources that pertain to this communication and to which this communication should be associated." )
699    protected List<Reference> about;
700    /**
701     * The actual objects that are the target of the reference (Other resources that pertain to this communication and to which this communication should be associated.)
702     */
703    protected List<Resource> aboutTarget;
704
705
706    /**
707     * The encounter within which the communication was sent.
708     */
709    @Child(name = "context", type = {Encounter.class, EpisodeOfCare.class}, order=14, min=0, max=1, modifier=false, summary=true)
710    @Description(shortDefinition="Encounter or episode leading to message", formalDefinition="The encounter within which the communication was sent." )
711    protected Reference context;
712
713    /**
714     * The actual object that is the target of the reference (The encounter within which the communication was sent.)
715     */
716    protected Resource contextTarget;
717
718    /**
719     * The time when this communication was sent.
720     */
721    @Child(name = "sent", type = {DateTimeType.class}, order=15, min=0, max=1, modifier=false, summary=false)
722    @Description(shortDefinition="When sent", formalDefinition="The time when this communication was sent." )
723    protected DateTimeType sent;
724
725    /**
726     * The time when this communication arrived at the destination.
727     */
728    @Child(name = "received", type = {DateTimeType.class}, order=16, min=0, max=1, modifier=false, summary=false)
729    @Description(shortDefinition="When received", formalDefinition="The time when this communication arrived at the destination." )
730    protected DateTimeType received;
731
732    /**
733     * The entity (e.g. person, organization, clinical information system, care team or device) which was the target of the communication. If receipts need to be tracked by 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).
734     */
735    @Child(name = "recipient", type = {Device.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class, Group.class, CareTeam.class, HealthcareService.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
736    @Description(shortDefinition="Message recipient", formalDefinition="The entity (e.g. person, organization, clinical information system, care team or device) which was the target of the communication. If receipts need to be tracked by 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)." )
737    protected List<Reference> recipient;
738    /**
739     * The actual objects that are the target of the reference (The entity (e.g. person, organization, clinical information system, care team or device) which was the target of the communication. If receipts need to be tracked by 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).)
740     */
741    protected List<Resource> recipientTarget;
742
743
744    /**
745     * The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication.
746     */
747    @Child(name = "sender", type = {Device.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class, HealthcareService.class}, order=18, min=0, max=1, modifier=false, summary=false)
748    @Description(shortDefinition="Message sender", formalDefinition="The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication." )
749    protected Reference sender;
750
751    /**
752     * 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.)
753     */
754    protected Resource senderTarget;
755
756    /**
757     * The reason or justification for the communication.
758     */
759    @Child(name = "reasonCode", type = {CodeableConcept.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
760    @Description(shortDefinition="Indication for message", formalDefinition="The reason or justification for the communication." )
761    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/clinical-findings")
762    protected List<CodeableConcept> reasonCode;
763
764    /**
765     * Indicates another resource whose existence justifies this communication.
766     */
767    @Child(name = "reasonReference", type = {Condition.class, Observation.class, DiagnosticReport.class, DocumentReference.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
768    @Description(shortDefinition="Why was communication done?", formalDefinition="Indicates another resource whose existence justifies this communication." )
769    protected List<Reference> reasonReference;
770    /**
771     * The actual objects that are the target of the reference (Indicates another resource whose existence justifies this communication.)
772     */
773    protected List<Resource> reasonReferenceTarget;
774
775
776    /**
777     * Text, attachment(s), or resource(s) that was communicated to the recipient.
778     */
779    @Child(name = "payload", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
780    @Description(shortDefinition="Message payload", formalDefinition="Text, attachment(s), or resource(s) that was communicated to the recipient." )
781    protected List<CommunicationPayloadComponent> payload;
782
783    /**
784     * Additional notes or commentary about the communication by the sender, receiver or other interested parties.
785     */
786    @Child(name = "note", type = {Annotation.class}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
787    @Description(shortDefinition="Comments made about the communication", formalDefinition="Additional notes or commentary about the communication by the sender, receiver or other interested parties." )
788    protected List<Annotation> note;
789
790    private static final long serialVersionUID = -1041082661L;
791
792  /**
793   * Constructor
794   */
795    public Communication() {
796      super();
797    }
798
799  /**
800   * Constructor
801   */
802    public Communication(Enumeration<CommunicationStatus> status) {
803      super();
804      this.status = status;
805    }
806
807    /**
808     * @return {@link #identifier} (Business identifiers assigned to this communication by the performer or other systems which remain constant as the resource is updated and propagates from server to server.)
809     */
810    public List<Identifier> getIdentifier() { 
811      if (this.identifier == null)
812        this.identifier = new ArrayList<Identifier>();
813      return this.identifier;
814    }
815
816    /**
817     * @return Returns a reference to <code>this</code> for easy method chaining
818     */
819    public Communication setIdentifier(List<Identifier> theIdentifier) { 
820      this.identifier = theIdentifier;
821      return this;
822    }
823
824    public boolean hasIdentifier() { 
825      if (this.identifier == null)
826        return false;
827      for (Identifier item : this.identifier)
828        if (!item.isEmpty())
829          return true;
830      return false;
831    }
832
833    public Identifier addIdentifier() { //3
834      Identifier t = new Identifier();
835      if (this.identifier == null)
836        this.identifier = new ArrayList<Identifier>();
837      this.identifier.add(t);
838      return t;
839    }
840
841    public Communication addIdentifier(Identifier t) { //3
842      if (t == null)
843        return this;
844      if (this.identifier == null)
845        this.identifier = new ArrayList<Identifier>();
846      this.identifier.add(t);
847      return this;
848    }
849
850    /**
851     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
852     */
853    public Identifier getIdentifierFirstRep() { 
854      if (getIdentifier().isEmpty()) {
855        addIdentifier();
856      }
857      return getIdentifier().get(0);
858    }
859
860    /**
861     * @return {@link #instantiatesCanonical} (The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.)
862     */
863    public List<CanonicalType> getInstantiatesCanonical() { 
864      if (this.instantiatesCanonical == null)
865        this.instantiatesCanonical = new ArrayList<CanonicalType>();
866      return this.instantiatesCanonical;
867    }
868
869    /**
870     * @return Returns a reference to <code>this</code> for easy method chaining
871     */
872    public Communication setInstantiatesCanonical(List<CanonicalType> theInstantiatesCanonical) { 
873      this.instantiatesCanonical = theInstantiatesCanonical;
874      return this;
875    }
876
877    public boolean hasInstantiatesCanonical() { 
878      if (this.instantiatesCanonical == null)
879        return false;
880      for (CanonicalType item : this.instantiatesCanonical)
881        if (!item.isEmpty())
882          return true;
883      return false;
884    }
885
886    /**
887     * @return {@link #instantiatesCanonical} (The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.)
888     */
889    public CanonicalType addInstantiatesCanonicalElement() {//2 
890      CanonicalType t = new CanonicalType();
891      if (this.instantiatesCanonical == null)
892        this.instantiatesCanonical = new ArrayList<CanonicalType>();
893      this.instantiatesCanonical.add(t);
894      return t;
895    }
896
897    /**
898     * @param value {@link #instantiatesCanonical} (The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.)
899     */
900    public Communication addInstantiatesCanonical(String value) { //1
901      CanonicalType t = new CanonicalType();
902      t.setValue(value);
903      if (this.instantiatesCanonical == null)
904        this.instantiatesCanonical = new ArrayList<CanonicalType>();
905      this.instantiatesCanonical.add(t);
906      return this;
907    }
908
909    /**
910     * @param value {@link #instantiatesCanonical} (The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.)
911     */
912    public boolean hasInstantiatesCanonical(String value) { 
913      if (this.instantiatesCanonical == null)
914        return false;
915      for (CanonicalType v : this.instantiatesCanonical)
916        if (v.getValue().equals(value)) // canonical(PlanDefinition|ActivityDefinition|Measure|OperationDefinition|Questionnaire)
917          return true;
918      return false;
919    }
920
921    /**
922     * @return {@link #instantiatesUri} (The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.)
923     */
924    public List<UriType> getInstantiatesUri() { 
925      if (this.instantiatesUri == null)
926        this.instantiatesUri = new ArrayList<UriType>();
927      return this.instantiatesUri;
928    }
929
930    /**
931     * @return Returns a reference to <code>this</code> for easy method chaining
932     */
933    public Communication setInstantiatesUri(List<UriType> theInstantiatesUri) { 
934      this.instantiatesUri = theInstantiatesUri;
935      return this;
936    }
937
938    public boolean hasInstantiatesUri() { 
939      if (this.instantiatesUri == null)
940        return false;
941      for (UriType item : this.instantiatesUri)
942        if (!item.isEmpty())
943          return true;
944      return false;
945    }
946
947    /**
948     * @return {@link #instantiatesUri} (The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.)
949     */
950    public UriType addInstantiatesUriElement() {//2 
951      UriType t = new UriType();
952      if (this.instantiatesUri == null)
953        this.instantiatesUri = new ArrayList<UriType>();
954      this.instantiatesUri.add(t);
955      return t;
956    }
957
958    /**
959     * @param value {@link #instantiatesUri} (The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.)
960     */
961    public Communication addInstantiatesUri(String value) { //1
962      UriType t = new UriType();
963      t.setValue(value);
964      if (this.instantiatesUri == null)
965        this.instantiatesUri = new ArrayList<UriType>();
966      this.instantiatesUri.add(t);
967      return this;
968    }
969
970    /**
971     * @param value {@link #instantiatesUri} (The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.)
972     */
973    public boolean hasInstantiatesUri(String value) { 
974      if (this.instantiatesUri == null)
975        return false;
976      for (UriType v : this.instantiatesUri)
977        if (v.getValue().equals(value)) // uri
978          return true;
979      return false;
980    }
981
982    /**
983     * @return {@link #basedOn} (An order, proposal or plan fulfilled in whole or in part by this Communication.)
984     */
985    public List<Reference> getBasedOn() { 
986      if (this.basedOn == null)
987        this.basedOn = new ArrayList<Reference>();
988      return this.basedOn;
989    }
990
991    /**
992     * @return Returns a reference to <code>this</code> for easy method chaining
993     */
994    public Communication setBasedOn(List<Reference> theBasedOn) { 
995      this.basedOn = theBasedOn;
996      return this;
997    }
998
999    public boolean hasBasedOn() { 
1000      if (this.basedOn == null)
1001        return false;
1002      for (Reference item : this.basedOn)
1003        if (!item.isEmpty())
1004          return true;
1005      return false;
1006    }
1007
1008    public Reference addBasedOn() { //3
1009      Reference t = new Reference();
1010      if (this.basedOn == null)
1011        this.basedOn = new ArrayList<Reference>();
1012      this.basedOn.add(t);
1013      return t;
1014    }
1015
1016    public Communication addBasedOn(Reference t) { //3
1017      if (t == null)
1018        return this;
1019      if (this.basedOn == null)
1020        this.basedOn = new ArrayList<Reference>();
1021      this.basedOn.add(t);
1022      return this;
1023    }
1024
1025    /**
1026     * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist
1027     */
1028    public Reference getBasedOnFirstRep() { 
1029      if (getBasedOn().isEmpty()) {
1030        addBasedOn();
1031      }
1032      return getBasedOn().get(0);
1033    }
1034
1035    /**
1036     * @deprecated Use Reference#setResource(IBaseResource) instead
1037     */
1038    @Deprecated
1039    public List<Resource> getBasedOnTarget() { 
1040      if (this.basedOnTarget == null)
1041        this.basedOnTarget = new ArrayList<Resource>();
1042      return this.basedOnTarget;
1043    }
1044
1045    /**
1046     * @return {@link #partOf} (Part of this action.)
1047     */
1048    public List<Reference> getPartOf() { 
1049      if (this.partOf == null)
1050        this.partOf = new ArrayList<Reference>();
1051      return this.partOf;
1052    }
1053
1054    /**
1055     * @return Returns a reference to <code>this</code> for easy method chaining
1056     */
1057    public Communication setPartOf(List<Reference> thePartOf) { 
1058      this.partOf = thePartOf;
1059      return this;
1060    }
1061
1062    public boolean hasPartOf() { 
1063      if (this.partOf == null)
1064        return false;
1065      for (Reference item : this.partOf)
1066        if (!item.isEmpty())
1067          return true;
1068      return false;
1069    }
1070
1071    public Reference addPartOf() { //3
1072      Reference t = new Reference();
1073      if (this.partOf == null)
1074        this.partOf = new ArrayList<Reference>();
1075      this.partOf.add(t);
1076      return t;
1077    }
1078
1079    public Communication addPartOf(Reference t) { //3
1080      if (t == null)
1081        return this;
1082      if (this.partOf == null)
1083        this.partOf = new ArrayList<Reference>();
1084      this.partOf.add(t);
1085      return this;
1086    }
1087
1088    /**
1089     * @return The first repetition of repeating field {@link #partOf}, creating it if it does not already exist
1090     */
1091    public Reference getPartOfFirstRep() { 
1092      if (getPartOf().isEmpty()) {
1093        addPartOf();
1094      }
1095      return getPartOf().get(0);
1096    }
1097
1098    /**
1099     * @deprecated Use Reference#setResource(IBaseResource) instead
1100     */
1101    @Deprecated
1102    public List<Resource> getPartOfTarget() { 
1103      if (this.partOfTarget == null)
1104        this.partOfTarget = new ArrayList<Resource>();
1105      return this.partOfTarget;
1106    }
1107
1108    /**
1109     * @return {@link #inResponseTo} (Prior communication that this communication is in response to.)
1110     */
1111    public List<Reference> getInResponseTo() { 
1112      if (this.inResponseTo == null)
1113        this.inResponseTo = new ArrayList<Reference>();
1114      return this.inResponseTo;
1115    }
1116
1117    /**
1118     * @return Returns a reference to <code>this</code> for easy method chaining
1119     */
1120    public Communication setInResponseTo(List<Reference> theInResponseTo) { 
1121      this.inResponseTo = theInResponseTo;
1122      return this;
1123    }
1124
1125    public boolean hasInResponseTo() { 
1126      if (this.inResponseTo == null)
1127        return false;
1128      for (Reference item : this.inResponseTo)
1129        if (!item.isEmpty())
1130          return true;
1131      return false;
1132    }
1133
1134    public Reference addInResponseTo() { //3
1135      Reference t = new Reference();
1136      if (this.inResponseTo == null)
1137        this.inResponseTo = new ArrayList<Reference>();
1138      this.inResponseTo.add(t);
1139      return t;
1140    }
1141
1142    public Communication addInResponseTo(Reference t) { //3
1143      if (t == null)
1144        return this;
1145      if (this.inResponseTo == null)
1146        this.inResponseTo = new ArrayList<Reference>();
1147      this.inResponseTo.add(t);
1148      return this;
1149    }
1150
1151    /**
1152     * @return The first repetition of repeating field {@link #inResponseTo}, creating it if it does not already exist
1153     */
1154    public Reference getInResponseToFirstRep() { 
1155      if (getInResponseTo().isEmpty()) {
1156        addInResponseTo();
1157      }
1158      return getInResponseTo().get(0);
1159    }
1160
1161    /**
1162     * @deprecated Use Reference#setResource(IBaseResource) instead
1163     */
1164    @Deprecated
1165    public List<Communication> getInResponseToTarget() { 
1166      if (this.inResponseToTarget == null)
1167        this.inResponseToTarget = new ArrayList<Communication>();
1168      return this.inResponseToTarget;
1169    }
1170
1171    /**
1172     * @deprecated Use Reference#setResource(IBaseResource) instead
1173     */
1174    @Deprecated
1175    public Communication addInResponseToTarget() { 
1176      Communication r = new Communication();
1177      if (this.inResponseToTarget == null)
1178        this.inResponseToTarget = new ArrayList<Communication>();
1179      this.inResponseToTarget.add(r);
1180      return r;
1181    }
1182
1183    /**
1184     * @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
1185     */
1186    public Enumeration<CommunicationStatus> getStatusElement() { 
1187      if (this.status == null)
1188        if (Configuration.errorOnAutoCreate())
1189          throw new Error("Attempt to auto-create Communication.status");
1190        else if (Configuration.doAutoCreate())
1191          this.status = new Enumeration<CommunicationStatus>(new CommunicationStatusEnumFactory()); // bb
1192      return this.status;
1193    }
1194
1195    public boolean hasStatusElement() { 
1196      return this.status != null && !this.status.isEmpty();
1197    }
1198
1199    public boolean hasStatus() { 
1200      return this.status != null && !this.status.isEmpty();
1201    }
1202
1203    /**
1204     * @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
1205     */
1206    public Communication setStatusElement(Enumeration<CommunicationStatus> value) { 
1207      this.status = value;
1208      return this;
1209    }
1210
1211    /**
1212     * @return The status of the transmission.
1213     */
1214    public CommunicationStatus getStatus() { 
1215      return this.status == null ? null : this.status.getValue();
1216    }
1217
1218    /**
1219     * @param value The status of the transmission.
1220     */
1221    public Communication setStatus(CommunicationStatus value) { 
1222        if (this.status == null)
1223          this.status = new Enumeration<CommunicationStatus>(new CommunicationStatusEnumFactory());
1224        this.status.setValue(value);
1225      return this;
1226    }
1227
1228    /**
1229     * @return {@link #statusReason} (Captures the reason for the current state of the Communication.)
1230     */
1231    public CodeableConcept getStatusReason() { 
1232      if (this.statusReason == null)
1233        if (Configuration.errorOnAutoCreate())
1234          throw new Error("Attempt to auto-create Communication.statusReason");
1235        else if (Configuration.doAutoCreate())
1236          this.statusReason = new CodeableConcept(); // cc
1237      return this.statusReason;
1238    }
1239
1240    public boolean hasStatusReason() { 
1241      return this.statusReason != null && !this.statusReason.isEmpty();
1242    }
1243
1244    /**
1245     * @param value {@link #statusReason} (Captures the reason for the current state of the Communication.)
1246     */
1247    public Communication setStatusReason(CodeableConcept value) { 
1248      this.statusReason = value;
1249      return this;
1250    }
1251
1252    /**
1253     * @return {@link #category} (The type of message conveyed such as alert, notification, reminder, instruction, etc.)
1254     */
1255    public List<CodeableConcept> getCategory() { 
1256      if (this.category == null)
1257        this.category = new ArrayList<CodeableConcept>();
1258      return this.category;
1259    }
1260
1261    /**
1262     * @return Returns a reference to <code>this</code> for easy method chaining
1263     */
1264    public Communication setCategory(List<CodeableConcept> theCategory) { 
1265      this.category = theCategory;
1266      return this;
1267    }
1268
1269    public boolean hasCategory() { 
1270      if (this.category == null)
1271        return false;
1272      for (CodeableConcept item : this.category)
1273        if (!item.isEmpty())
1274          return true;
1275      return false;
1276    }
1277
1278    public CodeableConcept addCategory() { //3
1279      CodeableConcept t = new CodeableConcept();
1280      if (this.category == null)
1281        this.category = new ArrayList<CodeableConcept>();
1282      this.category.add(t);
1283      return t;
1284    }
1285
1286    public Communication addCategory(CodeableConcept t) { //3
1287      if (t == null)
1288        return this;
1289      if (this.category == null)
1290        this.category = new ArrayList<CodeableConcept>();
1291      this.category.add(t);
1292      return this;
1293    }
1294
1295    /**
1296     * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist
1297     */
1298    public CodeableConcept getCategoryFirstRep() { 
1299      if (getCategory().isEmpty()) {
1300        addCategory();
1301      }
1302      return getCategory().get(0);
1303    }
1304
1305    /**
1306     * @return {@link #priority} (Characterizes how quickly the planned or in progress communication must be addressed. Includes concepts such as stat, urgent, routine.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value
1307     */
1308    public Enumeration<CommunicationPriority> getPriorityElement() { 
1309      if (this.priority == null)
1310        if (Configuration.errorOnAutoCreate())
1311          throw new Error("Attempt to auto-create Communication.priority");
1312        else if (Configuration.doAutoCreate())
1313          this.priority = new Enumeration<CommunicationPriority>(new CommunicationPriorityEnumFactory()); // bb
1314      return this.priority;
1315    }
1316
1317    public boolean hasPriorityElement() { 
1318      return this.priority != null && !this.priority.isEmpty();
1319    }
1320
1321    public boolean hasPriority() { 
1322      return this.priority != null && !this.priority.isEmpty();
1323    }
1324
1325    /**
1326     * @param value {@link #priority} (Characterizes how quickly the planned or in progress communication must be addressed. Includes concepts such as stat, urgent, routine.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value
1327     */
1328    public Communication setPriorityElement(Enumeration<CommunicationPriority> value) { 
1329      this.priority = value;
1330      return this;
1331    }
1332
1333    /**
1334     * @return Characterizes how quickly the planned or in progress communication must be addressed. Includes concepts such as stat, urgent, routine.
1335     */
1336    public CommunicationPriority getPriority() { 
1337      return this.priority == null ? null : this.priority.getValue();
1338    }
1339
1340    /**
1341     * @param value Characterizes how quickly the planned or in progress communication must be addressed. Includes concepts such as stat, urgent, routine.
1342     */
1343    public Communication setPriority(CommunicationPriority value) { 
1344      if (value == null)
1345        this.priority = null;
1346      else {
1347        if (this.priority == null)
1348          this.priority = new Enumeration<CommunicationPriority>(new CommunicationPriorityEnumFactory());
1349        this.priority.setValue(value);
1350      }
1351      return this;
1352    }
1353
1354    /**
1355     * @return {@link #medium} (A channel that was used for this communication (e.g. email, fax).)
1356     */
1357    public List<CodeableConcept> getMedium() { 
1358      if (this.medium == null)
1359        this.medium = new ArrayList<CodeableConcept>();
1360      return this.medium;
1361    }
1362
1363    /**
1364     * @return Returns a reference to <code>this</code> for easy method chaining
1365     */
1366    public Communication setMedium(List<CodeableConcept> theMedium) { 
1367      this.medium = theMedium;
1368      return this;
1369    }
1370
1371    public boolean hasMedium() { 
1372      if (this.medium == null)
1373        return false;
1374      for (CodeableConcept item : this.medium)
1375        if (!item.isEmpty())
1376          return true;
1377      return false;
1378    }
1379
1380    public CodeableConcept addMedium() { //3
1381      CodeableConcept t = new CodeableConcept();
1382      if (this.medium == null)
1383        this.medium = new ArrayList<CodeableConcept>();
1384      this.medium.add(t);
1385      return t;
1386    }
1387
1388    public Communication addMedium(CodeableConcept t) { //3
1389      if (t == null)
1390        return this;
1391      if (this.medium == null)
1392        this.medium = new ArrayList<CodeableConcept>();
1393      this.medium.add(t);
1394      return this;
1395    }
1396
1397    /**
1398     * @return The first repetition of repeating field {@link #medium}, creating it if it does not already exist
1399     */
1400    public CodeableConcept getMediumFirstRep() { 
1401      if (getMedium().isEmpty()) {
1402        addMedium();
1403      }
1404      return getMedium().get(0);
1405    }
1406
1407    /**
1408     * @return {@link #subject} (The patient or group that was the focus of this communication.)
1409     */
1410    public Reference getSubject() { 
1411      if (this.subject == null)
1412        if (Configuration.errorOnAutoCreate())
1413          throw new Error("Attempt to auto-create Communication.subject");
1414        else if (Configuration.doAutoCreate())
1415          this.subject = new Reference(); // cc
1416      return this.subject;
1417    }
1418
1419    public boolean hasSubject() { 
1420      return this.subject != null && !this.subject.isEmpty();
1421    }
1422
1423    /**
1424     * @param value {@link #subject} (The patient or group that was the focus of this communication.)
1425     */
1426    public Communication setSubject(Reference value) { 
1427      this.subject = value;
1428      return this;
1429    }
1430
1431    /**
1432     * @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.)
1433     */
1434    public Resource getSubjectTarget() { 
1435      return this.subjectTarget;
1436    }
1437
1438    /**
1439     * @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.)
1440     */
1441    public Communication setSubjectTarget(Resource value) { 
1442      this.subjectTarget = value;
1443      return this;
1444    }
1445
1446    /**
1447     * @return {@link #topic} (Description of the purpose/content, similar to a subject line in an email.)
1448     */
1449    public CodeableConcept getTopic() { 
1450      if (this.topic == null)
1451        if (Configuration.errorOnAutoCreate())
1452          throw new Error("Attempt to auto-create Communication.topic");
1453        else if (Configuration.doAutoCreate())
1454          this.topic = new CodeableConcept(); // cc
1455      return this.topic;
1456    }
1457
1458    public boolean hasTopic() { 
1459      return this.topic != null && !this.topic.isEmpty();
1460    }
1461
1462    /**
1463     * @param value {@link #topic} (Description of the purpose/content, similar to a subject line in an email.)
1464     */
1465    public Communication setTopic(CodeableConcept value) { 
1466      this.topic = value;
1467      return this;
1468    }
1469
1470    /**
1471     * @return {@link #about} (Other resources that pertain to this communication and to which this communication should be associated.)
1472     */
1473    public List<Reference> getAbout() { 
1474      if (this.about == null)
1475        this.about = new ArrayList<Reference>();
1476      return this.about;
1477    }
1478
1479    /**
1480     * @return Returns a reference to <code>this</code> for easy method chaining
1481     */
1482    public Communication setAbout(List<Reference> theAbout) { 
1483      this.about = theAbout;
1484      return this;
1485    }
1486
1487    public boolean hasAbout() { 
1488      if (this.about == null)
1489        return false;
1490      for (Reference item : this.about)
1491        if (!item.isEmpty())
1492          return true;
1493      return false;
1494    }
1495
1496    public Reference addAbout() { //3
1497      Reference t = new Reference();
1498      if (this.about == null)
1499        this.about = new ArrayList<Reference>();
1500      this.about.add(t);
1501      return t;
1502    }
1503
1504    public Communication addAbout(Reference t) { //3
1505      if (t == null)
1506        return this;
1507      if (this.about == null)
1508        this.about = new ArrayList<Reference>();
1509      this.about.add(t);
1510      return this;
1511    }
1512
1513    /**
1514     * @return The first repetition of repeating field {@link #about}, creating it if it does not already exist
1515     */
1516    public Reference getAboutFirstRep() { 
1517      if (getAbout().isEmpty()) {
1518        addAbout();
1519      }
1520      return getAbout().get(0);
1521    }
1522
1523    /**
1524     * @deprecated Use Reference#setResource(IBaseResource) instead
1525     */
1526    @Deprecated
1527    public List<Resource> getAboutTarget() { 
1528      if (this.aboutTarget == null)
1529        this.aboutTarget = new ArrayList<Resource>();
1530      return this.aboutTarget;
1531    }
1532
1533    /**
1534     * @return {@link #context} (The encounter within which the communication was sent.)
1535     */
1536    public Reference getContext() { 
1537      if (this.context == null)
1538        if (Configuration.errorOnAutoCreate())
1539          throw new Error("Attempt to auto-create Communication.context");
1540        else if (Configuration.doAutoCreate())
1541          this.context = new Reference(); // cc
1542      return this.context;
1543    }
1544
1545    public boolean hasContext() { 
1546      return this.context != null && !this.context.isEmpty();
1547    }
1548
1549    /**
1550     * @param value {@link #context} (The encounter within which the communication was sent.)
1551     */
1552    public Communication setContext(Reference value) { 
1553      this.context = value;
1554      return this;
1555    }
1556
1557    /**
1558     * @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.)
1559     */
1560    public Resource getContextTarget() { 
1561      return this.contextTarget;
1562    }
1563
1564    /**
1565     * @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.)
1566     */
1567    public Communication setContextTarget(Resource value) { 
1568      this.contextTarget = value;
1569      return this;
1570    }
1571
1572    /**
1573     * @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
1574     */
1575    public DateTimeType getSentElement() { 
1576      if (this.sent == null)
1577        if (Configuration.errorOnAutoCreate())
1578          throw new Error("Attempt to auto-create Communication.sent");
1579        else if (Configuration.doAutoCreate())
1580          this.sent = new DateTimeType(); // bb
1581      return this.sent;
1582    }
1583
1584    public boolean hasSentElement() { 
1585      return this.sent != null && !this.sent.isEmpty();
1586    }
1587
1588    public boolean hasSent() { 
1589      return this.sent != null && !this.sent.isEmpty();
1590    }
1591
1592    /**
1593     * @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
1594     */
1595    public Communication setSentElement(DateTimeType value) { 
1596      this.sent = value;
1597      return this;
1598    }
1599
1600    /**
1601     * @return The time when this communication was sent.
1602     */
1603    public Date getSent() { 
1604      return this.sent == null ? null : this.sent.getValue();
1605    }
1606
1607    /**
1608     * @param value The time when this communication was sent.
1609     */
1610    public Communication setSent(Date value) { 
1611      if (value == null)
1612        this.sent = null;
1613      else {
1614        if (this.sent == null)
1615          this.sent = new DateTimeType();
1616        this.sent.setValue(value);
1617      }
1618      return this;
1619    }
1620
1621    /**
1622     * @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
1623     */
1624    public DateTimeType getReceivedElement() { 
1625      if (this.received == null)
1626        if (Configuration.errorOnAutoCreate())
1627          throw new Error("Attempt to auto-create Communication.received");
1628        else if (Configuration.doAutoCreate())
1629          this.received = new DateTimeType(); // bb
1630      return this.received;
1631    }
1632
1633    public boolean hasReceivedElement() { 
1634      return this.received != null && !this.received.isEmpty();
1635    }
1636
1637    public boolean hasReceived() { 
1638      return this.received != null && !this.received.isEmpty();
1639    }
1640
1641    /**
1642     * @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
1643     */
1644    public Communication setReceivedElement(DateTimeType value) { 
1645      this.received = value;
1646      return this;
1647    }
1648
1649    /**
1650     * @return The time when this communication arrived at the destination.
1651     */
1652    public Date getReceived() { 
1653      return this.received == null ? null : this.received.getValue();
1654    }
1655
1656    /**
1657     * @param value The time when this communication arrived at the destination.
1658     */
1659    public Communication setReceived(Date value) { 
1660      if (value == null)
1661        this.received = null;
1662      else {
1663        if (this.received == null)
1664          this.received = new DateTimeType();
1665        this.received.setValue(value);
1666      }
1667      return this;
1668    }
1669
1670    /**
1671     * @return {@link #recipient} (The entity (e.g. person, organization, clinical information system, care team or device) which was the target of the communication. If receipts need to be tracked by 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).)
1672     */
1673    public List<Reference> getRecipient() { 
1674      if (this.recipient == null)
1675        this.recipient = new ArrayList<Reference>();
1676      return this.recipient;
1677    }
1678
1679    /**
1680     * @return Returns a reference to <code>this</code> for easy method chaining
1681     */
1682    public Communication setRecipient(List<Reference> theRecipient) { 
1683      this.recipient = theRecipient;
1684      return this;
1685    }
1686
1687    public boolean hasRecipient() { 
1688      if (this.recipient == null)
1689        return false;
1690      for (Reference item : this.recipient)
1691        if (!item.isEmpty())
1692          return true;
1693      return false;
1694    }
1695
1696    public Reference addRecipient() { //3
1697      Reference t = new Reference();
1698      if (this.recipient == null)
1699        this.recipient = new ArrayList<Reference>();
1700      this.recipient.add(t);
1701      return t;
1702    }
1703
1704    public Communication addRecipient(Reference t) { //3
1705      if (t == null)
1706        return this;
1707      if (this.recipient == null)
1708        this.recipient = new ArrayList<Reference>();
1709      this.recipient.add(t);
1710      return this;
1711    }
1712
1713    /**
1714     * @return The first repetition of repeating field {@link #recipient}, creating it if it does not already exist
1715     */
1716    public Reference getRecipientFirstRep() { 
1717      if (getRecipient().isEmpty()) {
1718        addRecipient();
1719      }
1720      return getRecipient().get(0);
1721    }
1722
1723    /**
1724     * @deprecated Use Reference#setResource(IBaseResource) instead
1725     */
1726    @Deprecated
1727    public List<Resource> getRecipientTarget() { 
1728      if (this.recipientTarget == null)
1729        this.recipientTarget = new ArrayList<Resource>();
1730      return this.recipientTarget;
1731    }
1732
1733    /**
1734     * @return {@link #sender} (The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication.)
1735     */
1736    public Reference getSender() { 
1737      if (this.sender == null)
1738        if (Configuration.errorOnAutoCreate())
1739          throw new Error("Attempt to auto-create Communication.sender");
1740        else if (Configuration.doAutoCreate())
1741          this.sender = new Reference(); // cc
1742      return this.sender;
1743    }
1744
1745    public boolean hasSender() { 
1746      return this.sender != null && !this.sender.isEmpty();
1747    }
1748
1749    /**
1750     * @param value {@link #sender} (The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication.)
1751     */
1752    public Communication setSender(Reference value) { 
1753      this.sender = value;
1754      return this;
1755    }
1756
1757    /**
1758     * @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.)
1759     */
1760    public Resource getSenderTarget() { 
1761      return this.senderTarget;
1762    }
1763
1764    /**
1765     * @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.)
1766     */
1767    public Communication setSenderTarget(Resource value) { 
1768      this.senderTarget = value;
1769      return this;
1770    }
1771
1772    /**
1773     * @return {@link #reasonCode} (The reason or justification for the communication.)
1774     */
1775    public List<CodeableConcept> getReasonCode() { 
1776      if (this.reasonCode == null)
1777        this.reasonCode = new ArrayList<CodeableConcept>();
1778      return this.reasonCode;
1779    }
1780
1781    /**
1782     * @return Returns a reference to <code>this</code> for easy method chaining
1783     */
1784    public Communication setReasonCode(List<CodeableConcept> theReasonCode) { 
1785      this.reasonCode = theReasonCode;
1786      return this;
1787    }
1788
1789    public boolean hasReasonCode() { 
1790      if (this.reasonCode == null)
1791        return false;
1792      for (CodeableConcept item : this.reasonCode)
1793        if (!item.isEmpty())
1794          return true;
1795      return false;
1796    }
1797
1798    public CodeableConcept addReasonCode() { //3
1799      CodeableConcept t = new CodeableConcept();
1800      if (this.reasonCode == null)
1801        this.reasonCode = new ArrayList<CodeableConcept>();
1802      this.reasonCode.add(t);
1803      return t;
1804    }
1805
1806    public Communication addReasonCode(CodeableConcept t) { //3
1807      if (t == null)
1808        return this;
1809      if (this.reasonCode == null)
1810        this.reasonCode = new ArrayList<CodeableConcept>();
1811      this.reasonCode.add(t);
1812      return this;
1813    }
1814
1815    /**
1816     * @return The first repetition of repeating field {@link #reasonCode}, creating it if it does not already exist
1817     */
1818    public CodeableConcept getReasonCodeFirstRep() { 
1819      if (getReasonCode().isEmpty()) {
1820        addReasonCode();
1821      }
1822      return getReasonCode().get(0);
1823    }
1824
1825    /**
1826     * @return {@link #reasonReference} (Indicates another resource whose existence justifies this communication.)
1827     */
1828    public List<Reference> getReasonReference() { 
1829      if (this.reasonReference == null)
1830        this.reasonReference = new ArrayList<Reference>();
1831      return this.reasonReference;
1832    }
1833
1834    /**
1835     * @return Returns a reference to <code>this</code> for easy method chaining
1836     */
1837    public Communication setReasonReference(List<Reference> theReasonReference) { 
1838      this.reasonReference = theReasonReference;
1839      return this;
1840    }
1841
1842    public boolean hasReasonReference() { 
1843      if (this.reasonReference == null)
1844        return false;
1845      for (Reference item : this.reasonReference)
1846        if (!item.isEmpty())
1847          return true;
1848      return false;
1849    }
1850
1851    public Reference addReasonReference() { //3
1852      Reference t = new Reference();
1853      if (this.reasonReference == null)
1854        this.reasonReference = new ArrayList<Reference>();
1855      this.reasonReference.add(t);
1856      return t;
1857    }
1858
1859    public Communication addReasonReference(Reference t) { //3
1860      if (t == null)
1861        return this;
1862      if (this.reasonReference == null)
1863        this.reasonReference = new ArrayList<Reference>();
1864      this.reasonReference.add(t);
1865      return this;
1866    }
1867
1868    /**
1869     * @return The first repetition of repeating field {@link #reasonReference}, creating it if it does not already exist
1870     */
1871    public Reference getReasonReferenceFirstRep() { 
1872      if (getReasonReference().isEmpty()) {
1873        addReasonReference();
1874      }
1875      return getReasonReference().get(0);
1876    }
1877
1878    /**
1879     * @deprecated Use Reference#setResource(IBaseResource) instead
1880     */
1881    @Deprecated
1882    public List<Resource> getReasonReferenceTarget() { 
1883      if (this.reasonReferenceTarget == null)
1884        this.reasonReferenceTarget = new ArrayList<Resource>();
1885      return this.reasonReferenceTarget;
1886    }
1887
1888    /**
1889     * @return {@link #payload} (Text, attachment(s), or resource(s) that was communicated to the recipient.)
1890     */
1891    public List<CommunicationPayloadComponent> getPayload() { 
1892      if (this.payload == null)
1893        this.payload = new ArrayList<CommunicationPayloadComponent>();
1894      return this.payload;
1895    }
1896
1897    /**
1898     * @return Returns a reference to <code>this</code> for easy method chaining
1899     */
1900    public Communication setPayload(List<CommunicationPayloadComponent> thePayload) { 
1901      this.payload = thePayload;
1902      return this;
1903    }
1904
1905    public boolean hasPayload() { 
1906      if (this.payload == null)
1907        return false;
1908      for (CommunicationPayloadComponent item : this.payload)
1909        if (!item.isEmpty())
1910          return true;
1911      return false;
1912    }
1913
1914    public CommunicationPayloadComponent addPayload() { //3
1915      CommunicationPayloadComponent t = new CommunicationPayloadComponent();
1916      if (this.payload == null)
1917        this.payload = new ArrayList<CommunicationPayloadComponent>();
1918      this.payload.add(t);
1919      return t;
1920    }
1921
1922    public Communication addPayload(CommunicationPayloadComponent t) { //3
1923      if (t == null)
1924        return this;
1925      if (this.payload == null)
1926        this.payload = new ArrayList<CommunicationPayloadComponent>();
1927      this.payload.add(t);
1928      return this;
1929    }
1930
1931    /**
1932     * @return The first repetition of repeating field {@link #payload}, creating it if it does not already exist
1933     */
1934    public CommunicationPayloadComponent getPayloadFirstRep() { 
1935      if (getPayload().isEmpty()) {
1936        addPayload();
1937      }
1938      return getPayload().get(0);
1939    }
1940
1941    /**
1942     * @return {@link #note} (Additional notes or commentary about the communication by the sender, receiver or other interested parties.)
1943     */
1944    public List<Annotation> getNote() { 
1945      if (this.note == null)
1946        this.note = new ArrayList<Annotation>();
1947      return this.note;
1948    }
1949
1950    /**
1951     * @return Returns a reference to <code>this</code> for easy method chaining
1952     */
1953    public Communication setNote(List<Annotation> theNote) { 
1954      this.note = theNote;
1955      return this;
1956    }
1957
1958    public boolean hasNote() { 
1959      if (this.note == null)
1960        return false;
1961      for (Annotation item : this.note)
1962        if (!item.isEmpty())
1963          return true;
1964      return false;
1965    }
1966
1967    public Annotation addNote() { //3
1968      Annotation t = new Annotation();
1969      if (this.note == null)
1970        this.note = new ArrayList<Annotation>();
1971      this.note.add(t);
1972      return t;
1973    }
1974
1975    public Communication addNote(Annotation t) { //3
1976      if (t == null)
1977        return this;
1978      if (this.note == null)
1979        this.note = new ArrayList<Annotation>();
1980      this.note.add(t);
1981      return this;
1982    }
1983
1984    /**
1985     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist
1986     */
1987    public Annotation getNoteFirstRep() { 
1988      if (getNote().isEmpty()) {
1989        addNote();
1990      }
1991      return getNote().get(0);
1992    }
1993
1994      protected void listChildren(List<Property> children) {
1995        super.listChildren(children);
1996        children.add(new Property("identifier", "Identifier", "Business identifiers assigned to this communication by the performer or other systems which remain constant as the resource is updated and propagates from server to server.", 0, java.lang.Integer.MAX_VALUE, identifier));
1997        children.add(new Property("instantiatesCanonical", "canonical(PlanDefinition|ActivityDefinition|Measure|OperationDefinition|Questionnaire)", "The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.", 0, java.lang.Integer.MAX_VALUE, instantiatesCanonical));
1998        children.add(new Property("instantiatesUri", "uri", "The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.", 0, java.lang.Integer.MAX_VALUE, instantiatesUri));
1999        children.add(new Property("basedOn", "Reference(Any)", "An order, proposal or plan fulfilled in whole or in part by this Communication.", 0, java.lang.Integer.MAX_VALUE, basedOn));
2000        children.add(new Property("partOf", "Reference(Any)", "Part of this action.", 0, java.lang.Integer.MAX_VALUE, partOf));
2001        children.add(new Property("inResponseTo", "Reference(Communication)", "Prior communication that this communication is in response to.", 0, java.lang.Integer.MAX_VALUE, inResponseTo));
2002        children.add(new Property("status", "code", "The status of the transmission.", 0, 1, status));
2003        children.add(new Property("statusReason", "CodeableConcept", "Captures the reason for the current state of the Communication.", 0, 1, statusReason));
2004        children.add(new Property("category", "CodeableConcept", "The type of message conveyed such as alert, notification, reminder, instruction, etc.", 0, java.lang.Integer.MAX_VALUE, category));
2005        children.add(new Property("priority", "code", "Characterizes how quickly the planned or in progress communication must be addressed. Includes concepts such as stat, urgent, routine.", 0, 1, priority));
2006        children.add(new Property("medium", "CodeableConcept", "A channel that was used for this communication (e.g. email, fax).", 0, java.lang.Integer.MAX_VALUE, medium));
2007        children.add(new Property("subject", "Reference(Patient|Group)", "The patient or group that was the focus of this communication.", 0, 1, subject));
2008        children.add(new Property("topic", "CodeableConcept", "Description of the purpose/content, similar to a subject line in an email.", 0, 1, topic));
2009        children.add(new Property("about", "Reference(Any)", "Other resources that pertain to this communication and to which this communication should be associated.", 0, java.lang.Integer.MAX_VALUE, about));
2010        children.add(new Property("context", "Reference(Encounter|EpisodeOfCare)", "The encounter within which the communication was sent.", 0, 1, context));
2011        children.add(new Property("sent", "dateTime", "The time when this communication was sent.", 0, 1, sent));
2012        children.add(new Property("received", "dateTime", "The time when this communication arrived at the destination.", 0, 1, received));
2013        children.add(new Property("recipient", "Reference(Device|Organization|Patient|Practitioner|PractitionerRole|RelatedPerson|Group|CareTeam|HealthcareService)", "The entity (e.g. person, organization, clinical information system, care team or device) which was the target of the communication. If receipts need to be tracked by 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));
2014        children.add(new Property("sender", "Reference(Device|Organization|Patient|Practitioner|PractitionerRole|RelatedPerson|HealthcareService)", "The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication.", 0, 1, sender));
2015        children.add(new Property("reasonCode", "CodeableConcept", "The reason or justification for the communication.", 0, java.lang.Integer.MAX_VALUE, reasonCode));
2016        children.add(new Property("reasonReference", "Reference(Condition|Observation|DiagnosticReport|DocumentReference)", "Indicates another resource whose existence justifies this communication.", 0, java.lang.Integer.MAX_VALUE, reasonReference));
2017        children.add(new Property("payload", "", "Text, attachment(s), or resource(s) that was communicated to the recipient.", 0, java.lang.Integer.MAX_VALUE, payload));
2018        children.add(new Property("note", "Annotation", "Additional notes or commentary about the communication by the sender, receiver or other interested parties.", 0, java.lang.Integer.MAX_VALUE, note));
2019      }
2020
2021      @Override
2022      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2023        switch (_hash) {
2024        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Business identifiers assigned to this communication by the performer or other systems which remain constant as the resource is updated and propagates from server to server.", 0, java.lang.Integer.MAX_VALUE, identifier);
2025        case 8911915: /*instantiatesCanonical*/  return new Property("instantiatesCanonical", "canonical(PlanDefinition|ActivityDefinition|Measure|OperationDefinition|Questionnaire)", "The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.", 0, java.lang.Integer.MAX_VALUE, instantiatesCanonical);
2026        case -1926393373: /*instantiatesUri*/  return new Property("instantiatesUri", "uri", "The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.", 0, java.lang.Integer.MAX_VALUE, instantiatesUri);
2027        case -332612366: /*basedOn*/  return new Property("basedOn", "Reference(Any)", "An order, proposal or plan fulfilled in whole or in part by this Communication.", 0, java.lang.Integer.MAX_VALUE, basedOn);
2028        case -995410646: /*partOf*/  return new Property("partOf", "Reference(Any)", "Part of this action.", 0, java.lang.Integer.MAX_VALUE, partOf);
2029        case 1932956065: /*inResponseTo*/  return new Property("inResponseTo", "Reference(Communication)", "Prior communication that this communication is in response to.", 0, java.lang.Integer.MAX_VALUE, inResponseTo);
2030        case -892481550: /*status*/  return new Property("status", "code", "The status of the transmission.", 0, 1, status);
2031        case 2051346646: /*statusReason*/  return new Property("statusReason", "CodeableConcept", "Captures the reason for the current state of the Communication.", 0, 1, statusReason);
2032        case 50511102: /*category*/  return new Property("category", "CodeableConcept", "The type of message conveyed such as alert, notification, reminder, instruction, etc.", 0, java.lang.Integer.MAX_VALUE, category);
2033        case -1165461084: /*priority*/  return new Property("priority", "code", "Characterizes how quickly the planned or in progress communication must be addressed. Includes concepts such as stat, urgent, routine.", 0, 1, priority);
2034        case -1078030475: /*medium*/  return new Property("medium", "CodeableConcept", "A channel that was used for this communication (e.g. email, fax).", 0, java.lang.Integer.MAX_VALUE, medium);
2035        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group)", "The patient or group that was the focus of this communication.", 0, 1, subject);
2036        case 110546223: /*topic*/  return new Property("topic", "CodeableConcept", "Description of the purpose/content, similar to a subject line in an email.", 0, 1, topic);
2037        case 92611469: /*about*/  return new Property("about", "Reference(Any)", "Other resources that pertain to this communication and to which this communication should be associated.", 0, java.lang.Integer.MAX_VALUE, about);
2038        case 951530927: /*context*/  return new Property("context", "Reference(Encounter|EpisodeOfCare)", "The encounter within which the communication was sent.", 0, 1, context);
2039        case 3526552: /*sent*/  return new Property("sent", "dateTime", "The time when this communication was sent.", 0, 1, sent);
2040        case -808719903: /*received*/  return new Property("received", "dateTime", "The time when this communication arrived at the destination.", 0, 1, received);
2041        case 820081177: /*recipient*/  return new Property("recipient", "Reference(Device|Organization|Patient|Practitioner|PractitionerRole|RelatedPerson|Group|CareTeam|HealthcareService)", "The entity (e.g. person, organization, clinical information system, care team or device) which was the target of the communication. If receipts need to be tracked by 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);
2042        case -905962955: /*sender*/  return new Property("sender", "Reference(Device|Organization|Patient|Practitioner|PractitionerRole|RelatedPerson|HealthcareService)", "The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication.", 0, 1, sender);
2043        case 722137681: /*reasonCode*/  return new Property("reasonCode", "CodeableConcept", "The reason or justification for the communication.", 0, java.lang.Integer.MAX_VALUE, reasonCode);
2044        case -1146218137: /*reasonReference*/  return new Property("reasonReference", "Reference(Condition|Observation|DiagnosticReport|DocumentReference)", "Indicates another resource whose existence justifies this communication.", 0, java.lang.Integer.MAX_VALUE, reasonReference);
2045        case -786701938: /*payload*/  return new Property("payload", "", "Text, attachment(s), or resource(s) that was communicated to the recipient.", 0, java.lang.Integer.MAX_VALUE, payload);
2046        case 3387378: /*note*/  return new Property("note", "Annotation", "Additional notes or commentary about the communication by the sender, receiver or other interested parties.", 0, java.lang.Integer.MAX_VALUE, note);
2047        default: return super.getNamedProperty(_hash, _name, _checkValid);
2048        }
2049
2050      }
2051
2052      @Override
2053      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2054        switch (hash) {
2055        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2056        case 8911915: /*instantiatesCanonical*/ return this.instantiatesCanonical == null ? new Base[0] : this.instantiatesCanonical.toArray(new Base[this.instantiatesCanonical.size()]); // CanonicalType
2057        case -1926393373: /*instantiatesUri*/ return this.instantiatesUri == null ? new Base[0] : this.instantiatesUri.toArray(new Base[this.instantiatesUri.size()]); // UriType
2058        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
2059        case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : this.partOf.toArray(new Base[this.partOf.size()]); // Reference
2060        case 1932956065: /*inResponseTo*/ return this.inResponseTo == null ? new Base[0] : this.inResponseTo.toArray(new Base[this.inResponseTo.size()]); // Reference
2061        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<CommunicationStatus>
2062        case 2051346646: /*statusReason*/ return this.statusReason == null ? new Base[0] : new Base[] {this.statusReason}; // CodeableConcept
2063        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
2064        case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Enumeration<CommunicationPriority>
2065        case -1078030475: /*medium*/ return this.medium == null ? new Base[0] : this.medium.toArray(new Base[this.medium.size()]); // CodeableConcept
2066        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
2067        case 110546223: /*topic*/ return this.topic == null ? new Base[0] : new Base[] {this.topic}; // CodeableConcept
2068        case 92611469: /*about*/ return this.about == null ? new Base[0] : this.about.toArray(new Base[this.about.size()]); // Reference
2069        case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // Reference
2070        case 3526552: /*sent*/ return this.sent == null ? new Base[0] : new Base[] {this.sent}; // DateTimeType
2071        case -808719903: /*received*/ return this.received == null ? new Base[0] : new Base[] {this.received}; // DateTimeType
2072        case 820081177: /*recipient*/ return this.recipient == null ? new Base[0] : this.recipient.toArray(new Base[this.recipient.size()]); // Reference
2073        case -905962955: /*sender*/ return this.sender == null ? new Base[0] : new Base[] {this.sender}; // Reference
2074        case 722137681: /*reasonCode*/ return this.reasonCode == null ? new Base[0] : this.reasonCode.toArray(new Base[this.reasonCode.size()]); // CodeableConcept
2075        case -1146218137: /*reasonReference*/ return this.reasonReference == null ? new Base[0] : this.reasonReference.toArray(new Base[this.reasonReference.size()]); // Reference
2076        case -786701938: /*payload*/ return this.payload == null ? new Base[0] : this.payload.toArray(new Base[this.payload.size()]); // CommunicationPayloadComponent
2077        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
2078        default: return super.getProperty(hash, name, checkValid);
2079        }
2080
2081      }
2082
2083      @Override
2084      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2085        switch (hash) {
2086        case -1618432855: // identifier
2087          this.getIdentifier().add(castToIdentifier(value)); // Identifier
2088          return value;
2089        case 8911915: // instantiatesCanonical
2090          this.getInstantiatesCanonical().add(castToCanonical(value)); // CanonicalType
2091          return value;
2092        case -1926393373: // instantiatesUri
2093          this.getInstantiatesUri().add(castToUri(value)); // UriType
2094          return value;
2095        case -332612366: // basedOn
2096          this.getBasedOn().add(castToReference(value)); // Reference
2097          return value;
2098        case -995410646: // partOf
2099          this.getPartOf().add(castToReference(value)); // Reference
2100          return value;
2101        case 1932956065: // inResponseTo
2102          this.getInResponseTo().add(castToReference(value)); // Reference
2103          return value;
2104        case -892481550: // status
2105          value = new CommunicationStatusEnumFactory().fromType(castToCode(value));
2106          this.status = (Enumeration) value; // Enumeration<CommunicationStatus>
2107          return value;
2108        case 2051346646: // statusReason
2109          this.statusReason = castToCodeableConcept(value); // CodeableConcept
2110          return value;
2111        case 50511102: // category
2112          this.getCategory().add(castToCodeableConcept(value)); // CodeableConcept
2113          return value;
2114        case -1165461084: // priority
2115          value = new CommunicationPriorityEnumFactory().fromType(castToCode(value));
2116          this.priority = (Enumeration) value; // Enumeration<CommunicationPriority>
2117          return value;
2118        case -1078030475: // medium
2119          this.getMedium().add(castToCodeableConcept(value)); // CodeableConcept
2120          return value;
2121        case -1867885268: // subject
2122          this.subject = castToReference(value); // Reference
2123          return value;
2124        case 110546223: // topic
2125          this.topic = castToCodeableConcept(value); // CodeableConcept
2126          return value;
2127        case 92611469: // about
2128          this.getAbout().add(castToReference(value)); // Reference
2129          return value;
2130        case 951530927: // context
2131          this.context = castToReference(value); // Reference
2132          return value;
2133        case 3526552: // sent
2134          this.sent = castToDateTime(value); // DateTimeType
2135          return value;
2136        case -808719903: // received
2137          this.received = castToDateTime(value); // DateTimeType
2138          return value;
2139        case 820081177: // recipient
2140          this.getRecipient().add(castToReference(value)); // Reference
2141          return value;
2142        case -905962955: // sender
2143          this.sender = castToReference(value); // Reference
2144          return value;
2145        case 722137681: // reasonCode
2146          this.getReasonCode().add(castToCodeableConcept(value)); // CodeableConcept
2147          return value;
2148        case -1146218137: // reasonReference
2149          this.getReasonReference().add(castToReference(value)); // Reference
2150          return value;
2151        case -786701938: // payload
2152          this.getPayload().add((CommunicationPayloadComponent) value); // CommunicationPayloadComponent
2153          return value;
2154        case 3387378: // note
2155          this.getNote().add(castToAnnotation(value)); // Annotation
2156          return value;
2157        default: return super.setProperty(hash, name, value);
2158        }
2159
2160      }
2161
2162      @Override
2163      public Base setProperty(String name, Base value) throws FHIRException {
2164        if (name.equals("identifier")) {
2165          this.getIdentifier().add(castToIdentifier(value));
2166        } else if (name.equals("instantiatesCanonical")) {
2167          this.getInstantiatesCanonical().add(castToCanonical(value));
2168        } else if (name.equals("instantiatesUri")) {
2169          this.getInstantiatesUri().add(castToUri(value));
2170        } else if (name.equals("basedOn")) {
2171          this.getBasedOn().add(castToReference(value));
2172        } else if (name.equals("partOf")) {
2173          this.getPartOf().add(castToReference(value));
2174        } else if (name.equals("inResponseTo")) {
2175          this.getInResponseTo().add(castToReference(value));
2176        } else if (name.equals("status")) {
2177          value = new CommunicationStatusEnumFactory().fromType(castToCode(value));
2178          this.status = (Enumeration) value; // Enumeration<CommunicationStatus>
2179        } else if (name.equals("statusReason")) {
2180          this.statusReason = castToCodeableConcept(value); // CodeableConcept
2181        } else if (name.equals("category")) {
2182          this.getCategory().add(castToCodeableConcept(value));
2183        } else if (name.equals("priority")) {
2184          value = new CommunicationPriorityEnumFactory().fromType(castToCode(value));
2185          this.priority = (Enumeration) value; // Enumeration<CommunicationPriority>
2186        } else if (name.equals("medium")) {
2187          this.getMedium().add(castToCodeableConcept(value));
2188        } else if (name.equals("subject")) {
2189          this.subject = castToReference(value); // Reference
2190        } else if (name.equals("topic")) {
2191          this.topic = castToCodeableConcept(value); // CodeableConcept
2192        } else if (name.equals("about")) {
2193          this.getAbout().add(castToReference(value));
2194        } else if (name.equals("context")) {
2195          this.context = castToReference(value); // Reference
2196        } else if (name.equals("sent")) {
2197          this.sent = castToDateTime(value); // DateTimeType
2198        } else if (name.equals("received")) {
2199          this.received = castToDateTime(value); // DateTimeType
2200        } else if (name.equals("recipient")) {
2201          this.getRecipient().add(castToReference(value));
2202        } else if (name.equals("sender")) {
2203          this.sender = castToReference(value); // Reference
2204        } else if (name.equals("reasonCode")) {
2205          this.getReasonCode().add(castToCodeableConcept(value));
2206        } else if (name.equals("reasonReference")) {
2207          this.getReasonReference().add(castToReference(value));
2208        } else if (name.equals("payload")) {
2209          this.getPayload().add((CommunicationPayloadComponent) value);
2210        } else if (name.equals("note")) {
2211          this.getNote().add(castToAnnotation(value));
2212        } else
2213          return super.setProperty(name, value);
2214        return value;
2215      }
2216
2217      @Override
2218      public Base makeProperty(int hash, String name) throws FHIRException {
2219        switch (hash) {
2220        case -1618432855:  return addIdentifier(); 
2221        case 8911915:  return addInstantiatesCanonicalElement();
2222        case -1926393373:  return addInstantiatesUriElement();
2223        case -332612366:  return addBasedOn(); 
2224        case -995410646:  return addPartOf(); 
2225        case 1932956065:  return addInResponseTo(); 
2226        case -892481550:  return getStatusElement();
2227        case 2051346646:  return getStatusReason(); 
2228        case 50511102:  return addCategory(); 
2229        case -1165461084:  return getPriorityElement();
2230        case -1078030475:  return addMedium(); 
2231        case -1867885268:  return getSubject(); 
2232        case 110546223:  return getTopic(); 
2233        case 92611469:  return addAbout(); 
2234        case 951530927:  return getContext(); 
2235        case 3526552:  return getSentElement();
2236        case -808719903:  return getReceivedElement();
2237        case 820081177:  return addRecipient(); 
2238        case -905962955:  return getSender(); 
2239        case 722137681:  return addReasonCode(); 
2240        case -1146218137:  return addReasonReference(); 
2241        case -786701938:  return addPayload(); 
2242        case 3387378:  return addNote(); 
2243        default: return super.makeProperty(hash, name);
2244        }
2245
2246      }
2247
2248      @Override
2249      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2250        switch (hash) {
2251        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2252        case 8911915: /*instantiatesCanonical*/ return new String[] {"canonical"};
2253        case -1926393373: /*instantiatesUri*/ return new String[] {"uri"};
2254        case -332612366: /*basedOn*/ return new String[] {"Reference"};
2255        case -995410646: /*partOf*/ return new String[] {"Reference"};
2256        case 1932956065: /*inResponseTo*/ return new String[] {"Reference"};
2257        case -892481550: /*status*/ return new String[] {"code"};
2258        case 2051346646: /*statusReason*/ return new String[] {"CodeableConcept"};
2259        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
2260        case -1165461084: /*priority*/ return new String[] {"code"};
2261        case -1078030475: /*medium*/ return new String[] {"CodeableConcept"};
2262        case -1867885268: /*subject*/ return new String[] {"Reference"};
2263        case 110546223: /*topic*/ return new String[] {"CodeableConcept"};
2264        case 92611469: /*about*/ return new String[] {"Reference"};
2265        case 951530927: /*context*/ return new String[] {"Reference"};
2266        case 3526552: /*sent*/ return new String[] {"dateTime"};
2267        case -808719903: /*received*/ return new String[] {"dateTime"};
2268        case 820081177: /*recipient*/ return new String[] {"Reference"};
2269        case -905962955: /*sender*/ return new String[] {"Reference"};
2270        case 722137681: /*reasonCode*/ return new String[] {"CodeableConcept"};
2271        case -1146218137: /*reasonReference*/ return new String[] {"Reference"};
2272        case -786701938: /*payload*/ return new String[] {};
2273        case 3387378: /*note*/ return new String[] {"Annotation"};
2274        default: return super.getTypesForProperty(hash, name);
2275        }
2276
2277      }
2278
2279      @Override
2280      public Base addChild(String name) throws FHIRException {
2281        if (name.equals("identifier")) {
2282          return addIdentifier();
2283        }
2284        else if (name.equals("instantiatesCanonical")) {
2285          throw new FHIRException("Cannot call addChild on a primitive type Communication.instantiatesCanonical");
2286        }
2287        else if (name.equals("instantiatesUri")) {
2288          throw new FHIRException("Cannot call addChild on a primitive type Communication.instantiatesUri");
2289        }
2290        else if (name.equals("basedOn")) {
2291          return addBasedOn();
2292        }
2293        else if (name.equals("partOf")) {
2294          return addPartOf();
2295        }
2296        else if (name.equals("inResponseTo")) {
2297          return addInResponseTo();
2298        }
2299        else if (name.equals("status")) {
2300          throw new FHIRException("Cannot call addChild on a primitive type Communication.status");
2301        }
2302        else if (name.equals("statusReason")) {
2303          this.statusReason = new CodeableConcept();
2304          return this.statusReason;
2305        }
2306        else if (name.equals("category")) {
2307          return addCategory();
2308        }
2309        else if (name.equals("priority")) {
2310          throw new FHIRException("Cannot call addChild on a primitive type Communication.priority");
2311        }
2312        else if (name.equals("medium")) {
2313          return addMedium();
2314        }
2315        else if (name.equals("subject")) {
2316          this.subject = new Reference();
2317          return this.subject;
2318        }
2319        else if (name.equals("topic")) {
2320          this.topic = new CodeableConcept();
2321          return this.topic;
2322        }
2323        else if (name.equals("about")) {
2324          return addAbout();
2325        }
2326        else if (name.equals("context")) {
2327          this.context = new Reference();
2328          return this.context;
2329        }
2330        else if (name.equals("sent")) {
2331          throw new FHIRException("Cannot call addChild on a primitive type Communication.sent");
2332        }
2333        else if (name.equals("received")) {
2334          throw new FHIRException("Cannot call addChild on a primitive type Communication.received");
2335        }
2336        else if (name.equals("recipient")) {
2337          return addRecipient();
2338        }
2339        else if (name.equals("sender")) {
2340          this.sender = new Reference();
2341          return this.sender;
2342        }
2343        else if (name.equals("reasonCode")) {
2344          return addReasonCode();
2345        }
2346        else if (name.equals("reasonReference")) {
2347          return addReasonReference();
2348        }
2349        else if (name.equals("payload")) {
2350          return addPayload();
2351        }
2352        else if (name.equals("note")) {
2353          return addNote();
2354        }
2355        else
2356          return super.addChild(name);
2357      }
2358
2359  public String fhirType() {
2360    return "Communication";
2361
2362  }
2363
2364      public Communication copy() {
2365        Communication dst = new Communication();
2366        copyValues(dst);
2367        if (identifier != null) {
2368          dst.identifier = new ArrayList<Identifier>();
2369          for (Identifier i : identifier)
2370            dst.identifier.add(i.copy());
2371        };
2372        if (instantiatesCanonical != null) {
2373          dst.instantiatesCanonical = new ArrayList<CanonicalType>();
2374          for (CanonicalType i : instantiatesCanonical)
2375            dst.instantiatesCanonical.add(i.copy());
2376        };
2377        if (instantiatesUri != null) {
2378          dst.instantiatesUri = new ArrayList<UriType>();
2379          for (UriType i : instantiatesUri)
2380            dst.instantiatesUri.add(i.copy());
2381        };
2382        if (basedOn != null) {
2383          dst.basedOn = new ArrayList<Reference>();
2384          for (Reference i : basedOn)
2385            dst.basedOn.add(i.copy());
2386        };
2387        if (partOf != null) {
2388          dst.partOf = new ArrayList<Reference>();
2389          for (Reference i : partOf)
2390            dst.partOf.add(i.copy());
2391        };
2392        if (inResponseTo != null) {
2393          dst.inResponseTo = new ArrayList<Reference>();
2394          for (Reference i : inResponseTo)
2395            dst.inResponseTo.add(i.copy());
2396        };
2397        dst.status = status == null ? null : status.copy();
2398        dst.statusReason = statusReason == null ? null : statusReason.copy();
2399        if (category != null) {
2400          dst.category = new ArrayList<CodeableConcept>();
2401          for (CodeableConcept i : category)
2402            dst.category.add(i.copy());
2403        };
2404        dst.priority = priority == null ? null : priority.copy();
2405        if (medium != null) {
2406          dst.medium = new ArrayList<CodeableConcept>();
2407          for (CodeableConcept i : medium)
2408            dst.medium.add(i.copy());
2409        };
2410        dst.subject = subject == null ? null : subject.copy();
2411        dst.topic = topic == null ? null : topic.copy();
2412        if (about != null) {
2413          dst.about = new ArrayList<Reference>();
2414          for (Reference i : about)
2415            dst.about.add(i.copy());
2416        };
2417        dst.context = context == null ? null : context.copy();
2418        dst.sent = sent == null ? null : sent.copy();
2419        dst.received = received == null ? null : received.copy();
2420        if (recipient != null) {
2421          dst.recipient = new ArrayList<Reference>();
2422          for (Reference i : recipient)
2423            dst.recipient.add(i.copy());
2424        };
2425        dst.sender = sender == null ? null : sender.copy();
2426        if (reasonCode != null) {
2427          dst.reasonCode = new ArrayList<CodeableConcept>();
2428          for (CodeableConcept i : reasonCode)
2429            dst.reasonCode.add(i.copy());
2430        };
2431        if (reasonReference != null) {
2432          dst.reasonReference = new ArrayList<Reference>();
2433          for (Reference i : reasonReference)
2434            dst.reasonReference.add(i.copy());
2435        };
2436        if (payload != null) {
2437          dst.payload = new ArrayList<CommunicationPayloadComponent>();
2438          for (CommunicationPayloadComponent i : payload)
2439            dst.payload.add(i.copy());
2440        };
2441        if (note != null) {
2442          dst.note = new ArrayList<Annotation>();
2443          for (Annotation i : note)
2444            dst.note.add(i.copy());
2445        };
2446        return dst;
2447      }
2448
2449      protected Communication typedCopy() {
2450        return copy();
2451      }
2452
2453      @Override
2454      public boolean equalsDeep(Base other_) {
2455        if (!super.equalsDeep(other_))
2456          return false;
2457        if (!(other_ instanceof Communication))
2458          return false;
2459        Communication o = (Communication) other_;
2460        return compareDeep(identifier, o.identifier, true) && compareDeep(instantiatesCanonical, o.instantiatesCanonical, true)
2461           && compareDeep(instantiatesUri, o.instantiatesUri, true) && compareDeep(basedOn, o.basedOn, true)
2462           && compareDeep(partOf, o.partOf, true) && compareDeep(inResponseTo, o.inResponseTo, true) && compareDeep(status, o.status, true)
2463           && compareDeep(statusReason, o.statusReason, true) && compareDeep(category, o.category, true) && compareDeep(priority, o.priority, true)
2464           && compareDeep(medium, o.medium, true) && compareDeep(subject, o.subject, true) && compareDeep(topic, o.topic, true)
2465           && compareDeep(about, o.about, true) && compareDeep(context, o.context, true) && compareDeep(sent, o.sent, true)
2466           && compareDeep(received, o.received, true) && compareDeep(recipient, o.recipient, true) && compareDeep(sender, o.sender, true)
2467           && compareDeep(reasonCode, o.reasonCode, true) && compareDeep(reasonReference, o.reasonReference, true)
2468           && compareDeep(payload, o.payload, true) && compareDeep(note, o.note, true);
2469      }
2470
2471      @Override
2472      public boolean equalsShallow(Base other_) {
2473        if (!super.equalsShallow(other_))
2474          return false;
2475        if (!(other_ instanceof Communication))
2476          return false;
2477        Communication o = (Communication) other_;
2478        return compareValues(instantiatesUri, o.instantiatesUri, true) && compareValues(status, o.status, true)
2479           && compareValues(priority, o.priority, true) && compareValues(sent, o.sent, true) && compareValues(received, o.received, true)
2480          ;
2481      }
2482
2483      public boolean isEmpty() {
2484        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, instantiatesCanonical
2485          , instantiatesUri, basedOn, partOf, inResponseTo, status, statusReason, category
2486          , priority, medium, subject, topic, about, context, sent, received, recipient
2487          , sender, reasonCode, reasonReference, payload, note);
2488      }
2489
2490  @Override
2491  public ResourceType getResourceType() {
2492    return ResourceType.Communication;
2493   }
2494
2495 /**
2496   * Search parameter: <b>identifier</b>
2497   * <p>
2498   * Description: <b>Unique identifier</b><br>
2499   * Type: <b>token</b><br>
2500   * Path: <b>Communication.identifier</b><br>
2501   * </p>
2502   */
2503  @SearchParamDefinition(name="identifier", path="Communication.identifier", description="Unique identifier", type="token" )
2504  public static final String SP_IDENTIFIER = "identifier";
2505 /**
2506   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2507   * <p>
2508   * Description: <b>Unique identifier</b><br>
2509   * Type: <b>token</b><br>
2510   * Path: <b>Communication.identifier</b><br>
2511   * </p>
2512   */
2513  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2514
2515 /**
2516   * Search parameter: <b>subject</b>
2517   * <p>
2518   * Description: <b>Focus of message</b><br>
2519   * Type: <b>reference</b><br>
2520   * Path: <b>Communication.subject</b><br>
2521   * </p>
2522   */
2523  @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 } )
2524  public static final String SP_SUBJECT = "subject";
2525 /**
2526   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
2527   * <p>
2528   * Description: <b>Focus of message</b><br>
2529   * Type: <b>reference</b><br>
2530   * Path: <b>Communication.subject</b><br>
2531   * </p>
2532   */
2533  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
2534
2535/**
2536   * Constant for fluent queries to be used to add include statements. Specifies
2537   * the path value of "<b>Communication:subject</b>".
2538   */
2539  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Communication:subject").toLocked();
2540
2541 /**
2542   * Search parameter: <b>instantiates-canonical</b>
2543   * <p>
2544   * Description: <b>Instantiates FHIR protocol or definition</b><br>
2545   * Type: <b>reference</b><br>
2546   * Path: <b>Communication.instantiatesCanonical</b><br>
2547   * </p>
2548   */
2549  @SearchParamDefinition(name="instantiates-canonical", path="Communication.instantiatesCanonical", description="Instantiates FHIR protocol or definition", type="reference", target={ActivityDefinition.class, Measure.class, OperationDefinition.class, PlanDefinition.class, Questionnaire.class } )
2550  public static final String SP_INSTANTIATES_CANONICAL = "instantiates-canonical";
2551 /**
2552   * <b>Fluent Client</b> search parameter constant for <b>instantiates-canonical</b>
2553   * <p>
2554   * Description: <b>Instantiates FHIR protocol or definition</b><br>
2555   * Type: <b>reference</b><br>
2556   * Path: <b>Communication.instantiatesCanonical</b><br>
2557   * </p>
2558   */
2559  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INSTANTIATES_CANONICAL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INSTANTIATES_CANONICAL);
2560
2561/**
2562   * Constant for fluent queries to be used to add include statements. Specifies
2563   * the path value of "<b>Communication:instantiates-canonical</b>".
2564   */
2565  public static final ca.uhn.fhir.model.api.Include INCLUDE_INSTANTIATES_CANONICAL = new ca.uhn.fhir.model.api.Include("Communication:instantiates-canonical").toLocked();
2566
2567 /**
2568   * Search parameter: <b>received</b>
2569   * <p>
2570   * Description: <b>When received</b><br>
2571   * Type: <b>date</b><br>
2572   * Path: <b>Communication.received</b><br>
2573   * </p>
2574   */
2575  @SearchParamDefinition(name="received", path="Communication.received", description="When received", type="date" )
2576  public static final String SP_RECEIVED = "received";
2577 /**
2578   * <b>Fluent Client</b> search parameter constant for <b>received</b>
2579   * <p>
2580   * Description: <b>When received</b><br>
2581   * Type: <b>date</b><br>
2582   * Path: <b>Communication.received</b><br>
2583   * </p>
2584   */
2585  public static final ca.uhn.fhir.rest.gclient.DateClientParam RECEIVED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_RECEIVED);
2586
2587 /**
2588   * Search parameter: <b>part-of</b>
2589   * <p>
2590   * Description: <b>Part of this action</b><br>
2591   * Type: <b>reference</b><br>
2592   * Path: <b>Communication.partOf</b><br>
2593   * </p>
2594   */
2595  @SearchParamDefinition(name="part-of", path="Communication.partOf", description="Part of this action", type="reference" )
2596  public static final String SP_PART_OF = "part-of";
2597 /**
2598   * <b>Fluent Client</b> search parameter constant for <b>part-of</b>
2599   * <p>
2600   * Description: <b>Part of this action</b><br>
2601   * Type: <b>reference</b><br>
2602   * Path: <b>Communication.partOf</b><br>
2603   * </p>
2604   */
2605  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PART_OF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PART_OF);
2606
2607/**
2608   * Constant for fluent queries to be used to add include statements. Specifies
2609   * the path value of "<b>Communication:part-of</b>".
2610   */
2611  public static final ca.uhn.fhir.model.api.Include INCLUDE_PART_OF = new ca.uhn.fhir.model.api.Include("Communication:part-of").toLocked();
2612
2613 /**
2614   * Search parameter: <b>medium</b>
2615   * <p>
2616   * Description: <b>A channel of communication</b><br>
2617   * Type: <b>token</b><br>
2618   * Path: <b>Communication.medium</b><br>
2619   * </p>
2620   */
2621  @SearchParamDefinition(name="medium", path="Communication.medium", description="A channel of communication", type="token" )
2622  public static final String SP_MEDIUM = "medium";
2623 /**
2624   * <b>Fluent Client</b> search parameter constant for <b>medium</b>
2625   * <p>
2626   * Description: <b>A channel of communication</b><br>
2627   * Type: <b>token</b><br>
2628   * Path: <b>Communication.medium</b><br>
2629   * </p>
2630   */
2631  public static final ca.uhn.fhir.rest.gclient.TokenClientParam MEDIUM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_MEDIUM);
2632
2633 /**
2634   * Search parameter: <b>encounter</b>
2635   * <p>
2636   * Description: <b>Encounter leading to message</b><br>
2637   * Type: <b>reference</b><br>
2638   * Path: <b>Communication.context</b><br>
2639   * </p>
2640   */
2641  @SearchParamDefinition(name="encounter", path="Communication.context.where(resolve() is Encounter)", description="Encounter leading to message", type="reference", target={Encounter.class } )
2642  public static final String SP_ENCOUNTER = "encounter";
2643 /**
2644   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
2645   * <p>
2646   * Description: <b>Encounter leading to message</b><br>
2647   * Type: <b>reference</b><br>
2648   * Path: <b>Communication.context</b><br>
2649   * </p>
2650   */
2651  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER);
2652
2653/**
2654   * Constant for fluent queries to be used to add include statements. Specifies
2655   * the path value of "<b>Communication:encounter</b>".
2656   */
2657  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("Communication:encounter").toLocked();
2658
2659 /**
2660   * Search parameter: <b>sent</b>
2661   * <p>
2662   * Description: <b>When sent</b><br>
2663   * Type: <b>date</b><br>
2664   * Path: <b>Communication.sent</b><br>
2665   * </p>
2666   */
2667  @SearchParamDefinition(name="sent", path="Communication.sent", description="When sent", type="date" )
2668  public static final String SP_SENT = "sent";
2669 /**
2670   * <b>Fluent Client</b> search parameter constant for <b>sent</b>
2671   * <p>
2672   * Description: <b>When sent</b><br>
2673   * Type: <b>date</b><br>
2674   * Path: <b>Communication.sent</b><br>
2675   * </p>
2676   */
2677  public static final ca.uhn.fhir.rest.gclient.DateClientParam SENT = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_SENT);
2678
2679 /**
2680   * Search parameter: <b>based-on</b>
2681   * <p>
2682   * Description: <b>Request fulfilled by this communication</b><br>
2683   * Type: <b>reference</b><br>
2684   * Path: <b>Communication.basedOn</b><br>
2685   * </p>
2686   */
2687  @SearchParamDefinition(name="based-on", path="Communication.basedOn", description="Request fulfilled by this communication", type="reference" )
2688  public static final String SP_BASED_ON = "based-on";
2689 /**
2690   * <b>Fluent Client</b> search parameter constant for <b>based-on</b>
2691   * <p>
2692   * Description: <b>Request fulfilled by this communication</b><br>
2693   * Type: <b>reference</b><br>
2694   * Path: <b>Communication.basedOn</b><br>
2695   * </p>
2696   */
2697  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASED_ON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BASED_ON);
2698
2699/**
2700   * Constant for fluent queries to be used to add include statements. Specifies
2701   * the path value of "<b>Communication:based-on</b>".
2702   */
2703  public static final ca.uhn.fhir.model.api.Include INCLUDE_BASED_ON = new ca.uhn.fhir.model.api.Include("Communication:based-on").toLocked();
2704
2705 /**
2706   * Search parameter: <b>sender</b>
2707   * <p>
2708   * Description: <b>Message sender</b><br>
2709   * Type: <b>reference</b><br>
2710   * Path: <b>Communication.sender</b><br>
2711   * </p>
2712   */
2713  @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, HealthcareService.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
2714  public static final String SP_SENDER = "sender";
2715 /**
2716   * <b>Fluent Client</b> search parameter constant for <b>sender</b>
2717   * <p>
2718   * Description: <b>Message sender</b><br>
2719   * Type: <b>reference</b><br>
2720   * Path: <b>Communication.sender</b><br>
2721   * </p>
2722   */
2723  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SENDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SENDER);
2724
2725/**
2726   * Constant for fluent queries to be used to add include statements. Specifies
2727   * the path value of "<b>Communication:sender</b>".
2728   */
2729  public static final ca.uhn.fhir.model.api.Include INCLUDE_SENDER = new ca.uhn.fhir.model.api.Include("Communication:sender").toLocked();
2730
2731 /**
2732   * Search parameter: <b>patient</b>
2733   * <p>
2734   * Description: <b>Focus of message</b><br>
2735   * Type: <b>reference</b><br>
2736   * Path: <b>Communication.subject</b><br>
2737   * </p>
2738   */
2739  @SearchParamDefinition(name="patient", path="Communication.subject.where(resolve() is Patient)", description="Focus of message", type="reference", target={Patient.class } )
2740  public static final String SP_PATIENT = "patient";
2741 /**
2742   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2743   * <p>
2744   * Description: <b>Focus of message</b><br>
2745   * Type: <b>reference</b><br>
2746   * Path: <b>Communication.subject</b><br>
2747   * </p>
2748   */
2749  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
2750
2751/**
2752   * Constant for fluent queries to be used to add include statements. Specifies
2753   * the path value of "<b>Communication:patient</b>".
2754   */
2755  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Communication:patient").toLocked();
2756
2757 /**
2758   * Search parameter: <b>recipient</b>
2759   * <p>
2760   * Description: <b>Message recipient</b><br>
2761   * Type: <b>reference</b><br>
2762   * Path: <b>Communication.recipient</b><br>
2763   * </p>
2764   */
2765  @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={CareTeam.class, Device.class, Group.class, HealthcareService.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
2766  public static final String SP_RECIPIENT = "recipient";
2767 /**
2768   * <b>Fluent Client</b> search parameter constant for <b>recipient</b>
2769   * <p>
2770   * Description: <b>Message recipient</b><br>
2771   * Type: <b>reference</b><br>
2772   * Path: <b>Communication.recipient</b><br>
2773   * </p>
2774   */
2775  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RECIPIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RECIPIENT);
2776
2777/**
2778   * Constant for fluent queries to be used to add include statements. Specifies
2779   * the path value of "<b>Communication:recipient</b>".
2780   */
2781  public static final ca.uhn.fhir.model.api.Include INCLUDE_RECIPIENT = new ca.uhn.fhir.model.api.Include("Communication:recipient").toLocked();
2782
2783 /**
2784   * Search parameter: <b>context</b>
2785   * <p>
2786   * Description: <b>Encounter or episode leading to message</b><br>
2787   * Type: <b>reference</b><br>
2788   * Path: <b>Communication.context</b><br>
2789   * </p>
2790   */
2791  @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 } )
2792  public static final String SP_CONTEXT = "context";
2793 /**
2794   * <b>Fluent Client</b> search parameter constant for <b>context</b>
2795   * <p>
2796   * Description: <b>Encounter or episode leading to message</b><br>
2797   * Type: <b>reference</b><br>
2798   * Path: <b>Communication.context</b><br>
2799   * </p>
2800   */
2801  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONTEXT);
2802
2803/**
2804   * Constant for fluent queries to be used to add include statements. Specifies
2805   * the path value of "<b>Communication:context</b>".
2806   */
2807  public static final ca.uhn.fhir.model.api.Include INCLUDE_CONTEXT = new ca.uhn.fhir.model.api.Include("Communication:context").toLocked();
2808
2809 /**
2810   * Search parameter: <b>instantiates-uri</b>
2811   * <p>
2812   * Description: <b>Instantiates external protocol or definition</b><br>
2813   * Type: <b>uri</b><br>
2814   * Path: <b>Communication.instantiatesUri</b><br>
2815   * </p>
2816   */
2817  @SearchParamDefinition(name="instantiates-uri", path="Communication.instantiatesUri", description="Instantiates external protocol or definition", type="uri" )
2818  public static final String SP_INSTANTIATES_URI = "instantiates-uri";
2819 /**
2820   * <b>Fluent Client</b> search parameter constant for <b>instantiates-uri</b>
2821   * <p>
2822   * Description: <b>Instantiates external protocol or definition</b><br>
2823   * Type: <b>uri</b><br>
2824   * Path: <b>Communication.instantiatesUri</b><br>
2825   * </p>
2826   */
2827  public static final ca.uhn.fhir.rest.gclient.UriClientParam INSTANTIATES_URI = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_INSTANTIATES_URI);
2828
2829 /**
2830   * Search parameter: <b>category</b>
2831   * <p>
2832   * Description: <b>Message category</b><br>
2833   * Type: <b>token</b><br>
2834   * Path: <b>Communication.category</b><br>
2835   * </p>
2836   */
2837  @SearchParamDefinition(name="category", path="Communication.category", description="Message category", type="token" )
2838  public static final String SP_CATEGORY = "category";
2839 /**
2840   * <b>Fluent Client</b> search parameter constant for <b>category</b>
2841   * <p>
2842   * Description: <b>Message category</b><br>
2843   * Type: <b>token</b><br>
2844   * Path: <b>Communication.category</b><br>
2845   * </p>
2846   */
2847  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY);
2848
2849 /**
2850   * Search parameter: <b>status</b>
2851   * <p>
2852   * Description: <b>preparation | in-progress | not-done | suspended | aborted | completed | entered-in-error</b><br>
2853   * Type: <b>token</b><br>
2854   * Path: <b>Communication.status</b><br>
2855   * </p>
2856   */
2857  @SearchParamDefinition(name="status", path="Communication.status", description="preparation | in-progress | not-done | suspended | aborted | completed | entered-in-error", type="token" )
2858  public static final String SP_STATUS = "status";
2859 /**
2860   * <b>Fluent Client</b> search parameter constant for <b>status</b>
2861   * <p>
2862   * Description: <b>preparation | in-progress | not-done | suspended | aborted | completed | entered-in-error</b><br>
2863   * Type: <b>token</b><br>
2864   * Path: <b>Communication.status</b><br>
2865   * </p>
2866   */
2867  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
2868
2869
2870}
2871