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