001package org.hl7.fhir.r5.model;
002
003/*-
004 * #%L
005 * org.hl7.fhir.r5
006 * %%
007 * Copyright (C) 2014 - 2019 Health Level 7
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 * 
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 * 
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023/*
024  Copyright (c) 2011+, HL7, Inc.
025  All rights reserved.
026  
027  Redistribution and use in source and binary forms, with or without modification, 
028  are permitted provided that the following conditions are met:
029  
030   * Redistributions of source code must retain the above copyright notice, this 
031     list of conditions and the following disclaimer.
032   * Redistributions in binary form must reproduce the above copyright notice, 
033     this list of conditions and the following disclaimer in the documentation 
034     and/or other materials provided with the distribution.
035   * Neither the name of HL7 nor the names of its contributors may be used to 
036     endorse or promote products derived from this software without specific 
037     prior written permission.
038  
039  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
040  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
041  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
042  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
043  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
044  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
045  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
046  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
047  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
048  POSSIBILITY OF SUCH DAMAGE.
049  
050*/
051
052// Generated on Thu, Dec 13, 2018 14:07+1100 for FHIR v4.0.0
053import java.util.ArrayList;
054import java.util.Date;
055import java.util.List;
056import org.hl7.fhir.exceptions.FHIRException;
057import org.hl7.fhir.instance.model.api.ICompositeType;
058
059import org.hl7.fhir.instance.model.api.IBaseDatatypeElement;
060import org.hl7.fhir.utilities.Utilities;
061import org.hl7.fhir.r5.model.Enumerations.*;
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 * Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted.
071 */
072@ResourceDef(name="MessageDefinition", profile="http://hl7.org/fhir/StructureDefinition/MessageDefinition")
073@ChildOrder(names={"url", "identifier", "version", "name", "title", "replaces", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "base", "parent", "event[x]", "category", "focus", "responseRequired", "allowedResponse", "graph"})
074public class MessageDefinition extends MetadataResource {
075
076    public enum MessageSignificanceCategory {
077        /**
078         * The message represents/requests a change that should not be processed more than once; e.g., making a booking for an appointment.
079         */
080        CONSEQUENCE, 
081        /**
082         * The message represents a response to query for current information. Retrospective processing is wrong and/or wasteful.
083         */
084        CURRENCY, 
085        /**
086         * The content is not necessarily intended to be current, and it can be reprocessed, though there may be version issues created by processing old notifications.
087         */
088        NOTIFICATION, 
089        /**
090         * added to help the parsers with the generic types
091         */
092        NULL;
093        public static MessageSignificanceCategory fromCode(String codeString) throws FHIRException {
094            if (codeString == null || "".equals(codeString))
095                return null;
096        if ("consequence".equals(codeString))
097          return CONSEQUENCE;
098        if ("currency".equals(codeString))
099          return CURRENCY;
100        if ("notification".equals(codeString))
101          return NOTIFICATION;
102        if (Configuration.isAcceptInvalidEnums())
103          return null;
104        else
105          throw new FHIRException("Unknown MessageSignificanceCategory code '"+codeString+"'");
106        }
107        public String toCode() {
108          switch (this) {
109            case CONSEQUENCE: return "consequence";
110            case CURRENCY: return "currency";
111            case NOTIFICATION: return "notification";
112            default: return "?";
113          }
114        }
115        public String getSystem() {
116          switch (this) {
117            case CONSEQUENCE: return "http://hl7.org/fhir/message-significance-category";
118            case CURRENCY: return "http://hl7.org/fhir/message-significance-category";
119            case NOTIFICATION: return "http://hl7.org/fhir/message-significance-category";
120            default: return "?";
121          }
122        }
123        public String getDefinition() {
124          switch (this) {
125            case CONSEQUENCE: return "The message represents/requests a change that should not be processed more than once; e.g., making a booking for an appointment.";
126            case CURRENCY: return "The message represents a response to query for current information. Retrospective processing is wrong and/or wasteful.";
127            case NOTIFICATION: return "The content is not necessarily intended to be current, and it can be reprocessed, though there may be version issues created by processing old notifications.";
128            default: return "?";
129          }
130        }
131        public String getDisplay() {
132          switch (this) {
133            case CONSEQUENCE: return "Consequence";
134            case CURRENCY: return "Currency";
135            case NOTIFICATION: return "Notification";
136            default: return "?";
137          }
138        }
139    }
140
141  public static class MessageSignificanceCategoryEnumFactory implements EnumFactory<MessageSignificanceCategory> {
142    public MessageSignificanceCategory fromCode(String codeString) throws IllegalArgumentException {
143      if (codeString == null || "".equals(codeString))
144            if (codeString == null || "".equals(codeString))
145                return null;
146        if ("consequence".equals(codeString))
147          return MessageSignificanceCategory.CONSEQUENCE;
148        if ("currency".equals(codeString))
149          return MessageSignificanceCategory.CURRENCY;
150        if ("notification".equals(codeString))
151          return MessageSignificanceCategory.NOTIFICATION;
152        throw new IllegalArgumentException("Unknown MessageSignificanceCategory code '"+codeString+"'");
153        }
154        public Enumeration<MessageSignificanceCategory> fromType(Base code) throws FHIRException {
155          if (code == null)
156            return null;
157          if (code.isEmpty())
158            return new Enumeration<MessageSignificanceCategory>(this);
159          String codeString = ((PrimitiveType) code).asStringValue();
160          if (codeString == null || "".equals(codeString))
161            return null;
162        if ("consequence".equals(codeString))
163          return new Enumeration<MessageSignificanceCategory>(this, MessageSignificanceCategory.CONSEQUENCE);
164        if ("currency".equals(codeString))
165          return new Enumeration<MessageSignificanceCategory>(this, MessageSignificanceCategory.CURRENCY);
166        if ("notification".equals(codeString))
167          return new Enumeration<MessageSignificanceCategory>(this, MessageSignificanceCategory.NOTIFICATION);
168        throw new FHIRException("Unknown MessageSignificanceCategory code '"+codeString+"'");
169        }
170    public String toCode(MessageSignificanceCategory code) {
171      if (code == MessageSignificanceCategory.CONSEQUENCE)
172        return "consequence";
173      if (code == MessageSignificanceCategory.CURRENCY)
174        return "currency";
175      if (code == MessageSignificanceCategory.NOTIFICATION)
176        return "notification";
177      return "?";
178      }
179    public String toSystem(MessageSignificanceCategory code) {
180      return code.getSystem();
181      }
182    }
183
184    public enum MessageheaderResponseRequest {
185        /**
186         * initiator expects a response for this message.
187         */
188        ALWAYS, 
189        /**
190         * initiator expects a response only if in error.
191         */
192        ONERROR, 
193        /**
194         * initiator does not expect a response.
195         */
196        NEVER, 
197        /**
198         * initiator expects a response only if successful.
199         */
200        ONSUCCESS, 
201        /**
202         * added to help the parsers with the generic types
203         */
204        NULL;
205        public static MessageheaderResponseRequest fromCode(String codeString) throws FHIRException {
206            if (codeString == null || "".equals(codeString))
207                return null;
208        if ("always".equals(codeString))
209          return ALWAYS;
210        if ("on-error".equals(codeString))
211          return ONERROR;
212        if ("never".equals(codeString))
213          return NEVER;
214        if ("on-success".equals(codeString))
215          return ONSUCCESS;
216        if (Configuration.isAcceptInvalidEnums())
217          return null;
218        else
219          throw new FHIRException("Unknown MessageheaderResponseRequest code '"+codeString+"'");
220        }
221        public String toCode() {
222          switch (this) {
223            case ALWAYS: return "always";
224            case ONERROR: return "on-error";
225            case NEVER: return "never";
226            case ONSUCCESS: return "on-success";
227            default: return "?";
228          }
229        }
230        public String getSystem() {
231          switch (this) {
232            case ALWAYS: return "http://hl7.org/fhir/messageheader-response-request";
233            case ONERROR: return "http://hl7.org/fhir/messageheader-response-request";
234            case NEVER: return "http://hl7.org/fhir/messageheader-response-request";
235            case ONSUCCESS: return "http://hl7.org/fhir/messageheader-response-request";
236            default: return "?";
237          }
238        }
239        public String getDefinition() {
240          switch (this) {
241            case ALWAYS: return "initiator expects a response for this message.";
242            case ONERROR: return "initiator expects a response only if in error.";
243            case NEVER: return "initiator does not expect a response.";
244            case ONSUCCESS: return "initiator expects a response only if successful.";
245            default: return "?";
246          }
247        }
248        public String getDisplay() {
249          switch (this) {
250            case ALWAYS: return "Always";
251            case ONERROR: return "Error/reject conditions only";
252            case NEVER: return "Never";
253            case ONSUCCESS: return "Successful completion only";
254            default: return "?";
255          }
256        }
257    }
258
259  public static class MessageheaderResponseRequestEnumFactory implements EnumFactory<MessageheaderResponseRequest> {
260    public MessageheaderResponseRequest fromCode(String codeString) throws IllegalArgumentException {
261      if (codeString == null || "".equals(codeString))
262            if (codeString == null || "".equals(codeString))
263                return null;
264        if ("always".equals(codeString))
265          return MessageheaderResponseRequest.ALWAYS;
266        if ("on-error".equals(codeString))
267          return MessageheaderResponseRequest.ONERROR;
268        if ("never".equals(codeString))
269          return MessageheaderResponseRequest.NEVER;
270        if ("on-success".equals(codeString))
271          return MessageheaderResponseRequest.ONSUCCESS;
272        throw new IllegalArgumentException("Unknown MessageheaderResponseRequest code '"+codeString+"'");
273        }
274        public Enumeration<MessageheaderResponseRequest> fromType(Base code) throws FHIRException {
275          if (code == null)
276            return null;
277          if (code.isEmpty())
278            return new Enumeration<MessageheaderResponseRequest>(this);
279          String codeString = ((PrimitiveType) code).asStringValue();
280          if (codeString == null || "".equals(codeString))
281            return null;
282        if ("always".equals(codeString))
283          return new Enumeration<MessageheaderResponseRequest>(this, MessageheaderResponseRequest.ALWAYS);
284        if ("on-error".equals(codeString))
285          return new Enumeration<MessageheaderResponseRequest>(this, MessageheaderResponseRequest.ONERROR);
286        if ("never".equals(codeString))
287          return new Enumeration<MessageheaderResponseRequest>(this, MessageheaderResponseRequest.NEVER);
288        if ("on-success".equals(codeString))
289          return new Enumeration<MessageheaderResponseRequest>(this, MessageheaderResponseRequest.ONSUCCESS);
290        throw new FHIRException("Unknown MessageheaderResponseRequest code '"+codeString+"'");
291        }
292    public String toCode(MessageheaderResponseRequest code) {
293      if (code == MessageheaderResponseRequest.ALWAYS)
294        return "always";
295      if (code == MessageheaderResponseRequest.ONERROR)
296        return "on-error";
297      if (code == MessageheaderResponseRequest.NEVER)
298        return "never";
299      if (code == MessageheaderResponseRequest.ONSUCCESS)
300        return "on-success";
301      return "?";
302      }
303    public String toSystem(MessageheaderResponseRequest code) {
304      return code.getSystem();
305      }
306    }
307
308    @Block()
309    public static class MessageDefinitionFocusComponent extends BackboneElement implements IBaseBackboneElement {
310        /**
311         * The kind of resource that must be the focus for this message.
312         */
313        @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
314        @Description(shortDefinition="Type of resource", formalDefinition="The kind of resource that must be the focus for this message." )
315        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/resource-types")
316        protected CodeType code;
317
318        /**
319         * A profile that reflects constraints for the focal resource (and potentially for related resources).
320         */
321        @Child(name = "profile", type = {CanonicalType.class}, order=2, min=0, max=1, modifier=false, summary=false)
322        @Description(shortDefinition="Profile that must be adhered to by focus", formalDefinition="A profile that reflects constraints for the focal resource (and potentially for related resources)." )
323        protected CanonicalType profile;
324
325        /**
326         * Identifies the minimum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition.
327         */
328        @Child(name = "min", type = {UnsignedIntType.class}, order=3, min=1, max=1, modifier=false, summary=true)
329        @Description(shortDefinition="Minimum number of focuses of this type", formalDefinition="Identifies the minimum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition." )
330        protected UnsignedIntType min;
331
332        /**
333         * Identifies the maximum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition.
334         */
335        @Child(name = "max", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
336        @Description(shortDefinition="Maximum number of focuses of this type", formalDefinition="Identifies the maximum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition." )
337        protected StringType max;
338
339        private static final long serialVersionUID = -68504836L;
340
341    /**
342     * Constructor
343     */
344      public MessageDefinitionFocusComponent() {
345        super();
346      }
347
348    /**
349     * Constructor
350     */
351      public MessageDefinitionFocusComponent(CodeType code, UnsignedIntType min) {
352        super();
353        this.code = code;
354        this.min = min;
355      }
356
357        /**
358         * @return {@link #code} (The kind of resource that must be the focus for this message.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
359         */
360        public CodeType getCodeElement() { 
361          if (this.code == null)
362            if (Configuration.errorOnAutoCreate())
363              throw new Error("Attempt to auto-create MessageDefinitionFocusComponent.code");
364            else if (Configuration.doAutoCreate())
365              this.code = new CodeType(); // bb
366          return this.code;
367        }
368
369        public boolean hasCodeElement() { 
370          return this.code != null && !this.code.isEmpty();
371        }
372
373        public boolean hasCode() { 
374          return this.code != null && !this.code.isEmpty();
375        }
376
377        /**
378         * @param value {@link #code} (The kind of resource that must be the focus for this message.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
379         */
380        public MessageDefinitionFocusComponent setCodeElement(CodeType value) { 
381          this.code = value;
382          return this;
383        }
384
385        /**
386         * @return The kind of resource that must be the focus for this message.
387         */
388        public String getCode() { 
389          return this.code == null ? null : this.code.getValue();
390        }
391
392        /**
393         * @param value The kind of resource that must be the focus for this message.
394         */
395        public MessageDefinitionFocusComponent setCode(String value) { 
396            if (this.code == null)
397              this.code = new CodeType();
398            this.code.setValue(value);
399          return this;
400        }
401
402        /**
403         * @return {@link #profile} (A profile that reflects constraints for the focal resource (and potentially for related resources).). This is the underlying object with id, value and extensions. The accessor "getProfile" gives direct access to the value
404         */
405        public CanonicalType getProfileElement() { 
406          if (this.profile == null)
407            if (Configuration.errorOnAutoCreate())
408              throw new Error("Attempt to auto-create MessageDefinitionFocusComponent.profile");
409            else if (Configuration.doAutoCreate())
410              this.profile = new CanonicalType(); // bb
411          return this.profile;
412        }
413
414        public boolean hasProfileElement() { 
415          return this.profile != null && !this.profile.isEmpty();
416        }
417
418        public boolean hasProfile() { 
419          return this.profile != null && !this.profile.isEmpty();
420        }
421
422        /**
423         * @param value {@link #profile} (A profile that reflects constraints for the focal resource (and potentially for related resources).). This is the underlying object with id, value and extensions. The accessor "getProfile" gives direct access to the value
424         */
425        public MessageDefinitionFocusComponent setProfileElement(CanonicalType value) { 
426          this.profile = value;
427          return this;
428        }
429
430        /**
431         * @return A profile that reflects constraints for the focal resource (and potentially for related resources).
432         */
433        public String getProfile() { 
434          return this.profile == null ? null : this.profile.getValue();
435        }
436
437        /**
438         * @param value A profile that reflects constraints for the focal resource (and potentially for related resources).
439         */
440        public MessageDefinitionFocusComponent setProfile(String value) { 
441          if (Utilities.noString(value))
442            this.profile = null;
443          else {
444            if (this.profile == null)
445              this.profile = new CanonicalType();
446            this.profile.setValue(value);
447          }
448          return this;
449        }
450
451        /**
452         * @return {@link #min} (Identifies the minimum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value
453         */
454        public UnsignedIntType getMinElement() { 
455          if (this.min == null)
456            if (Configuration.errorOnAutoCreate())
457              throw new Error("Attempt to auto-create MessageDefinitionFocusComponent.min");
458            else if (Configuration.doAutoCreate())
459              this.min = new UnsignedIntType(); // bb
460          return this.min;
461        }
462
463        public boolean hasMinElement() { 
464          return this.min != null && !this.min.isEmpty();
465        }
466
467        public boolean hasMin() { 
468          return this.min != null && !this.min.isEmpty();
469        }
470
471        /**
472         * @param value {@link #min} (Identifies the minimum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value
473         */
474        public MessageDefinitionFocusComponent setMinElement(UnsignedIntType value) { 
475          this.min = value;
476          return this;
477        }
478
479        /**
480         * @return Identifies the minimum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition.
481         */
482        public int getMin() { 
483          return this.min == null || this.min.isEmpty() ? 0 : this.min.getValue();
484        }
485
486        /**
487         * @param value Identifies the minimum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition.
488         */
489        public MessageDefinitionFocusComponent setMin(int value) { 
490            if (this.min == null)
491              this.min = new UnsignedIntType();
492            this.min.setValue(value);
493          return this;
494        }
495
496        /**
497         * @return {@link #max} (Identifies the maximum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value
498         */
499        public StringType getMaxElement() { 
500          if (this.max == null)
501            if (Configuration.errorOnAutoCreate())
502              throw new Error("Attempt to auto-create MessageDefinitionFocusComponent.max");
503            else if (Configuration.doAutoCreate())
504              this.max = new StringType(); // bb
505          return this.max;
506        }
507
508        public boolean hasMaxElement() { 
509          return this.max != null && !this.max.isEmpty();
510        }
511
512        public boolean hasMax() { 
513          return this.max != null && !this.max.isEmpty();
514        }
515
516        /**
517         * @param value {@link #max} (Identifies the maximum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value
518         */
519        public MessageDefinitionFocusComponent setMaxElement(StringType value) { 
520          this.max = value;
521          return this;
522        }
523
524        /**
525         * @return Identifies the maximum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition.
526         */
527        public String getMax() { 
528          return this.max == null ? null : this.max.getValue();
529        }
530
531        /**
532         * @param value Identifies the maximum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition.
533         */
534        public MessageDefinitionFocusComponent setMax(String value) { 
535          if (Utilities.noString(value))
536            this.max = null;
537          else {
538            if (this.max == null)
539              this.max = new StringType();
540            this.max.setValue(value);
541          }
542          return this;
543        }
544
545        protected void listChildren(List<Property> children) {
546          super.listChildren(children);
547          children.add(new Property("code", "code", "The kind of resource that must be the focus for this message.", 0, 1, code));
548          children.add(new Property("profile", "canonical(StructureDefinition)", "A profile that reflects constraints for the focal resource (and potentially for related resources).", 0, 1, profile));
549          children.add(new Property("min", "unsignedInt", "Identifies the minimum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition.", 0, 1, min));
550          children.add(new Property("max", "string", "Identifies the maximum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition.", 0, 1, max));
551        }
552
553        @Override
554        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
555          switch (_hash) {
556          case 3059181: /*code*/  return new Property("code", "code", "The kind of resource that must be the focus for this message.", 0, 1, code);
557          case -309425751: /*profile*/  return new Property("profile", "canonical(StructureDefinition)", "A profile that reflects constraints for the focal resource (and potentially for related resources).", 0, 1, profile);
558          case 108114: /*min*/  return new Property("min", "unsignedInt", "Identifies the minimum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition.", 0, 1, min);
559          case 107876: /*max*/  return new Property("max", "string", "Identifies the maximum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition.", 0, 1, max);
560          default: return super.getNamedProperty(_hash, _name, _checkValid);
561          }
562
563        }
564
565      @Override
566      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
567        switch (hash) {
568        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType
569        case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // CanonicalType
570        case 108114: /*min*/ return this.min == null ? new Base[0] : new Base[] {this.min}; // UnsignedIntType
571        case 107876: /*max*/ return this.max == null ? new Base[0] : new Base[] {this.max}; // StringType
572        default: return super.getProperty(hash, name, checkValid);
573        }
574
575      }
576
577      @Override
578      public Base setProperty(int hash, String name, Base value) throws FHIRException {
579        switch (hash) {
580        case 3059181: // code
581          this.code = castToCode(value); // CodeType
582          return value;
583        case -309425751: // profile
584          this.profile = castToCanonical(value); // CanonicalType
585          return value;
586        case 108114: // min
587          this.min = castToUnsignedInt(value); // UnsignedIntType
588          return value;
589        case 107876: // max
590          this.max = castToString(value); // StringType
591          return value;
592        default: return super.setProperty(hash, name, value);
593        }
594
595      }
596
597      @Override
598      public Base setProperty(String name, Base value) throws FHIRException {
599        if (name.equals("code")) {
600          this.code = castToCode(value); // CodeType
601        } else if (name.equals("profile")) {
602          this.profile = castToCanonical(value); // CanonicalType
603        } else if (name.equals("min")) {
604          this.min = castToUnsignedInt(value); // UnsignedIntType
605        } else if (name.equals("max")) {
606          this.max = castToString(value); // StringType
607        } else
608          return super.setProperty(name, value);
609        return value;
610      }
611
612      @Override
613      public Base makeProperty(int hash, String name) throws FHIRException {
614        switch (hash) {
615        case 3059181:  return getCodeElement();
616        case -309425751:  return getProfileElement();
617        case 108114:  return getMinElement();
618        case 107876:  return getMaxElement();
619        default: return super.makeProperty(hash, name);
620        }
621
622      }
623
624      @Override
625      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
626        switch (hash) {
627        case 3059181: /*code*/ return new String[] {"code"};
628        case -309425751: /*profile*/ return new String[] {"canonical"};
629        case 108114: /*min*/ return new String[] {"unsignedInt"};
630        case 107876: /*max*/ return new String[] {"string"};
631        default: return super.getTypesForProperty(hash, name);
632        }
633
634      }
635
636      @Override
637      public Base addChild(String name) throws FHIRException {
638        if (name.equals("code")) {
639          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.code");
640        }
641        else if (name.equals("profile")) {
642          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.profile");
643        }
644        else if (name.equals("min")) {
645          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.min");
646        }
647        else if (name.equals("max")) {
648          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.max");
649        }
650        else
651          return super.addChild(name);
652      }
653
654      public MessageDefinitionFocusComponent copy() {
655        MessageDefinitionFocusComponent dst = new MessageDefinitionFocusComponent();
656        copyValues(dst);
657        return dst;
658      }
659
660      public void copyValues(MessageDefinitionFocusComponent dst) {
661        super.copyValues(dst);
662        dst.code = code == null ? null : code.copy();
663        dst.profile = profile == null ? null : profile.copy();
664        dst.min = min == null ? null : min.copy();
665        dst.max = max == null ? null : max.copy();
666      }
667
668      @Override
669      public boolean equalsDeep(Base other_) {
670        if (!super.equalsDeep(other_))
671          return false;
672        if (!(other_ instanceof MessageDefinitionFocusComponent))
673          return false;
674        MessageDefinitionFocusComponent o = (MessageDefinitionFocusComponent) other_;
675        return compareDeep(code, o.code, true) && compareDeep(profile, o.profile, true) && compareDeep(min, o.min, true)
676           && compareDeep(max, o.max, true);
677      }
678
679      @Override
680      public boolean equalsShallow(Base other_) {
681        if (!super.equalsShallow(other_))
682          return false;
683        if (!(other_ instanceof MessageDefinitionFocusComponent))
684          return false;
685        MessageDefinitionFocusComponent o = (MessageDefinitionFocusComponent) other_;
686        return compareValues(code, o.code, true) && compareValues(min, o.min, true) && compareValues(max, o.max, true)
687          ;
688      }
689
690      public boolean isEmpty() {
691        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, profile, min, max
692          );
693      }
694
695  public String fhirType() {
696    return "MessageDefinition.focus";
697
698  }
699
700  }
701
702    @Block()
703    public static class MessageDefinitionAllowedResponseComponent extends BackboneElement implements IBaseBackboneElement {
704        /**
705         * A reference to the message definition that must be adhered to by this supported response.
706         */
707        @Child(name = "message", type = {CanonicalType.class}, order=1, min=1, max=1, modifier=false, summary=false)
708        @Description(shortDefinition="Reference to allowed message definition response", formalDefinition="A reference to the message definition that must be adhered to by this supported response." )
709        protected CanonicalType message;
710
711        /**
712         * Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses).
713         */
714        @Child(name = "situation", type = {MarkdownType.class}, order=2, min=0, max=1, modifier=false, summary=false)
715        @Description(shortDefinition="When should this response be used", formalDefinition="Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses)." )
716        protected MarkdownType situation;
717
718        private static final long serialVersionUID = -1943810550L;
719
720    /**
721     * Constructor
722     */
723      public MessageDefinitionAllowedResponseComponent() {
724        super();
725      }
726
727    /**
728     * Constructor
729     */
730      public MessageDefinitionAllowedResponseComponent(CanonicalType message) {
731        super();
732        this.message = message;
733      }
734
735        /**
736         * @return {@link #message} (A reference to the message definition that must be adhered to by this supported response.). This is the underlying object with id, value and extensions. The accessor "getMessage" gives direct access to the value
737         */
738        public CanonicalType getMessageElement() { 
739          if (this.message == null)
740            if (Configuration.errorOnAutoCreate())
741              throw new Error("Attempt to auto-create MessageDefinitionAllowedResponseComponent.message");
742            else if (Configuration.doAutoCreate())
743              this.message = new CanonicalType(); // bb
744          return this.message;
745        }
746
747        public boolean hasMessageElement() { 
748          return this.message != null && !this.message.isEmpty();
749        }
750
751        public boolean hasMessage() { 
752          return this.message != null && !this.message.isEmpty();
753        }
754
755        /**
756         * @param value {@link #message} (A reference to the message definition that must be adhered to by this supported response.). This is the underlying object with id, value and extensions. The accessor "getMessage" gives direct access to the value
757         */
758        public MessageDefinitionAllowedResponseComponent setMessageElement(CanonicalType value) { 
759          this.message = value;
760          return this;
761        }
762
763        /**
764         * @return A reference to the message definition that must be adhered to by this supported response.
765         */
766        public String getMessage() { 
767          return this.message == null ? null : this.message.getValue();
768        }
769
770        /**
771         * @param value A reference to the message definition that must be adhered to by this supported response.
772         */
773        public MessageDefinitionAllowedResponseComponent setMessage(String value) { 
774            if (this.message == null)
775              this.message = new CanonicalType();
776            this.message.setValue(value);
777          return this;
778        }
779
780        /**
781         * @return {@link #situation} (Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses).). This is the underlying object with id, value and extensions. The accessor "getSituation" gives direct access to the value
782         */
783        public MarkdownType getSituationElement() { 
784          if (this.situation == null)
785            if (Configuration.errorOnAutoCreate())
786              throw new Error("Attempt to auto-create MessageDefinitionAllowedResponseComponent.situation");
787            else if (Configuration.doAutoCreate())
788              this.situation = new MarkdownType(); // bb
789          return this.situation;
790        }
791
792        public boolean hasSituationElement() { 
793          return this.situation != null && !this.situation.isEmpty();
794        }
795
796        public boolean hasSituation() { 
797          return this.situation != null && !this.situation.isEmpty();
798        }
799
800        /**
801         * @param value {@link #situation} (Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses).). This is the underlying object with id, value and extensions. The accessor "getSituation" gives direct access to the value
802         */
803        public MessageDefinitionAllowedResponseComponent setSituationElement(MarkdownType value) { 
804          this.situation = value;
805          return this;
806        }
807
808        /**
809         * @return Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses).
810         */
811        public String getSituation() { 
812          return this.situation == null ? null : this.situation.getValue();
813        }
814
815        /**
816         * @param value Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses).
817         */
818        public MessageDefinitionAllowedResponseComponent setSituation(String value) { 
819          if (value == null)
820            this.situation = null;
821          else {
822            if (this.situation == null)
823              this.situation = new MarkdownType();
824            this.situation.setValue(value);
825          }
826          return this;
827        }
828
829        protected void listChildren(List<Property> children) {
830          super.listChildren(children);
831          children.add(new Property("message", "canonical(MessageDefinition)", "A reference to the message definition that must be adhered to by this supported response.", 0, 1, message));
832          children.add(new Property("situation", "markdown", "Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses).", 0, 1, situation));
833        }
834
835        @Override
836        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
837          switch (_hash) {
838          case 954925063: /*message*/  return new Property("message", "canonical(MessageDefinition)", "A reference to the message definition that must be adhered to by this supported response.", 0, 1, message);
839          case -73377282: /*situation*/  return new Property("situation", "markdown", "Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses).", 0, 1, situation);
840          default: return super.getNamedProperty(_hash, _name, _checkValid);
841          }
842
843        }
844
845      @Override
846      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
847        switch (hash) {
848        case 954925063: /*message*/ return this.message == null ? new Base[0] : new Base[] {this.message}; // CanonicalType
849        case -73377282: /*situation*/ return this.situation == null ? new Base[0] : new Base[] {this.situation}; // MarkdownType
850        default: return super.getProperty(hash, name, checkValid);
851        }
852
853      }
854
855      @Override
856      public Base setProperty(int hash, String name, Base value) throws FHIRException {
857        switch (hash) {
858        case 954925063: // message
859          this.message = castToCanonical(value); // CanonicalType
860          return value;
861        case -73377282: // situation
862          this.situation = castToMarkdown(value); // MarkdownType
863          return value;
864        default: return super.setProperty(hash, name, value);
865        }
866
867      }
868
869      @Override
870      public Base setProperty(String name, Base value) throws FHIRException {
871        if (name.equals("message")) {
872          this.message = castToCanonical(value); // CanonicalType
873        } else if (name.equals("situation")) {
874          this.situation = castToMarkdown(value); // MarkdownType
875        } else
876          return super.setProperty(name, value);
877        return value;
878      }
879
880      @Override
881      public Base makeProperty(int hash, String name) throws FHIRException {
882        switch (hash) {
883        case 954925063:  return getMessageElement();
884        case -73377282:  return getSituationElement();
885        default: return super.makeProperty(hash, name);
886        }
887
888      }
889
890      @Override
891      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
892        switch (hash) {
893        case 954925063: /*message*/ return new String[] {"canonical"};
894        case -73377282: /*situation*/ return new String[] {"markdown"};
895        default: return super.getTypesForProperty(hash, name);
896        }
897
898      }
899
900      @Override
901      public Base addChild(String name) throws FHIRException {
902        if (name.equals("message")) {
903          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.message");
904        }
905        else if (name.equals("situation")) {
906          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.situation");
907        }
908        else
909          return super.addChild(name);
910      }
911
912      public MessageDefinitionAllowedResponseComponent copy() {
913        MessageDefinitionAllowedResponseComponent dst = new MessageDefinitionAllowedResponseComponent();
914        copyValues(dst);
915        return dst;
916      }
917
918      public void copyValues(MessageDefinitionAllowedResponseComponent dst) {
919        super.copyValues(dst);
920        dst.message = message == null ? null : message.copy();
921        dst.situation = situation == null ? null : situation.copy();
922      }
923
924      @Override
925      public boolean equalsDeep(Base other_) {
926        if (!super.equalsDeep(other_))
927          return false;
928        if (!(other_ instanceof MessageDefinitionAllowedResponseComponent))
929          return false;
930        MessageDefinitionAllowedResponseComponent o = (MessageDefinitionAllowedResponseComponent) other_;
931        return compareDeep(message, o.message, true) && compareDeep(situation, o.situation, true);
932      }
933
934      @Override
935      public boolean equalsShallow(Base other_) {
936        if (!super.equalsShallow(other_))
937          return false;
938        if (!(other_ instanceof MessageDefinitionAllowedResponseComponent))
939          return false;
940        MessageDefinitionAllowedResponseComponent o = (MessageDefinitionAllowedResponseComponent) other_;
941        return compareValues(situation, o.situation, true);
942      }
943
944      public boolean isEmpty() {
945        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(message, situation);
946      }
947
948  public String fhirType() {
949    return "MessageDefinition.allowedResponse";
950
951  }
952
953  }
954
955    /**
956     * A formal identifier that is used to identify this message definition when it is represented in other formats, or referenced in a specification, model, design or an instance.
957     */
958    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
959    @Description(shortDefinition="Primary key for the message definition on a given server", formalDefinition="A formal identifier that is used to identify this message definition when it is represented in other formats, or referenced in a specification, model, design or an instance." )
960    protected List<Identifier> identifier;
961
962    /**
963     * A MessageDefinition that is superseded by this definition.
964     */
965    @Child(name = "replaces", type = {CanonicalType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
966    @Description(shortDefinition="Takes the place of", formalDefinition="A MessageDefinition that is superseded by this definition." )
967    protected List<CanonicalType> replaces;
968
969    /**
970     * Explanation of why this message definition is needed and why it has been designed as it has.
971     */
972    @Child(name = "purpose", type = {MarkdownType.class}, order=2, min=0, max=1, modifier=false, summary=true)
973    @Description(shortDefinition="Why this message definition is defined", formalDefinition="Explanation of why this message definition is needed and why it has been designed as it has." )
974    protected MarkdownType purpose;
975
976    /**
977     * A copyright statement relating to the message definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the message definition.
978     */
979    @Child(name = "copyright", type = {MarkdownType.class}, order=3, min=0, max=1, modifier=false, summary=false)
980    @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the message definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the message definition." )
981    protected MarkdownType copyright;
982
983    /**
984     * The MessageDefinition that is the basis for the contents of this resource.
985     */
986    @Child(name = "base", type = {CanonicalType.class}, order=4, min=0, max=1, modifier=false, summary=true)
987    @Description(shortDefinition="Definition this one is based on", formalDefinition="The MessageDefinition that is the basis for the contents of this resource." )
988    protected CanonicalType base;
989
990    /**
991     * Identifies a protocol or workflow that this MessageDefinition represents a step in.
992     */
993    @Child(name = "parent", type = {CanonicalType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
994    @Description(shortDefinition="Protocol/workflow this is part of", formalDefinition="Identifies a protocol or workflow that this MessageDefinition represents a step in." )
995    protected List<CanonicalType> parent;
996
997    /**
998     * Event code or link to the EventDefinition.
999     */
1000    @Child(name = "event", type = {Coding.class, UriType.class}, order=6, min=1, max=1, modifier=false, summary=true)
1001    @Description(shortDefinition="Event code  or link to the EventDefinition", formalDefinition="Event code or link to the EventDefinition." )
1002    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/message-events")
1003    protected Type event;
1004
1005    /**
1006     * The impact of the content of the message.
1007     */
1008    @Child(name = "category", type = {CodeType.class}, order=7, min=0, max=1, modifier=false, summary=true)
1009    @Description(shortDefinition="consequence | currency | notification", formalDefinition="The impact of the content of the message." )
1010    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/message-significance-category")
1011    protected Enumeration<MessageSignificanceCategory> category;
1012
1013    /**
1014     * Identifies the resource (or resources) that are being addressed by the event.  For example, the Encounter for an admit message or two Account records for a merge.
1015     */
1016    @Child(name = "focus", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1017    @Description(shortDefinition="Resource(s) that are the subject of the event", formalDefinition="Identifies the resource (or resources) that are being addressed by the event.  For example, the Encounter for an admit message or two Account records for a merge." )
1018    protected List<MessageDefinitionFocusComponent> focus;
1019
1020    /**
1021     * Declare at a message definition level whether a response is required or only upon error or success, or never.
1022     */
1023    @Child(name = "responseRequired", type = {CodeType.class}, order=9, min=0, max=1, modifier=false, summary=false)
1024    @Description(shortDefinition="always | on-error | never | on-success", formalDefinition="Declare at a message definition level whether a response is required or only upon error or success, or never." )
1025    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/messageheader-response-request")
1026    protected Enumeration<MessageheaderResponseRequest> responseRequired;
1027
1028    /**
1029     * Indicates what types of messages may be sent as an application-level response to this message.
1030     */
1031    @Child(name = "allowedResponse", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1032    @Description(shortDefinition="Responses to this message", formalDefinition="Indicates what types of messages may be sent as an application-level response to this message." )
1033    protected List<MessageDefinitionAllowedResponseComponent> allowedResponse;
1034
1035    /**
1036     * Canonical reference to a GraphDefinition. If a URL is provided, it is the canonical reference to a [[[GraphDefinition]]] that it controls what resources are to be added to the bundle when building the document. The GraphDefinition can also specify profiles that apply to the various resources.
1037     */
1038    @Child(name = "graph", type = {CanonicalType.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1039    @Description(shortDefinition="Canonical reference to a GraphDefinition", formalDefinition="Canonical reference to a GraphDefinition. If a URL is provided, it is the canonical reference to a [[[GraphDefinition]]] that it controls what resources are to be added to the bundle when building the document. The GraphDefinition can also specify profiles that apply to the various resources." )
1040    protected List<CanonicalType> graph;
1041
1042    private static final long serialVersionUID = 927775347L;
1043
1044  /**
1045   * Constructor
1046   */
1047    public MessageDefinition() {
1048      super();
1049    }
1050
1051  /**
1052   * Constructor
1053   */
1054    public MessageDefinition(Enumeration<PublicationStatus> status, DateTimeType date, Type event) {
1055      super();
1056      this.status = status;
1057      this.date = date;
1058      this.event = event;
1059    }
1060
1061    /**
1062     * @return {@link #url} (The business identifier that is used to reference the MessageDefinition and *is* expected to be consistent from server to server.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
1063     */
1064    public UriType getUrlElement() { 
1065      if (this.url == null)
1066        if (Configuration.errorOnAutoCreate())
1067          throw new Error("Attempt to auto-create MessageDefinition.url");
1068        else if (Configuration.doAutoCreate())
1069          this.url = new UriType(); // bb
1070      return this.url;
1071    }
1072
1073    public boolean hasUrlElement() { 
1074      return this.url != null && !this.url.isEmpty();
1075    }
1076
1077    public boolean hasUrl() { 
1078      return this.url != null && !this.url.isEmpty();
1079    }
1080
1081    /**
1082     * @param value {@link #url} (The business identifier that is used to reference the MessageDefinition and *is* expected to be consistent from server to server.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
1083     */
1084    public MessageDefinition setUrlElement(UriType value) { 
1085      this.url = value;
1086      return this;
1087    }
1088
1089    /**
1090     * @return The business identifier that is used to reference the MessageDefinition and *is* expected to be consistent from server to server.
1091     */
1092    public String getUrl() { 
1093      return this.url == null ? null : this.url.getValue();
1094    }
1095
1096    /**
1097     * @param value The business identifier that is used to reference the MessageDefinition and *is* expected to be consistent from server to server.
1098     */
1099    public MessageDefinition setUrl(String value) { 
1100      if (Utilities.noString(value))
1101        this.url = null;
1102      else {
1103        if (this.url == null)
1104          this.url = new UriType();
1105        this.url.setValue(value);
1106      }
1107      return this;
1108    }
1109
1110    /**
1111     * @return {@link #identifier} (A formal identifier that is used to identify this message definition when it is represented in other formats, or referenced in a specification, model, design or an instance.)
1112     */
1113    public List<Identifier> getIdentifier() { 
1114      if (this.identifier == null)
1115        this.identifier = new ArrayList<Identifier>();
1116      return this.identifier;
1117    }
1118
1119    /**
1120     * @return Returns a reference to <code>this</code> for easy method chaining
1121     */
1122    public MessageDefinition setIdentifier(List<Identifier> theIdentifier) { 
1123      this.identifier = theIdentifier;
1124      return this;
1125    }
1126
1127    public boolean hasIdentifier() { 
1128      if (this.identifier == null)
1129        return false;
1130      for (Identifier item : this.identifier)
1131        if (!item.isEmpty())
1132          return true;
1133      return false;
1134    }
1135
1136    public Identifier addIdentifier() { //3
1137      Identifier t = new Identifier();
1138      if (this.identifier == null)
1139        this.identifier = new ArrayList<Identifier>();
1140      this.identifier.add(t);
1141      return t;
1142    }
1143
1144    public MessageDefinition addIdentifier(Identifier t) { //3
1145      if (t == null)
1146        return this;
1147      if (this.identifier == null)
1148        this.identifier = new ArrayList<Identifier>();
1149      this.identifier.add(t);
1150      return this;
1151    }
1152
1153    /**
1154     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
1155     */
1156    public Identifier getIdentifierFirstRep() { 
1157      if (getIdentifier().isEmpty()) {
1158        addIdentifier();
1159      }
1160      return getIdentifier().get(0);
1161    }
1162
1163    /**
1164     * @return {@link #version} (The identifier that is used to identify this version of the message definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the message definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
1165     */
1166    public StringType getVersionElement() { 
1167      if (this.version == null)
1168        if (Configuration.errorOnAutoCreate())
1169          throw new Error("Attempt to auto-create MessageDefinition.version");
1170        else if (Configuration.doAutoCreate())
1171          this.version = new StringType(); // bb
1172      return this.version;
1173    }
1174
1175    public boolean hasVersionElement() { 
1176      return this.version != null && !this.version.isEmpty();
1177    }
1178
1179    public boolean hasVersion() { 
1180      return this.version != null && !this.version.isEmpty();
1181    }
1182
1183    /**
1184     * @param value {@link #version} (The identifier that is used to identify this version of the message definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the message definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
1185     */
1186    public MessageDefinition setVersionElement(StringType value) { 
1187      this.version = value;
1188      return this;
1189    }
1190
1191    /**
1192     * @return The identifier that is used to identify this version of the message definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the message definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.
1193     */
1194    public String getVersion() { 
1195      return this.version == null ? null : this.version.getValue();
1196    }
1197
1198    /**
1199     * @param value The identifier that is used to identify this version of the message definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the message definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.
1200     */
1201    public MessageDefinition setVersion(String value) { 
1202      if (Utilities.noString(value))
1203        this.version = null;
1204      else {
1205        if (this.version == null)
1206          this.version = new StringType();
1207        this.version.setValue(value);
1208      }
1209      return this;
1210    }
1211
1212    /**
1213     * @return {@link #name} (A natural language name identifying the message definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1214     */
1215    public StringType getNameElement() { 
1216      if (this.name == null)
1217        if (Configuration.errorOnAutoCreate())
1218          throw new Error("Attempt to auto-create MessageDefinition.name");
1219        else if (Configuration.doAutoCreate())
1220          this.name = new StringType(); // bb
1221      return this.name;
1222    }
1223
1224    public boolean hasNameElement() { 
1225      return this.name != null && !this.name.isEmpty();
1226    }
1227
1228    public boolean hasName() { 
1229      return this.name != null && !this.name.isEmpty();
1230    }
1231
1232    /**
1233     * @param value {@link #name} (A natural language name identifying the message definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1234     */
1235    public MessageDefinition setNameElement(StringType value) { 
1236      this.name = value;
1237      return this;
1238    }
1239
1240    /**
1241     * @return A natural language name identifying the message definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.
1242     */
1243    public String getName() { 
1244      return this.name == null ? null : this.name.getValue();
1245    }
1246
1247    /**
1248     * @param value A natural language name identifying the message definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.
1249     */
1250    public MessageDefinition setName(String value) { 
1251      if (Utilities.noString(value))
1252        this.name = null;
1253      else {
1254        if (this.name == null)
1255          this.name = new StringType();
1256        this.name.setValue(value);
1257      }
1258      return this;
1259    }
1260
1261    /**
1262     * @return {@link #title} (A short, descriptive, user-friendly title for the message definition.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
1263     */
1264    public StringType getTitleElement() { 
1265      if (this.title == null)
1266        if (Configuration.errorOnAutoCreate())
1267          throw new Error("Attempt to auto-create MessageDefinition.title");
1268        else if (Configuration.doAutoCreate())
1269          this.title = new StringType(); // bb
1270      return this.title;
1271    }
1272
1273    public boolean hasTitleElement() { 
1274      return this.title != null && !this.title.isEmpty();
1275    }
1276
1277    public boolean hasTitle() { 
1278      return this.title != null && !this.title.isEmpty();
1279    }
1280
1281    /**
1282     * @param value {@link #title} (A short, descriptive, user-friendly title for the message definition.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
1283     */
1284    public MessageDefinition setTitleElement(StringType value) { 
1285      this.title = value;
1286      return this;
1287    }
1288
1289    /**
1290     * @return A short, descriptive, user-friendly title for the message definition.
1291     */
1292    public String getTitle() { 
1293      return this.title == null ? null : this.title.getValue();
1294    }
1295
1296    /**
1297     * @param value A short, descriptive, user-friendly title for the message definition.
1298     */
1299    public MessageDefinition setTitle(String value) { 
1300      if (Utilities.noString(value))
1301        this.title = null;
1302      else {
1303        if (this.title == null)
1304          this.title = new StringType();
1305        this.title.setValue(value);
1306      }
1307      return this;
1308    }
1309
1310    /**
1311     * @return {@link #replaces} (A MessageDefinition that is superseded by this definition.)
1312     */
1313    public List<CanonicalType> getReplaces() { 
1314      if (this.replaces == null)
1315        this.replaces = new ArrayList<CanonicalType>();
1316      return this.replaces;
1317    }
1318
1319    /**
1320     * @return Returns a reference to <code>this</code> for easy method chaining
1321     */
1322    public MessageDefinition setReplaces(List<CanonicalType> theReplaces) { 
1323      this.replaces = theReplaces;
1324      return this;
1325    }
1326
1327    public boolean hasReplaces() { 
1328      if (this.replaces == null)
1329        return false;
1330      for (CanonicalType item : this.replaces)
1331        if (!item.isEmpty())
1332          return true;
1333      return false;
1334    }
1335
1336    /**
1337     * @return {@link #replaces} (A MessageDefinition that is superseded by this definition.)
1338     */
1339    public CanonicalType addReplacesElement() {//2 
1340      CanonicalType t = new CanonicalType();
1341      if (this.replaces == null)
1342        this.replaces = new ArrayList<CanonicalType>();
1343      this.replaces.add(t);
1344      return t;
1345    }
1346
1347    /**
1348     * @param value {@link #replaces} (A MessageDefinition that is superseded by this definition.)
1349     */
1350    public MessageDefinition addReplaces(String value) { //1
1351      CanonicalType t = new CanonicalType();
1352      t.setValue(value);
1353      if (this.replaces == null)
1354        this.replaces = new ArrayList<CanonicalType>();
1355      this.replaces.add(t);
1356      return this;
1357    }
1358
1359    /**
1360     * @param value {@link #replaces} (A MessageDefinition that is superseded by this definition.)
1361     */
1362    public boolean hasReplaces(String value) { 
1363      if (this.replaces == null)
1364        return false;
1365      for (CanonicalType v : this.replaces)
1366        if (v.getValue().equals(value)) // canonical(MessageDefinition)
1367          return true;
1368      return false;
1369    }
1370
1371    /**
1372     * @return {@link #status} (The status of this message definition. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1373     */
1374    public Enumeration<PublicationStatus> getStatusElement() { 
1375      if (this.status == null)
1376        if (Configuration.errorOnAutoCreate())
1377          throw new Error("Attempt to auto-create MessageDefinition.status");
1378        else if (Configuration.doAutoCreate())
1379          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
1380      return this.status;
1381    }
1382
1383    public boolean hasStatusElement() { 
1384      return this.status != null && !this.status.isEmpty();
1385    }
1386
1387    public boolean hasStatus() { 
1388      return this.status != null && !this.status.isEmpty();
1389    }
1390
1391    /**
1392     * @param value {@link #status} (The status of this message definition. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1393     */
1394    public MessageDefinition setStatusElement(Enumeration<PublicationStatus> value) { 
1395      this.status = value;
1396      return this;
1397    }
1398
1399    /**
1400     * @return The status of this message definition. Enables tracking the life-cycle of the content.
1401     */
1402    public PublicationStatus getStatus() { 
1403      return this.status == null ? null : this.status.getValue();
1404    }
1405
1406    /**
1407     * @param value The status of this message definition. Enables tracking the life-cycle of the content.
1408     */
1409    public MessageDefinition setStatus(PublicationStatus value) { 
1410        if (this.status == null)
1411          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
1412        this.status.setValue(value);
1413      return this;
1414    }
1415
1416    /**
1417     * @return {@link #experimental} (A Boolean value to indicate that this message definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
1418     */
1419    public BooleanType getExperimentalElement() { 
1420      if (this.experimental == null)
1421        if (Configuration.errorOnAutoCreate())
1422          throw new Error("Attempt to auto-create MessageDefinition.experimental");
1423        else if (Configuration.doAutoCreate())
1424          this.experimental = new BooleanType(); // bb
1425      return this.experimental;
1426    }
1427
1428    public boolean hasExperimentalElement() { 
1429      return this.experimental != null && !this.experimental.isEmpty();
1430    }
1431
1432    public boolean hasExperimental() { 
1433      return this.experimental != null && !this.experimental.isEmpty();
1434    }
1435
1436    /**
1437     * @param value {@link #experimental} (A Boolean value to indicate that this message definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
1438     */
1439    public MessageDefinition setExperimentalElement(BooleanType value) { 
1440      this.experimental = value;
1441      return this;
1442    }
1443
1444    /**
1445     * @return A Boolean value to indicate that this message definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.
1446     */
1447    public boolean getExperimental() { 
1448      return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
1449    }
1450
1451    /**
1452     * @param value A Boolean value to indicate that this message definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.
1453     */
1454    public MessageDefinition setExperimental(boolean value) { 
1455        if (this.experimental == null)
1456          this.experimental = new BooleanType();
1457        this.experimental.setValue(value);
1458      return this;
1459    }
1460
1461    /**
1462     * @return {@link #date} (The date  (and optionally time) when the message definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the message definition changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
1463     */
1464    public DateTimeType getDateElement() { 
1465      if (this.date == null)
1466        if (Configuration.errorOnAutoCreate())
1467          throw new Error("Attempt to auto-create MessageDefinition.date");
1468        else if (Configuration.doAutoCreate())
1469          this.date = new DateTimeType(); // bb
1470      return this.date;
1471    }
1472
1473    public boolean hasDateElement() { 
1474      return this.date != null && !this.date.isEmpty();
1475    }
1476
1477    public boolean hasDate() { 
1478      return this.date != null && !this.date.isEmpty();
1479    }
1480
1481    /**
1482     * @param value {@link #date} (The date  (and optionally time) when the message definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the message definition changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
1483     */
1484    public MessageDefinition setDateElement(DateTimeType value) { 
1485      this.date = value;
1486      return this;
1487    }
1488
1489    /**
1490     * @return The date  (and optionally time) when the message definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the message definition changes.
1491     */
1492    public Date getDate() { 
1493      return this.date == null ? null : this.date.getValue();
1494    }
1495
1496    /**
1497     * @param value The date  (and optionally time) when the message definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the message definition changes.
1498     */
1499    public MessageDefinition setDate(Date value) { 
1500        if (this.date == null)
1501          this.date = new DateTimeType();
1502        this.date.setValue(value);
1503      return this;
1504    }
1505
1506    /**
1507     * @return {@link #publisher} (The name of the organization or individual that published the message definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
1508     */
1509    public StringType getPublisherElement() { 
1510      if (this.publisher == null)
1511        if (Configuration.errorOnAutoCreate())
1512          throw new Error("Attempt to auto-create MessageDefinition.publisher");
1513        else if (Configuration.doAutoCreate())
1514          this.publisher = new StringType(); // bb
1515      return this.publisher;
1516    }
1517
1518    public boolean hasPublisherElement() { 
1519      return this.publisher != null && !this.publisher.isEmpty();
1520    }
1521
1522    public boolean hasPublisher() { 
1523      return this.publisher != null && !this.publisher.isEmpty();
1524    }
1525
1526    /**
1527     * @param value {@link #publisher} (The name of the organization or individual that published the message definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
1528     */
1529    public MessageDefinition setPublisherElement(StringType value) { 
1530      this.publisher = value;
1531      return this;
1532    }
1533
1534    /**
1535     * @return The name of the organization or individual that published the message definition.
1536     */
1537    public String getPublisher() { 
1538      return this.publisher == null ? null : this.publisher.getValue();
1539    }
1540
1541    /**
1542     * @param value The name of the organization or individual that published the message definition.
1543     */
1544    public MessageDefinition setPublisher(String value) { 
1545      if (Utilities.noString(value))
1546        this.publisher = null;
1547      else {
1548        if (this.publisher == null)
1549          this.publisher = new StringType();
1550        this.publisher.setValue(value);
1551      }
1552      return this;
1553    }
1554
1555    /**
1556     * @return {@link #contact} (Contact details to assist a user in finding and communicating with the publisher.)
1557     */
1558    public List<ContactDetail> getContact() { 
1559      if (this.contact == null)
1560        this.contact = new ArrayList<ContactDetail>();
1561      return this.contact;
1562    }
1563
1564    /**
1565     * @return Returns a reference to <code>this</code> for easy method chaining
1566     */
1567    public MessageDefinition setContact(List<ContactDetail> theContact) { 
1568      this.contact = theContact;
1569      return this;
1570    }
1571
1572    public boolean hasContact() { 
1573      if (this.contact == null)
1574        return false;
1575      for (ContactDetail item : this.contact)
1576        if (!item.isEmpty())
1577          return true;
1578      return false;
1579    }
1580
1581    public ContactDetail addContact() { //3
1582      ContactDetail t = new ContactDetail();
1583      if (this.contact == null)
1584        this.contact = new ArrayList<ContactDetail>();
1585      this.contact.add(t);
1586      return t;
1587    }
1588
1589    public MessageDefinition addContact(ContactDetail t) { //3
1590      if (t == null)
1591        return this;
1592      if (this.contact == null)
1593        this.contact = new ArrayList<ContactDetail>();
1594      this.contact.add(t);
1595      return this;
1596    }
1597
1598    /**
1599     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist
1600     */
1601    public ContactDetail getContactFirstRep() { 
1602      if (getContact().isEmpty()) {
1603        addContact();
1604      }
1605      return getContact().get(0);
1606    }
1607
1608    /**
1609     * @return {@link #description} (A free text natural language description of the message definition from a consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1610     */
1611    public MarkdownType getDescriptionElement() { 
1612      if (this.description == null)
1613        if (Configuration.errorOnAutoCreate())
1614          throw new Error("Attempt to auto-create MessageDefinition.description");
1615        else if (Configuration.doAutoCreate())
1616          this.description = new MarkdownType(); // bb
1617      return this.description;
1618    }
1619
1620    public boolean hasDescriptionElement() { 
1621      return this.description != null && !this.description.isEmpty();
1622    }
1623
1624    public boolean hasDescription() { 
1625      return this.description != null && !this.description.isEmpty();
1626    }
1627
1628    /**
1629     * @param value {@link #description} (A free text natural language description of the message definition from a consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1630     */
1631    public MessageDefinition setDescriptionElement(MarkdownType value) { 
1632      this.description = value;
1633      return this;
1634    }
1635
1636    /**
1637     * @return A free text natural language description of the message definition from a consumer's perspective.
1638     */
1639    public String getDescription() { 
1640      return this.description == null ? null : this.description.getValue();
1641    }
1642
1643    /**
1644     * @param value A free text natural language description of the message definition from a consumer's perspective.
1645     */
1646    public MessageDefinition setDescription(String value) { 
1647      if (value == null)
1648        this.description = null;
1649      else {
1650        if (this.description == null)
1651          this.description = new MarkdownType();
1652        this.description.setValue(value);
1653      }
1654      return this;
1655    }
1656
1657    /**
1658     * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate message definition instances.)
1659     */
1660    public List<UsageContext> getUseContext() { 
1661      if (this.useContext == null)
1662        this.useContext = new ArrayList<UsageContext>();
1663      return this.useContext;
1664    }
1665
1666    /**
1667     * @return Returns a reference to <code>this</code> for easy method chaining
1668     */
1669    public MessageDefinition setUseContext(List<UsageContext> theUseContext) { 
1670      this.useContext = theUseContext;
1671      return this;
1672    }
1673
1674    public boolean hasUseContext() { 
1675      if (this.useContext == null)
1676        return false;
1677      for (UsageContext item : this.useContext)
1678        if (!item.isEmpty())
1679          return true;
1680      return false;
1681    }
1682
1683    public UsageContext addUseContext() { //3
1684      UsageContext t = new UsageContext();
1685      if (this.useContext == null)
1686        this.useContext = new ArrayList<UsageContext>();
1687      this.useContext.add(t);
1688      return t;
1689    }
1690
1691    public MessageDefinition addUseContext(UsageContext t) { //3
1692      if (t == null)
1693        return this;
1694      if (this.useContext == null)
1695        this.useContext = new ArrayList<UsageContext>();
1696      this.useContext.add(t);
1697      return this;
1698    }
1699
1700    /**
1701     * @return The first repetition of repeating field {@link #useContext}, creating it if it does not already exist
1702     */
1703    public UsageContext getUseContextFirstRep() { 
1704      if (getUseContext().isEmpty()) {
1705        addUseContext();
1706      }
1707      return getUseContext().get(0);
1708    }
1709
1710    /**
1711     * @return {@link #jurisdiction} (A legal or geographic region in which the message definition is intended to be used.)
1712     */
1713    public List<CodeableConcept> getJurisdiction() { 
1714      if (this.jurisdiction == null)
1715        this.jurisdiction = new ArrayList<CodeableConcept>();
1716      return this.jurisdiction;
1717    }
1718
1719    /**
1720     * @return Returns a reference to <code>this</code> for easy method chaining
1721     */
1722    public MessageDefinition setJurisdiction(List<CodeableConcept> theJurisdiction) { 
1723      this.jurisdiction = theJurisdiction;
1724      return this;
1725    }
1726
1727    public boolean hasJurisdiction() { 
1728      if (this.jurisdiction == null)
1729        return false;
1730      for (CodeableConcept item : this.jurisdiction)
1731        if (!item.isEmpty())
1732          return true;
1733      return false;
1734    }
1735
1736    public CodeableConcept addJurisdiction() { //3
1737      CodeableConcept t = new CodeableConcept();
1738      if (this.jurisdiction == null)
1739        this.jurisdiction = new ArrayList<CodeableConcept>();
1740      this.jurisdiction.add(t);
1741      return t;
1742    }
1743
1744    public MessageDefinition addJurisdiction(CodeableConcept t) { //3
1745      if (t == null)
1746        return this;
1747      if (this.jurisdiction == null)
1748        this.jurisdiction = new ArrayList<CodeableConcept>();
1749      this.jurisdiction.add(t);
1750      return this;
1751    }
1752
1753    /**
1754     * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist
1755     */
1756    public CodeableConcept getJurisdictionFirstRep() { 
1757      if (getJurisdiction().isEmpty()) {
1758        addJurisdiction();
1759      }
1760      return getJurisdiction().get(0);
1761    }
1762
1763    /**
1764     * @return {@link #purpose} (Explanation of why this message definition is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
1765     */
1766    public MarkdownType getPurposeElement() { 
1767      if (this.purpose == null)
1768        if (Configuration.errorOnAutoCreate())
1769          throw new Error("Attempt to auto-create MessageDefinition.purpose");
1770        else if (Configuration.doAutoCreate())
1771          this.purpose = new MarkdownType(); // bb
1772      return this.purpose;
1773    }
1774
1775    public boolean hasPurposeElement() { 
1776      return this.purpose != null && !this.purpose.isEmpty();
1777    }
1778
1779    public boolean hasPurpose() { 
1780      return this.purpose != null && !this.purpose.isEmpty();
1781    }
1782
1783    /**
1784     * @param value {@link #purpose} (Explanation of why this message definition is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
1785     */
1786    public MessageDefinition setPurposeElement(MarkdownType value) { 
1787      this.purpose = value;
1788      return this;
1789    }
1790
1791    /**
1792     * @return Explanation of why this message definition is needed and why it has been designed as it has.
1793     */
1794    public String getPurpose() { 
1795      return this.purpose == null ? null : this.purpose.getValue();
1796    }
1797
1798    /**
1799     * @param value Explanation of why this message definition is needed and why it has been designed as it has.
1800     */
1801    public MessageDefinition setPurpose(String value) { 
1802      if (value == null)
1803        this.purpose = null;
1804      else {
1805        if (this.purpose == null)
1806          this.purpose = new MarkdownType();
1807        this.purpose.setValue(value);
1808      }
1809      return this;
1810    }
1811
1812    /**
1813     * @return {@link #copyright} (A copyright statement relating to the message definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the message definition.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
1814     */
1815    public MarkdownType getCopyrightElement() { 
1816      if (this.copyright == null)
1817        if (Configuration.errorOnAutoCreate())
1818          throw new Error("Attempt to auto-create MessageDefinition.copyright");
1819        else if (Configuration.doAutoCreate())
1820          this.copyright = new MarkdownType(); // bb
1821      return this.copyright;
1822    }
1823
1824    public boolean hasCopyrightElement() { 
1825      return this.copyright != null && !this.copyright.isEmpty();
1826    }
1827
1828    public boolean hasCopyright() { 
1829      return this.copyright != null && !this.copyright.isEmpty();
1830    }
1831
1832    /**
1833     * @param value {@link #copyright} (A copyright statement relating to the message definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the message definition.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
1834     */
1835    public MessageDefinition setCopyrightElement(MarkdownType value) { 
1836      this.copyright = value;
1837      return this;
1838    }
1839
1840    /**
1841     * @return A copyright statement relating to the message definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the message definition.
1842     */
1843    public String getCopyright() { 
1844      return this.copyright == null ? null : this.copyright.getValue();
1845    }
1846
1847    /**
1848     * @param value A copyright statement relating to the message definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the message definition.
1849     */
1850    public MessageDefinition setCopyright(String value) { 
1851      if (value == null)
1852        this.copyright = null;
1853      else {
1854        if (this.copyright == null)
1855          this.copyright = new MarkdownType();
1856        this.copyright.setValue(value);
1857      }
1858      return this;
1859    }
1860
1861    /**
1862     * @return {@link #base} (The MessageDefinition that is the basis for the contents of this resource.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value
1863     */
1864    public CanonicalType getBaseElement() { 
1865      if (this.base == null)
1866        if (Configuration.errorOnAutoCreate())
1867          throw new Error("Attempt to auto-create MessageDefinition.base");
1868        else if (Configuration.doAutoCreate())
1869          this.base = new CanonicalType(); // bb
1870      return this.base;
1871    }
1872
1873    public boolean hasBaseElement() { 
1874      return this.base != null && !this.base.isEmpty();
1875    }
1876
1877    public boolean hasBase() { 
1878      return this.base != null && !this.base.isEmpty();
1879    }
1880
1881    /**
1882     * @param value {@link #base} (The MessageDefinition that is the basis for the contents of this resource.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value
1883     */
1884    public MessageDefinition setBaseElement(CanonicalType value) { 
1885      this.base = value;
1886      return this;
1887    }
1888
1889    /**
1890     * @return The MessageDefinition that is the basis for the contents of this resource.
1891     */
1892    public String getBase() { 
1893      return this.base == null ? null : this.base.getValue();
1894    }
1895
1896    /**
1897     * @param value The MessageDefinition that is the basis for the contents of this resource.
1898     */
1899    public MessageDefinition setBase(String value) { 
1900      if (Utilities.noString(value))
1901        this.base = null;
1902      else {
1903        if (this.base == null)
1904          this.base = new CanonicalType();
1905        this.base.setValue(value);
1906      }
1907      return this;
1908    }
1909
1910    /**
1911     * @return {@link #parent} (Identifies a protocol or workflow that this MessageDefinition represents a step in.)
1912     */
1913    public List<CanonicalType> getParent() { 
1914      if (this.parent == null)
1915        this.parent = new ArrayList<CanonicalType>();
1916      return this.parent;
1917    }
1918
1919    /**
1920     * @return Returns a reference to <code>this</code> for easy method chaining
1921     */
1922    public MessageDefinition setParent(List<CanonicalType> theParent) { 
1923      this.parent = theParent;
1924      return this;
1925    }
1926
1927    public boolean hasParent() { 
1928      if (this.parent == null)
1929        return false;
1930      for (CanonicalType item : this.parent)
1931        if (!item.isEmpty())
1932          return true;
1933      return false;
1934    }
1935
1936    /**
1937     * @return {@link #parent} (Identifies a protocol or workflow that this MessageDefinition represents a step in.)
1938     */
1939    public CanonicalType addParentElement() {//2 
1940      CanonicalType t = new CanonicalType();
1941      if (this.parent == null)
1942        this.parent = new ArrayList<CanonicalType>();
1943      this.parent.add(t);
1944      return t;
1945    }
1946
1947    /**
1948     * @param value {@link #parent} (Identifies a protocol or workflow that this MessageDefinition represents a step in.)
1949     */
1950    public MessageDefinition addParent(String value) { //1
1951      CanonicalType t = new CanonicalType();
1952      t.setValue(value);
1953      if (this.parent == null)
1954        this.parent = new ArrayList<CanonicalType>();
1955      this.parent.add(t);
1956      return this;
1957    }
1958
1959    /**
1960     * @param value {@link #parent} (Identifies a protocol or workflow that this MessageDefinition represents a step in.)
1961     */
1962    public boolean hasParent(String value) { 
1963      if (this.parent == null)
1964        return false;
1965      for (CanonicalType v : this.parent)
1966        if (v.getValue().equals(value)) // canonical(ActivityDefinition|PlanDefinition)
1967          return true;
1968      return false;
1969    }
1970
1971    /**
1972     * @return {@link #event} (Event code or link to the EventDefinition.)
1973     */
1974    public Type getEvent() { 
1975      return this.event;
1976    }
1977
1978    /**
1979     * @return {@link #event} (Event code or link to the EventDefinition.)
1980     */
1981    public Coding getEventCoding() throws FHIRException { 
1982      if (this.event == null)
1983        this.event = new Coding();
1984      if (!(this.event instanceof Coding))
1985        throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.event.getClass().getName()+" was encountered");
1986      return (Coding) this.event;
1987    }
1988
1989    public boolean hasEventCoding() { 
1990      return this != null && this.event instanceof Coding;
1991    }
1992
1993    /**
1994     * @return {@link #event} (Event code or link to the EventDefinition.)
1995     */
1996    public UriType getEventUriType() throws FHIRException { 
1997      if (this.event == null)
1998        this.event = new UriType();
1999      if (!(this.event instanceof UriType))
2000        throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.event.getClass().getName()+" was encountered");
2001      return (UriType) this.event;
2002    }
2003
2004    public boolean hasEventUriType() { 
2005      return this != null && this.event instanceof UriType;
2006    }
2007
2008    public boolean hasEvent() { 
2009      return this.event != null && !this.event.isEmpty();
2010    }
2011
2012    /**
2013     * @param value {@link #event} (Event code or link to the EventDefinition.)
2014     */
2015    public MessageDefinition setEvent(Type value) { 
2016      if (value != null && !(value instanceof Coding || value instanceof UriType))
2017        throw new Error("Not the right type for MessageDefinition.event[x]: "+value.fhirType());
2018      this.event = value;
2019      return this;
2020    }
2021
2022    /**
2023     * @return {@link #category} (The impact of the content of the message.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value
2024     */
2025    public Enumeration<MessageSignificanceCategory> getCategoryElement() { 
2026      if (this.category == null)
2027        if (Configuration.errorOnAutoCreate())
2028          throw new Error("Attempt to auto-create MessageDefinition.category");
2029        else if (Configuration.doAutoCreate())
2030          this.category = new Enumeration<MessageSignificanceCategory>(new MessageSignificanceCategoryEnumFactory()); // bb
2031      return this.category;
2032    }
2033
2034    public boolean hasCategoryElement() { 
2035      return this.category != null && !this.category.isEmpty();
2036    }
2037
2038    public boolean hasCategory() { 
2039      return this.category != null && !this.category.isEmpty();
2040    }
2041
2042    /**
2043     * @param value {@link #category} (The impact of the content of the message.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value
2044     */
2045    public MessageDefinition setCategoryElement(Enumeration<MessageSignificanceCategory> value) { 
2046      this.category = value;
2047      return this;
2048    }
2049
2050    /**
2051     * @return The impact of the content of the message.
2052     */
2053    public MessageSignificanceCategory getCategory() { 
2054      return this.category == null ? null : this.category.getValue();
2055    }
2056
2057    /**
2058     * @param value The impact of the content of the message.
2059     */
2060    public MessageDefinition setCategory(MessageSignificanceCategory value) { 
2061      if (value == null)
2062        this.category = null;
2063      else {
2064        if (this.category == null)
2065          this.category = new Enumeration<MessageSignificanceCategory>(new MessageSignificanceCategoryEnumFactory());
2066        this.category.setValue(value);
2067      }
2068      return this;
2069    }
2070
2071    /**
2072     * @return {@link #focus} (Identifies the resource (or resources) that are being addressed by the event.  For example, the Encounter for an admit message or two Account records for a merge.)
2073     */
2074    public List<MessageDefinitionFocusComponent> getFocus() { 
2075      if (this.focus == null)
2076        this.focus = new ArrayList<MessageDefinitionFocusComponent>();
2077      return this.focus;
2078    }
2079
2080    /**
2081     * @return Returns a reference to <code>this</code> for easy method chaining
2082     */
2083    public MessageDefinition setFocus(List<MessageDefinitionFocusComponent> theFocus) { 
2084      this.focus = theFocus;
2085      return this;
2086    }
2087
2088    public boolean hasFocus() { 
2089      if (this.focus == null)
2090        return false;
2091      for (MessageDefinitionFocusComponent item : this.focus)
2092        if (!item.isEmpty())
2093          return true;
2094      return false;
2095    }
2096
2097    public MessageDefinitionFocusComponent addFocus() { //3
2098      MessageDefinitionFocusComponent t = new MessageDefinitionFocusComponent();
2099      if (this.focus == null)
2100        this.focus = new ArrayList<MessageDefinitionFocusComponent>();
2101      this.focus.add(t);
2102      return t;
2103    }
2104
2105    public MessageDefinition addFocus(MessageDefinitionFocusComponent t) { //3
2106      if (t == null)
2107        return this;
2108      if (this.focus == null)
2109        this.focus = new ArrayList<MessageDefinitionFocusComponent>();
2110      this.focus.add(t);
2111      return this;
2112    }
2113
2114    /**
2115     * @return The first repetition of repeating field {@link #focus}, creating it if it does not already exist
2116     */
2117    public MessageDefinitionFocusComponent getFocusFirstRep() { 
2118      if (getFocus().isEmpty()) {
2119        addFocus();
2120      }
2121      return getFocus().get(0);
2122    }
2123
2124    /**
2125     * @return {@link #responseRequired} (Declare at a message definition level whether a response is required or only upon error or success, or never.). This is the underlying object with id, value and extensions. The accessor "getResponseRequired" gives direct access to the value
2126     */
2127    public Enumeration<MessageheaderResponseRequest> getResponseRequiredElement() { 
2128      if (this.responseRequired == null)
2129        if (Configuration.errorOnAutoCreate())
2130          throw new Error("Attempt to auto-create MessageDefinition.responseRequired");
2131        else if (Configuration.doAutoCreate())
2132          this.responseRequired = new Enumeration<MessageheaderResponseRequest>(new MessageheaderResponseRequestEnumFactory()); // bb
2133      return this.responseRequired;
2134    }
2135
2136    public boolean hasResponseRequiredElement() { 
2137      return this.responseRequired != null && !this.responseRequired.isEmpty();
2138    }
2139
2140    public boolean hasResponseRequired() { 
2141      return this.responseRequired != null && !this.responseRequired.isEmpty();
2142    }
2143
2144    /**
2145     * @param value {@link #responseRequired} (Declare at a message definition level whether a response is required or only upon error or success, or never.). This is the underlying object with id, value and extensions. The accessor "getResponseRequired" gives direct access to the value
2146     */
2147    public MessageDefinition setResponseRequiredElement(Enumeration<MessageheaderResponseRequest> value) { 
2148      this.responseRequired = value;
2149      return this;
2150    }
2151
2152    /**
2153     * @return Declare at a message definition level whether a response is required or only upon error or success, or never.
2154     */
2155    public MessageheaderResponseRequest getResponseRequired() { 
2156      return this.responseRequired == null ? null : this.responseRequired.getValue();
2157    }
2158
2159    /**
2160     * @param value Declare at a message definition level whether a response is required or only upon error or success, or never.
2161     */
2162    public MessageDefinition setResponseRequired(MessageheaderResponseRequest value) { 
2163      if (value == null)
2164        this.responseRequired = null;
2165      else {
2166        if (this.responseRequired == null)
2167          this.responseRequired = new Enumeration<MessageheaderResponseRequest>(new MessageheaderResponseRequestEnumFactory());
2168        this.responseRequired.setValue(value);
2169      }
2170      return this;
2171    }
2172
2173    /**
2174     * @return {@link #allowedResponse} (Indicates what types of messages may be sent as an application-level response to this message.)
2175     */
2176    public List<MessageDefinitionAllowedResponseComponent> getAllowedResponse() { 
2177      if (this.allowedResponse == null)
2178        this.allowedResponse = new ArrayList<MessageDefinitionAllowedResponseComponent>();
2179      return this.allowedResponse;
2180    }
2181
2182    /**
2183     * @return Returns a reference to <code>this</code> for easy method chaining
2184     */
2185    public MessageDefinition setAllowedResponse(List<MessageDefinitionAllowedResponseComponent> theAllowedResponse) { 
2186      this.allowedResponse = theAllowedResponse;
2187      return this;
2188    }
2189
2190    public boolean hasAllowedResponse() { 
2191      if (this.allowedResponse == null)
2192        return false;
2193      for (MessageDefinitionAllowedResponseComponent item : this.allowedResponse)
2194        if (!item.isEmpty())
2195          return true;
2196      return false;
2197    }
2198
2199    public MessageDefinitionAllowedResponseComponent addAllowedResponse() { //3
2200      MessageDefinitionAllowedResponseComponent t = new MessageDefinitionAllowedResponseComponent();
2201      if (this.allowedResponse == null)
2202        this.allowedResponse = new ArrayList<MessageDefinitionAllowedResponseComponent>();
2203      this.allowedResponse.add(t);
2204      return t;
2205    }
2206
2207    public MessageDefinition addAllowedResponse(MessageDefinitionAllowedResponseComponent t) { //3
2208      if (t == null)
2209        return this;
2210      if (this.allowedResponse == null)
2211        this.allowedResponse = new ArrayList<MessageDefinitionAllowedResponseComponent>();
2212      this.allowedResponse.add(t);
2213      return this;
2214    }
2215
2216    /**
2217     * @return The first repetition of repeating field {@link #allowedResponse}, creating it if it does not already exist
2218     */
2219    public MessageDefinitionAllowedResponseComponent getAllowedResponseFirstRep() { 
2220      if (getAllowedResponse().isEmpty()) {
2221        addAllowedResponse();
2222      }
2223      return getAllowedResponse().get(0);
2224    }
2225
2226    /**
2227     * @return {@link #graph} (Canonical reference to a GraphDefinition. If a URL is provided, it is the canonical reference to a [[[GraphDefinition]]] that it controls what resources are to be added to the bundle when building the document. The GraphDefinition can also specify profiles that apply to the various resources.)
2228     */
2229    public List<CanonicalType> getGraph() { 
2230      if (this.graph == null)
2231        this.graph = new ArrayList<CanonicalType>();
2232      return this.graph;
2233    }
2234
2235    /**
2236     * @return Returns a reference to <code>this</code> for easy method chaining
2237     */
2238    public MessageDefinition setGraph(List<CanonicalType> theGraph) { 
2239      this.graph = theGraph;
2240      return this;
2241    }
2242
2243    public boolean hasGraph() { 
2244      if (this.graph == null)
2245        return false;
2246      for (CanonicalType item : this.graph)
2247        if (!item.isEmpty())
2248          return true;
2249      return false;
2250    }
2251
2252    /**
2253     * @return {@link #graph} (Canonical reference to a GraphDefinition. If a URL is provided, it is the canonical reference to a [[[GraphDefinition]]] that it controls what resources are to be added to the bundle when building the document. The GraphDefinition can also specify profiles that apply to the various resources.)
2254     */
2255    public CanonicalType addGraphElement() {//2 
2256      CanonicalType t = new CanonicalType();
2257      if (this.graph == null)
2258        this.graph = new ArrayList<CanonicalType>();
2259      this.graph.add(t);
2260      return t;
2261    }
2262
2263    /**
2264     * @param value {@link #graph} (Canonical reference to a GraphDefinition. If a URL is provided, it is the canonical reference to a [[[GraphDefinition]]] that it controls what resources are to be added to the bundle when building the document. The GraphDefinition can also specify profiles that apply to the various resources.)
2265     */
2266    public MessageDefinition addGraph(String value) { //1
2267      CanonicalType t = new CanonicalType();
2268      t.setValue(value);
2269      if (this.graph == null)
2270        this.graph = new ArrayList<CanonicalType>();
2271      this.graph.add(t);
2272      return this;
2273    }
2274
2275    /**
2276     * @param value {@link #graph} (Canonical reference to a GraphDefinition. If a URL is provided, it is the canonical reference to a [[[GraphDefinition]]] that it controls what resources are to be added to the bundle when building the document. The GraphDefinition can also specify profiles that apply to the various resources.)
2277     */
2278    public boolean hasGraph(String value) { 
2279      if (this.graph == null)
2280        return false;
2281      for (CanonicalType v : this.graph)
2282        if (v.getValue().equals(value)) // canonical(GraphDefinition)
2283          return true;
2284      return false;
2285    }
2286
2287      protected void listChildren(List<Property> children) {
2288        super.listChildren(children);
2289        children.add(new Property("url", "uri", "The business identifier that is used to reference the MessageDefinition and *is* expected to be consistent from server to server.", 0, 1, url));
2290        children.add(new Property("identifier", "Identifier", "A formal identifier that is used to identify this message definition when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier));
2291        children.add(new Property("version", "string", "The identifier that is used to identify this version of the message definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the message definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.", 0, 1, version));
2292        children.add(new Property("name", "string", "A natural language name identifying the message definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name));
2293        children.add(new Property("title", "string", "A short, descriptive, user-friendly title for the message definition.", 0, 1, title));
2294        children.add(new Property("replaces", "canonical(MessageDefinition)", "A MessageDefinition that is superseded by this definition.", 0, java.lang.Integer.MAX_VALUE, replaces));
2295        children.add(new Property("status", "code", "The status of this message definition. Enables tracking the life-cycle of the content.", 0, 1, status));
2296        children.add(new Property("experimental", "boolean", "A Boolean value to indicate that this message definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.", 0, 1, experimental));
2297        children.add(new Property("date", "dateTime", "The date  (and optionally time) when the message definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the message definition changes.", 0, 1, date));
2298        children.add(new Property("publisher", "string", "The name of the organization or individual that published the message definition.", 0, 1, publisher));
2299        children.add(new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact));
2300        children.add(new Property("description", "markdown", "A free text natural language description of the message definition from a consumer's perspective.", 0, 1, description));
2301        children.add(new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate message definition instances.", 0, java.lang.Integer.MAX_VALUE, useContext));
2302        children.add(new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the message definition is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction));
2303        children.add(new Property("purpose", "markdown", "Explanation of why this message definition is needed and why it has been designed as it has.", 0, 1, purpose));
2304        children.add(new Property("copyright", "markdown", "A copyright statement relating to the message definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the message definition.", 0, 1, copyright));
2305        children.add(new Property("base", "canonical(MessageDefinition)", "The MessageDefinition that is the basis for the contents of this resource.", 0, 1, base));
2306        children.add(new Property("parent", "canonical(ActivityDefinition|PlanDefinition)", "Identifies a protocol or workflow that this MessageDefinition represents a step in.", 0, java.lang.Integer.MAX_VALUE, parent));
2307        children.add(new Property("event[x]", "Coding|uri", "Event code or link to the EventDefinition.", 0, 1, event));
2308        children.add(new Property("category", "code", "The impact of the content of the message.", 0, 1, category));
2309        children.add(new Property("focus", "", "Identifies the resource (or resources) that are being addressed by the event.  For example, the Encounter for an admit message or two Account records for a merge.", 0, java.lang.Integer.MAX_VALUE, focus));
2310        children.add(new Property("responseRequired", "code", "Declare at a message definition level whether a response is required or only upon error or success, or never.", 0, 1, responseRequired));
2311        children.add(new Property("allowedResponse", "", "Indicates what types of messages may be sent as an application-level response to this message.", 0, java.lang.Integer.MAX_VALUE, allowedResponse));
2312        children.add(new Property("graph", "canonical(GraphDefinition)", "Canonical reference to a GraphDefinition. If a URL is provided, it is the canonical reference to a [[[GraphDefinition]]] that it controls what resources are to be added to the bundle when building the document. The GraphDefinition can also specify profiles that apply to the various resources.", 0, java.lang.Integer.MAX_VALUE, graph));
2313      }
2314
2315      @Override
2316      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2317        switch (_hash) {
2318        case 116079: /*url*/  return new Property("url", "uri", "The business identifier that is used to reference the MessageDefinition and *is* expected to be consistent from server to server.", 0, 1, url);
2319        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A formal identifier that is used to identify this message definition when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier);
2320        case 351608024: /*version*/  return new Property("version", "string", "The identifier that is used to identify this version of the message definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the message definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.", 0, 1, version);
2321        case 3373707: /*name*/  return new Property("name", "string", "A natural language name identifying the message definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name);
2322        case 110371416: /*title*/  return new Property("title", "string", "A short, descriptive, user-friendly title for the message definition.", 0, 1, title);
2323        case -430332865: /*replaces*/  return new Property("replaces", "canonical(MessageDefinition)", "A MessageDefinition that is superseded by this definition.", 0, java.lang.Integer.MAX_VALUE, replaces);
2324        case -892481550: /*status*/  return new Property("status", "code", "The status of this message definition. Enables tracking the life-cycle of the content.", 0, 1, status);
2325        case -404562712: /*experimental*/  return new Property("experimental", "boolean", "A Boolean value to indicate that this message definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.", 0, 1, experimental);
2326        case 3076014: /*date*/  return new Property("date", "dateTime", "The date  (and optionally time) when the message definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the message definition changes.", 0, 1, date);
2327        case 1447404028: /*publisher*/  return new Property("publisher", "string", "The name of the organization or individual that published the message definition.", 0, 1, publisher);
2328        case 951526432: /*contact*/  return new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact);
2329        case -1724546052: /*description*/  return new Property("description", "markdown", "A free text natural language description of the message definition from a consumer's perspective.", 0, 1, description);
2330        case -669707736: /*useContext*/  return new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate message definition instances.", 0, java.lang.Integer.MAX_VALUE, useContext);
2331        case -507075711: /*jurisdiction*/  return new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the message definition is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction);
2332        case -220463842: /*purpose*/  return new Property("purpose", "markdown", "Explanation of why this message definition is needed and why it has been designed as it has.", 0, 1, purpose);
2333        case 1522889671: /*copyright*/  return new Property("copyright", "markdown", "A copyright statement relating to the message definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the message definition.", 0, 1, copyright);
2334        case 3016401: /*base*/  return new Property("base", "canonical(MessageDefinition)", "The MessageDefinition that is the basis for the contents of this resource.", 0, 1, base);
2335        case -995424086: /*parent*/  return new Property("parent", "canonical(ActivityDefinition|PlanDefinition)", "Identifies a protocol or workflow that this MessageDefinition represents a step in.", 0, java.lang.Integer.MAX_VALUE, parent);
2336        case 278115238: /*event[x]*/  return new Property("event[x]", "Coding|uri", "Event code or link to the EventDefinition.", 0, 1, event);
2337        case 96891546: /*event*/  return new Property("event[x]", "Coding|uri", "Event code or link to the EventDefinition.", 0, 1, event);
2338        case -355957084: /*eventCoding*/  return new Property("event[x]", "Coding|uri", "Event code or link to the EventDefinition.", 0, 1, event);
2339        case 278109298: /*eventUri*/  return new Property("event[x]", "Coding|uri", "Event code or link to the EventDefinition.", 0, 1, event);
2340        case 50511102: /*category*/  return new Property("category", "code", "The impact of the content of the message.", 0, 1, category);
2341        case 97604824: /*focus*/  return new Property("focus", "", "Identifies the resource (or resources) that are being addressed by the event.  For example, the Encounter for an admit message or two Account records for a merge.", 0, java.lang.Integer.MAX_VALUE, focus);
2342        case 791597824: /*responseRequired*/  return new Property("responseRequired", "code", "Declare at a message definition level whether a response is required or only upon error or success, or never.", 0, 1, responseRequired);
2343        case -1130933751: /*allowedResponse*/  return new Property("allowedResponse", "", "Indicates what types of messages may be sent as an application-level response to this message.", 0, java.lang.Integer.MAX_VALUE, allowedResponse);
2344        case 98615630: /*graph*/  return new Property("graph", "canonical(GraphDefinition)", "Canonical reference to a GraphDefinition. If a URL is provided, it is the canonical reference to a [[[GraphDefinition]]] that it controls what resources are to be added to the bundle when building the document. The GraphDefinition can also specify profiles that apply to the various resources.", 0, java.lang.Integer.MAX_VALUE, graph);
2345        default: return super.getNamedProperty(_hash, _name, _checkValid);
2346        }
2347
2348      }
2349
2350      @Override
2351      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2352        switch (hash) {
2353        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
2354        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2355        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
2356        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
2357        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
2358        case -430332865: /*replaces*/ return this.replaces == null ? new Base[0] : this.replaces.toArray(new Base[this.replaces.size()]); // CanonicalType
2359        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
2360        case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType
2361        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
2362        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType
2363        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
2364        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
2365        case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
2366        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept
2367        case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // MarkdownType
2368        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
2369        case 3016401: /*base*/ return this.base == null ? new Base[0] : new Base[] {this.base}; // CanonicalType
2370        case -995424086: /*parent*/ return this.parent == null ? new Base[0] : this.parent.toArray(new Base[this.parent.size()]); // CanonicalType
2371        case 96891546: /*event*/ return this.event == null ? new Base[0] : new Base[] {this.event}; // Type
2372        case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Enumeration<MessageSignificanceCategory>
2373        case 97604824: /*focus*/ return this.focus == null ? new Base[0] : this.focus.toArray(new Base[this.focus.size()]); // MessageDefinitionFocusComponent
2374        case 791597824: /*responseRequired*/ return this.responseRequired == null ? new Base[0] : new Base[] {this.responseRequired}; // Enumeration<MessageheaderResponseRequest>
2375        case -1130933751: /*allowedResponse*/ return this.allowedResponse == null ? new Base[0] : this.allowedResponse.toArray(new Base[this.allowedResponse.size()]); // MessageDefinitionAllowedResponseComponent
2376        case 98615630: /*graph*/ return this.graph == null ? new Base[0] : this.graph.toArray(new Base[this.graph.size()]); // CanonicalType
2377        default: return super.getProperty(hash, name, checkValid);
2378        }
2379
2380      }
2381
2382      @Override
2383      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2384        switch (hash) {
2385        case 116079: // url
2386          this.url = castToUri(value); // UriType
2387          return value;
2388        case -1618432855: // identifier
2389          this.getIdentifier().add(castToIdentifier(value)); // Identifier
2390          return value;
2391        case 351608024: // version
2392          this.version = castToString(value); // StringType
2393          return value;
2394        case 3373707: // name
2395          this.name = castToString(value); // StringType
2396          return value;
2397        case 110371416: // title
2398          this.title = castToString(value); // StringType
2399          return value;
2400        case -430332865: // replaces
2401          this.getReplaces().add(castToCanonical(value)); // CanonicalType
2402          return value;
2403        case -892481550: // status
2404          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
2405          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
2406          return value;
2407        case -404562712: // experimental
2408          this.experimental = castToBoolean(value); // BooleanType
2409          return value;
2410        case 3076014: // date
2411          this.date = castToDateTime(value); // DateTimeType
2412          return value;
2413        case 1447404028: // publisher
2414          this.publisher = castToString(value); // StringType
2415          return value;
2416        case 951526432: // contact
2417          this.getContact().add(castToContactDetail(value)); // ContactDetail
2418          return value;
2419        case -1724546052: // description
2420          this.description = castToMarkdown(value); // MarkdownType
2421          return value;
2422        case -669707736: // useContext
2423          this.getUseContext().add(castToUsageContext(value)); // UsageContext
2424          return value;
2425        case -507075711: // jurisdiction
2426          this.getJurisdiction().add(castToCodeableConcept(value)); // CodeableConcept
2427          return value;
2428        case -220463842: // purpose
2429          this.purpose = castToMarkdown(value); // MarkdownType
2430          return value;
2431        case 1522889671: // copyright
2432          this.copyright = castToMarkdown(value); // MarkdownType
2433          return value;
2434        case 3016401: // base
2435          this.base = castToCanonical(value); // CanonicalType
2436          return value;
2437        case -995424086: // parent
2438          this.getParent().add(castToCanonical(value)); // CanonicalType
2439          return value;
2440        case 96891546: // event
2441          this.event = castToType(value); // Type
2442          return value;
2443        case 50511102: // category
2444          value = new MessageSignificanceCategoryEnumFactory().fromType(castToCode(value));
2445          this.category = (Enumeration) value; // Enumeration<MessageSignificanceCategory>
2446          return value;
2447        case 97604824: // focus
2448          this.getFocus().add((MessageDefinitionFocusComponent) value); // MessageDefinitionFocusComponent
2449          return value;
2450        case 791597824: // responseRequired
2451          value = new MessageheaderResponseRequestEnumFactory().fromType(castToCode(value));
2452          this.responseRequired = (Enumeration) value; // Enumeration<MessageheaderResponseRequest>
2453          return value;
2454        case -1130933751: // allowedResponse
2455          this.getAllowedResponse().add((MessageDefinitionAllowedResponseComponent) value); // MessageDefinitionAllowedResponseComponent
2456          return value;
2457        case 98615630: // graph
2458          this.getGraph().add(castToCanonical(value)); // CanonicalType
2459          return value;
2460        default: return super.setProperty(hash, name, value);
2461        }
2462
2463      }
2464
2465      @Override
2466      public Base setProperty(String name, Base value) throws FHIRException {
2467        if (name.equals("url")) {
2468          this.url = castToUri(value); // UriType
2469        } else if (name.equals("identifier")) {
2470          this.getIdentifier().add(castToIdentifier(value));
2471        } else if (name.equals("version")) {
2472          this.version = castToString(value); // StringType
2473        } else if (name.equals("name")) {
2474          this.name = castToString(value); // StringType
2475        } else if (name.equals("title")) {
2476          this.title = castToString(value); // StringType
2477        } else if (name.equals("replaces")) {
2478          this.getReplaces().add(castToCanonical(value));
2479        } else if (name.equals("status")) {
2480          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
2481          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
2482        } else if (name.equals("experimental")) {
2483          this.experimental = castToBoolean(value); // BooleanType
2484        } else if (name.equals("date")) {
2485          this.date = castToDateTime(value); // DateTimeType
2486        } else if (name.equals("publisher")) {
2487          this.publisher = castToString(value); // StringType
2488        } else if (name.equals("contact")) {
2489          this.getContact().add(castToContactDetail(value));
2490        } else if (name.equals("description")) {
2491          this.description = castToMarkdown(value); // MarkdownType
2492        } else if (name.equals("useContext")) {
2493          this.getUseContext().add(castToUsageContext(value));
2494        } else if (name.equals("jurisdiction")) {
2495          this.getJurisdiction().add(castToCodeableConcept(value));
2496        } else if (name.equals("purpose")) {
2497          this.purpose = castToMarkdown(value); // MarkdownType
2498        } else if (name.equals("copyright")) {
2499          this.copyright = castToMarkdown(value); // MarkdownType
2500        } else if (name.equals("base")) {
2501          this.base = castToCanonical(value); // CanonicalType
2502        } else if (name.equals("parent")) {
2503          this.getParent().add(castToCanonical(value));
2504        } else if (name.equals("event[x]")) {
2505          this.event = castToType(value); // Type
2506        } else if (name.equals("category")) {
2507          value = new MessageSignificanceCategoryEnumFactory().fromType(castToCode(value));
2508          this.category = (Enumeration) value; // Enumeration<MessageSignificanceCategory>
2509        } else if (name.equals("focus")) {
2510          this.getFocus().add((MessageDefinitionFocusComponent) value);
2511        } else if (name.equals("responseRequired")) {
2512          value = new MessageheaderResponseRequestEnumFactory().fromType(castToCode(value));
2513          this.responseRequired = (Enumeration) value; // Enumeration<MessageheaderResponseRequest>
2514        } else if (name.equals("allowedResponse")) {
2515          this.getAllowedResponse().add((MessageDefinitionAllowedResponseComponent) value);
2516        } else if (name.equals("graph")) {
2517          this.getGraph().add(castToCanonical(value));
2518        } else
2519          return super.setProperty(name, value);
2520        return value;
2521      }
2522
2523      @Override
2524      public Base makeProperty(int hash, String name) throws FHIRException {
2525        switch (hash) {
2526        case 116079:  return getUrlElement();
2527        case -1618432855:  return addIdentifier(); 
2528        case 351608024:  return getVersionElement();
2529        case 3373707:  return getNameElement();
2530        case 110371416:  return getTitleElement();
2531        case -430332865:  return addReplacesElement();
2532        case -892481550:  return getStatusElement();
2533        case -404562712:  return getExperimentalElement();
2534        case 3076014:  return getDateElement();
2535        case 1447404028:  return getPublisherElement();
2536        case 951526432:  return addContact(); 
2537        case -1724546052:  return getDescriptionElement();
2538        case -669707736:  return addUseContext(); 
2539        case -507075711:  return addJurisdiction(); 
2540        case -220463842:  return getPurposeElement();
2541        case 1522889671:  return getCopyrightElement();
2542        case 3016401:  return getBaseElement();
2543        case -995424086:  return addParentElement();
2544        case 278115238:  return getEvent();
2545        case 96891546:  return getEvent();
2546        case 50511102:  return getCategoryElement();
2547        case 97604824:  return addFocus(); 
2548        case 791597824:  return getResponseRequiredElement();
2549        case -1130933751:  return addAllowedResponse(); 
2550        case 98615630:  return addGraphElement();
2551        default: return super.makeProperty(hash, name);
2552        }
2553
2554      }
2555
2556      @Override
2557      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2558        switch (hash) {
2559        case 116079: /*url*/ return new String[] {"uri"};
2560        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2561        case 351608024: /*version*/ return new String[] {"string"};
2562        case 3373707: /*name*/ return new String[] {"string"};
2563        case 110371416: /*title*/ return new String[] {"string"};
2564        case -430332865: /*replaces*/ return new String[] {"canonical"};
2565        case -892481550: /*status*/ return new String[] {"code"};
2566        case -404562712: /*experimental*/ return new String[] {"boolean"};
2567        case 3076014: /*date*/ return new String[] {"dateTime"};
2568        case 1447404028: /*publisher*/ return new String[] {"string"};
2569        case 951526432: /*contact*/ return new String[] {"ContactDetail"};
2570        case -1724546052: /*description*/ return new String[] {"markdown"};
2571        case -669707736: /*useContext*/ return new String[] {"UsageContext"};
2572        case -507075711: /*jurisdiction*/ return new String[] {"CodeableConcept"};
2573        case -220463842: /*purpose*/ return new String[] {"markdown"};
2574        case 1522889671: /*copyright*/ return new String[] {"markdown"};
2575        case 3016401: /*base*/ return new String[] {"canonical"};
2576        case -995424086: /*parent*/ return new String[] {"canonical"};
2577        case 96891546: /*event*/ return new String[] {"Coding", "uri"};
2578        case 50511102: /*category*/ return new String[] {"code"};
2579        case 97604824: /*focus*/ return new String[] {};
2580        case 791597824: /*responseRequired*/ return new String[] {"code"};
2581        case -1130933751: /*allowedResponse*/ return new String[] {};
2582        case 98615630: /*graph*/ return new String[] {"canonical"};
2583        default: return super.getTypesForProperty(hash, name);
2584        }
2585
2586      }
2587
2588      @Override
2589      public Base addChild(String name) throws FHIRException {
2590        if (name.equals("url")) {
2591          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.url");
2592        }
2593        else if (name.equals("identifier")) {
2594          return addIdentifier();
2595        }
2596        else if (name.equals("version")) {
2597          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.version");
2598        }
2599        else if (name.equals("name")) {
2600          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.name");
2601        }
2602        else if (name.equals("title")) {
2603          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.title");
2604        }
2605        else if (name.equals("replaces")) {
2606          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.replaces");
2607        }
2608        else if (name.equals("status")) {
2609          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.status");
2610        }
2611        else if (name.equals("experimental")) {
2612          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.experimental");
2613        }
2614        else if (name.equals("date")) {
2615          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.date");
2616        }
2617        else if (name.equals("publisher")) {
2618          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.publisher");
2619        }
2620        else if (name.equals("contact")) {
2621          return addContact();
2622        }
2623        else if (name.equals("description")) {
2624          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.description");
2625        }
2626        else if (name.equals("useContext")) {
2627          return addUseContext();
2628        }
2629        else if (name.equals("jurisdiction")) {
2630          return addJurisdiction();
2631        }
2632        else if (name.equals("purpose")) {
2633          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.purpose");
2634        }
2635        else if (name.equals("copyright")) {
2636          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.copyright");
2637        }
2638        else if (name.equals("base")) {
2639          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.base");
2640        }
2641        else if (name.equals("parent")) {
2642          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.parent");
2643        }
2644        else if (name.equals("eventCoding")) {
2645          this.event = new Coding();
2646          return this.event;
2647        }
2648        else if (name.equals("eventUri")) {
2649          this.event = new UriType();
2650          return this.event;
2651        }
2652        else if (name.equals("category")) {
2653          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.category");
2654        }
2655        else if (name.equals("focus")) {
2656          return addFocus();
2657        }
2658        else if (name.equals("responseRequired")) {
2659          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.responseRequired");
2660        }
2661        else if (name.equals("allowedResponse")) {
2662          return addAllowedResponse();
2663        }
2664        else if (name.equals("graph")) {
2665          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.graph");
2666        }
2667        else
2668          return super.addChild(name);
2669      }
2670
2671  public String fhirType() {
2672    return "MessageDefinition";
2673
2674  }
2675
2676      public MessageDefinition copy() {
2677        MessageDefinition dst = new MessageDefinition();
2678        copyValues(dst);
2679        return dst;
2680      }
2681
2682      public void copyValues(MessageDefinition dst) {
2683        super.copyValues(dst);
2684        dst.url = url == null ? null : url.copy();
2685        if (identifier != null) {
2686          dst.identifier = new ArrayList<Identifier>();
2687          for (Identifier i : identifier)
2688            dst.identifier.add(i.copy());
2689        };
2690        dst.version = version == null ? null : version.copy();
2691        dst.name = name == null ? null : name.copy();
2692        dst.title = title == null ? null : title.copy();
2693        if (replaces != null) {
2694          dst.replaces = new ArrayList<CanonicalType>();
2695          for (CanonicalType i : replaces)
2696            dst.replaces.add(i.copy());
2697        };
2698        dst.status = status == null ? null : status.copy();
2699        dst.experimental = experimental == null ? null : experimental.copy();
2700        dst.date = date == null ? null : date.copy();
2701        dst.publisher = publisher == null ? null : publisher.copy();
2702        if (contact != null) {
2703          dst.contact = new ArrayList<ContactDetail>();
2704          for (ContactDetail i : contact)
2705            dst.contact.add(i.copy());
2706        };
2707        dst.description = description == null ? null : description.copy();
2708        if (useContext != null) {
2709          dst.useContext = new ArrayList<UsageContext>();
2710          for (UsageContext i : useContext)
2711            dst.useContext.add(i.copy());
2712        };
2713        if (jurisdiction != null) {
2714          dst.jurisdiction = new ArrayList<CodeableConcept>();
2715          for (CodeableConcept i : jurisdiction)
2716            dst.jurisdiction.add(i.copy());
2717        };
2718        dst.purpose = purpose == null ? null : purpose.copy();
2719        dst.copyright = copyright == null ? null : copyright.copy();
2720        dst.base = base == null ? null : base.copy();
2721        if (parent != null) {
2722          dst.parent = new ArrayList<CanonicalType>();
2723          for (CanonicalType i : parent)
2724            dst.parent.add(i.copy());
2725        };
2726        dst.event = event == null ? null : event.copy();
2727        dst.category = category == null ? null : category.copy();
2728        if (focus != null) {
2729          dst.focus = new ArrayList<MessageDefinitionFocusComponent>();
2730          for (MessageDefinitionFocusComponent i : focus)
2731            dst.focus.add(i.copy());
2732        };
2733        dst.responseRequired = responseRequired == null ? null : responseRequired.copy();
2734        if (allowedResponse != null) {
2735          dst.allowedResponse = new ArrayList<MessageDefinitionAllowedResponseComponent>();
2736          for (MessageDefinitionAllowedResponseComponent i : allowedResponse)
2737            dst.allowedResponse.add(i.copy());
2738        };
2739        if (graph != null) {
2740          dst.graph = new ArrayList<CanonicalType>();
2741          for (CanonicalType i : graph)
2742            dst.graph.add(i.copy());
2743        };
2744      }
2745
2746      protected MessageDefinition typedCopy() {
2747        return copy();
2748      }
2749
2750      @Override
2751      public boolean equalsDeep(Base other_) {
2752        if (!super.equalsDeep(other_))
2753          return false;
2754        if (!(other_ instanceof MessageDefinition))
2755          return false;
2756        MessageDefinition o = (MessageDefinition) other_;
2757        return compareDeep(identifier, o.identifier, true) && compareDeep(replaces, o.replaces, true) && compareDeep(purpose, o.purpose, true)
2758           && compareDeep(copyright, o.copyright, true) && compareDeep(base, o.base, true) && compareDeep(parent, o.parent, true)
2759           && compareDeep(event, o.event, true) && compareDeep(category, o.category, true) && compareDeep(focus, o.focus, true)
2760           && compareDeep(responseRequired, o.responseRequired, true) && compareDeep(allowedResponse, o.allowedResponse, true)
2761           && compareDeep(graph, o.graph, true);
2762      }
2763
2764      @Override
2765      public boolean equalsShallow(Base other_) {
2766        if (!super.equalsShallow(other_))
2767          return false;
2768        if (!(other_ instanceof MessageDefinition))
2769          return false;
2770        MessageDefinition o = (MessageDefinition) other_;
2771        return compareValues(purpose, o.purpose, true) && compareValues(copyright, o.copyright, true) && compareValues(category, o.category, true)
2772           && compareValues(responseRequired, o.responseRequired, true);
2773      }
2774
2775      public boolean isEmpty() {
2776        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, replaces, purpose
2777          , copyright, base, parent, event, category, focus, responseRequired, allowedResponse
2778          , graph);
2779      }
2780
2781  @Override
2782  public ResourceType getResourceType() {
2783    return ResourceType.MessageDefinition;
2784   }
2785
2786 /**
2787   * Search parameter: <b>date</b>
2788   * <p>
2789   * Description: <b>The message definition publication date</b><br>
2790   * Type: <b>date</b><br>
2791   * Path: <b>MessageDefinition.date</b><br>
2792   * </p>
2793   */
2794  @SearchParamDefinition(name="date", path="MessageDefinition.date", description="The message definition publication date", type="date" )
2795  public static final String SP_DATE = "date";
2796 /**
2797   * <b>Fluent Client</b> search parameter constant for <b>date</b>
2798   * <p>
2799   * Description: <b>The message definition publication date</b><br>
2800   * Type: <b>date</b><br>
2801   * Path: <b>MessageDefinition.date</b><br>
2802   * </p>
2803   */
2804  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
2805
2806 /**
2807   * Search parameter: <b>identifier</b>
2808   * <p>
2809   * Description: <b>External identifier for the message definition</b><br>
2810   * Type: <b>token</b><br>
2811   * Path: <b>MessageDefinition.identifier</b><br>
2812   * </p>
2813   */
2814  @SearchParamDefinition(name="identifier", path="MessageDefinition.identifier", description="External identifier for the message definition", type="token" )
2815  public static final String SP_IDENTIFIER = "identifier";
2816 /**
2817   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2818   * <p>
2819   * Description: <b>External identifier for the message definition</b><br>
2820   * Type: <b>token</b><br>
2821   * Path: <b>MessageDefinition.identifier</b><br>
2822   * </p>
2823   */
2824  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2825
2826 /**
2827   * Search parameter: <b>parent</b>
2828   * <p>
2829   * Description: <b>A resource that is the parent of the definition</b><br>
2830   * Type: <b>reference</b><br>
2831   * Path: <b>MessageDefinition.parent</b><br>
2832   * </p>
2833   */
2834  @SearchParamDefinition(name="parent", path="MessageDefinition.parent", description="A resource that is the parent of the definition", type="reference", target={ActivityDefinition.class, PlanDefinition.class } )
2835  public static final String SP_PARENT = "parent";
2836 /**
2837   * <b>Fluent Client</b> search parameter constant for <b>parent</b>
2838   * <p>
2839   * Description: <b>A resource that is the parent of the definition</b><br>
2840   * Type: <b>reference</b><br>
2841   * Path: <b>MessageDefinition.parent</b><br>
2842   * </p>
2843   */
2844  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARENT);
2845
2846/**
2847   * Constant for fluent queries to be used to add include statements. Specifies
2848   * the path value of "<b>MessageDefinition:parent</b>".
2849   */
2850  public static final ca.uhn.fhir.model.api.Include INCLUDE_PARENT = new ca.uhn.fhir.model.api.Include("MessageDefinition:parent").toLocked();
2851
2852 /**
2853   * Search parameter: <b>context-type-value</b>
2854   * <p>
2855   * Description: <b>A use context type and value assigned to the message definition</b><br>
2856   * Type: <b>composite</b><br>
2857   * Path: <b></b><br>
2858   * </p>
2859   */
2860  @SearchParamDefinition(name="context-type-value", path="MessageDefinition.useContext", description="A use context type and value assigned to the message definition", type="composite", compositeOf={"context-type", "context"} )
2861  public static final String SP_CONTEXT_TYPE_VALUE = "context-type-value";
2862 /**
2863   * <b>Fluent Client</b> search parameter constant for <b>context-type-value</b>
2864   * <p>
2865   * Description: <b>A use context type and value assigned to the message definition</b><br>
2866   * Type: <b>composite</b><br>
2867   * Path: <b></b><br>
2868   * </p>
2869   */
2870  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam> CONTEXT_TYPE_VALUE = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam>(SP_CONTEXT_TYPE_VALUE);
2871
2872 /**
2873   * Search parameter: <b>jurisdiction</b>
2874   * <p>
2875   * Description: <b>Intended jurisdiction for the message definition</b><br>
2876   * Type: <b>token</b><br>
2877   * Path: <b>MessageDefinition.jurisdiction</b><br>
2878   * </p>
2879   */
2880  @SearchParamDefinition(name="jurisdiction", path="MessageDefinition.jurisdiction", description="Intended jurisdiction for the message definition", type="token" )
2881  public static final String SP_JURISDICTION = "jurisdiction";
2882 /**
2883   * <b>Fluent Client</b> search parameter constant for <b>jurisdiction</b>
2884   * <p>
2885   * Description: <b>Intended jurisdiction for the message definition</b><br>
2886   * Type: <b>token</b><br>
2887   * Path: <b>MessageDefinition.jurisdiction</b><br>
2888   * </p>
2889   */
2890  public static final ca.uhn.fhir.rest.gclient.TokenClientParam JURISDICTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_JURISDICTION);
2891
2892 /**
2893   * Search parameter: <b>description</b>
2894   * <p>
2895   * Description: <b>The description of the message definition</b><br>
2896   * Type: <b>string</b><br>
2897   * Path: <b>MessageDefinition.description</b><br>
2898   * </p>
2899   */
2900  @SearchParamDefinition(name="description", path="MessageDefinition.description", description="The description of the message definition", type="string" )
2901  public static final String SP_DESCRIPTION = "description";
2902 /**
2903   * <b>Fluent Client</b> search parameter constant for <b>description</b>
2904   * <p>
2905   * Description: <b>The description of the message definition</b><br>
2906   * Type: <b>string</b><br>
2907   * Path: <b>MessageDefinition.description</b><br>
2908   * </p>
2909   */
2910  public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION);
2911
2912 /**
2913   * Search parameter: <b>focus</b>
2914   * <p>
2915   * Description: <b>A resource that is a permitted focus of the message</b><br>
2916   * Type: <b>token</b><br>
2917   * Path: <b>MessageDefinition.focus.code</b><br>
2918   * </p>
2919   */
2920  @SearchParamDefinition(name="focus", path="MessageDefinition.focus.code", description="A resource that is a permitted focus of the message", type="token" )
2921  public static final String SP_FOCUS = "focus";
2922 /**
2923   * <b>Fluent Client</b> search parameter constant for <b>focus</b>
2924   * <p>
2925   * Description: <b>A resource that is a permitted focus of the message</b><br>
2926   * Type: <b>token</b><br>
2927   * Path: <b>MessageDefinition.focus.code</b><br>
2928   * </p>
2929   */
2930  public static final ca.uhn.fhir.rest.gclient.TokenClientParam FOCUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FOCUS);
2931
2932 /**
2933   * Search parameter: <b>context-type</b>
2934   * <p>
2935   * Description: <b>A type of use context assigned to the message definition</b><br>
2936   * Type: <b>token</b><br>
2937   * Path: <b>MessageDefinition.useContext.code</b><br>
2938   * </p>
2939   */
2940  @SearchParamDefinition(name="context-type", path="MessageDefinition.useContext.code", description="A type of use context assigned to the message definition", type="token" )
2941  public static final String SP_CONTEXT_TYPE = "context-type";
2942 /**
2943   * <b>Fluent Client</b> search parameter constant for <b>context-type</b>
2944   * <p>
2945   * Description: <b>A type of use context assigned to the message definition</b><br>
2946   * Type: <b>token</b><br>
2947   * Path: <b>MessageDefinition.useContext.code</b><br>
2948   * </p>
2949   */
2950  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT_TYPE);
2951
2952 /**
2953   * Search parameter: <b>title</b>
2954   * <p>
2955   * Description: <b>The human-friendly name of the message definition</b><br>
2956   * Type: <b>string</b><br>
2957   * Path: <b>MessageDefinition.title</b><br>
2958   * </p>
2959   */
2960  @SearchParamDefinition(name="title", path="MessageDefinition.title", description="The human-friendly name of the message definition", type="string" )
2961  public static final String SP_TITLE = "title";
2962 /**
2963   * <b>Fluent Client</b> search parameter constant for <b>title</b>
2964   * <p>
2965   * Description: <b>The human-friendly name of the message definition</b><br>
2966   * Type: <b>string</b><br>
2967   * Path: <b>MessageDefinition.title</b><br>
2968   * </p>
2969   */
2970  public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE);
2971
2972 /**
2973   * Search parameter: <b>version</b>
2974   * <p>
2975   * Description: <b>The business version of the message definition</b><br>
2976   * Type: <b>token</b><br>
2977   * Path: <b>MessageDefinition.version</b><br>
2978   * </p>
2979   */
2980  @SearchParamDefinition(name="version", path="MessageDefinition.version", description="The business version of the message definition", type="token" )
2981  public static final String SP_VERSION = "version";
2982 /**
2983   * <b>Fluent Client</b> search parameter constant for <b>version</b>
2984   * <p>
2985   * Description: <b>The business version of the message definition</b><br>
2986   * Type: <b>token</b><br>
2987   * Path: <b>MessageDefinition.version</b><br>
2988   * </p>
2989   */
2990  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION);
2991
2992 /**
2993   * Search parameter: <b>url</b>
2994   * <p>
2995   * Description: <b>The uri that identifies the message definition</b><br>
2996   * Type: <b>uri</b><br>
2997   * Path: <b>MessageDefinition.url</b><br>
2998   * </p>
2999   */
3000  @SearchParamDefinition(name="url", path="MessageDefinition.url", description="The uri that identifies the message definition", type="uri" )
3001  public static final String SP_URL = "url";
3002 /**
3003   * <b>Fluent Client</b> search parameter constant for <b>url</b>
3004   * <p>
3005   * Description: <b>The uri that identifies the message definition</b><br>
3006   * Type: <b>uri</b><br>
3007   * Path: <b>MessageDefinition.url</b><br>
3008   * </p>
3009   */
3010  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
3011
3012 /**
3013   * Search parameter: <b>context-quantity</b>
3014   * <p>
3015   * Description: <b>A quantity- or range-valued use context assigned to the message definition</b><br>
3016   * Type: <b>quantity</b><br>
3017   * Path: <b>MessageDefinition.useContext.valueQuantity, MessageDefinition.useContext.valueRange</b><br>
3018   * </p>
3019   */
3020  @SearchParamDefinition(name="context-quantity", path="(MessageDefinition.useContext.value as Quantity) | (MessageDefinition.useContext.value as Range)", description="A quantity- or range-valued use context assigned to the message definition", type="quantity" )
3021  public static final String SP_CONTEXT_QUANTITY = "context-quantity";
3022 /**
3023   * <b>Fluent Client</b> search parameter constant for <b>context-quantity</b>
3024   * <p>
3025   * Description: <b>A quantity- or range-valued use context assigned to the message definition</b><br>
3026   * Type: <b>quantity</b><br>
3027   * Path: <b>MessageDefinition.useContext.valueQuantity, MessageDefinition.useContext.valueRange</b><br>
3028   * </p>
3029   */
3030  public static final ca.uhn.fhir.rest.gclient.QuantityClientParam CONTEXT_QUANTITY = new ca.uhn.fhir.rest.gclient.QuantityClientParam(SP_CONTEXT_QUANTITY);
3031
3032 /**
3033   * Search parameter: <b>name</b>
3034   * <p>
3035   * Description: <b>Computationally friendly name of the message definition</b><br>
3036   * Type: <b>string</b><br>
3037   * Path: <b>MessageDefinition.name</b><br>
3038   * </p>
3039   */
3040  @SearchParamDefinition(name="name", path="MessageDefinition.name", description="Computationally friendly name of the message definition", type="string" )
3041  public static final String SP_NAME = "name";
3042 /**
3043   * <b>Fluent Client</b> search parameter constant for <b>name</b>
3044   * <p>
3045   * Description: <b>Computationally friendly name of the message definition</b><br>
3046   * Type: <b>string</b><br>
3047   * Path: <b>MessageDefinition.name</b><br>
3048   * </p>
3049   */
3050  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
3051
3052 /**
3053   * Search parameter: <b>context</b>
3054   * <p>
3055   * Description: <b>A use context assigned to the message definition</b><br>
3056   * Type: <b>token</b><br>
3057   * Path: <b>MessageDefinition.useContext.valueCodeableConcept</b><br>
3058   * </p>
3059   */
3060  @SearchParamDefinition(name="context", path="(MessageDefinition.useContext.value as CodeableConcept)", description="A use context assigned to the message definition", type="token" )
3061  public static final String SP_CONTEXT = "context";
3062 /**
3063   * <b>Fluent Client</b> search parameter constant for <b>context</b>
3064   * <p>
3065   * Description: <b>A use context assigned to the message definition</b><br>
3066   * Type: <b>token</b><br>
3067   * Path: <b>MessageDefinition.useContext.valueCodeableConcept</b><br>
3068   * </p>
3069   */
3070  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT);
3071
3072 /**
3073   * Search parameter: <b>publisher</b>
3074   * <p>
3075   * Description: <b>Name of the publisher of the message definition</b><br>
3076   * Type: <b>string</b><br>
3077   * Path: <b>MessageDefinition.publisher</b><br>
3078   * </p>
3079   */
3080  @SearchParamDefinition(name="publisher", path="MessageDefinition.publisher", description="Name of the publisher of the message definition", type="string" )
3081  public static final String SP_PUBLISHER = "publisher";
3082 /**
3083   * <b>Fluent Client</b> search parameter constant for <b>publisher</b>
3084   * <p>
3085   * Description: <b>Name of the publisher of the message definition</b><br>
3086   * Type: <b>string</b><br>
3087   * Path: <b>MessageDefinition.publisher</b><br>
3088   * </p>
3089   */
3090  public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER);
3091
3092 /**
3093   * Search parameter: <b>event</b>
3094   * <p>
3095   * Description: <b>The event that triggers the message or link to the event definition.</b><br>
3096   * Type: <b>token</b><br>
3097   * Path: <b>MessageDefinition.event[x]</b><br>
3098   * </p>
3099   */
3100  @SearchParamDefinition(name="event", path="MessageDefinition.event", description="The event that triggers the message or link to the event definition.", type="token" )
3101  public static final String SP_EVENT = "event";
3102 /**
3103   * <b>Fluent Client</b> search parameter constant for <b>event</b>
3104   * <p>
3105   * Description: <b>The event that triggers the message or link to the event definition.</b><br>
3106   * Type: <b>token</b><br>
3107   * Path: <b>MessageDefinition.event[x]</b><br>
3108   * </p>
3109   */
3110  public static final ca.uhn.fhir.rest.gclient.TokenClientParam EVENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EVENT);
3111
3112 /**
3113   * Search parameter: <b>category</b>
3114   * <p>
3115   * Description: <b>The behavior associated with the message</b><br>
3116   * Type: <b>token</b><br>
3117   * Path: <b>MessageDefinition.category</b><br>
3118   * </p>
3119   */
3120  @SearchParamDefinition(name="category", path="MessageDefinition.category", description="The behavior associated with the message", type="token" )
3121  public static final String SP_CATEGORY = "category";
3122 /**
3123   * <b>Fluent Client</b> search parameter constant for <b>category</b>
3124   * <p>
3125   * Description: <b>The behavior associated with the message</b><br>
3126   * Type: <b>token</b><br>
3127   * Path: <b>MessageDefinition.category</b><br>
3128   * </p>
3129   */
3130  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY);
3131
3132 /**
3133   * Search parameter: <b>context-type-quantity</b>
3134   * <p>
3135   * Description: <b>A use context type and quantity- or range-based value assigned to the message definition</b><br>
3136   * Type: <b>composite</b><br>
3137   * Path: <b></b><br>
3138   * </p>
3139   */
3140  @SearchParamDefinition(name="context-type-quantity", path="MessageDefinition.useContext", description="A use context type and quantity- or range-based value assigned to the message definition", type="composite", compositeOf={"context-type", "context-quantity"} )
3141  public static final String SP_CONTEXT_TYPE_QUANTITY = "context-type-quantity";
3142 /**
3143   * <b>Fluent Client</b> search parameter constant for <b>context-type-quantity</b>
3144   * <p>
3145   * Description: <b>A use context type and quantity- or range-based value assigned to the message definition</b><br>
3146   * Type: <b>composite</b><br>
3147   * Path: <b></b><br>
3148   * </p>
3149   */
3150  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.QuantityClientParam> CONTEXT_TYPE_QUANTITY = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.QuantityClientParam>(SP_CONTEXT_TYPE_QUANTITY);
3151
3152 /**
3153   * Search parameter: <b>status</b>
3154   * <p>
3155   * Description: <b>The current status of the message definition</b><br>
3156   * Type: <b>token</b><br>
3157   * Path: <b>MessageDefinition.status</b><br>
3158   * </p>
3159   */
3160  @SearchParamDefinition(name="status", path="MessageDefinition.status", description="The current status of the message definition", type="token" )
3161  public static final String SP_STATUS = "status";
3162 /**
3163   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3164   * <p>
3165   * Description: <b>The current status of the message definition</b><br>
3166   * Type: <b>token</b><br>
3167   * Path: <b>MessageDefinition.status</b><br>
3168   * </p>
3169   */
3170  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3171
3172
3173}
3174