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