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, Dec 27, 2018 10:06-0500 for FHIR v4.0.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 that 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/source system does not know which of the status values currently applies for this event.  Note: This concept is not to be used for "other" - one of the listed statuses is presumed to apply,  but the authoring/source system does not know which.
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/source system does not know which of the status values currently applies for this event.  Note: This concept is not to be used for \"other\" - one of the listed statuses is presumed to apply,  but the authoring/source system does not know which.";
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            this.content = new StringType();
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            this.content = new Attachment();
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            this.content = new Reference();
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 during which this Communication was created or to which the creation of this record is tightly associated.
708     */
709    @Child(name = "encounter", type = {Encounter.class}, order=14, min=0, max=1, modifier=false, summary=true)
710    @Description(shortDefinition="Encounter created as part of", formalDefinition="The Encounter during which this Communication was created or to which the creation of this record is tightly associated." )
711    protected Reference encounter;
712
713    /**
714     * The actual object that is the target of the reference (The Encounter during which this Communication was created or to which the creation of this record is tightly associated.)
715     */
716    protected Encounter encounterTarget;
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 an individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either receipts are not tracked (e.g. a mass mail-out) or a receipt is captured in aggregate (all emails confirmed received by a particular time).
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 an individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either receipts are not tracked (e.g. a mass mail-out) or a receipt is captured in aggregate (all emails confirmed received by a particular time)." )
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 an individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either receipts are not tracked (e.g. a mass mail-out) or a receipt is captured in aggregate (all emails confirmed received by a particular time).)
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 = 1325359310L;
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 #encounter} (The Encounter during which this Communication was created or to which the creation of this record is tightly associated.)
1535     */
1536    public Reference getEncounter() { 
1537      if (this.encounter == null)
1538        if (Configuration.errorOnAutoCreate())
1539          throw new Error("Attempt to auto-create Communication.encounter");
1540        else if (Configuration.doAutoCreate())
1541          this.encounter = new Reference(); // cc
1542      return this.encounter;
1543    }
1544
1545    public boolean hasEncounter() { 
1546      return this.encounter != null && !this.encounter.isEmpty();
1547    }
1548
1549    /**
1550     * @param value {@link #encounter} (The Encounter during which this Communication was created or to which the creation of this record is tightly associated.)
1551     */
1552    public Communication setEncounter(Reference value) { 
1553      this.encounter = value;
1554      return this;
1555    }
1556
1557    /**
1558     * @return {@link #encounter} 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 during which this Communication was created or to which the creation of this record is tightly associated.)
1559     */
1560    public Encounter getEncounterTarget() { 
1561      if (this.encounterTarget == null)
1562        if (Configuration.errorOnAutoCreate())
1563          throw new Error("Attempt to auto-create Communication.encounter");
1564        else if (Configuration.doAutoCreate())
1565          this.encounterTarget = new Encounter(); // aa
1566      return this.encounterTarget;
1567    }
1568
1569    /**
1570     * @param value {@link #encounter} 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 during which this Communication was created or to which the creation of this record is tightly associated.)
1571     */
1572    public Communication setEncounterTarget(Encounter value) { 
1573      this.encounterTarget = value;
1574      return this;
1575    }
1576
1577    /**
1578     * @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
1579     */
1580    public DateTimeType getSentElement() { 
1581      if (this.sent == null)
1582        if (Configuration.errorOnAutoCreate())
1583          throw new Error("Attempt to auto-create Communication.sent");
1584        else if (Configuration.doAutoCreate())
1585          this.sent = new DateTimeType(); // bb
1586      return this.sent;
1587    }
1588
1589    public boolean hasSentElement() { 
1590      return this.sent != null && !this.sent.isEmpty();
1591    }
1592
1593    public boolean hasSent() { 
1594      return this.sent != null && !this.sent.isEmpty();
1595    }
1596
1597    /**
1598     * @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
1599     */
1600    public Communication setSentElement(DateTimeType value) { 
1601      this.sent = value;
1602      return this;
1603    }
1604
1605    /**
1606     * @return The time when this communication was sent.
1607     */
1608    public Date getSent() { 
1609      return this.sent == null ? null : this.sent.getValue();
1610    }
1611
1612    /**
1613     * @param value The time when this communication was sent.
1614     */
1615    public Communication setSent(Date value) { 
1616      if (value == null)
1617        this.sent = null;
1618      else {
1619        if (this.sent == null)
1620          this.sent = new DateTimeType();
1621        this.sent.setValue(value);
1622      }
1623      return this;
1624    }
1625
1626    /**
1627     * @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
1628     */
1629    public DateTimeType getReceivedElement() { 
1630      if (this.received == null)
1631        if (Configuration.errorOnAutoCreate())
1632          throw new Error("Attempt to auto-create Communication.received");
1633        else if (Configuration.doAutoCreate())
1634          this.received = new DateTimeType(); // bb
1635      return this.received;
1636    }
1637
1638    public boolean hasReceivedElement() { 
1639      return this.received != null && !this.received.isEmpty();
1640    }
1641
1642    public boolean hasReceived() { 
1643      return this.received != null && !this.received.isEmpty();
1644    }
1645
1646    /**
1647     * @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
1648     */
1649    public Communication setReceivedElement(DateTimeType value) { 
1650      this.received = value;
1651      return this;
1652    }
1653
1654    /**
1655     * @return The time when this communication arrived at the destination.
1656     */
1657    public Date getReceived() { 
1658      return this.received == null ? null : this.received.getValue();
1659    }
1660
1661    /**
1662     * @param value The time when this communication arrived at the destination.
1663     */
1664    public Communication setReceived(Date value) { 
1665      if (value == null)
1666        this.received = null;
1667      else {
1668        if (this.received == null)
1669          this.received = new DateTimeType();
1670        this.received.setValue(value);
1671      }
1672      return this;
1673    }
1674
1675    /**
1676     * @return {@link #recipient} (The entity (e.g. person, organization, clinical information system, care team or device) which was the target of the communication. If receipts need to be tracked by an individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either receipts are not tracked (e.g. a mass mail-out) or a receipt is captured in aggregate (all emails confirmed received by a particular time).)
1677     */
1678    public List<Reference> getRecipient() { 
1679      if (this.recipient == null)
1680        this.recipient = new ArrayList<Reference>();
1681      return this.recipient;
1682    }
1683
1684    /**
1685     * @return Returns a reference to <code>this</code> for easy method chaining
1686     */
1687    public Communication setRecipient(List<Reference> theRecipient) { 
1688      this.recipient = theRecipient;
1689      return this;
1690    }
1691
1692    public boolean hasRecipient() { 
1693      if (this.recipient == null)
1694        return false;
1695      for (Reference item : this.recipient)
1696        if (!item.isEmpty())
1697          return true;
1698      return false;
1699    }
1700
1701    public Reference addRecipient() { //3
1702      Reference t = new Reference();
1703      if (this.recipient == null)
1704        this.recipient = new ArrayList<Reference>();
1705      this.recipient.add(t);
1706      return t;
1707    }
1708
1709    public Communication addRecipient(Reference t) { //3
1710      if (t == null)
1711        return this;
1712      if (this.recipient == null)
1713        this.recipient = new ArrayList<Reference>();
1714      this.recipient.add(t);
1715      return this;
1716    }
1717
1718    /**
1719     * @return The first repetition of repeating field {@link #recipient}, creating it if it does not already exist
1720     */
1721    public Reference getRecipientFirstRep() { 
1722      if (getRecipient().isEmpty()) {
1723        addRecipient();
1724      }
1725      return getRecipient().get(0);
1726    }
1727
1728    /**
1729     * @deprecated Use Reference#setResource(IBaseResource) instead
1730     */
1731    @Deprecated
1732    public List<Resource> getRecipientTarget() { 
1733      if (this.recipientTarget == null)
1734        this.recipientTarget = new ArrayList<Resource>();
1735      return this.recipientTarget;
1736    }
1737
1738    /**
1739     * @return {@link #sender} (The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication.)
1740     */
1741    public Reference getSender() { 
1742      if (this.sender == null)
1743        if (Configuration.errorOnAutoCreate())
1744          throw new Error("Attempt to auto-create Communication.sender");
1745        else if (Configuration.doAutoCreate())
1746          this.sender = new Reference(); // cc
1747      return this.sender;
1748    }
1749
1750    public boolean hasSender() { 
1751      return this.sender != null && !this.sender.isEmpty();
1752    }
1753
1754    /**
1755     * @param value {@link #sender} (The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication.)
1756     */
1757    public Communication setSender(Reference value) { 
1758      this.sender = value;
1759      return this;
1760    }
1761
1762    /**
1763     * @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.)
1764     */
1765    public Resource getSenderTarget() { 
1766      return this.senderTarget;
1767    }
1768
1769    /**
1770     * @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.)
1771     */
1772    public Communication setSenderTarget(Resource value) { 
1773      this.senderTarget = value;
1774      return this;
1775    }
1776
1777    /**
1778     * @return {@link #reasonCode} (The reason or justification for the communication.)
1779     */
1780    public List<CodeableConcept> getReasonCode() { 
1781      if (this.reasonCode == null)
1782        this.reasonCode = new ArrayList<CodeableConcept>();
1783      return this.reasonCode;
1784    }
1785
1786    /**
1787     * @return Returns a reference to <code>this</code> for easy method chaining
1788     */
1789    public Communication setReasonCode(List<CodeableConcept> theReasonCode) { 
1790      this.reasonCode = theReasonCode;
1791      return this;
1792    }
1793
1794    public boolean hasReasonCode() { 
1795      if (this.reasonCode == null)
1796        return false;
1797      for (CodeableConcept item : this.reasonCode)
1798        if (!item.isEmpty())
1799          return true;
1800      return false;
1801    }
1802
1803    public CodeableConcept addReasonCode() { //3
1804      CodeableConcept t = new CodeableConcept();
1805      if (this.reasonCode == null)
1806        this.reasonCode = new ArrayList<CodeableConcept>();
1807      this.reasonCode.add(t);
1808      return t;
1809    }
1810
1811    public Communication addReasonCode(CodeableConcept t) { //3
1812      if (t == null)
1813        return this;
1814      if (this.reasonCode == null)
1815        this.reasonCode = new ArrayList<CodeableConcept>();
1816      this.reasonCode.add(t);
1817      return this;
1818    }
1819
1820    /**
1821     * @return The first repetition of repeating field {@link #reasonCode}, creating it if it does not already exist
1822     */
1823    public CodeableConcept getReasonCodeFirstRep() { 
1824      if (getReasonCode().isEmpty()) {
1825        addReasonCode();
1826      }
1827      return getReasonCode().get(0);
1828    }
1829
1830    /**
1831     * @return {@link #reasonReference} (Indicates another resource whose existence justifies this communication.)
1832     */
1833    public List<Reference> getReasonReference() { 
1834      if (this.reasonReference == null)
1835        this.reasonReference = new ArrayList<Reference>();
1836      return this.reasonReference;
1837    }
1838
1839    /**
1840     * @return Returns a reference to <code>this</code> for easy method chaining
1841     */
1842    public Communication setReasonReference(List<Reference> theReasonReference) { 
1843      this.reasonReference = theReasonReference;
1844      return this;
1845    }
1846
1847    public boolean hasReasonReference() { 
1848      if (this.reasonReference == null)
1849        return false;
1850      for (Reference item : this.reasonReference)
1851        if (!item.isEmpty())
1852          return true;
1853      return false;
1854    }
1855
1856    public Reference addReasonReference() { //3
1857      Reference t = new Reference();
1858      if (this.reasonReference == null)
1859        this.reasonReference = new ArrayList<Reference>();
1860      this.reasonReference.add(t);
1861      return t;
1862    }
1863
1864    public Communication addReasonReference(Reference t) { //3
1865      if (t == null)
1866        return this;
1867      if (this.reasonReference == null)
1868        this.reasonReference = new ArrayList<Reference>();
1869      this.reasonReference.add(t);
1870      return this;
1871    }
1872
1873    /**
1874     * @return The first repetition of repeating field {@link #reasonReference}, creating it if it does not already exist
1875     */
1876    public Reference getReasonReferenceFirstRep() { 
1877      if (getReasonReference().isEmpty()) {
1878        addReasonReference();
1879      }
1880      return getReasonReference().get(0);
1881    }
1882
1883    /**
1884     * @deprecated Use Reference#setResource(IBaseResource) instead
1885     */
1886    @Deprecated
1887    public List<Resource> getReasonReferenceTarget() { 
1888      if (this.reasonReferenceTarget == null)
1889        this.reasonReferenceTarget = new ArrayList<Resource>();
1890      return this.reasonReferenceTarget;
1891    }
1892
1893    /**
1894     * @return {@link #payload} (Text, attachment(s), or resource(s) that was communicated to the recipient.)
1895     */
1896    public List<CommunicationPayloadComponent> getPayload() { 
1897      if (this.payload == null)
1898        this.payload = new ArrayList<CommunicationPayloadComponent>();
1899      return this.payload;
1900    }
1901
1902    /**
1903     * @return Returns a reference to <code>this</code> for easy method chaining
1904     */
1905    public Communication setPayload(List<CommunicationPayloadComponent> thePayload) { 
1906      this.payload = thePayload;
1907      return this;
1908    }
1909
1910    public boolean hasPayload() { 
1911      if (this.payload == null)
1912        return false;
1913      for (CommunicationPayloadComponent item : this.payload)
1914        if (!item.isEmpty())
1915          return true;
1916      return false;
1917    }
1918
1919    public CommunicationPayloadComponent addPayload() { //3
1920      CommunicationPayloadComponent t = new CommunicationPayloadComponent();
1921      if (this.payload == null)
1922        this.payload = new ArrayList<CommunicationPayloadComponent>();
1923      this.payload.add(t);
1924      return t;
1925    }
1926
1927    public Communication addPayload(CommunicationPayloadComponent t) { //3
1928      if (t == null)
1929        return this;
1930      if (this.payload == null)
1931        this.payload = new ArrayList<CommunicationPayloadComponent>();
1932      this.payload.add(t);
1933      return this;
1934    }
1935
1936    /**
1937     * @return The first repetition of repeating field {@link #payload}, creating it if it does not already exist
1938     */
1939    public CommunicationPayloadComponent getPayloadFirstRep() { 
1940      if (getPayload().isEmpty()) {
1941        addPayload();
1942      }
1943      return getPayload().get(0);
1944    }
1945
1946    /**
1947     * @return {@link #note} (Additional notes or commentary about the communication by the sender, receiver or other interested parties.)
1948     */
1949    public List<Annotation> getNote() { 
1950      if (this.note == null)
1951        this.note = new ArrayList<Annotation>();
1952      return this.note;
1953    }
1954
1955    /**
1956     * @return Returns a reference to <code>this</code> for easy method chaining
1957     */
1958    public Communication setNote(List<Annotation> theNote) { 
1959      this.note = theNote;
1960      return this;
1961    }
1962
1963    public boolean hasNote() { 
1964      if (this.note == null)
1965        return false;
1966      for (Annotation item : this.note)
1967        if (!item.isEmpty())
1968          return true;
1969      return false;
1970    }
1971
1972    public Annotation addNote() { //3
1973      Annotation t = new Annotation();
1974      if (this.note == null)
1975        this.note = new ArrayList<Annotation>();
1976      this.note.add(t);
1977      return t;
1978    }
1979
1980    public Communication addNote(Annotation t) { //3
1981      if (t == null)
1982        return this;
1983      if (this.note == null)
1984        this.note = new ArrayList<Annotation>();
1985      this.note.add(t);
1986      return this;
1987    }
1988
1989    /**
1990     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist
1991     */
1992    public Annotation getNoteFirstRep() { 
1993      if (getNote().isEmpty()) {
1994        addNote();
1995      }
1996      return getNote().get(0);
1997    }
1998
1999      protected void listChildren(List<Property> children) {
2000        super.listChildren(children);
2001        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));
2002        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));
2003        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));
2004        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));
2005        children.add(new Property("partOf", "Reference(Any)", "Part of this action.", 0, java.lang.Integer.MAX_VALUE, partOf));
2006        children.add(new Property("inResponseTo", "Reference(Communication)", "Prior communication that this communication is in response to.", 0, java.lang.Integer.MAX_VALUE, inResponseTo));
2007        children.add(new Property("status", "code", "The status of the transmission.", 0, 1, status));
2008        children.add(new Property("statusReason", "CodeableConcept", "Captures the reason for the current state of the Communication.", 0, 1, statusReason));
2009        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));
2010        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));
2011        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));
2012        children.add(new Property("subject", "Reference(Patient|Group)", "The patient or group that was the focus of this communication.", 0, 1, subject));
2013        children.add(new Property("topic", "CodeableConcept", "Description of the purpose/content, similar to a subject line in an email.", 0, 1, topic));
2014        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));
2015        children.add(new Property("encounter", "Reference(Encounter)", "The Encounter during which this Communication was created or to which the creation of this record is tightly associated.", 0, 1, encounter));
2016        children.add(new Property("sent", "dateTime", "The time when this communication was sent.", 0, 1, sent));
2017        children.add(new Property("received", "dateTime", "The time when this communication arrived at the destination.", 0, 1, received));
2018        children.add(new Property("recipient", "Reference(Device|Organization|Patient|Practitioner|PractitionerRole|RelatedPerson|Group|CareTeam|HealthcareService)", "The entity (e.g. person, organization, clinical information system, care team or device) which was the target of the communication. If receipts need to be tracked by an individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either receipts are not tracked (e.g. a mass mail-out) or a receipt is captured in aggregate (all emails confirmed received by a particular time).", 0, java.lang.Integer.MAX_VALUE, recipient));
2019        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));
2020        children.add(new Property("reasonCode", "CodeableConcept", "The reason or justification for the communication.", 0, java.lang.Integer.MAX_VALUE, reasonCode));
2021        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));
2022        children.add(new Property("payload", "", "Text, attachment(s), or resource(s) that was communicated to the recipient.", 0, java.lang.Integer.MAX_VALUE, payload));
2023        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));
2024      }
2025
2026      @Override
2027      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2028        switch (_hash) {
2029        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);
2030        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);
2031        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);
2032        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);
2033        case -995410646: /*partOf*/  return new Property("partOf", "Reference(Any)", "Part of this action.", 0, java.lang.Integer.MAX_VALUE, partOf);
2034        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);
2035        case -892481550: /*status*/  return new Property("status", "code", "The status of the transmission.", 0, 1, status);
2036        case 2051346646: /*statusReason*/  return new Property("statusReason", "CodeableConcept", "Captures the reason for the current state of the Communication.", 0, 1, statusReason);
2037        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);
2038        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);
2039        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);
2040        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group)", "The patient or group that was the focus of this communication.", 0, 1, subject);
2041        case 110546223: /*topic*/  return new Property("topic", "CodeableConcept", "Description of the purpose/content, similar to a subject line in an email.", 0, 1, topic);
2042        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);
2043        case 1524132147: /*encounter*/  return new Property("encounter", "Reference(Encounter)", "The Encounter during which this Communication was created or to which the creation of this record is tightly associated.", 0, 1, encounter);
2044        case 3526552: /*sent*/  return new Property("sent", "dateTime", "The time when this communication was sent.", 0, 1, sent);
2045        case -808719903: /*received*/  return new Property("received", "dateTime", "The time when this communication arrived at the destination.", 0, 1, received);
2046        case 820081177: /*recipient*/  return new Property("recipient", "Reference(Device|Organization|Patient|Practitioner|PractitionerRole|RelatedPerson|Group|CareTeam|HealthcareService)", "The entity (e.g. person, organization, clinical information system, care team or device) which was the target of the communication. If receipts need to be tracked by an individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either receipts are not tracked (e.g. a mass mail-out) or a receipt is captured in aggregate (all emails confirmed received by a particular time).", 0, java.lang.Integer.MAX_VALUE, recipient);
2047        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);
2048        case 722137681: /*reasonCode*/  return new Property("reasonCode", "CodeableConcept", "The reason or justification for the communication.", 0, java.lang.Integer.MAX_VALUE, reasonCode);
2049        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);
2050        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);
2051        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);
2052        default: return super.getNamedProperty(_hash, _name, _checkValid);
2053        }
2054
2055      }
2056
2057      @Override
2058      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2059        switch (hash) {
2060        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2061        case 8911915: /*instantiatesCanonical*/ return this.instantiatesCanonical == null ? new Base[0] : this.instantiatesCanonical.toArray(new Base[this.instantiatesCanonical.size()]); // CanonicalType
2062        case -1926393373: /*instantiatesUri*/ return this.instantiatesUri == null ? new Base[0] : this.instantiatesUri.toArray(new Base[this.instantiatesUri.size()]); // UriType
2063        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
2064        case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : this.partOf.toArray(new Base[this.partOf.size()]); // Reference
2065        case 1932956065: /*inResponseTo*/ return this.inResponseTo == null ? new Base[0] : this.inResponseTo.toArray(new Base[this.inResponseTo.size()]); // Reference
2066        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<CommunicationStatus>
2067        case 2051346646: /*statusReason*/ return this.statusReason == null ? new Base[0] : new Base[] {this.statusReason}; // CodeableConcept
2068        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
2069        case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Enumeration<CommunicationPriority>
2070        case -1078030475: /*medium*/ return this.medium == null ? new Base[0] : this.medium.toArray(new Base[this.medium.size()]); // CodeableConcept
2071        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
2072        case 110546223: /*topic*/ return this.topic == null ? new Base[0] : new Base[] {this.topic}; // CodeableConcept
2073        case 92611469: /*about*/ return this.about == null ? new Base[0] : this.about.toArray(new Base[this.about.size()]); // Reference
2074        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference
2075        case 3526552: /*sent*/ return this.sent == null ? new Base[0] : new Base[] {this.sent}; // DateTimeType
2076        case -808719903: /*received*/ return this.received == null ? new Base[0] : new Base[] {this.received}; // DateTimeType
2077        case 820081177: /*recipient*/ return this.recipient == null ? new Base[0] : this.recipient.toArray(new Base[this.recipient.size()]); // Reference
2078        case -905962955: /*sender*/ return this.sender == null ? new Base[0] : new Base[] {this.sender}; // Reference
2079        case 722137681: /*reasonCode*/ return this.reasonCode == null ? new Base[0] : this.reasonCode.toArray(new Base[this.reasonCode.size()]); // CodeableConcept
2080        case -1146218137: /*reasonReference*/ return this.reasonReference == null ? new Base[0] : this.reasonReference.toArray(new Base[this.reasonReference.size()]); // Reference
2081        case -786701938: /*payload*/ return this.payload == null ? new Base[0] : this.payload.toArray(new Base[this.payload.size()]); // CommunicationPayloadComponent
2082        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
2083        default: return super.getProperty(hash, name, checkValid);
2084        }
2085
2086      }
2087
2088      @Override
2089      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2090        switch (hash) {
2091        case -1618432855: // identifier
2092          this.getIdentifier().add(castToIdentifier(value)); // Identifier
2093          return value;
2094        case 8911915: // instantiatesCanonical
2095          this.getInstantiatesCanonical().add(castToCanonical(value)); // CanonicalType
2096          return value;
2097        case -1926393373: // instantiatesUri
2098          this.getInstantiatesUri().add(castToUri(value)); // UriType
2099          return value;
2100        case -332612366: // basedOn
2101          this.getBasedOn().add(castToReference(value)); // Reference
2102          return value;
2103        case -995410646: // partOf
2104          this.getPartOf().add(castToReference(value)); // Reference
2105          return value;
2106        case 1932956065: // inResponseTo
2107          this.getInResponseTo().add(castToReference(value)); // Reference
2108          return value;
2109        case -892481550: // status
2110          value = new CommunicationStatusEnumFactory().fromType(castToCode(value));
2111          this.status = (Enumeration) value; // Enumeration<CommunicationStatus>
2112          return value;
2113        case 2051346646: // statusReason
2114          this.statusReason = castToCodeableConcept(value); // CodeableConcept
2115          return value;
2116        case 50511102: // category
2117          this.getCategory().add(castToCodeableConcept(value)); // CodeableConcept
2118          return value;
2119        case -1165461084: // priority
2120          value = new CommunicationPriorityEnumFactory().fromType(castToCode(value));
2121          this.priority = (Enumeration) value; // Enumeration<CommunicationPriority>
2122          return value;
2123        case -1078030475: // medium
2124          this.getMedium().add(castToCodeableConcept(value)); // CodeableConcept
2125          return value;
2126        case -1867885268: // subject
2127          this.subject = castToReference(value); // Reference
2128          return value;
2129        case 110546223: // topic
2130          this.topic = castToCodeableConcept(value); // CodeableConcept
2131          return value;
2132        case 92611469: // about
2133          this.getAbout().add(castToReference(value)); // Reference
2134          return value;
2135        case 1524132147: // encounter
2136          this.encounter = castToReference(value); // Reference
2137          return value;
2138        case 3526552: // sent
2139          this.sent = castToDateTime(value); // DateTimeType
2140          return value;
2141        case -808719903: // received
2142          this.received = castToDateTime(value); // DateTimeType
2143          return value;
2144        case 820081177: // recipient
2145          this.getRecipient().add(castToReference(value)); // Reference
2146          return value;
2147        case -905962955: // sender
2148          this.sender = castToReference(value); // Reference
2149          return value;
2150        case 722137681: // reasonCode
2151          this.getReasonCode().add(castToCodeableConcept(value)); // CodeableConcept
2152          return value;
2153        case -1146218137: // reasonReference
2154          this.getReasonReference().add(castToReference(value)); // Reference
2155          return value;
2156        case -786701938: // payload
2157          this.getPayload().add((CommunicationPayloadComponent) value); // CommunicationPayloadComponent
2158          return value;
2159        case 3387378: // note
2160          this.getNote().add(castToAnnotation(value)); // Annotation
2161          return value;
2162        default: return super.setProperty(hash, name, value);
2163        }
2164
2165      }
2166
2167      @Override
2168      public Base setProperty(String name, Base value) throws FHIRException {
2169        if (name.equals("identifier")) {
2170          this.getIdentifier().add(castToIdentifier(value));
2171        } else if (name.equals("instantiatesCanonical")) {
2172          this.getInstantiatesCanonical().add(castToCanonical(value));
2173        } else if (name.equals("instantiatesUri")) {
2174          this.getInstantiatesUri().add(castToUri(value));
2175        } else if (name.equals("basedOn")) {
2176          this.getBasedOn().add(castToReference(value));
2177        } else if (name.equals("partOf")) {
2178          this.getPartOf().add(castToReference(value));
2179        } else if (name.equals("inResponseTo")) {
2180          this.getInResponseTo().add(castToReference(value));
2181        } else if (name.equals("status")) {
2182          value = new CommunicationStatusEnumFactory().fromType(castToCode(value));
2183          this.status = (Enumeration) value; // Enumeration<CommunicationStatus>
2184        } else if (name.equals("statusReason")) {
2185          this.statusReason = castToCodeableConcept(value); // CodeableConcept
2186        } else if (name.equals("category")) {
2187          this.getCategory().add(castToCodeableConcept(value));
2188        } else if (name.equals("priority")) {
2189          value = new CommunicationPriorityEnumFactory().fromType(castToCode(value));
2190          this.priority = (Enumeration) value; // Enumeration<CommunicationPriority>
2191        } else if (name.equals("medium")) {
2192          this.getMedium().add(castToCodeableConcept(value));
2193        } else if (name.equals("subject")) {
2194          this.subject = castToReference(value); // Reference
2195        } else if (name.equals("topic")) {
2196          this.topic = castToCodeableConcept(value); // CodeableConcept
2197        } else if (name.equals("about")) {
2198          this.getAbout().add(castToReference(value));
2199        } else if (name.equals("encounter")) {
2200          this.encounter = castToReference(value); // Reference
2201        } else if (name.equals("sent")) {
2202          this.sent = castToDateTime(value); // DateTimeType
2203        } else if (name.equals("received")) {
2204          this.received = castToDateTime(value); // DateTimeType
2205        } else if (name.equals("recipient")) {
2206          this.getRecipient().add(castToReference(value));
2207        } else if (name.equals("sender")) {
2208          this.sender = castToReference(value); // Reference
2209        } else if (name.equals("reasonCode")) {
2210          this.getReasonCode().add(castToCodeableConcept(value));
2211        } else if (name.equals("reasonReference")) {
2212          this.getReasonReference().add(castToReference(value));
2213        } else if (name.equals("payload")) {
2214          this.getPayload().add((CommunicationPayloadComponent) value);
2215        } else if (name.equals("note")) {
2216          this.getNote().add(castToAnnotation(value));
2217        } else
2218          return super.setProperty(name, value);
2219        return value;
2220      }
2221
2222      @Override
2223      public Base makeProperty(int hash, String name) throws FHIRException {
2224        switch (hash) {
2225        case -1618432855:  return addIdentifier(); 
2226        case 8911915:  return addInstantiatesCanonicalElement();
2227        case -1926393373:  return addInstantiatesUriElement();
2228        case -332612366:  return addBasedOn(); 
2229        case -995410646:  return addPartOf(); 
2230        case 1932956065:  return addInResponseTo(); 
2231        case -892481550:  return getStatusElement();
2232        case 2051346646:  return getStatusReason(); 
2233        case 50511102:  return addCategory(); 
2234        case -1165461084:  return getPriorityElement();
2235        case -1078030475:  return addMedium(); 
2236        case -1867885268:  return getSubject(); 
2237        case 110546223:  return getTopic(); 
2238        case 92611469:  return addAbout(); 
2239        case 1524132147:  return getEncounter(); 
2240        case 3526552:  return getSentElement();
2241        case -808719903:  return getReceivedElement();
2242        case 820081177:  return addRecipient(); 
2243        case -905962955:  return getSender(); 
2244        case 722137681:  return addReasonCode(); 
2245        case -1146218137:  return addReasonReference(); 
2246        case -786701938:  return addPayload(); 
2247        case 3387378:  return addNote(); 
2248        default: return super.makeProperty(hash, name);
2249        }
2250
2251      }
2252
2253      @Override
2254      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2255        switch (hash) {
2256        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2257        case 8911915: /*instantiatesCanonical*/ return new String[] {"canonical"};
2258        case -1926393373: /*instantiatesUri*/ return new String[] {"uri"};
2259        case -332612366: /*basedOn*/ return new String[] {"Reference"};
2260        case -995410646: /*partOf*/ return new String[] {"Reference"};
2261        case 1932956065: /*inResponseTo*/ return new String[] {"Reference"};
2262        case -892481550: /*status*/ return new String[] {"code"};
2263        case 2051346646: /*statusReason*/ return new String[] {"CodeableConcept"};
2264        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
2265        case -1165461084: /*priority*/ return new String[] {"code"};
2266        case -1078030475: /*medium*/ return new String[] {"CodeableConcept"};
2267        case -1867885268: /*subject*/ return new String[] {"Reference"};
2268        case 110546223: /*topic*/ return new String[] {"CodeableConcept"};
2269        case 92611469: /*about*/ return new String[] {"Reference"};
2270        case 1524132147: /*encounter*/ return new String[] {"Reference"};
2271        case 3526552: /*sent*/ return new String[] {"dateTime"};
2272        case -808719903: /*received*/ return new String[] {"dateTime"};
2273        case 820081177: /*recipient*/ return new String[] {"Reference"};
2274        case -905962955: /*sender*/ return new String[] {"Reference"};
2275        case 722137681: /*reasonCode*/ return new String[] {"CodeableConcept"};
2276        case -1146218137: /*reasonReference*/ return new String[] {"Reference"};
2277        case -786701938: /*payload*/ return new String[] {};
2278        case 3387378: /*note*/ return new String[] {"Annotation"};
2279        default: return super.getTypesForProperty(hash, name);
2280        }
2281
2282      }
2283
2284      @Override
2285      public Base addChild(String name) throws FHIRException {
2286        if (name.equals("identifier")) {
2287          return addIdentifier();
2288        }
2289        else if (name.equals("instantiatesCanonical")) {
2290          throw new FHIRException("Cannot call addChild on a primitive type Communication.instantiatesCanonical");
2291        }
2292        else if (name.equals("instantiatesUri")) {
2293          throw new FHIRException("Cannot call addChild on a primitive type Communication.instantiatesUri");
2294        }
2295        else if (name.equals("basedOn")) {
2296          return addBasedOn();
2297        }
2298        else if (name.equals("partOf")) {
2299          return addPartOf();
2300        }
2301        else if (name.equals("inResponseTo")) {
2302          return addInResponseTo();
2303        }
2304        else if (name.equals("status")) {
2305          throw new FHIRException("Cannot call addChild on a primitive type Communication.status");
2306        }
2307        else if (name.equals("statusReason")) {
2308          this.statusReason = new CodeableConcept();
2309          return this.statusReason;
2310        }
2311        else if (name.equals("category")) {
2312          return addCategory();
2313        }
2314        else if (name.equals("priority")) {
2315          throw new FHIRException("Cannot call addChild on a primitive type Communication.priority");
2316        }
2317        else if (name.equals("medium")) {
2318          return addMedium();
2319        }
2320        else if (name.equals("subject")) {
2321          this.subject = new Reference();
2322          return this.subject;
2323        }
2324        else if (name.equals("topic")) {
2325          this.topic = new CodeableConcept();
2326          return this.topic;
2327        }
2328        else if (name.equals("about")) {
2329          return addAbout();
2330        }
2331        else if (name.equals("encounter")) {
2332          this.encounter = new Reference();
2333          return this.encounter;
2334        }
2335        else if (name.equals("sent")) {
2336          throw new FHIRException("Cannot call addChild on a primitive type Communication.sent");
2337        }
2338        else if (name.equals("received")) {
2339          throw new FHIRException("Cannot call addChild on a primitive type Communication.received");
2340        }
2341        else if (name.equals("recipient")) {
2342          return addRecipient();
2343        }
2344        else if (name.equals("sender")) {
2345          this.sender = new Reference();
2346          return this.sender;
2347        }
2348        else if (name.equals("reasonCode")) {
2349          return addReasonCode();
2350        }
2351        else if (name.equals("reasonReference")) {
2352          return addReasonReference();
2353        }
2354        else if (name.equals("payload")) {
2355          return addPayload();
2356        }
2357        else if (name.equals("note")) {
2358          return addNote();
2359        }
2360        else
2361          return super.addChild(name);
2362      }
2363
2364  public String fhirType() {
2365    return "Communication";
2366
2367  }
2368
2369      public Communication copy() {
2370        Communication dst = new Communication();
2371        copyValues(dst);
2372        if (identifier != null) {
2373          dst.identifier = new ArrayList<Identifier>();
2374          for (Identifier i : identifier)
2375            dst.identifier.add(i.copy());
2376        };
2377        if (instantiatesCanonical != null) {
2378          dst.instantiatesCanonical = new ArrayList<CanonicalType>();
2379          for (CanonicalType i : instantiatesCanonical)
2380            dst.instantiatesCanonical.add(i.copy());
2381        };
2382        if (instantiatesUri != null) {
2383          dst.instantiatesUri = new ArrayList<UriType>();
2384          for (UriType i : instantiatesUri)
2385            dst.instantiatesUri.add(i.copy());
2386        };
2387        if (basedOn != null) {
2388          dst.basedOn = new ArrayList<Reference>();
2389          for (Reference i : basedOn)
2390            dst.basedOn.add(i.copy());
2391        };
2392        if (partOf != null) {
2393          dst.partOf = new ArrayList<Reference>();
2394          for (Reference i : partOf)
2395            dst.partOf.add(i.copy());
2396        };
2397        if (inResponseTo != null) {
2398          dst.inResponseTo = new ArrayList<Reference>();
2399          for (Reference i : inResponseTo)
2400            dst.inResponseTo.add(i.copy());
2401        };
2402        dst.status = status == null ? null : status.copy();
2403        dst.statusReason = statusReason == null ? null : statusReason.copy();
2404        if (category != null) {
2405          dst.category = new ArrayList<CodeableConcept>();
2406          for (CodeableConcept i : category)
2407            dst.category.add(i.copy());
2408        };
2409        dst.priority = priority == null ? null : priority.copy();
2410        if (medium != null) {
2411          dst.medium = new ArrayList<CodeableConcept>();
2412          for (CodeableConcept i : medium)
2413            dst.medium.add(i.copy());
2414        };
2415        dst.subject = subject == null ? null : subject.copy();
2416        dst.topic = topic == null ? null : topic.copy();
2417        if (about != null) {
2418          dst.about = new ArrayList<Reference>();
2419          for (Reference i : about)
2420            dst.about.add(i.copy());
2421        };
2422        dst.encounter = encounter == null ? null : encounter.copy();
2423        dst.sent = sent == null ? null : sent.copy();
2424        dst.received = received == null ? null : received.copy();
2425        if (recipient != null) {
2426          dst.recipient = new ArrayList<Reference>();
2427          for (Reference i : recipient)
2428            dst.recipient.add(i.copy());
2429        };
2430        dst.sender = sender == null ? null : sender.copy();
2431        if (reasonCode != null) {
2432          dst.reasonCode = new ArrayList<CodeableConcept>();
2433          for (CodeableConcept i : reasonCode)
2434            dst.reasonCode.add(i.copy());
2435        };
2436        if (reasonReference != null) {
2437          dst.reasonReference = new ArrayList<Reference>();
2438          for (Reference i : reasonReference)
2439            dst.reasonReference.add(i.copy());
2440        };
2441        if (payload != null) {
2442          dst.payload = new ArrayList<CommunicationPayloadComponent>();
2443          for (CommunicationPayloadComponent i : payload)
2444            dst.payload.add(i.copy());
2445        };
2446        if (note != null) {
2447          dst.note = new ArrayList<Annotation>();
2448          for (Annotation i : note)
2449            dst.note.add(i.copy());
2450        };
2451        return dst;
2452      }
2453
2454      protected Communication typedCopy() {
2455        return copy();
2456      }
2457
2458      @Override
2459      public boolean equalsDeep(Base other_) {
2460        if (!super.equalsDeep(other_))
2461          return false;
2462        if (!(other_ instanceof Communication))
2463          return false;
2464        Communication o = (Communication) other_;
2465        return compareDeep(identifier, o.identifier, true) && compareDeep(instantiatesCanonical, o.instantiatesCanonical, true)
2466           && compareDeep(instantiatesUri, o.instantiatesUri, true) && compareDeep(basedOn, o.basedOn, true)
2467           && compareDeep(partOf, o.partOf, true) && compareDeep(inResponseTo, o.inResponseTo, true) && compareDeep(status, o.status, true)
2468           && compareDeep(statusReason, o.statusReason, true) && compareDeep(category, o.category, true) && compareDeep(priority, o.priority, true)
2469           && compareDeep(medium, o.medium, true) && compareDeep(subject, o.subject, true) && compareDeep(topic, o.topic, true)
2470           && compareDeep(about, o.about, true) && compareDeep(encounter, o.encounter, true) && compareDeep(sent, o.sent, true)
2471           && compareDeep(received, o.received, true) && compareDeep(recipient, o.recipient, true) && compareDeep(sender, o.sender, true)
2472           && compareDeep(reasonCode, o.reasonCode, true) && compareDeep(reasonReference, o.reasonReference, true)
2473           && compareDeep(payload, o.payload, true) && compareDeep(note, o.note, true);
2474      }
2475
2476      @Override
2477      public boolean equalsShallow(Base other_) {
2478        if (!super.equalsShallow(other_))
2479          return false;
2480        if (!(other_ instanceof Communication))
2481          return false;
2482        Communication o = (Communication) other_;
2483        return compareValues(instantiatesUri, o.instantiatesUri, true) && compareValues(status, o.status, true)
2484           && compareValues(priority, o.priority, true) && compareValues(sent, o.sent, true) && compareValues(received, o.received, true)
2485          ;
2486      }
2487
2488      public boolean isEmpty() {
2489        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, instantiatesCanonical
2490          , instantiatesUri, basedOn, partOf, inResponseTo, status, statusReason, category
2491          , priority, medium, subject, topic, about, encounter, sent, received, recipient
2492          , sender, reasonCode, reasonReference, payload, note);
2493      }
2494
2495  @Override
2496  public ResourceType getResourceType() {
2497    return ResourceType.Communication;
2498   }
2499
2500 /**
2501   * Search parameter: <b>identifier</b>
2502   * <p>
2503   * Description: <b>Unique identifier</b><br>
2504   * Type: <b>token</b><br>
2505   * Path: <b>Communication.identifier</b><br>
2506   * </p>
2507   */
2508  @SearchParamDefinition(name="identifier", path="Communication.identifier", description="Unique identifier", type="token" )
2509  public static final String SP_IDENTIFIER = "identifier";
2510 /**
2511   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2512   * <p>
2513   * Description: <b>Unique identifier</b><br>
2514   * Type: <b>token</b><br>
2515   * Path: <b>Communication.identifier</b><br>
2516   * </p>
2517   */
2518  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2519
2520 /**
2521   * Search parameter: <b>subject</b>
2522   * <p>
2523   * Description: <b>Focus of message</b><br>
2524   * Type: <b>reference</b><br>
2525   * Path: <b>Communication.subject</b><br>
2526   * </p>
2527   */
2528  @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 } )
2529  public static final String SP_SUBJECT = "subject";
2530 /**
2531   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
2532   * <p>
2533   * Description: <b>Focus of message</b><br>
2534   * Type: <b>reference</b><br>
2535   * Path: <b>Communication.subject</b><br>
2536   * </p>
2537   */
2538  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
2539
2540/**
2541   * Constant for fluent queries to be used to add include statements. Specifies
2542   * the path value of "<b>Communication:subject</b>".
2543   */
2544  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Communication:subject").toLocked();
2545
2546 /**
2547   * Search parameter: <b>instantiates-canonical</b>
2548   * <p>
2549   * Description: <b>Instantiates FHIR protocol or definition</b><br>
2550   * Type: <b>reference</b><br>
2551   * Path: <b>Communication.instantiatesCanonical</b><br>
2552   * </p>
2553   */
2554  @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 } )
2555  public static final String SP_INSTANTIATES_CANONICAL = "instantiates-canonical";
2556 /**
2557   * <b>Fluent Client</b> search parameter constant for <b>instantiates-canonical</b>
2558   * <p>
2559   * Description: <b>Instantiates FHIR protocol or definition</b><br>
2560   * Type: <b>reference</b><br>
2561   * Path: <b>Communication.instantiatesCanonical</b><br>
2562   * </p>
2563   */
2564  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INSTANTIATES_CANONICAL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INSTANTIATES_CANONICAL);
2565
2566/**
2567   * Constant for fluent queries to be used to add include statements. Specifies
2568   * the path value of "<b>Communication:instantiates-canonical</b>".
2569   */
2570  public static final ca.uhn.fhir.model.api.Include INCLUDE_INSTANTIATES_CANONICAL = new ca.uhn.fhir.model.api.Include("Communication:instantiates-canonical").toLocked();
2571
2572 /**
2573   * Search parameter: <b>received</b>
2574   * <p>
2575   * Description: <b>When received</b><br>
2576   * Type: <b>date</b><br>
2577   * Path: <b>Communication.received</b><br>
2578   * </p>
2579   */
2580  @SearchParamDefinition(name="received", path="Communication.received", description="When received", type="date" )
2581  public static final String SP_RECEIVED = "received";
2582 /**
2583   * <b>Fluent Client</b> search parameter constant for <b>received</b>
2584   * <p>
2585   * Description: <b>When received</b><br>
2586   * Type: <b>date</b><br>
2587   * Path: <b>Communication.received</b><br>
2588   * </p>
2589   */
2590  public static final ca.uhn.fhir.rest.gclient.DateClientParam RECEIVED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_RECEIVED);
2591
2592 /**
2593   * Search parameter: <b>part-of</b>
2594   * <p>
2595   * Description: <b>Part of this action</b><br>
2596   * Type: <b>reference</b><br>
2597   * Path: <b>Communication.partOf</b><br>
2598   * </p>
2599   */
2600  @SearchParamDefinition(name="part-of", path="Communication.partOf", description="Part of this action", type="reference" )
2601  public static final String SP_PART_OF = "part-of";
2602 /**
2603   * <b>Fluent Client</b> search parameter constant for <b>part-of</b>
2604   * <p>
2605   * Description: <b>Part of this action</b><br>
2606   * Type: <b>reference</b><br>
2607   * Path: <b>Communication.partOf</b><br>
2608   * </p>
2609   */
2610  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PART_OF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PART_OF);
2611
2612/**
2613   * Constant for fluent queries to be used to add include statements. Specifies
2614   * the path value of "<b>Communication:part-of</b>".
2615   */
2616  public static final ca.uhn.fhir.model.api.Include INCLUDE_PART_OF = new ca.uhn.fhir.model.api.Include("Communication:part-of").toLocked();
2617
2618 /**
2619   * Search parameter: <b>medium</b>
2620   * <p>
2621   * Description: <b>A channel of communication</b><br>
2622   * Type: <b>token</b><br>
2623   * Path: <b>Communication.medium</b><br>
2624   * </p>
2625   */
2626  @SearchParamDefinition(name="medium", path="Communication.medium", description="A channel of communication", type="token" )
2627  public static final String SP_MEDIUM = "medium";
2628 /**
2629   * <b>Fluent Client</b> search parameter constant for <b>medium</b>
2630   * <p>
2631   * Description: <b>A channel of communication</b><br>
2632   * Type: <b>token</b><br>
2633   * Path: <b>Communication.medium</b><br>
2634   * </p>
2635   */
2636  public static final ca.uhn.fhir.rest.gclient.TokenClientParam MEDIUM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_MEDIUM);
2637
2638 /**
2639   * Search parameter: <b>encounter</b>
2640   * <p>
2641   * Description: <b>Encounter created as part of</b><br>
2642   * Type: <b>reference</b><br>
2643   * Path: <b>Communication.encounter</b><br>
2644   * </p>
2645   */
2646  @SearchParamDefinition(name="encounter", path="Communication.encounter", description="Encounter created as part of", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Encounter") }, target={Encounter.class } )
2647  public static final String SP_ENCOUNTER = "encounter";
2648 /**
2649   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
2650   * <p>
2651   * Description: <b>Encounter created as part of</b><br>
2652   * Type: <b>reference</b><br>
2653   * Path: <b>Communication.encounter</b><br>
2654   * </p>
2655   */
2656  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER);
2657
2658/**
2659   * Constant for fluent queries to be used to add include statements. Specifies
2660   * the path value of "<b>Communication:encounter</b>".
2661   */
2662  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("Communication:encounter").toLocked();
2663
2664 /**
2665   * Search parameter: <b>sent</b>
2666   * <p>
2667   * Description: <b>When sent</b><br>
2668   * Type: <b>date</b><br>
2669   * Path: <b>Communication.sent</b><br>
2670   * </p>
2671   */
2672  @SearchParamDefinition(name="sent", path="Communication.sent", description="When sent", type="date" )
2673  public static final String SP_SENT = "sent";
2674 /**
2675   * <b>Fluent Client</b> search parameter constant for <b>sent</b>
2676   * <p>
2677   * Description: <b>When sent</b><br>
2678   * Type: <b>date</b><br>
2679   * Path: <b>Communication.sent</b><br>
2680   * </p>
2681   */
2682  public static final ca.uhn.fhir.rest.gclient.DateClientParam SENT = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_SENT);
2683
2684 /**
2685   * Search parameter: <b>based-on</b>
2686   * <p>
2687   * Description: <b>Request fulfilled by this communication</b><br>
2688   * Type: <b>reference</b><br>
2689   * Path: <b>Communication.basedOn</b><br>
2690   * </p>
2691   */
2692  @SearchParamDefinition(name="based-on", path="Communication.basedOn", description="Request fulfilled by this communication", type="reference" )
2693  public static final String SP_BASED_ON = "based-on";
2694 /**
2695   * <b>Fluent Client</b> search parameter constant for <b>based-on</b>
2696   * <p>
2697   * Description: <b>Request fulfilled by this communication</b><br>
2698   * Type: <b>reference</b><br>
2699   * Path: <b>Communication.basedOn</b><br>
2700   * </p>
2701   */
2702  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASED_ON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BASED_ON);
2703
2704/**
2705   * Constant for fluent queries to be used to add include statements. Specifies
2706   * the path value of "<b>Communication:based-on</b>".
2707   */
2708  public static final ca.uhn.fhir.model.api.Include INCLUDE_BASED_ON = new ca.uhn.fhir.model.api.Include("Communication:based-on").toLocked();
2709
2710 /**
2711   * Search parameter: <b>sender</b>
2712   * <p>
2713   * Description: <b>Message sender</b><br>
2714   * Type: <b>reference</b><br>
2715   * Path: <b>Communication.sender</b><br>
2716   * </p>
2717   */
2718  @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 } )
2719  public static final String SP_SENDER = "sender";
2720 /**
2721   * <b>Fluent Client</b> search parameter constant for <b>sender</b>
2722   * <p>
2723   * Description: <b>Message sender</b><br>
2724   * Type: <b>reference</b><br>
2725   * Path: <b>Communication.sender</b><br>
2726   * </p>
2727   */
2728  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SENDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SENDER);
2729
2730/**
2731   * Constant for fluent queries to be used to add include statements. Specifies
2732   * the path value of "<b>Communication:sender</b>".
2733   */
2734  public static final ca.uhn.fhir.model.api.Include INCLUDE_SENDER = new ca.uhn.fhir.model.api.Include("Communication:sender").toLocked();
2735
2736 /**
2737   * Search parameter: <b>patient</b>
2738   * <p>
2739   * Description: <b>Focus of message</b><br>
2740   * Type: <b>reference</b><br>
2741   * Path: <b>Communication.subject</b><br>
2742   * </p>
2743   */
2744  @SearchParamDefinition(name="patient", path="Communication.subject.where(resolve() is Patient)", description="Focus of message", type="reference", target={Patient.class } )
2745  public static final String SP_PATIENT = "patient";
2746 /**
2747   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2748   * <p>
2749   * Description: <b>Focus of message</b><br>
2750   * Type: <b>reference</b><br>
2751   * Path: <b>Communication.subject</b><br>
2752   * </p>
2753   */
2754  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
2755
2756/**
2757   * Constant for fluent queries to be used to add include statements. Specifies
2758   * the path value of "<b>Communication:patient</b>".
2759   */
2760  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Communication:patient").toLocked();
2761
2762 /**
2763   * Search parameter: <b>recipient</b>
2764   * <p>
2765   * Description: <b>Message recipient</b><br>
2766   * Type: <b>reference</b><br>
2767   * Path: <b>Communication.recipient</b><br>
2768   * </p>
2769   */
2770  @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 } )
2771  public static final String SP_RECIPIENT = "recipient";
2772 /**
2773   * <b>Fluent Client</b> search parameter constant for <b>recipient</b>
2774   * <p>
2775   * Description: <b>Message recipient</b><br>
2776   * Type: <b>reference</b><br>
2777   * Path: <b>Communication.recipient</b><br>
2778   * </p>
2779   */
2780  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RECIPIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RECIPIENT);
2781
2782/**
2783   * Constant for fluent queries to be used to add include statements. Specifies
2784   * the path value of "<b>Communication:recipient</b>".
2785   */
2786  public static final ca.uhn.fhir.model.api.Include INCLUDE_RECIPIENT = new ca.uhn.fhir.model.api.Include("Communication:recipient").toLocked();
2787
2788 /**
2789   * Search parameter: <b>instantiates-uri</b>
2790   * <p>
2791   * Description: <b>Instantiates external protocol or definition</b><br>
2792   * Type: <b>uri</b><br>
2793   * Path: <b>Communication.instantiatesUri</b><br>
2794   * </p>
2795   */
2796  @SearchParamDefinition(name="instantiates-uri", path="Communication.instantiatesUri", description="Instantiates external protocol or definition", type="uri" )
2797  public static final String SP_INSTANTIATES_URI = "instantiates-uri";
2798 /**
2799   * <b>Fluent Client</b> search parameter constant for <b>instantiates-uri</b>
2800   * <p>
2801   * Description: <b>Instantiates external protocol or definition</b><br>
2802   * Type: <b>uri</b><br>
2803   * Path: <b>Communication.instantiatesUri</b><br>
2804   * </p>
2805   */
2806  public static final ca.uhn.fhir.rest.gclient.UriClientParam INSTANTIATES_URI = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_INSTANTIATES_URI);
2807
2808 /**
2809   * Search parameter: <b>category</b>
2810   * <p>
2811   * Description: <b>Message category</b><br>
2812   * Type: <b>token</b><br>
2813   * Path: <b>Communication.category</b><br>
2814   * </p>
2815   */
2816  @SearchParamDefinition(name="category", path="Communication.category", description="Message category", type="token" )
2817  public static final String SP_CATEGORY = "category";
2818 /**
2819   * <b>Fluent Client</b> search parameter constant for <b>category</b>
2820   * <p>
2821   * Description: <b>Message category</b><br>
2822   * Type: <b>token</b><br>
2823   * Path: <b>Communication.category</b><br>
2824   * </p>
2825   */
2826  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY);
2827
2828 /**
2829   * Search parameter: <b>status</b>
2830   * <p>
2831   * Description: <b>preparation | in-progress | not-done | suspended | aborted | completed | entered-in-error</b><br>
2832   * Type: <b>token</b><br>
2833   * Path: <b>Communication.status</b><br>
2834   * </p>
2835   */
2836  @SearchParamDefinition(name="status", path="Communication.status", description="preparation | in-progress | not-done | suspended | aborted | completed | entered-in-error", type="token" )
2837  public static final String SP_STATUS = "status";
2838 /**
2839   * <b>Fluent Client</b> search parameter constant for <b>status</b>
2840   * <p>
2841   * Description: <b>preparation | in-progress | not-done | suspended | aborted | completed | entered-in-error</b><br>
2842   * Type: <b>token</b><br>
2843   * Path: <b>Communication.status</b><br>
2844   * </p>
2845   */
2846  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
2847
2848
2849}
2850