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