001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Thu, Mar 23, 2023 19:59+1100 for FHIR v5.0.0
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * The header for a message exchange that is either requesting or responding to an action.  The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.
052 */
053@ResourceDef(name="MessageHeader", profile="http://hl7.org/fhir/StructureDefinition/MessageHeader")
054public class MessageHeader extends DomainResource {
055
056    public enum ResponseType {
057        /**
058         * The message was accepted and processed without error.
059         */
060        OK, 
061        /**
062         * Some internal unexpected error occurred - wait and try again. Note - this is usually used for things like database unavailable, which may be expected to resolve, though human intervention may be required.
063         */
064        TRANSIENTERROR, 
065        /**
066         * The message was rejected because of a problem with the content. There is no point in re-sending without change. The response narrative SHALL describe the issue.
067         */
068        FATALERROR, 
069        /**
070         * added to help the parsers with the generic types
071         */
072        NULL;
073        public static ResponseType fromCode(String codeString) throws FHIRException {
074            if (codeString == null || "".equals(codeString))
075                return null;
076        if ("ok".equals(codeString))
077          return OK;
078        if ("transient-error".equals(codeString))
079          return TRANSIENTERROR;
080        if ("fatal-error".equals(codeString))
081          return FATALERROR;
082        if (Configuration.isAcceptInvalidEnums())
083          return null;
084        else
085          throw new FHIRException("Unknown ResponseType code '"+codeString+"'");
086        }
087        public String toCode() {
088          switch (this) {
089            case OK: return "ok";
090            case TRANSIENTERROR: return "transient-error";
091            case FATALERROR: return "fatal-error";
092            case NULL: return null;
093            default: return "?";
094          }
095        }
096        public String getSystem() {
097          switch (this) {
098            case OK: return "http://hl7.org/fhir/response-code";
099            case TRANSIENTERROR: return "http://hl7.org/fhir/response-code";
100            case FATALERROR: return "http://hl7.org/fhir/response-code";
101            case NULL: return null;
102            default: return "?";
103          }
104        }
105        public String getDefinition() {
106          switch (this) {
107            case OK: return "The message was accepted and processed without error.";
108            case TRANSIENTERROR: return "Some internal unexpected error occurred - wait and try again. Note - this is usually used for things like database unavailable, which may be expected to resolve, though human intervention may be required.";
109            case FATALERROR: return "The message was rejected because of a problem with the content. There is no point in re-sending without change. The response narrative SHALL describe the issue.";
110            case NULL: return null;
111            default: return "?";
112          }
113        }
114        public String getDisplay() {
115          switch (this) {
116            case OK: return "OK";
117            case TRANSIENTERROR: return "Transient Error";
118            case FATALERROR: return "Fatal Error";
119            case NULL: return null;
120            default: return "?";
121          }
122        }
123    }
124
125  public static class ResponseTypeEnumFactory implements EnumFactory<ResponseType> {
126    public ResponseType fromCode(String codeString) throws IllegalArgumentException {
127      if (codeString == null || "".equals(codeString))
128            if (codeString == null || "".equals(codeString))
129                return null;
130        if ("ok".equals(codeString))
131          return ResponseType.OK;
132        if ("transient-error".equals(codeString))
133          return ResponseType.TRANSIENTERROR;
134        if ("fatal-error".equals(codeString))
135          return ResponseType.FATALERROR;
136        throw new IllegalArgumentException("Unknown ResponseType code '"+codeString+"'");
137        }
138        public Enumeration<ResponseType> fromType(PrimitiveType<?> code) throws FHIRException {
139          if (code == null)
140            return null;
141          if (code.isEmpty())
142            return new Enumeration<ResponseType>(this, ResponseType.NULL, code);
143          String codeString = ((PrimitiveType) code).asStringValue();
144          if (codeString == null || "".equals(codeString))
145            return new Enumeration<ResponseType>(this, ResponseType.NULL, code);
146        if ("ok".equals(codeString))
147          return new Enumeration<ResponseType>(this, ResponseType.OK, code);
148        if ("transient-error".equals(codeString))
149          return new Enumeration<ResponseType>(this, ResponseType.TRANSIENTERROR, code);
150        if ("fatal-error".equals(codeString))
151          return new Enumeration<ResponseType>(this, ResponseType.FATALERROR, code);
152        throw new FHIRException("Unknown ResponseType code '"+codeString+"'");
153        }
154    public String toCode(ResponseType code) {
155      if (code == ResponseType.OK)
156        return "ok";
157      if (code == ResponseType.TRANSIENTERROR)
158        return "transient-error";
159      if (code == ResponseType.FATALERROR)
160        return "fatal-error";
161      return "?";
162      }
163    public String toSystem(ResponseType code) {
164      return code.getSystem();
165      }
166    }
167
168    @Block()
169    public static class MessageDestinationComponent extends BackboneElement implements IBaseBackboneElement {
170        /**
171         * Indicates where the message should be routed.
172         */
173        @Child(name = "endpoint", type = {UrlType.class, Endpoint.class}, order=1, min=0, max=1, modifier=false, summary=true)
174        @Description(shortDefinition="Actual destination address or Endpoint resource", formalDefinition="Indicates where the message should be routed." )
175        protected DataType endpoint;
176
177        /**
178         * Human-readable name for the target system.
179         */
180        @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
181        @Description(shortDefinition="Name of system", formalDefinition="Human-readable name for the target system." )
182        protected StringType name;
183
184        /**
185         * Identifies the target end system in situations where the initial message transmission is to an intermediary system.
186         */
187        @Child(name = "target", type = {Device.class}, order=3, min=0, max=1, modifier=false, summary=true)
188        @Description(shortDefinition="Particular delivery destination within the destination", formalDefinition="Identifies the target end system in situations where the initial message transmission is to an intermediary system." )
189        protected Reference target;
190
191        /**
192         * Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.
193         */
194        @Child(name = "receiver", type = {Practitioner.class, PractitionerRole.class, Organization.class}, order=4, min=0, max=1, modifier=false, summary=true)
195        @Description(shortDefinition="Intended \"real-world\" recipient for the data", formalDefinition="Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient." )
196        protected Reference receiver;
197
198        private static final long serialVersionUID = -274385787L;
199
200    /**
201     * Constructor
202     */
203      public MessageDestinationComponent() {
204        super();
205      }
206
207        /**
208         * @return {@link #endpoint} (Indicates where the message should be routed.)
209         */
210        public DataType getEndpoint() { 
211          return this.endpoint;
212        }
213
214        /**
215         * @return {@link #endpoint} (Indicates where the message should be routed.)
216         */
217        public UrlType getEndpointUrlType() throws FHIRException { 
218          if (this.endpoint == null)
219            this.endpoint = new UrlType();
220          if (!(this.endpoint instanceof UrlType))
221            throw new FHIRException("Type mismatch: the type UrlType was expected, but "+this.endpoint.getClass().getName()+" was encountered");
222          return (UrlType) this.endpoint;
223        }
224
225        public boolean hasEndpointUrlType() { 
226          return this != null && this.endpoint instanceof UrlType;
227        }
228
229        /**
230         * @return {@link #endpoint} (Indicates where the message should be routed.)
231         */
232        public Reference getEndpointReference() throws FHIRException { 
233          if (this.endpoint == null)
234            this.endpoint = new Reference();
235          if (!(this.endpoint instanceof Reference))
236            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.endpoint.getClass().getName()+" was encountered");
237          return (Reference) this.endpoint;
238        }
239
240        public boolean hasEndpointReference() { 
241          return this != null && this.endpoint instanceof Reference;
242        }
243
244        public boolean hasEndpoint() { 
245          return this.endpoint != null && !this.endpoint.isEmpty();
246        }
247
248        /**
249         * @param value {@link #endpoint} (Indicates where the message should be routed.)
250         */
251        public MessageDestinationComponent setEndpoint(DataType value) { 
252          if (value != null && !(value instanceof UrlType || value instanceof Reference))
253            throw new FHIRException("Not the right type for MessageHeader.destination.endpoint[x]: "+value.fhirType());
254          this.endpoint = value;
255          return this;
256        }
257
258        /**
259         * @return {@link #name} (Human-readable name for the target system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
260         */
261        public StringType getNameElement() { 
262          if (this.name == null)
263            if (Configuration.errorOnAutoCreate())
264              throw new Error("Attempt to auto-create MessageDestinationComponent.name");
265            else if (Configuration.doAutoCreate())
266              this.name = new StringType(); // bb
267          return this.name;
268        }
269
270        public boolean hasNameElement() { 
271          return this.name != null && !this.name.isEmpty();
272        }
273
274        public boolean hasName() { 
275          return this.name != null && !this.name.isEmpty();
276        }
277
278        /**
279         * @param value {@link #name} (Human-readable name for the target system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
280         */
281        public MessageDestinationComponent setNameElement(StringType value) { 
282          this.name = value;
283          return this;
284        }
285
286        /**
287         * @return Human-readable name for the target system.
288         */
289        public String getName() { 
290          return this.name == null ? null : this.name.getValue();
291        }
292
293        /**
294         * @param value Human-readable name for the target system.
295         */
296        public MessageDestinationComponent setName(String value) { 
297          if (Utilities.noString(value))
298            this.name = null;
299          else {
300            if (this.name == null)
301              this.name = new StringType();
302            this.name.setValue(value);
303          }
304          return this;
305        }
306
307        /**
308         * @return {@link #target} (Identifies the target end system in situations where the initial message transmission is to an intermediary system.)
309         */
310        public Reference getTarget() { 
311          if (this.target == null)
312            if (Configuration.errorOnAutoCreate())
313              throw new Error("Attempt to auto-create MessageDestinationComponent.target");
314            else if (Configuration.doAutoCreate())
315              this.target = new Reference(); // cc
316          return this.target;
317        }
318
319        public boolean hasTarget() { 
320          return this.target != null && !this.target.isEmpty();
321        }
322
323        /**
324         * @param value {@link #target} (Identifies the target end system in situations where the initial message transmission is to an intermediary system.)
325         */
326        public MessageDestinationComponent setTarget(Reference value) { 
327          this.target = value;
328          return this;
329        }
330
331        /**
332         * @return {@link #receiver} (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.)
333         */
334        public Reference getReceiver() { 
335          if (this.receiver == null)
336            if (Configuration.errorOnAutoCreate())
337              throw new Error("Attempt to auto-create MessageDestinationComponent.receiver");
338            else if (Configuration.doAutoCreate())
339              this.receiver = new Reference(); // cc
340          return this.receiver;
341        }
342
343        public boolean hasReceiver() { 
344          return this.receiver != null && !this.receiver.isEmpty();
345        }
346
347        /**
348         * @param value {@link #receiver} (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.)
349         */
350        public MessageDestinationComponent setReceiver(Reference value) { 
351          this.receiver = value;
352          return this;
353        }
354
355        protected void listChildren(List<Property> children) {
356          super.listChildren(children);
357          children.add(new Property("endpoint[x]", "url|Reference(Endpoint)", "Indicates where the message should be routed.", 0, 1, endpoint));
358          children.add(new Property("name", "string", "Human-readable name for the target system.", 0, 1, name));
359          children.add(new Property("target", "Reference(Device)", "Identifies the target end system in situations where the initial message transmission is to an intermediary system.", 0, 1, target));
360          children.add(new Property("receiver", "Reference(Practitioner|PractitionerRole|Organization)", "Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.", 0, 1, receiver));
361        }
362
363        @Override
364        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
365          switch (_hash) {
366          case -1135811893: /*endpoint[x]*/  return new Property("endpoint[x]", "url|Reference(Endpoint)", "Indicates where the message should be routed.", 0, 1, endpoint);
367          case 1741102485: /*endpoint*/  return new Property("endpoint[x]", "url|Reference(Endpoint)", "Indicates where the message should be routed.", 0, 1, endpoint);
368          case -1135817830: /*endpointUrl*/  return new Property("endpoint[x]", "url", "Indicates where the message should be routed.", 0, 1, endpoint);
369          case 687192374: /*endpointReference*/  return new Property("endpoint[x]", "Reference(Endpoint)", "Indicates where the message should be routed.", 0, 1, endpoint);
370          case 3373707: /*name*/  return new Property("name", "string", "Human-readable name for the target system.", 0, 1, name);
371          case -880905839: /*target*/  return new Property("target", "Reference(Device)", "Identifies the target end system in situations where the initial message transmission is to an intermediary system.", 0, 1, target);
372          case -808719889: /*receiver*/  return new Property("receiver", "Reference(Practitioner|PractitionerRole|Organization)", "Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.", 0, 1, receiver);
373          default: return super.getNamedProperty(_hash, _name, _checkValid);
374          }
375
376        }
377
378      @Override
379      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
380        switch (hash) {
381        case 1741102485: /*endpoint*/ return this.endpoint == null ? new Base[0] : new Base[] {this.endpoint}; // DataType
382        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
383        case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Reference
384        case -808719889: /*receiver*/ return this.receiver == null ? new Base[0] : new Base[] {this.receiver}; // Reference
385        default: return super.getProperty(hash, name, checkValid);
386        }
387
388      }
389
390      @Override
391      public Base setProperty(int hash, String name, Base value) throws FHIRException {
392        switch (hash) {
393        case 1741102485: // endpoint
394          this.endpoint = TypeConvertor.castToType(value); // DataType
395          return value;
396        case 3373707: // name
397          this.name = TypeConvertor.castToString(value); // StringType
398          return value;
399        case -880905839: // target
400          this.target = TypeConvertor.castToReference(value); // Reference
401          return value;
402        case -808719889: // receiver
403          this.receiver = TypeConvertor.castToReference(value); // Reference
404          return value;
405        default: return super.setProperty(hash, name, value);
406        }
407
408      }
409
410      @Override
411      public Base setProperty(String name, Base value) throws FHIRException {
412        if (name.equals("endpoint[x]")) {
413          this.endpoint = TypeConvertor.castToType(value); // DataType
414        } else if (name.equals("name")) {
415          this.name = TypeConvertor.castToString(value); // StringType
416        } else if (name.equals("target")) {
417          this.target = TypeConvertor.castToReference(value); // Reference
418        } else if (name.equals("receiver")) {
419          this.receiver = TypeConvertor.castToReference(value); // Reference
420        } else
421          return super.setProperty(name, value);
422        return value;
423      }
424
425      @Override
426      public Base makeProperty(int hash, String name) throws FHIRException {
427        switch (hash) {
428        case -1135811893:  return getEndpoint();
429        case 1741102485:  return getEndpoint();
430        case 3373707:  return getNameElement();
431        case -880905839:  return getTarget();
432        case -808719889:  return getReceiver();
433        default: return super.makeProperty(hash, name);
434        }
435
436      }
437
438      @Override
439      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
440        switch (hash) {
441        case 1741102485: /*endpoint*/ return new String[] {"url", "Reference"};
442        case 3373707: /*name*/ return new String[] {"string"};
443        case -880905839: /*target*/ return new String[] {"Reference"};
444        case -808719889: /*receiver*/ return new String[] {"Reference"};
445        default: return super.getTypesForProperty(hash, name);
446        }
447
448      }
449
450      @Override
451      public Base addChild(String name) throws FHIRException {
452        if (name.equals("endpointUrl")) {
453          this.endpoint = new UrlType();
454          return this.endpoint;
455        }
456        else if (name.equals("endpointReference")) {
457          this.endpoint = new Reference();
458          return this.endpoint;
459        }
460        else if (name.equals("name")) {
461          throw new FHIRException("Cannot call addChild on a singleton property MessageHeader.destination.name");
462        }
463        else if (name.equals("target")) {
464          this.target = new Reference();
465          return this.target;
466        }
467        else if (name.equals("receiver")) {
468          this.receiver = new Reference();
469          return this.receiver;
470        }
471        else
472          return super.addChild(name);
473      }
474
475      public MessageDestinationComponent copy() {
476        MessageDestinationComponent dst = new MessageDestinationComponent();
477        copyValues(dst);
478        return dst;
479      }
480
481      public void copyValues(MessageDestinationComponent dst) {
482        super.copyValues(dst);
483        dst.endpoint = endpoint == null ? null : endpoint.copy();
484        dst.name = name == null ? null : name.copy();
485        dst.target = target == null ? null : target.copy();
486        dst.receiver = receiver == null ? null : receiver.copy();
487      }
488
489      @Override
490      public boolean equalsDeep(Base other_) {
491        if (!super.equalsDeep(other_))
492          return false;
493        if (!(other_ instanceof MessageDestinationComponent))
494          return false;
495        MessageDestinationComponent o = (MessageDestinationComponent) other_;
496        return compareDeep(endpoint, o.endpoint, true) && compareDeep(name, o.name, true) && compareDeep(target, o.target, true)
497           && compareDeep(receiver, o.receiver, true);
498      }
499
500      @Override
501      public boolean equalsShallow(Base other_) {
502        if (!super.equalsShallow(other_))
503          return false;
504        if (!(other_ instanceof MessageDestinationComponent))
505          return false;
506        MessageDestinationComponent o = (MessageDestinationComponent) other_;
507        return compareValues(name, o.name, true);
508      }
509
510      public boolean isEmpty() {
511        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(endpoint, name, target, receiver
512          );
513      }
514
515  public String fhirType() {
516    return "MessageHeader.destination";
517
518  }
519
520  }
521
522    @Block()
523    public static class MessageSourceComponent extends BackboneElement implements IBaseBackboneElement {
524        /**
525         * Identifies the routing target to send acknowledgements to.
526         */
527        @Child(name = "endpoint", type = {UrlType.class, Endpoint.class}, order=1, min=0, max=1, modifier=false, summary=true)
528        @Description(shortDefinition="Actual source address or Endpoint resource", formalDefinition="Identifies the routing target to send acknowledgements to." )
529        protected DataType endpoint;
530
531        /**
532         * Human-readable name for the source system.
533         */
534        @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
535        @Description(shortDefinition="Name of system", formalDefinition="Human-readable name for the source system." )
536        protected StringType name;
537
538        /**
539         * May include configuration or other information useful in debugging.
540         */
541        @Child(name = "software", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
542        @Description(shortDefinition="Name of software running the system", formalDefinition="May include configuration or other information useful in debugging." )
543        protected StringType software;
544
545        /**
546         * Can convey versions of multiple systems in situations where a message passes through multiple hands.
547         */
548        @Child(name = "version", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
549        @Description(shortDefinition="Version of software running", formalDefinition="Can convey versions of multiple systems in situations where a message passes through multiple hands." )
550        protected StringType version;
551
552        /**
553         * An e-mail, phone, website or other contact point to use to resolve issues with message communications.
554         */
555        @Child(name = "contact", type = {ContactPoint.class}, order=5, min=0, max=1, modifier=false, summary=true)
556        @Description(shortDefinition="Human contact for problems", formalDefinition="An e-mail, phone, website or other contact point to use to resolve issues with message communications." )
557        protected ContactPoint contact;
558
559        private static final long serialVersionUID = 62264996L;
560
561    /**
562     * Constructor
563     */
564      public MessageSourceComponent() {
565        super();
566      }
567
568        /**
569         * @return {@link #endpoint} (Identifies the routing target to send acknowledgements to.)
570         */
571        public DataType getEndpoint() { 
572          return this.endpoint;
573        }
574
575        /**
576         * @return {@link #endpoint} (Identifies the routing target to send acknowledgements to.)
577         */
578        public UrlType getEndpointUrlType() throws FHIRException { 
579          if (this.endpoint == null)
580            this.endpoint = new UrlType();
581          if (!(this.endpoint instanceof UrlType))
582            throw new FHIRException("Type mismatch: the type UrlType was expected, but "+this.endpoint.getClass().getName()+" was encountered");
583          return (UrlType) this.endpoint;
584        }
585
586        public boolean hasEndpointUrlType() { 
587          return this != null && this.endpoint instanceof UrlType;
588        }
589
590        /**
591         * @return {@link #endpoint} (Identifies the routing target to send acknowledgements to.)
592         */
593        public Reference getEndpointReference() throws FHIRException { 
594          if (this.endpoint == null)
595            this.endpoint = new Reference();
596          if (!(this.endpoint instanceof Reference))
597            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.endpoint.getClass().getName()+" was encountered");
598          return (Reference) this.endpoint;
599        }
600
601        public boolean hasEndpointReference() { 
602          return this != null && this.endpoint instanceof Reference;
603        }
604
605        public boolean hasEndpoint() { 
606          return this.endpoint != null && !this.endpoint.isEmpty();
607        }
608
609        /**
610         * @param value {@link #endpoint} (Identifies the routing target to send acknowledgements to.)
611         */
612        public MessageSourceComponent setEndpoint(DataType value) { 
613          if (value != null && !(value instanceof UrlType || value instanceof Reference))
614            throw new FHIRException("Not the right type for MessageHeader.source.endpoint[x]: "+value.fhirType());
615          this.endpoint = value;
616          return this;
617        }
618
619        /**
620         * @return {@link #name} (Human-readable name for the source system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
621         */
622        public StringType getNameElement() { 
623          if (this.name == null)
624            if (Configuration.errorOnAutoCreate())
625              throw new Error("Attempt to auto-create MessageSourceComponent.name");
626            else if (Configuration.doAutoCreate())
627              this.name = new StringType(); // bb
628          return this.name;
629        }
630
631        public boolean hasNameElement() { 
632          return this.name != null && !this.name.isEmpty();
633        }
634
635        public boolean hasName() { 
636          return this.name != null && !this.name.isEmpty();
637        }
638
639        /**
640         * @param value {@link #name} (Human-readable name for the source system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
641         */
642        public MessageSourceComponent setNameElement(StringType value) { 
643          this.name = value;
644          return this;
645        }
646
647        /**
648         * @return Human-readable name for the source system.
649         */
650        public String getName() { 
651          return this.name == null ? null : this.name.getValue();
652        }
653
654        /**
655         * @param value Human-readable name for the source system.
656         */
657        public MessageSourceComponent setName(String value) { 
658          if (Utilities.noString(value))
659            this.name = null;
660          else {
661            if (this.name == null)
662              this.name = new StringType();
663            this.name.setValue(value);
664          }
665          return this;
666        }
667
668        /**
669         * @return {@link #software} (May include configuration or other information useful in debugging.). This is the underlying object with id, value and extensions. The accessor "getSoftware" gives direct access to the value
670         */
671        public StringType getSoftwareElement() { 
672          if (this.software == null)
673            if (Configuration.errorOnAutoCreate())
674              throw new Error("Attempt to auto-create MessageSourceComponent.software");
675            else if (Configuration.doAutoCreate())
676              this.software = new StringType(); // bb
677          return this.software;
678        }
679
680        public boolean hasSoftwareElement() { 
681          return this.software != null && !this.software.isEmpty();
682        }
683
684        public boolean hasSoftware() { 
685          return this.software != null && !this.software.isEmpty();
686        }
687
688        /**
689         * @param value {@link #software} (May include configuration or other information useful in debugging.). This is the underlying object with id, value and extensions. The accessor "getSoftware" gives direct access to the value
690         */
691        public MessageSourceComponent setSoftwareElement(StringType value) { 
692          this.software = value;
693          return this;
694        }
695
696        /**
697         * @return May include configuration or other information useful in debugging.
698         */
699        public String getSoftware() { 
700          return this.software == null ? null : this.software.getValue();
701        }
702
703        /**
704         * @param value May include configuration or other information useful in debugging.
705         */
706        public MessageSourceComponent setSoftware(String value) { 
707          if (Utilities.noString(value))
708            this.software = null;
709          else {
710            if (this.software == null)
711              this.software = new StringType();
712            this.software.setValue(value);
713          }
714          return this;
715        }
716
717        /**
718         * @return {@link #version} (Can convey versions of multiple systems in situations where a message passes through multiple hands.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
719         */
720        public StringType getVersionElement() { 
721          if (this.version == null)
722            if (Configuration.errorOnAutoCreate())
723              throw new Error("Attempt to auto-create MessageSourceComponent.version");
724            else if (Configuration.doAutoCreate())
725              this.version = new StringType(); // bb
726          return this.version;
727        }
728
729        public boolean hasVersionElement() { 
730          return this.version != null && !this.version.isEmpty();
731        }
732
733        public boolean hasVersion() { 
734          return this.version != null && !this.version.isEmpty();
735        }
736
737        /**
738         * @param value {@link #version} (Can convey versions of multiple systems in situations where a message passes through multiple hands.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
739         */
740        public MessageSourceComponent setVersionElement(StringType value) { 
741          this.version = value;
742          return this;
743        }
744
745        /**
746         * @return Can convey versions of multiple systems in situations where a message passes through multiple hands.
747         */
748        public String getVersion() { 
749          return this.version == null ? null : this.version.getValue();
750        }
751
752        /**
753         * @param value Can convey versions of multiple systems in situations where a message passes through multiple hands.
754         */
755        public MessageSourceComponent setVersion(String value) { 
756          if (Utilities.noString(value))
757            this.version = null;
758          else {
759            if (this.version == null)
760              this.version = new StringType();
761            this.version.setValue(value);
762          }
763          return this;
764        }
765
766        /**
767         * @return {@link #contact} (An e-mail, phone, website or other contact point to use to resolve issues with message communications.)
768         */
769        public ContactPoint getContact() { 
770          if (this.contact == null)
771            if (Configuration.errorOnAutoCreate())
772              throw new Error("Attempt to auto-create MessageSourceComponent.contact");
773            else if (Configuration.doAutoCreate())
774              this.contact = new ContactPoint(); // cc
775          return this.contact;
776        }
777
778        public boolean hasContact() { 
779          return this.contact != null && !this.contact.isEmpty();
780        }
781
782        /**
783         * @param value {@link #contact} (An e-mail, phone, website or other contact point to use to resolve issues with message communications.)
784         */
785        public MessageSourceComponent setContact(ContactPoint value) { 
786          this.contact = value;
787          return this;
788        }
789
790        protected void listChildren(List<Property> children) {
791          super.listChildren(children);
792          children.add(new Property("endpoint[x]", "url|Reference(Endpoint)", "Identifies the routing target to send acknowledgements to.", 0, 1, endpoint));
793          children.add(new Property("name", "string", "Human-readable name for the source system.", 0, 1, name));
794          children.add(new Property("software", "string", "May include configuration or other information useful in debugging.", 0, 1, software));
795          children.add(new Property("version", "string", "Can convey versions of multiple systems in situations where a message passes through multiple hands.", 0, 1, version));
796          children.add(new Property("contact", "ContactPoint", "An e-mail, phone, website or other contact point to use to resolve issues with message communications.", 0, 1, contact));
797        }
798
799        @Override
800        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
801          switch (_hash) {
802          case -1135811893: /*endpoint[x]*/  return new Property("endpoint[x]", "url|Reference(Endpoint)", "Identifies the routing target to send acknowledgements to.", 0, 1, endpoint);
803          case 1741102485: /*endpoint*/  return new Property("endpoint[x]", "url|Reference(Endpoint)", "Identifies the routing target to send acknowledgements to.", 0, 1, endpoint);
804          case -1135817830: /*endpointUrl*/  return new Property("endpoint[x]", "url", "Identifies the routing target to send acknowledgements to.", 0, 1, endpoint);
805          case 687192374: /*endpointReference*/  return new Property("endpoint[x]", "Reference(Endpoint)", "Identifies the routing target to send acknowledgements to.", 0, 1, endpoint);
806          case 3373707: /*name*/  return new Property("name", "string", "Human-readable name for the source system.", 0, 1, name);
807          case 1319330215: /*software*/  return new Property("software", "string", "May include configuration or other information useful in debugging.", 0, 1, software);
808          case 351608024: /*version*/  return new Property("version", "string", "Can convey versions of multiple systems in situations where a message passes through multiple hands.", 0, 1, version);
809          case 951526432: /*contact*/  return new Property("contact", "ContactPoint", "An e-mail, phone, website or other contact point to use to resolve issues with message communications.", 0, 1, contact);
810          default: return super.getNamedProperty(_hash, _name, _checkValid);
811          }
812
813        }
814
815      @Override
816      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
817        switch (hash) {
818        case 1741102485: /*endpoint*/ return this.endpoint == null ? new Base[0] : new Base[] {this.endpoint}; // DataType
819        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
820        case 1319330215: /*software*/ return this.software == null ? new Base[0] : new Base[] {this.software}; // StringType
821        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
822        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : new Base[] {this.contact}; // ContactPoint
823        default: return super.getProperty(hash, name, checkValid);
824        }
825
826      }
827
828      @Override
829      public Base setProperty(int hash, String name, Base value) throws FHIRException {
830        switch (hash) {
831        case 1741102485: // endpoint
832          this.endpoint = TypeConvertor.castToType(value); // DataType
833          return value;
834        case 3373707: // name
835          this.name = TypeConvertor.castToString(value); // StringType
836          return value;
837        case 1319330215: // software
838          this.software = TypeConvertor.castToString(value); // StringType
839          return value;
840        case 351608024: // version
841          this.version = TypeConvertor.castToString(value); // StringType
842          return value;
843        case 951526432: // contact
844          this.contact = TypeConvertor.castToContactPoint(value); // ContactPoint
845          return value;
846        default: return super.setProperty(hash, name, value);
847        }
848
849      }
850
851      @Override
852      public Base setProperty(String name, Base value) throws FHIRException {
853        if (name.equals("endpoint[x]")) {
854          this.endpoint = TypeConvertor.castToType(value); // DataType
855        } else if (name.equals("name")) {
856          this.name = TypeConvertor.castToString(value); // StringType
857        } else if (name.equals("software")) {
858          this.software = TypeConvertor.castToString(value); // StringType
859        } else if (name.equals("version")) {
860          this.version = TypeConvertor.castToString(value); // StringType
861        } else if (name.equals("contact")) {
862          this.contact = TypeConvertor.castToContactPoint(value); // ContactPoint
863        } else
864          return super.setProperty(name, value);
865        return value;
866      }
867
868      @Override
869      public Base makeProperty(int hash, String name) throws FHIRException {
870        switch (hash) {
871        case -1135811893:  return getEndpoint();
872        case 1741102485:  return getEndpoint();
873        case 3373707:  return getNameElement();
874        case 1319330215:  return getSoftwareElement();
875        case 351608024:  return getVersionElement();
876        case 951526432:  return getContact();
877        default: return super.makeProperty(hash, name);
878        }
879
880      }
881
882      @Override
883      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
884        switch (hash) {
885        case 1741102485: /*endpoint*/ return new String[] {"url", "Reference"};
886        case 3373707: /*name*/ return new String[] {"string"};
887        case 1319330215: /*software*/ return new String[] {"string"};
888        case 351608024: /*version*/ return new String[] {"string"};
889        case 951526432: /*contact*/ return new String[] {"ContactPoint"};
890        default: return super.getTypesForProperty(hash, name);
891        }
892
893      }
894
895      @Override
896      public Base addChild(String name) throws FHIRException {
897        if (name.equals("endpointUrl")) {
898          this.endpoint = new UrlType();
899          return this.endpoint;
900        }
901        else if (name.equals("endpointReference")) {
902          this.endpoint = new Reference();
903          return this.endpoint;
904        }
905        else if (name.equals("name")) {
906          throw new FHIRException("Cannot call addChild on a singleton property MessageHeader.source.name");
907        }
908        else if (name.equals("software")) {
909          throw new FHIRException("Cannot call addChild on a singleton property MessageHeader.source.software");
910        }
911        else if (name.equals("version")) {
912          throw new FHIRException("Cannot call addChild on a singleton property MessageHeader.source.version");
913        }
914        else if (name.equals("contact")) {
915          this.contact = new ContactPoint();
916          return this.contact;
917        }
918        else
919          return super.addChild(name);
920      }
921
922      public MessageSourceComponent copy() {
923        MessageSourceComponent dst = new MessageSourceComponent();
924        copyValues(dst);
925        return dst;
926      }
927
928      public void copyValues(MessageSourceComponent dst) {
929        super.copyValues(dst);
930        dst.endpoint = endpoint == null ? null : endpoint.copy();
931        dst.name = name == null ? null : name.copy();
932        dst.software = software == null ? null : software.copy();
933        dst.version = version == null ? null : version.copy();
934        dst.contact = contact == null ? null : contact.copy();
935      }
936
937      @Override
938      public boolean equalsDeep(Base other_) {
939        if (!super.equalsDeep(other_))
940          return false;
941        if (!(other_ instanceof MessageSourceComponent))
942          return false;
943        MessageSourceComponent o = (MessageSourceComponent) other_;
944        return compareDeep(endpoint, o.endpoint, true) && compareDeep(name, o.name, true) && compareDeep(software, o.software, true)
945           && compareDeep(version, o.version, true) && compareDeep(contact, o.contact, true);
946      }
947
948      @Override
949      public boolean equalsShallow(Base other_) {
950        if (!super.equalsShallow(other_))
951          return false;
952        if (!(other_ instanceof MessageSourceComponent))
953          return false;
954        MessageSourceComponent o = (MessageSourceComponent) other_;
955        return compareValues(name, o.name, true) && compareValues(software, o.software, true) && compareValues(version, o.version, true)
956          ;
957      }
958
959      public boolean isEmpty() {
960        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(endpoint, name, software
961          , version, contact);
962      }
963
964  public String fhirType() {
965    return "MessageHeader.source";
966
967  }
968
969  }
970
971    @Block()
972    public static class MessageHeaderResponseComponent extends BackboneElement implements IBaseBackboneElement {
973        /**
974         * The Bundle.identifier of the message to which this message is a response.
975         */
976        @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=true)
977        @Description(shortDefinition="Bundle.identifier of original message", formalDefinition="The Bundle.identifier of the message to which this message is a response." )
978        protected Identifier identifier;
979
980        /**
981         * Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.
982         */
983        @Child(name = "code", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=true)
984        @Description(shortDefinition="ok | transient-error | fatal-error", formalDefinition="Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not." )
985        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/response-code")
986        protected Enumeration<ResponseType> code;
987
988        /**
989         * Full details of any issues found in the message.
990         */
991        @Child(name = "details", type = {OperationOutcome.class}, order=3, min=0, max=1, modifier=false, summary=true)
992        @Description(shortDefinition="Specific list of hints/warnings/errors", formalDefinition="Full details of any issues found in the message." )
993        protected Reference details;
994
995        private static final long serialVersionUID = 1091046778L;
996
997    /**
998     * Constructor
999     */
1000      public MessageHeaderResponseComponent() {
1001        super();
1002      }
1003
1004    /**
1005     * Constructor
1006     */
1007      public MessageHeaderResponseComponent(Identifier identifier, ResponseType code) {
1008        super();
1009        this.setIdentifier(identifier);
1010        this.setCode(code);
1011      }
1012
1013        /**
1014         * @return {@link #identifier} (The Bundle.identifier of the message to which this message is a response.)
1015         */
1016        public Identifier getIdentifier() { 
1017          if (this.identifier == null)
1018            if (Configuration.errorOnAutoCreate())
1019              throw new Error("Attempt to auto-create MessageHeaderResponseComponent.identifier");
1020            else if (Configuration.doAutoCreate())
1021              this.identifier = new Identifier(); // cc
1022          return this.identifier;
1023        }
1024
1025        public boolean hasIdentifier() { 
1026          return this.identifier != null && !this.identifier.isEmpty();
1027        }
1028
1029        /**
1030         * @param value {@link #identifier} (The Bundle.identifier of the message to which this message is a response.)
1031         */
1032        public MessageHeaderResponseComponent setIdentifier(Identifier value) { 
1033          this.identifier = value;
1034          return this;
1035        }
1036
1037        /**
1038         * @return {@link #code} (Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
1039         */
1040        public Enumeration<ResponseType> getCodeElement() { 
1041          if (this.code == null)
1042            if (Configuration.errorOnAutoCreate())
1043              throw new Error("Attempt to auto-create MessageHeaderResponseComponent.code");
1044            else if (Configuration.doAutoCreate())
1045              this.code = new Enumeration<ResponseType>(new ResponseTypeEnumFactory()); // bb
1046          return this.code;
1047        }
1048
1049        public boolean hasCodeElement() { 
1050          return this.code != null && !this.code.isEmpty();
1051        }
1052
1053        public boolean hasCode() { 
1054          return this.code != null && !this.code.isEmpty();
1055        }
1056
1057        /**
1058         * @param value {@link #code} (Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
1059         */
1060        public MessageHeaderResponseComponent setCodeElement(Enumeration<ResponseType> value) { 
1061          this.code = value;
1062          return this;
1063        }
1064
1065        /**
1066         * @return Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.
1067         */
1068        public ResponseType getCode() { 
1069          return this.code == null ? null : this.code.getValue();
1070        }
1071
1072        /**
1073         * @param value Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.
1074         */
1075        public MessageHeaderResponseComponent setCode(ResponseType value) { 
1076            if (this.code == null)
1077              this.code = new Enumeration<ResponseType>(new ResponseTypeEnumFactory());
1078            this.code.setValue(value);
1079          return this;
1080        }
1081
1082        /**
1083         * @return {@link #details} (Full details of any issues found in the message.)
1084         */
1085        public Reference getDetails() { 
1086          if (this.details == null)
1087            if (Configuration.errorOnAutoCreate())
1088              throw new Error("Attempt to auto-create MessageHeaderResponseComponent.details");
1089            else if (Configuration.doAutoCreate())
1090              this.details = new Reference(); // cc
1091          return this.details;
1092        }
1093
1094        public boolean hasDetails() { 
1095          return this.details != null && !this.details.isEmpty();
1096        }
1097
1098        /**
1099         * @param value {@link #details} (Full details of any issues found in the message.)
1100         */
1101        public MessageHeaderResponseComponent setDetails(Reference value) { 
1102          this.details = value;
1103          return this;
1104        }
1105
1106        protected void listChildren(List<Property> children) {
1107          super.listChildren(children);
1108          children.add(new Property("identifier", "Identifier", "The Bundle.identifier of the message to which this message is a response.", 0, 1, identifier));
1109          children.add(new Property("code", "code", "Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.", 0, 1, code));
1110          children.add(new Property("details", "Reference(OperationOutcome)", "Full details of any issues found in the message.", 0, 1, details));
1111        }
1112
1113        @Override
1114        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1115          switch (_hash) {
1116          case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "The Bundle.identifier of the message to which this message is a response.", 0, 1, identifier);
1117          case 3059181: /*code*/  return new Property("code", "code", "Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.", 0, 1, code);
1118          case 1557721666: /*details*/  return new Property("details", "Reference(OperationOutcome)", "Full details of any issues found in the message.", 0, 1, details);
1119          default: return super.getNamedProperty(_hash, _name, _checkValid);
1120          }
1121
1122        }
1123
1124      @Override
1125      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1126        switch (hash) {
1127        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
1128        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Enumeration<ResponseType>
1129        case 1557721666: /*details*/ return this.details == null ? new Base[0] : new Base[] {this.details}; // Reference
1130        default: return super.getProperty(hash, name, checkValid);
1131        }
1132
1133      }
1134
1135      @Override
1136      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1137        switch (hash) {
1138        case -1618432855: // identifier
1139          this.identifier = TypeConvertor.castToIdentifier(value); // Identifier
1140          return value;
1141        case 3059181: // code
1142          value = new ResponseTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1143          this.code = (Enumeration) value; // Enumeration<ResponseType>
1144          return value;
1145        case 1557721666: // details
1146          this.details = TypeConvertor.castToReference(value); // Reference
1147          return value;
1148        default: return super.setProperty(hash, name, value);
1149        }
1150
1151      }
1152
1153      @Override
1154      public Base setProperty(String name, Base value) throws FHIRException {
1155        if (name.equals("identifier")) {
1156          this.identifier = TypeConvertor.castToIdentifier(value); // Identifier
1157        } else if (name.equals("code")) {
1158          value = new ResponseTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1159          this.code = (Enumeration) value; // Enumeration<ResponseType>
1160        } else if (name.equals("details")) {
1161          this.details = TypeConvertor.castToReference(value); // Reference
1162        } else
1163          return super.setProperty(name, value);
1164        return value;
1165      }
1166
1167      @Override
1168      public Base makeProperty(int hash, String name) throws FHIRException {
1169        switch (hash) {
1170        case -1618432855:  return getIdentifier();
1171        case 3059181:  return getCodeElement();
1172        case 1557721666:  return getDetails();
1173        default: return super.makeProperty(hash, name);
1174        }
1175
1176      }
1177
1178      @Override
1179      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1180        switch (hash) {
1181        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1182        case 3059181: /*code*/ return new String[] {"code"};
1183        case 1557721666: /*details*/ return new String[] {"Reference"};
1184        default: return super.getTypesForProperty(hash, name);
1185        }
1186
1187      }
1188
1189      @Override
1190      public Base addChild(String name) throws FHIRException {
1191        if (name.equals("identifier")) {
1192          this.identifier = new Identifier();
1193          return this.identifier;
1194        }
1195        else if (name.equals("code")) {
1196          throw new FHIRException("Cannot call addChild on a singleton property MessageHeader.response.code");
1197        }
1198        else if (name.equals("details")) {
1199          this.details = new Reference();
1200          return this.details;
1201        }
1202        else
1203          return super.addChild(name);
1204      }
1205
1206      public MessageHeaderResponseComponent copy() {
1207        MessageHeaderResponseComponent dst = new MessageHeaderResponseComponent();
1208        copyValues(dst);
1209        return dst;
1210      }
1211
1212      public void copyValues(MessageHeaderResponseComponent dst) {
1213        super.copyValues(dst);
1214        dst.identifier = identifier == null ? null : identifier.copy();
1215        dst.code = code == null ? null : code.copy();
1216        dst.details = details == null ? null : details.copy();
1217      }
1218
1219      @Override
1220      public boolean equalsDeep(Base other_) {
1221        if (!super.equalsDeep(other_))
1222          return false;
1223        if (!(other_ instanceof MessageHeaderResponseComponent))
1224          return false;
1225        MessageHeaderResponseComponent o = (MessageHeaderResponseComponent) other_;
1226        return compareDeep(identifier, o.identifier, true) && compareDeep(code, o.code, true) && compareDeep(details, o.details, true)
1227          ;
1228      }
1229
1230      @Override
1231      public boolean equalsShallow(Base other_) {
1232        if (!super.equalsShallow(other_))
1233          return false;
1234        if (!(other_ instanceof MessageHeaderResponseComponent))
1235          return false;
1236        MessageHeaderResponseComponent o = (MessageHeaderResponseComponent) other_;
1237        return compareValues(code, o.code, true);
1238      }
1239
1240      public boolean isEmpty() {
1241        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, code, details
1242          );
1243      }
1244
1245  public String fhirType() {
1246    return "MessageHeader.response";
1247
1248  }
1249
1250  }
1251
1252    /**
1253     * Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification are defined by the implementation.  Alternatively a canonical uri to the EventDefinition.
1254     */
1255    @Child(name = "event", type = {Coding.class, CanonicalType.class}, order=0, min=1, max=1, modifier=false, summary=true)
1256    @Description(shortDefinition="Event code or link to EventDefinition", formalDefinition="Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification are defined by the implementation.  Alternatively a canonical uri to the EventDefinition." )
1257    protected DataType event;
1258
1259    /**
1260     * The destination application which the message is intended for.
1261     */
1262    @Child(name = "destination", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1263    @Description(shortDefinition="Message destination application(s)", formalDefinition="The destination application which the message is intended for." )
1264    protected List<MessageDestinationComponent> destination;
1265
1266    /**
1267     * Identifies the sending system to allow the use of a trust relationship.
1268     */
1269    @Child(name = "sender", type = {Practitioner.class, PractitionerRole.class, Device.class, Organization.class}, order=2, min=0, max=1, modifier=false, summary=true)
1270    @Description(shortDefinition="Real world sender of the message", formalDefinition="Identifies the sending system to allow the use of a trust relationship." )
1271    protected Reference sender;
1272
1273    /**
1274     * The logical author of the message - the personor device that decided the described event should happen. When there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.
1275     */
1276    @Child(name = "author", type = {Practitioner.class, PractitionerRole.class, Device.class, Organization.class}, order=3, min=0, max=1, modifier=false, summary=true)
1277    @Description(shortDefinition="The source of the decision", formalDefinition="The logical author of the message - the personor device that decided the described event should happen. When there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions." )
1278    protected Reference author;
1279
1280    /**
1281     * The source application from which this message originated.
1282     */
1283    @Child(name = "source", type = {}, order=4, min=1, max=1, modifier=false, summary=true)
1284    @Description(shortDefinition="Message source application", formalDefinition="The source application from which this message originated." )
1285    protected MessageSourceComponent source;
1286
1287    /**
1288     * The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.
1289     */
1290    @Child(name = "responsible", type = {Practitioner.class, PractitionerRole.class, Organization.class}, order=5, min=0, max=1, modifier=false, summary=true)
1291    @Description(shortDefinition="Final responsibility for event", formalDefinition="The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party." )
1292    protected Reference responsible;
1293
1294    /**
1295     * Coded indication of the cause for the event - indicates  a reason for the occurrence of the event that is a focus of this message.
1296     */
1297    @Child(name = "reason", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true)
1298    @Description(shortDefinition="Cause of event", formalDefinition="Coded indication of the cause for the event - indicates  a reason for the occurrence of the event that is a focus of this message." )
1299    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/message-reason-encounter")
1300    protected CodeableConcept reason;
1301
1302    /**
1303     * Information about the message that this message is a response to.  Only present if this message is a response.
1304     */
1305    @Child(name = "response", type = {}, order=7, min=0, max=1, modifier=false, summary=true)
1306    @Description(shortDefinition="If this is a reply to prior message", formalDefinition="Information about the message that this message is a response to.  Only present if this message is a response." )
1307    protected MessageHeaderResponseComponent response;
1308
1309    /**
1310     * The actual data of the message - a reference to the root/focus class of the event. This is allowed to be a Parameters resource.
1311     */
1312    @Child(name = "focus", type = {Reference.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1313    @Description(shortDefinition="The actual content of the message", formalDefinition="The actual data of the message - a reference to the root/focus class of the event. This is allowed to be a Parameters resource." )
1314    protected List<Reference> focus;
1315
1316    /**
1317     * Permanent link to the MessageDefinition for this message.
1318     */
1319    @Child(name = "definition", type = {CanonicalType.class}, order=9, min=0, max=1, modifier=false, summary=true)
1320    @Description(shortDefinition="Link to the definition for this message", formalDefinition="Permanent link to the MessageDefinition for this message." )
1321    protected CanonicalType definition;
1322
1323    private static final long serialVersionUID = 2129967751L;
1324
1325  /**
1326   * Constructor
1327   */
1328    public MessageHeader() {
1329      super();
1330    }
1331
1332  /**
1333   * Constructor
1334   */
1335    public MessageHeader(DataType event, MessageSourceComponent source) {
1336      super();
1337      this.setEvent(event);
1338      this.setSource(source);
1339    }
1340
1341    /**
1342     * @return {@link #event} (Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification are defined by the implementation.  Alternatively a canonical uri to the EventDefinition.)
1343     */
1344    public DataType getEvent() { 
1345      return this.event;
1346    }
1347
1348    /**
1349     * @return {@link #event} (Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification are defined by the implementation.  Alternatively a canonical uri to the EventDefinition.)
1350     */
1351    public Coding getEventCoding() throws FHIRException { 
1352      if (this.event == null)
1353        this.event = new Coding();
1354      if (!(this.event instanceof Coding))
1355        throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.event.getClass().getName()+" was encountered");
1356      return (Coding) this.event;
1357    }
1358
1359    public boolean hasEventCoding() { 
1360      return this != null && this.event instanceof Coding;
1361    }
1362
1363    /**
1364     * @return {@link #event} (Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification are defined by the implementation.  Alternatively a canonical uri to the EventDefinition.)
1365     */
1366    public CanonicalType getEventCanonicalType() throws FHIRException { 
1367      if (this.event == null)
1368        this.event = new CanonicalType();
1369      if (!(this.event instanceof CanonicalType))
1370        throw new FHIRException("Type mismatch: the type CanonicalType was expected, but "+this.event.getClass().getName()+" was encountered");
1371      return (CanonicalType) this.event;
1372    }
1373
1374    public boolean hasEventCanonicalType() { 
1375      return this != null && this.event instanceof CanonicalType;
1376    }
1377
1378    public boolean hasEvent() { 
1379      return this.event != null && !this.event.isEmpty();
1380    }
1381
1382    /**
1383     * @param value {@link #event} (Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification are defined by the implementation.  Alternatively a canonical uri to the EventDefinition.)
1384     */
1385    public MessageHeader setEvent(DataType value) { 
1386      if (value != null && !(value instanceof Coding || value instanceof CanonicalType))
1387        throw new FHIRException("Not the right type for MessageHeader.event[x]: "+value.fhirType());
1388      this.event = value;
1389      return this;
1390    }
1391
1392    /**
1393     * @return {@link #destination} (The destination application which the message is intended for.)
1394     */
1395    public List<MessageDestinationComponent> getDestination() { 
1396      if (this.destination == null)
1397        this.destination = new ArrayList<MessageDestinationComponent>();
1398      return this.destination;
1399    }
1400
1401    /**
1402     * @return Returns a reference to <code>this</code> for easy method chaining
1403     */
1404    public MessageHeader setDestination(List<MessageDestinationComponent> theDestination) { 
1405      this.destination = theDestination;
1406      return this;
1407    }
1408
1409    public boolean hasDestination() { 
1410      if (this.destination == null)
1411        return false;
1412      for (MessageDestinationComponent item : this.destination)
1413        if (!item.isEmpty())
1414          return true;
1415      return false;
1416    }
1417
1418    public MessageDestinationComponent addDestination() { //3
1419      MessageDestinationComponent t = new MessageDestinationComponent();
1420      if (this.destination == null)
1421        this.destination = new ArrayList<MessageDestinationComponent>();
1422      this.destination.add(t);
1423      return t;
1424    }
1425
1426    public MessageHeader addDestination(MessageDestinationComponent t) { //3
1427      if (t == null)
1428        return this;
1429      if (this.destination == null)
1430        this.destination = new ArrayList<MessageDestinationComponent>();
1431      this.destination.add(t);
1432      return this;
1433    }
1434
1435    /**
1436     * @return The first repetition of repeating field {@link #destination}, creating it if it does not already exist {3}
1437     */
1438    public MessageDestinationComponent getDestinationFirstRep() { 
1439      if (getDestination().isEmpty()) {
1440        addDestination();
1441      }
1442      return getDestination().get(0);
1443    }
1444
1445    /**
1446     * @return {@link #sender} (Identifies the sending system to allow the use of a trust relationship.)
1447     */
1448    public Reference getSender() { 
1449      if (this.sender == null)
1450        if (Configuration.errorOnAutoCreate())
1451          throw new Error("Attempt to auto-create MessageHeader.sender");
1452        else if (Configuration.doAutoCreate())
1453          this.sender = new Reference(); // cc
1454      return this.sender;
1455    }
1456
1457    public boolean hasSender() { 
1458      return this.sender != null && !this.sender.isEmpty();
1459    }
1460
1461    /**
1462     * @param value {@link #sender} (Identifies the sending system to allow the use of a trust relationship.)
1463     */
1464    public MessageHeader setSender(Reference value) { 
1465      this.sender = value;
1466      return this;
1467    }
1468
1469    /**
1470     * @return {@link #author} (The logical author of the message - the personor device that decided the described event should happen. When there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.)
1471     */
1472    public Reference getAuthor() { 
1473      if (this.author == null)
1474        if (Configuration.errorOnAutoCreate())
1475          throw new Error("Attempt to auto-create MessageHeader.author");
1476        else if (Configuration.doAutoCreate())
1477          this.author = new Reference(); // cc
1478      return this.author;
1479    }
1480
1481    public boolean hasAuthor() { 
1482      return this.author != null && !this.author.isEmpty();
1483    }
1484
1485    /**
1486     * @param value {@link #author} (The logical author of the message - the personor device that decided the described event should happen. When there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.)
1487     */
1488    public MessageHeader setAuthor(Reference value) { 
1489      this.author = value;
1490      return this;
1491    }
1492
1493    /**
1494     * @return {@link #source} (The source application from which this message originated.)
1495     */
1496    public MessageSourceComponent getSource() { 
1497      if (this.source == null)
1498        if (Configuration.errorOnAutoCreate())
1499          throw new Error("Attempt to auto-create MessageHeader.source");
1500        else if (Configuration.doAutoCreate())
1501          this.source = new MessageSourceComponent(); // cc
1502      return this.source;
1503    }
1504
1505    public boolean hasSource() { 
1506      return this.source != null && !this.source.isEmpty();
1507    }
1508
1509    /**
1510     * @param value {@link #source} (The source application from which this message originated.)
1511     */
1512    public MessageHeader setSource(MessageSourceComponent value) { 
1513      this.source = value;
1514      return this;
1515    }
1516
1517    /**
1518     * @return {@link #responsible} (The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.)
1519     */
1520    public Reference getResponsible() { 
1521      if (this.responsible == null)
1522        if (Configuration.errorOnAutoCreate())
1523          throw new Error("Attempt to auto-create MessageHeader.responsible");
1524        else if (Configuration.doAutoCreate())
1525          this.responsible = new Reference(); // cc
1526      return this.responsible;
1527    }
1528
1529    public boolean hasResponsible() { 
1530      return this.responsible != null && !this.responsible.isEmpty();
1531    }
1532
1533    /**
1534     * @param value {@link #responsible} (The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.)
1535     */
1536    public MessageHeader setResponsible(Reference value) { 
1537      this.responsible = value;
1538      return this;
1539    }
1540
1541    /**
1542     * @return {@link #reason} (Coded indication of the cause for the event - indicates  a reason for the occurrence of the event that is a focus of this message.)
1543     */
1544    public CodeableConcept getReason() { 
1545      if (this.reason == null)
1546        if (Configuration.errorOnAutoCreate())
1547          throw new Error("Attempt to auto-create MessageHeader.reason");
1548        else if (Configuration.doAutoCreate())
1549          this.reason = new CodeableConcept(); // cc
1550      return this.reason;
1551    }
1552
1553    public boolean hasReason() { 
1554      return this.reason != null && !this.reason.isEmpty();
1555    }
1556
1557    /**
1558     * @param value {@link #reason} (Coded indication of the cause for the event - indicates  a reason for the occurrence of the event that is a focus of this message.)
1559     */
1560    public MessageHeader setReason(CodeableConcept value) { 
1561      this.reason = value;
1562      return this;
1563    }
1564
1565    /**
1566     * @return {@link #response} (Information about the message that this message is a response to.  Only present if this message is a response.)
1567     */
1568    public MessageHeaderResponseComponent getResponse() { 
1569      if (this.response == null)
1570        if (Configuration.errorOnAutoCreate())
1571          throw new Error("Attempt to auto-create MessageHeader.response");
1572        else if (Configuration.doAutoCreate())
1573          this.response = new MessageHeaderResponseComponent(); // cc
1574      return this.response;
1575    }
1576
1577    public boolean hasResponse() { 
1578      return this.response != null && !this.response.isEmpty();
1579    }
1580
1581    /**
1582     * @param value {@link #response} (Information about the message that this message is a response to.  Only present if this message is a response.)
1583     */
1584    public MessageHeader setResponse(MessageHeaderResponseComponent value) { 
1585      this.response = value;
1586      return this;
1587    }
1588
1589    /**
1590     * @return {@link #focus} (The actual data of the message - a reference to the root/focus class of the event. This is allowed to be a Parameters resource.)
1591     */
1592    public List<Reference> getFocus() { 
1593      if (this.focus == null)
1594        this.focus = new ArrayList<Reference>();
1595      return this.focus;
1596    }
1597
1598    /**
1599     * @return Returns a reference to <code>this</code> for easy method chaining
1600     */
1601    public MessageHeader setFocus(List<Reference> theFocus) { 
1602      this.focus = theFocus;
1603      return this;
1604    }
1605
1606    public boolean hasFocus() { 
1607      if (this.focus == null)
1608        return false;
1609      for (Reference item : this.focus)
1610        if (!item.isEmpty())
1611          return true;
1612      return false;
1613    }
1614
1615    public Reference addFocus() { //3
1616      Reference t = new Reference();
1617      if (this.focus == null)
1618        this.focus = new ArrayList<Reference>();
1619      this.focus.add(t);
1620      return t;
1621    }
1622
1623    public MessageHeader addFocus(Reference t) { //3
1624      if (t == null)
1625        return this;
1626      if (this.focus == null)
1627        this.focus = new ArrayList<Reference>();
1628      this.focus.add(t);
1629      return this;
1630    }
1631
1632    /**
1633     * @return The first repetition of repeating field {@link #focus}, creating it if it does not already exist {3}
1634     */
1635    public Reference getFocusFirstRep() { 
1636      if (getFocus().isEmpty()) {
1637        addFocus();
1638      }
1639      return getFocus().get(0);
1640    }
1641
1642    /**
1643     * @return {@link #definition} (Permanent link to the MessageDefinition for this message.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value
1644     */
1645    public CanonicalType getDefinitionElement() { 
1646      if (this.definition == null)
1647        if (Configuration.errorOnAutoCreate())
1648          throw new Error("Attempt to auto-create MessageHeader.definition");
1649        else if (Configuration.doAutoCreate())
1650          this.definition = new CanonicalType(); // bb
1651      return this.definition;
1652    }
1653
1654    public boolean hasDefinitionElement() { 
1655      return this.definition != null && !this.definition.isEmpty();
1656    }
1657
1658    public boolean hasDefinition() { 
1659      return this.definition != null && !this.definition.isEmpty();
1660    }
1661
1662    /**
1663     * @param value {@link #definition} (Permanent link to the MessageDefinition for this message.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value
1664     */
1665    public MessageHeader setDefinitionElement(CanonicalType value) { 
1666      this.definition = value;
1667      return this;
1668    }
1669
1670    /**
1671     * @return Permanent link to the MessageDefinition for this message.
1672     */
1673    public String getDefinition() { 
1674      return this.definition == null ? null : this.definition.getValue();
1675    }
1676
1677    /**
1678     * @param value Permanent link to the MessageDefinition for this message.
1679     */
1680    public MessageHeader setDefinition(String value) { 
1681      if (Utilities.noString(value))
1682        this.definition = null;
1683      else {
1684        if (this.definition == null)
1685          this.definition = new CanonicalType();
1686        this.definition.setValue(value);
1687      }
1688      return this;
1689    }
1690
1691      protected void listChildren(List<Property> children) {
1692        super.listChildren(children);
1693        children.add(new Property("event[x]", "Coding|canonical(EventDefinition)", "Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification are defined by the implementation.  Alternatively a canonical uri to the EventDefinition.", 0, 1, event));
1694        children.add(new Property("destination", "", "The destination application which the message is intended for.", 0, java.lang.Integer.MAX_VALUE, destination));
1695        children.add(new Property("sender", "Reference(Practitioner|PractitionerRole|Device|Organization)", "Identifies the sending system to allow the use of a trust relationship.", 0, 1, sender));
1696        children.add(new Property("author", "Reference(Practitioner|PractitionerRole|Device|Organization)", "The logical author of the message - the personor device that decided the described event should happen. When there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.", 0, 1, author));
1697        children.add(new Property("source", "", "The source application from which this message originated.", 0, 1, source));
1698        children.add(new Property("responsible", "Reference(Practitioner|PractitionerRole|Organization)", "The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.", 0, 1, responsible));
1699        children.add(new Property("reason", "CodeableConcept", "Coded indication of the cause for the event - indicates  a reason for the occurrence of the event that is a focus of this message.", 0, 1, reason));
1700        children.add(new Property("response", "", "Information about the message that this message is a response to.  Only present if this message is a response.", 0, 1, response));
1701        children.add(new Property("focus", "Reference(Any)", "The actual data of the message - a reference to the root/focus class of the event. This is allowed to be a Parameters resource.", 0, java.lang.Integer.MAX_VALUE, focus));
1702        children.add(new Property("definition", "canonical(MessageDefinition)", "Permanent link to the MessageDefinition for this message.", 0, 1, definition));
1703      }
1704
1705      @Override
1706      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1707        switch (_hash) {
1708        case 278115238: /*event[x]*/  return new Property("event[x]", "Coding|canonical(EventDefinition)", "Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification are defined by the implementation.  Alternatively a canonical uri to the EventDefinition.", 0, 1, event);
1709        case 96891546: /*event*/  return new Property("event[x]", "Coding|canonical(EventDefinition)", "Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification are defined by the implementation.  Alternatively a canonical uri to the EventDefinition.", 0, 1, event);
1710        case -355957084: /*eventCoding*/  return new Property("event[x]", "Coding", "Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification are defined by the implementation.  Alternatively a canonical uri to the EventDefinition.", 0, 1, event);
1711        case 1784258426: /*eventCanonical*/  return new Property("event[x]", "canonical(EventDefinition)", "Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification are defined by the implementation.  Alternatively a canonical uri to the EventDefinition.", 0, 1, event);
1712        case -1429847026: /*destination*/  return new Property("destination", "", "The destination application which the message is intended for.", 0, java.lang.Integer.MAX_VALUE, destination);
1713        case -905962955: /*sender*/  return new Property("sender", "Reference(Practitioner|PractitionerRole|Device|Organization)", "Identifies the sending system to allow the use of a trust relationship.", 0, 1, sender);
1714        case -1406328437: /*author*/  return new Property("author", "Reference(Practitioner|PractitionerRole|Device|Organization)", "The logical author of the message - the personor device that decided the described event should happen. When there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.", 0, 1, author);
1715        case -896505829: /*source*/  return new Property("source", "", "The source application from which this message originated.", 0, 1, source);
1716        case 1847674614: /*responsible*/  return new Property("responsible", "Reference(Practitioner|PractitionerRole|Organization)", "The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.", 0, 1, responsible);
1717        case -934964668: /*reason*/  return new Property("reason", "CodeableConcept", "Coded indication of the cause for the event - indicates  a reason for the occurrence of the event that is a focus of this message.", 0, 1, reason);
1718        case -340323263: /*response*/  return new Property("response", "", "Information about the message that this message is a response to.  Only present if this message is a response.", 0, 1, response);
1719        case 97604824: /*focus*/  return new Property("focus", "Reference(Any)", "The actual data of the message - a reference to the root/focus class of the event. This is allowed to be a Parameters resource.", 0, java.lang.Integer.MAX_VALUE, focus);
1720        case -1014418093: /*definition*/  return new Property("definition", "canonical(MessageDefinition)", "Permanent link to the MessageDefinition for this message.", 0, 1, definition);
1721        default: return super.getNamedProperty(_hash, _name, _checkValid);
1722        }
1723
1724      }
1725
1726      @Override
1727      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1728        switch (hash) {
1729        case 96891546: /*event*/ return this.event == null ? new Base[0] : new Base[] {this.event}; // DataType
1730        case -1429847026: /*destination*/ return this.destination == null ? new Base[0] : this.destination.toArray(new Base[this.destination.size()]); // MessageDestinationComponent
1731        case -905962955: /*sender*/ return this.sender == null ? new Base[0] : new Base[] {this.sender}; // Reference
1732        case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference
1733        case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // MessageSourceComponent
1734        case 1847674614: /*responsible*/ return this.responsible == null ? new Base[0] : new Base[] {this.responsible}; // Reference
1735        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // CodeableConcept
1736        case -340323263: /*response*/ return this.response == null ? new Base[0] : new Base[] {this.response}; // MessageHeaderResponseComponent
1737        case 97604824: /*focus*/ return this.focus == null ? new Base[0] : this.focus.toArray(new Base[this.focus.size()]); // Reference
1738        case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // CanonicalType
1739        default: return super.getProperty(hash, name, checkValid);
1740        }
1741
1742      }
1743
1744      @Override
1745      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1746        switch (hash) {
1747        case 96891546: // event
1748          this.event = TypeConvertor.castToType(value); // DataType
1749          return value;
1750        case -1429847026: // destination
1751          this.getDestination().add((MessageDestinationComponent) value); // MessageDestinationComponent
1752          return value;
1753        case -905962955: // sender
1754          this.sender = TypeConvertor.castToReference(value); // Reference
1755          return value;
1756        case -1406328437: // author
1757          this.author = TypeConvertor.castToReference(value); // Reference
1758          return value;
1759        case -896505829: // source
1760          this.source = (MessageSourceComponent) value; // MessageSourceComponent
1761          return value;
1762        case 1847674614: // responsible
1763          this.responsible = TypeConvertor.castToReference(value); // Reference
1764          return value;
1765        case -934964668: // reason
1766          this.reason = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1767          return value;
1768        case -340323263: // response
1769          this.response = (MessageHeaderResponseComponent) value; // MessageHeaderResponseComponent
1770          return value;
1771        case 97604824: // focus
1772          this.getFocus().add(TypeConvertor.castToReference(value)); // Reference
1773          return value;
1774        case -1014418093: // definition
1775          this.definition = TypeConvertor.castToCanonical(value); // CanonicalType
1776          return value;
1777        default: return super.setProperty(hash, name, value);
1778        }
1779
1780      }
1781
1782      @Override
1783      public Base setProperty(String name, Base value) throws FHIRException {
1784        if (name.equals("event[x]")) {
1785          this.event = TypeConvertor.castToType(value); // DataType
1786        } else if (name.equals("destination")) {
1787          this.getDestination().add((MessageDestinationComponent) value);
1788        } else if (name.equals("sender")) {
1789          this.sender = TypeConvertor.castToReference(value); // Reference
1790        } else if (name.equals("author")) {
1791          this.author = TypeConvertor.castToReference(value); // Reference
1792        } else if (name.equals("source")) {
1793          this.source = (MessageSourceComponent) value; // MessageSourceComponent
1794        } else if (name.equals("responsible")) {
1795          this.responsible = TypeConvertor.castToReference(value); // Reference
1796        } else if (name.equals("reason")) {
1797          this.reason = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1798        } else if (name.equals("response")) {
1799          this.response = (MessageHeaderResponseComponent) value; // MessageHeaderResponseComponent
1800        } else if (name.equals("focus")) {
1801          this.getFocus().add(TypeConvertor.castToReference(value));
1802        } else if (name.equals("definition")) {
1803          this.definition = TypeConvertor.castToCanonical(value); // CanonicalType
1804        } else
1805          return super.setProperty(name, value);
1806        return value;
1807      }
1808
1809      @Override
1810      public Base makeProperty(int hash, String name) throws FHIRException {
1811        switch (hash) {
1812        case 278115238:  return getEvent();
1813        case 96891546:  return getEvent();
1814        case -1429847026:  return addDestination(); 
1815        case -905962955:  return getSender();
1816        case -1406328437:  return getAuthor();
1817        case -896505829:  return getSource();
1818        case 1847674614:  return getResponsible();
1819        case -934964668:  return getReason();
1820        case -340323263:  return getResponse();
1821        case 97604824:  return addFocus(); 
1822        case -1014418093:  return getDefinitionElement();
1823        default: return super.makeProperty(hash, name);
1824        }
1825
1826      }
1827
1828      @Override
1829      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1830        switch (hash) {
1831        case 96891546: /*event*/ return new String[] {"Coding", "canonical"};
1832        case -1429847026: /*destination*/ return new String[] {};
1833        case -905962955: /*sender*/ return new String[] {"Reference"};
1834        case -1406328437: /*author*/ return new String[] {"Reference"};
1835        case -896505829: /*source*/ return new String[] {};
1836        case 1847674614: /*responsible*/ return new String[] {"Reference"};
1837        case -934964668: /*reason*/ return new String[] {"CodeableConcept"};
1838        case -340323263: /*response*/ return new String[] {};
1839        case 97604824: /*focus*/ return new String[] {"Reference"};
1840        case -1014418093: /*definition*/ return new String[] {"canonical"};
1841        default: return super.getTypesForProperty(hash, name);
1842        }
1843
1844      }
1845
1846      @Override
1847      public Base addChild(String name) throws FHIRException {
1848        if (name.equals("eventCoding")) {
1849          this.event = new Coding();
1850          return this.event;
1851        }
1852        else if (name.equals("eventCanonical")) {
1853          this.event = new CanonicalType();
1854          return this.event;
1855        }
1856        else if (name.equals("destination")) {
1857          return addDestination();
1858        }
1859        else if (name.equals("sender")) {
1860          this.sender = new Reference();
1861          return this.sender;
1862        }
1863        else if (name.equals("author")) {
1864          this.author = new Reference();
1865          return this.author;
1866        }
1867        else if (name.equals("source")) {
1868          this.source = new MessageSourceComponent();
1869          return this.source;
1870        }
1871        else if (name.equals("responsible")) {
1872          this.responsible = new Reference();
1873          return this.responsible;
1874        }
1875        else if (name.equals("reason")) {
1876          this.reason = new CodeableConcept();
1877          return this.reason;
1878        }
1879        else if (name.equals("response")) {
1880          this.response = new MessageHeaderResponseComponent();
1881          return this.response;
1882        }
1883        else if (name.equals("focus")) {
1884          return addFocus();
1885        }
1886        else if (name.equals("definition")) {
1887          throw new FHIRException("Cannot call addChild on a singleton property MessageHeader.definition");
1888        }
1889        else
1890          return super.addChild(name);
1891      }
1892
1893  public String fhirType() {
1894    return "MessageHeader";
1895
1896  }
1897
1898      public MessageHeader copy() {
1899        MessageHeader dst = new MessageHeader();
1900        copyValues(dst);
1901        return dst;
1902      }
1903
1904      public void copyValues(MessageHeader dst) {
1905        super.copyValues(dst);
1906        dst.event = event == null ? null : event.copy();
1907        if (destination != null) {
1908          dst.destination = new ArrayList<MessageDestinationComponent>();
1909          for (MessageDestinationComponent i : destination)
1910            dst.destination.add(i.copy());
1911        };
1912        dst.sender = sender == null ? null : sender.copy();
1913        dst.author = author == null ? null : author.copy();
1914        dst.source = source == null ? null : source.copy();
1915        dst.responsible = responsible == null ? null : responsible.copy();
1916        dst.reason = reason == null ? null : reason.copy();
1917        dst.response = response == null ? null : response.copy();
1918        if (focus != null) {
1919          dst.focus = new ArrayList<Reference>();
1920          for (Reference i : focus)
1921            dst.focus.add(i.copy());
1922        };
1923        dst.definition = definition == null ? null : definition.copy();
1924      }
1925
1926      protected MessageHeader typedCopy() {
1927        return copy();
1928      }
1929
1930      @Override
1931      public boolean equalsDeep(Base other_) {
1932        if (!super.equalsDeep(other_))
1933          return false;
1934        if (!(other_ instanceof MessageHeader))
1935          return false;
1936        MessageHeader o = (MessageHeader) other_;
1937        return compareDeep(event, o.event, true) && compareDeep(destination, o.destination, true) && compareDeep(sender, o.sender, true)
1938           && compareDeep(author, o.author, true) && compareDeep(source, o.source, true) && compareDeep(responsible, o.responsible, true)
1939           && compareDeep(reason, o.reason, true) && compareDeep(response, o.response, true) && compareDeep(focus, o.focus, true)
1940           && compareDeep(definition, o.definition, true);
1941      }
1942
1943      @Override
1944      public boolean equalsShallow(Base other_) {
1945        if (!super.equalsShallow(other_))
1946          return false;
1947        if (!(other_ instanceof MessageHeader))
1948          return false;
1949        MessageHeader o = (MessageHeader) other_;
1950        return compareValues(definition, o.definition, true);
1951      }
1952
1953      public boolean isEmpty() {
1954        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(event, destination, sender
1955          , author, source, responsible, reason, response, focus, definition);
1956      }
1957
1958  @Override
1959  public ResourceType getResourceType() {
1960    return ResourceType.MessageHeader;
1961   }
1962
1963 /**
1964   * Search parameter: <b>author</b>
1965   * <p>
1966   * Description: <b>The source of the decision</b><br>
1967   * Type: <b>reference</b><br>
1968   * Path: <b>MessageHeader.author</b><br>
1969   * </p>
1970   */
1971  @SearchParamDefinition(name="author", path="MessageHeader.author", description="The source of the decision", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner") }, target={Device.class, Organization.class, Practitioner.class, PractitionerRole.class } )
1972  public static final String SP_AUTHOR = "author";
1973 /**
1974   * <b>Fluent Client</b> search parameter constant for <b>author</b>
1975   * <p>
1976   * Description: <b>The source of the decision</b><br>
1977   * Type: <b>reference</b><br>
1978   * Path: <b>MessageHeader.author</b><br>
1979   * </p>
1980   */
1981  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR);
1982
1983/**
1984   * Constant for fluent queries to be used to add include statements. Specifies
1985   * the path value of "<b>MessageHeader:author</b>".
1986   */
1987  public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("MessageHeader:author").toLocked();
1988
1989 /**
1990   * Search parameter: <b>code</b>
1991   * <p>
1992   * Description: <b>ok | transient-error | fatal-error</b><br>
1993   * Type: <b>token</b><br>
1994   * Path: <b>MessageHeader.response.code</b><br>
1995   * </p>
1996   */
1997  @SearchParamDefinition(name="code", path="MessageHeader.response.code", description="ok | transient-error | fatal-error", type="token" )
1998  public static final String SP_CODE = "code";
1999 /**
2000   * <b>Fluent Client</b> search parameter constant for <b>code</b>
2001   * <p>
2002   * Description: <b>ok | transient-error | fatal-error</b><br>
2003   * Type: <b>token</b><br>
2004   * Path: <b>MessageHeader.response.code</b><br>
2005   * </p>
2006   */
2007  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
2008
2009 /**
2010   * Search parameter: <b>destination</b>
2011   * <p>
2012   * Description: <b>Name of system</b><br>
2013   * Type: <b>string</b><br>
2014   * Path: <b>MessageHeader.destination.name</b><br>
2015   * </p>
2016   */
2017  @SearchParamDefinition(name="destination", path="MessageHeader.destination.name", description="Name of system", type="string" )
2018  public static final String SP_DESTINATION = "destination";
2019 /**
2020   * <b>Fluent Client</b> search parameter constant for <b>destination</b>
2021   * <p>
2022   * Description: <b>Name of system</b><br>
2023   * Type: <b>string</b><br>
2024   * Path: <b>MessageHeader.destination.name</b><br>
2025   * </p>
2026   */
2027  public static final ca.uhn.fhir.rest.gclient.StringClientParam DESTINATION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESTINATION);
2028
2029 /**
2030   * Search parameter: <b>event</b>
2031   * <p>
2032   * Description: <b>Code for the event this message represents or link to event definition</b><br>
2033   * Type: <b>token</b><br>
2034   * Path: <b>MessageHeader.event.ofType(Coding) | MessageHeader.event.ofType(canonical)</b><br>
2035   * </p>
2036   */
2037  @SearchParamDefinition(name="event", path="MessageHeader.event.ofType(Coding) | MessageHeader.event.ofType(canonical)", description="Code for the event this message represents or link to event definition", type="token" )
2038  public static final String SP_EVENT = "event";
2039 /**
2040   * <b>Fluent Client</b> search parameter constant for <b>event</b>
2041   * <p>
2042   * Description: <b>Code for the event this message represents or link to event definition</b><br>
2043   * Type: <b>token</b><br>
2044   * Path: <b>MessageHeader.event.ofType(Coding) | MessageHeader.event.ofType(canonical)</b><br>
2045   * </p>
2046   */
2047  public static final ca.uhn.fhir.rest.gclient.TokenClientParam EVENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EVENT);
2048
2049 /**
2050   * Search parameter: <b>focus</b>
2051   * <p>
2052   * Description: <b>The actual content of the message</b><br>
2053   * Type: <b>reference</b><br>
2054   * Path: <b>MessageHeader.focus</b><br>
2055   * </p>
2056   */
2057  @SearchParamDefinition(name="focus", path="MessageHeader.focus", description="The actual content of the message", type="reference", target={Account.class, ActivityDefinition.class, ActorDefinition.class, AdministrableProductDefinition.class, AdverseEvent.class, AllergyIntolerance.class, Appointment.class, AppointmentResponse.class, ArtifactAssessment.class, AuditEvent.class, Basic.class, Binary.class, BiologicallyDerivedProduct.class, BiologicallyDerivedProductDispense.class, BodyStructure.class, Bundle.class, CapabilityStatement.class, CarePlan.class, CareTeam.class, ChargeItem.class, ChargeItemDefinition.class, Citation.class, Claim.class, ClaimResponse.class, ClinicalImpression.class, ClinicalUseDefinition.class, CodeSystem.class, Communication.class, CommunicationRequest.class, CompartmentDefinition.class, Composition.class, ConceptMap.class, Condition.class, ConditionDefinition.class, Consent.class, Contract.class, Coverage.class, CoverageEligibilityRequest.class, CoverageEligibilityResponse.class, DetectedIssue.class, Device.class, DeviceAssociation.class, DeviceDefinition.class, DeviceDispense.class, DeviceMetric.class, DeviceRequest.class, DeviceUsage.class, DiagnosticReport.class, DocumentReference.class, Encounter.class, EncounterHistory.class, Endpoint.class, EnrollmentRequest.class, EnrollmentResponse.class, EpisodeOfCare.class, EventDefinition.class, Evidence.class, EvidenceReport.class, EvidenceVariable.class, ExampleScenario.class, ExplanationOfBenefit.class, FamilyMemberHistory.class, Flag.class, FormularyItem.class, GenomicStudy.class, Goal.class, GraphDefinition.class, Group.class, GuidanceResponse.class, HealthcareService.class, ImagingSelection.class, ImagingStudy.class, Immunization.class, ImmunizationEvaluation.class, ImmunizationRecommendation.class, ImplementationGuide.class, Ingredient.class, InsurancePlan.class, InventoryItem.class, InventoryReport.class, Invoice.class, Library.class, Linkage.class, ListResource.class, Location.class, ManufacturedItemDefinition.class, Measure.class, MeasureReport.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationStatement.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.class, NutritionIntake.class, NutritionOrder.class, NutritionProduct.class, Observation.class, ObservationDefinition.class, OperationDefinition.class, OperationOutcome.class, Organization.class, OrganizationAffiliation.class, PackagedProductDefinition.class, Parameters.class, Patient.class, PaymentNotice.class, PaymentReconciliation.class, Permission.class, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestOrchestration.class, Requirements.class, ResearchStudy.class, ResearchSubject.class, RiskAssessment.class, Schedule.class, SearchParameter.class, ServiceRequest.class, Slot.class, Specimen.class, SpecimenDefinition.class, StructureDefinition.class, StructureMap.class, Subscription.class, SubscriptionStatus.class, SubscriptionTopic.class, Substance.class, SubstanceDefinition.class, SubstanceNucleicAcid.class, SubstancePolymer.class, SubstanceProtein.class, SubstanceReferenceInformation.class, SubstanceSourceMaterial.class, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestPlan.class, TestReport.class, TestScript.class, Transport.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
2058  public static final String SP_FOCUS = "focus";
2059 /**
2060   * <b>Fluent Client</b> search parameter constant for <b>focus</b>
2061   * <p>
2062   * Description: <b>The actual content of the message</b><br>
2063   * Type: <b>reference</b><br>
2064   * Path: <b>MessageHeader.focus</b><br>
2065   * </p>
2066   */
2067  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam FOCUS = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_FOCUS);
2068
2069/**
2070   * Constant for fluent queries to be used to add include statements. Specifies
2071   * the path value of "<b>MessageHeader:focus</b>".
2072   */
2073  public static final ca.uhn.fhir.model.api.Include INCLUDE_FOCUS = new ca.uhn.fhir.model.api.Include("MessageHeader:focus").toLocked();
2074
2075 /**
2076   * Search parameter: <b>receiver</b>
2077   * <p>
2078   * Description: <b>Intended "real-world" recipient for the data</b><br>
2079   * Type: <b>reference</b><br>
2080   * Path: <b>MessageHeader.destination.receiver</b><br>
2081   * </p>
2082   */
2083  @SearchParamDefinition(name="receiver", path="MessageHeader.destination.receiver", description="Intended \"real-world\" recipient for the data", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner") }, target={Organization.class, Practitioner.class, PractitionerRole.class } )
2084  public static final String SP_RECEIVER = "receiver";
2085 /**
2086   * <b>Fluent Client</b> search parameter constant for <b>receiver</b>
2087   * <p>
2088   * Description: <b>Intended "real-world" recipient for the data</b><br>
2089   * Type: <b>reference</b><br>
2090   * Path: <b>MessageHeader.destination.receiver</b><br>
2091   * </p>
2092   */
2093  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RECEIVER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RECEIVER);
2094
2095/**
2096   * Constant for fluent queries to be used to add include statements. Specifies
2097   * the path value of "<b>MessageHeader:receiver</b>".
2098   */
2099  public static final ca.uhn.fhir.model.api.Include INCLUDE_RECEIVER = new ca.uhn.fhir.model.api.Include("MessageHeader:receiver").toLocked();
2100
2101 /**
2102   * Search parameter: <b>response-id</b>
2103   * <p>
2104   * Description: <b>Id of original message</b><br>
2105   * Type: <b>token</b><br>
2106   * Path: <b>MessageHeader.response.identifier</b><br>
2107   * </p>
2108   */
2109  @SearchParamDefinition(name="response-id", path="MessageHeader.response.identifier", description="Id of original message", type="token" )
2110  public static final String SP_RESPONSE_ID = "response-id";
2111 /**
2112   * <b>Fluent Client</b> search parameter constant for <b>response-id</b>
2113   * <p>
2114   * Description: <b>Id of original message</b><br>
2115   * Type: <b>token</b><br>
2116   * Path: <b>MessageHeader.response.identifier</b><br>
2117   * </p>
2118   */
2119  public static final ca.uhn.fhir.rest.gclient.TokenClientParam RESPONSE_ID = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RESPONSE_ID);
2120
2121 /**
2122   * Search parameter: <b>responsible</b>
2123   * <p>
2124   * Description: <b>Final responsibility for event</b><br>
2125   * Type: <b>reference</b><br>
2126   * Path: <b>MessageHeader.responsible</b><br>
2127   * </p>
2128   */
2129  @SearchParamDefinition(name="responsible", path="MessageHeader.responsible", description="Final responsibility for event", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner") }, target={Organization.class, Practitioner.class, PractitionerRole.class } )
2130  public static final String SP_RESPONSIBLE = "responsible";
2131 /**
2132   * <b>Fluent Client</b> search parameter constant for <b>responsible</b>
2133   * <p>
2134   * Description: <b>Final responsibility for event</b><br>
2135   * Type: <b>reference</b><br>
2136   * Path: <b>MessageHeader.responsible</b><br>
2137   * </p>
2138   */
2139  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RESPONSIBLE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RESPONSIBLE);
2140
2141/**
2142   * Constant for fluent queries to be used to add include statements. Specifies
2143   * the path value of "<b>MessageHeader:responsible</b>".
2144   */
2145  public static final ca.uhn.fhir.model.api.Include INCLUDE_RESPONSIBLE = new ca.uhn.fhir.model.api.Include("MessageHeader:responsible").toLocked();
2146
2147 /**
2148   * Search parameter: <b>sender</b>
2149   * <p>
2150   * Description: <b>Real world sender of the message</b><br>
2151   * Type: <b>reference</b><br>
2152   * Path: <b>MessageHeader.sender</b><br>
2153   * </p>
2154   */
2155  @SearchParamDefinition(name="sender", path="MessageHeader.sender", description="Real world sender of the message", type="reference", target={Device.class, Organization.class, Practitioner.class, PractitionerRole.class } )
2156  public static final String SP_SENDER = "sender";
2157 /**
2158   * <b>Fluent Client</b> search parameter constant for <b>sender</b>
2159   * <p>
2160   * Description: <b>Real world sender of the message</b><br>
2161   * Type: <b>reference</b><br>
2162   * Path: <b>MessageHeader.sender</b><br>
2163   * </p>
2164   */
2165  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SENDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SENDER);
2166
2167/**
2168   * Constant for fluent queries to be used to add include statements. Specifies
2169   * the path value of "<b>MessageHeader:sender</b>".
2170   */
2171  public static final ca.uhn.fhir.model.api.Include INCLUDE_SENDER = new ca.uhn.fhir.model.api.Include("MessageHeader:sender").toLocked();
2172
2173 /**
2174   * Search parameter: <b>source</b>
2175   * <p>
2176   * Description: <b>Name of system</b><br>
2177   * Type: <b>string</b><br>
2178   * Path: <b>MessageHeader.source.name</b><br>
2179   * </p>
2180   */
2181  @SearchParamDefinition(name="source", path="MessageHeader.source.name", description="Name of system", type="string" )
2182  public static final String SP_SOURCE = "source";
2183 /**
2184   * <b>Fluent Client</b> search parameter constant for <b>source</b>
2185   * <p>
2186   * Description: <b>Name of system</b><br>
2187   * Type: <b>string</b><br>
2188   * Path: <b>MessageHeader.source.name</b><br>
2189   * </p>
2190   */
2191  public static final ca.uhn.fhir.rest.gclient.StringClientParam SOURCE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_SOURCE);
2192
2193 /**
2194   * Search parameter: <b>target</b>
2195   * <p>
2196   * Description: <b>Particular delivery destination within the destination</b><br>
2197   * Type: <b>reference</b><br>
2198   * Path: <b>MessageHeader.destination.target</b><br>
2199   * </p>
2200   */
2201  @SearchParamDefinition(name="target", path="MessageHeader.destination.target", description="Particular delivery destination within the destination", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Device") }, target={Device.class } )
2202  public static final String SP_TARGET = "target";
2203 /**
2204   * <b>Fluent Client</b> search parameter constant for <b>target</b>
2205   * <p>
2206   * Description: <b>Particular delivery destination within the destination</b><br>
2207   * Type: <b>reference</b><br>
2208   * Path: <b>MessageHeader.destination.target</b><br>
2209   * </p>
2210   */
2211  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam TARGET = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_TARGET);
2212
2213/**
2214   * Constant for fluent queries to be used to add include statements. Specifies
2215   * the path value of "<b>MessageHeader:target</b>".
2216   */
2217  public static final ca.uhn.fhir.model.api.Include INCLUDE_TARGET = new ca.uhn.fhir.model.api.Include("MessageHeader:target").toLocked();
2218
2219
2220}
2221