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