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