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