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