001package org.hl7.fhir.r4.model;
002
003/*-
004 * #%L
005 * org.hl7.fhir.r4
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;
056
057import org.hl7.fhir.exceptions.FHIRException;
058import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
059import org.hl7.fhir.r4.model.Enumerations.PublicationStatus;
060import org.hl7.fhir.r4.model.Enumerations.PublicationStatusEnumFactory;
061import org.hl7.fhir.utilities.Utilities;
062
063import ca.uhn.fhir.model.api.annotation.Block;
064import ca.uhn.fhir.model.api.annotation.Child;
065import ca.uhn.fhir.model.api.annotation.ChildOrder;
066import ca.uhn.fhir.model.api.annotation.Description;
067import ca.uhn.fhir.model.api.annotation.ResourceDef;
068import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
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        dst.code = code == null ? null : code.copy();
658        dst.profile = profile == null ? null : profile.copy();
659        dst.min = min == null ? null : min.copy();
660        dst.max = max == null ? null : max.copy();
661        return dst;
662      }
663
664      @Override
665      public boolean equalsDeep(Base other_) {
666        if (!super.equalsDeep(other_))
667          return false;
668        if (!(other_ instanceof MessageDefinitionFocusComponent))
669          return false;
670        MessageDefinitionFocusComponent o = (MessageDefinitionFocusComponent) other_;
671        return compareDeep(code, o.code, true) && compareDeep(profile, o.profile, true) && compareDeep(min, o.min, true)
672           && compareDeep(max, o.max, true);
673      }
674
675      @Override
676      public boolean equalsShallow(Base other_) {
677        if (!super.equalsShallow(other_))
678          return false;
679        if (!(other_ instanceof MessageDefinitionFocusComponent))
680          return false;
681        MessageDefinitionFocusComponent o = (MessageDefinitionFocusComponent) other_;
682        return compareValues(code, o.code, true) && compareValues(min, o.min, true) && compareValues(max, o.max, true)
683          ;
684      }
685
686      public boolean isEmpty() {
687        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, profile, min, max
688          );
689      }
690
691  public String fhirType() {
692    return "MessageDefinition.focus";
693
694  }
695
696  }
697
698    @Block()
699    public static class MessageDefinitionAllowedResponseComponent extends BackboneElement implements IBaseBackboneElement {
700        /**
701         * A reference to the message definition that must be adhered to by this supported response.
702         */
703        @Child(name = "message", type = {CanonicalType.class}, order=1, min=1, max=1, modifier=false, summary=false)
704        @Description(shortDefinition="Reference to allowed message definition response", formalDefinition="A reference to the message definition that must be adhered to by this supported response." )
705        protected CanonicalType message;
706
707        /**
708         * Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses).
709         */
710        @Child(name = "situation", type = {MarkdownType.class}, order=2, min=0, max=1, modifier=false, summary=false)
711        @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)." )
712        protected MarkdownType situation;
713
714        private static final long serialVersionUID = -1943810550L;
715
716    /**
717     * Constructor
718     */
719      public MessageDefinitionAllowedResponseComponent() {
720        super();
721      }
722
723    /**
724     * Constructor
725     */
726      public MessageDefinitionAllowedResponseComponent(CanonicalType message) {
727        super();
728        this.message = message;
729      }
730
731        /**
732         * @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
733         */
734        public CanonicalType getMessageElement() { 
735          if (this.message == null)
736            if (Configuration.errorOnAutoCreate())
737              throw new Error("Attempt to auto-create MessageDefinitionAllowedResponseComponent.message");
738            else if (Configuration.doAutoCreate())
739              this.message = new CanonicalType(); // bb
740          return this.message;
741        }
742
743        public boolean hasMessageElement() { 
744          return this.message != null && !this.message.isEmpty();
745        }
746
747        public boolean hasMessage() { 
748          return this.message != null && !this.message.isEmpty();
749        }
750
751        /**
752         * @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
753         */
754        public MessageDefinitionAllowedResponseComponent setMessageElement(CanonicalType value) { 
755          this.message = value;
756          return this;
757        }
758
759        /**
760         * @return A reference to the message definition that must be adhered to by this supported response.
761         */
762        public String getMessage() { 
763          return this.message == null ? null : this.message.getValue();
764        }
765
766        /**
767         * @param value A reference to the message definition that must be adhered to by this supported response.
768         */
769        public MessageDefinitionAllowedResponseComponent setMessage(String value) { 
770            if (this.message == null)
771              this.message = new CanonicalType();
772            this.message.setValue(value);
773          return this;
774        }
775
776        /**
777         * @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
778         */
779        public MarkdownType getSituationElement() { 
780          if (this.situation == null)
781            if (Configuration.errorOnAutoCreate())
782              throw new Error("Attempt to auto-create MessageDefinitionAllowedResponseComponent.situation");
783            else if (Configuration.doAutoCreate())
784              this.situation = new MarkdownType(); // bb
785          return this.situation;
786        }
787
788        public boolean hasSituationElement() { 
789          return this.situation != null && !this.situation.isEmpty();
790        }
791
792        public boolean hasSituation() { 
793          return this.situation != null && !this.situation.isEmpty();
794        }
795
796        /**
797         * @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
798         */
799        public MessageDefinitionAllowedResponseComponent setSituationElement(MarkdownType value) { 
800          this.situation = value;
801          return this;
802        }
803
804        /**
805         * @return Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses).
806         */
807        public String getSituation() { 
808          return this.situation == null ? null : this.situation.getValue();
809        }
810
811        /**
812         * @param value Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses).
813         */
814        public MessageDefinitionAllowedResponseComponent setSituation(String value) { 
815          if (value == null)
816            this.situation = null;
817          else {
818            if (this.situation == null)
819              this.situation = new MarkdownType();
820            this.situation.setValue(value);
821          }
822          return this;
823        }
824
825        protected void listChildren(List<Property> children) {
826          super.listChildren(children);
827          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));
828          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));
829        }
830
831        @Override
832        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
833          switch (_hash) {
834          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);
835          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);
836          default: return super.getNamedProperty(_hash, _name, _checkValid);
837          }
838
839        }
840
841      @Override
842      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
843        switch (hash) {
844        case 954925063: /*message*/ return this.message == null ? new Base[0] : new Base[] {this.message}; // CanonicalType
845        case -73377282: /*situation*/ return this.situation == null ? new Base[0] : new Base[] {this.situation}; // MarkdownType
846        default: return super.getProperty(hash, name, checkValid);
847        }
848
849      }
850
851      @Override
852      public Base setProperty(int hash, String name, Base value) throws FHIRException {
853        switch (hash) {
854        case 954925063: // message
855          this.message = castToCanonical(value); // CanonicalType
856          return value;
857        case -73377282: // situation
858          this.situation = castToMarkdown(value); // MarkdownType
859          return value;
860        default: return super.setProperty(hash, name, value);
861        }
862
863      }
864
865      @Override
866      public Base setProperty(String name, Base value) throws FHIRException {
867        if (name.equals("message")) {
868          this.message = castToCanonical(value); // CanonicalType
869        } else if (name.equals("situation")) {
870          this.situation = castToMarkdown(value); // MarkdownType
871        } else
872          return super.setProperty(name, value);
873        return value;
874      }
875
876      @Override
877      public Base makeProperty(int hash, String name) throws FHIRException {
878        switch (hash) {
879        case 954925063:  return getMessageElement();
880        case -73377282:  return getSituationElement();
881        default: return super.makeProperty(hash, name);
882        }
883
884      }
885
886      @Override
887      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
888        switch (hash) {
889        case 954925063: /*message*/ return new String[] {"canonical"};
890        case -73377282: /*situation*/ return new String[] {"markdown"};
891        default: return super.getTypesForProperty(hash, name);
892        }
893
894      }
895
896      @Override
897      public Base addChild(String name) throws FHIRException {
898        if (name.equals("message")) {
899          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.message");
900        }
901        else if (name.equals("situation")) {
902          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.situation");
903        }
904        else
905          return super.addChild(name);
906      }
907
908      public MessageDefinitionAllowedResponseComponent copy() {
909        MessageDefinitionAllowedResponseComponent dst = new MessageDefinitionAllowedResponseComponent();
910        copyValues(dst);
911        dst.message = message == null ? null : message.copy();
912        dst.situation = situation == null ? null : situation.copy();
913        return dst;
914      }
915
916      @Override
917      public boolean equalsDeep(Base other_) {
918        if (!super.equalsDeep(other_))
919          return false;
920        if (!(other_ instanceof MessageDefinitionAllowedResponseComponent))
921          return false;
922        MessageDefinitionAllowedResponseComponent o = (MessageDefinitionAllowedResponseComponent) other_;
923        return compareDeep(message, o.message, true) && compareDeep(situation, o.situation, true);
924      }
925
926      @Override
927      public boolean equalsShallow(Base other_) {
928        if (!super.equalsShallow(other_))
929          return false;
930        if (!(other_ instanceof MessageDefinitionAllowedResponseComponent))
931          return false;
932        MessageDefinitionAllowedResponseComponent o = (MessageDefinitionAllowedResponseComponent) other_;
933        return compareValues(situation, o.situation, true);
934      }
935
936      public boolean isEmpty() {
937        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(message, situation);
938      }
939
940  public String fhirType() {
941    return "MessageDefinition.allowedResponse";
942
943  }
944
945  }
946
947    /**
948     * 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.
949     */
950    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
951    @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." )
952    protected List<Identifier> identifier;
953
954    /**
955     * A MessageDefinition that is superseded by this definition.
956     */
957    @Child(name = "replaces", type = {CanonicalType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
958    @Description(shortDefinition="Takes the place of", formalDefinition="A MessageDefinition that is superseded by this definition." )
959    protected List<CanonicalType> replaces;
960
961    /**
962     * Explanation of why this message definition is needed and why it has been designed as it has.
963     */
964    @Child(name = "purpose", type = {MarkdownType.class}, order=2, min=0, max=1, modifier=false, summary=true)
965    @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." )
966    protected MarkdownType purpose;
967
968    /**
969     * 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.
970     */
971    @Child(name = "copyright", type = {MarkdownType.class}, order=3, min=0, max=1, modifier=false, summary=false)
972    @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." )
973    protected MarkdownType copyright;
974
975    /**
976     * The MessageDefinition that is the basis for the contents of this resource.
977     */
978    @Child(name = "base", type = {CanonicalType.class}, order=4, min=0, max=1, modifier=false, summary=true)
979    @Description(shortDefinition="Definition this one is based on", formalDefinition="The MessageDefinition that is the basis for the contents of this resource." )
980    protected CanonicalType base;
981
982    /**
983     * Identifies a protocol or workflow that this MessageDefinition represents a step in.
984     */
985    @Child(name = "parent", type = {CanonicalType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
986    @Description(shortDefinition="Protocol/workflow this is part of", formalDefinition="Identifies a protocol or workflow that this MessageDefinition represents a step in." )
987    protected List<CanonicalType> parent;
988
989    /**
990     * Event code or link to the EventDefinition.
991     */
992    @Child(name = "event", type = {Coding.class, UriType.class}, order=6, min=1, max=1, modifier=false, summary=true)
993    @Description(shortDefinition="Event code  or link to the EventDefinition", formalDefinition="Event code or link to the EventDefinition." )
994    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/message-events")
995    protected Type event;
996
997    /**
998     * The impact of the content of the message.
999     */
1000    @Child(name = "category", type = {CodeType.class}, order=7, min=0, max=1, modifier=false, summary=true)
1001    @Description(shortDefinition="consequence | currency | notification", formalDefinition="The impact of the content of the message." )
1002    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/message-significance-category")
1003    protected Enumeration<MessageSignificanceCategory> category;
1004
1005    /**
1006     * 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.
1007     */
1008    @Child(name = "focus", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1009    @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." )
1010    protected List<MessageDefinitionFocusComponent> focus;
1011
1012    /**
1013     * Declare at a message definition level whether a response is required or only upon error or success, or never.
1014     */
1015    @Child(name = "responseRequired", type = {CodeType.class}, order=9, min=0, max=1, modifier=false, summary=false)
1016    @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." )
1017    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/messageheader-response-request")
1018    protected Enumeration<MessageheaderResponseRequest> responseRequired;
1019
1020    /**
1021     * Indicates what types of messages may be sent as an application-level response to this message.
1022     */
1023    @Child(name = "allowedResponse", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1024    @Description(shortDefinition="Responses to this message", formalDefinition="Indicates what types of messages may be sent as an application-level response to this message." )
1025    protected List<MessageDefinitionAllowedResponseComponent> allowedResponse;
1026
1027    /**
1028     * 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.
1029     */
1030    @Child(name = "graph", type = {CanonicalType.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1031    @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." )
1032    protected List<CanonicalType> graph;
1033
1034    private static final long serialVersionUID = 927775347L;
1035
1036  /**
1037   * Constructor
1038   */
1039    public MessageDefinition() {
1040      super();
1041    }
1042
1043  /**
1044   * Constructor
1045   */
1046    public MessageDefinition(Enumeration<PublicationStatus> status, DateTimeType date, Type event) {
1047      super();
1048      this.status = status;
1049      this.date = date;
1050      this.event = event;
1051    }
1052
1053    /**
1054     * @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
1055     */
1056    public UriType getUrlElement() { 
1057      if (this.url == null)
1058        if (Configuration.errorOnAutoCreate())
1059          throw new Error("Attempt to auto-create MessageDefinition.url");
1060        else if (Configuration.doAutoCreate())
1061          this.url = new UriType(); // bb
1062      return this.url;
1063    }
1064
1065    public boolean hasUrlElement() { 
1066      return this.url != null && !this.url.isEmpty();
1067    }
1068
1069    public boolean hasUrl() { 
1070      return this.url != null && !this.url.isEmpty();
1071    }
1072
1073    /**
1074     * @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
1075     */
1076    public MessageDefinition setUrlElement(UriType value) { 
1077      this.url = value;
1078      return this;
1079    }
1080
1081    /**
1082     * @return The business identifier that is used to reference the MessageDefinition and *is* expected to be consistent from server to server.
1083     */
1084    public String getUrl() { 
1085      return this.url == null ? null : this.url.getValue();
1086    }
1087
1088    /**
1089     * @param value The business identifier that is used to reference the MessageDefinition and *is* expected to be consistent from server to server.
1090     */
1091    public MessageDefinition setUrl(String value) { 
1092      if (Utilities.noString(value))
1093        this.url = null;
1094      else {
1095        if (this.url == null)
1096          this.url = new UriType();
1097        this.url.setValue(value);
1098      }
1099      return this;
1100    }
1101
1102    /**
1103     * @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.)
1104     */
1105    public List<Identifier> getIdentifier() { 
1106      if (this.identifier == null)
1107        this.identifier = new ArrayList<Identifier>();
1108      return this.identifier;
1109    }
1110
1111    /**
1112     * @return Returns a reference to <code>this</code> for easy method chaining
1113     */
1114    public MessageDefinition setIdentifier(List<Identifier> theIdentifier) { 
1115      this.identifier = theIdentifier;
1116      return this;
1117    }
1118
1119    public boolean hasIdentifier() { 
1120      if (this.identifier == null)
1121        return false;
1122      for (Identifier item : this.identifier)
1123        if (!item.isEmpty())
1124          return true;
1125      return false;
1126    }
1127
1128    public Identifier addIdentifier() { //3
1129      Identifier t = new Identifier();
1130      if (this.identifier == null)
1131        this.identifier = new ArrayList<Identifier>();
1132      this.identifier.add(t);
1133      return t;
1134    }
1135
1136    public MessageDefinition addIdentifier(Identifier t) { //3
1137      if (t == null)
1138        return this;
1139      if (this.identifier == null)
1140        this.identifier = new ArrayList<Identifier>();
1141      this.identifier.add(t);
1142      return this;
1143    }
1144
1145    /**
1146     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
1147     */
1148    public Identifier getIdentifierFirstRep() { 
1149      if (getIdentifier().isEmpty()) {
1150        addIdentifier();
1151      }
1152      return getIdentifier().get(0);
1153    }
1154
1155    /**
1156     * @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
1157     */
1158    public StringType getVersionElement() { 
1159      if (this.version == null)
1160        if (Configuration.errorOnAutoCreate())
1161          throw new Error("Attempt to auto-create MessageDefinition.version");
1162        else if (Configuration.doAutoCreate())
1163          this.version = new StringType(); // bb
1164      return this.version;
1165    }
1166
1167    public boolean hasVersionElement() { 
1168      return this.version != null && !this.version.isEmpty();
1169    }
1170
1171    public boolean hasVersion() { 
1172      return this.version != null && !this.version.isEmpty();
1173    }
1174
1175    /**
1176     * @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
1177     */
1178    public MessageDefinition setVersionElement(StringType value) { 
1179      this.version = value;
1180      return this;
1181    }
1182
1183    /**
1184     * @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.
1185     */
1186    public String getVersion() { 
1187      return this.version == null ? null : this.version.getValue();
1188    }
1189
1190    /**
1191     * @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.
1192     */
1193    public MessageDefinition setVersion(String value) { 
1194      if (Utilities.noString(value))
1195        this.version = null;
1196      else {
1197        if (this.version == null)
1198          this.version = new StringType();
1199        this.version.setValue(value);
1200      }
1201      return this;
1202    }
1203
1204    /**
1205     * @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
1206     */
1207    public StringType getNameElement() { 
1208      if (this.name == null)
1209        if (Configuration.errorOnAutoCreate())
1210          throw new Error("Attempt to auto-create MessageDefinition.name");
1211        else if (Configuration.doAutoCreate())
1212          this.name = new StringType(); // bb
1213      return this.name;
1214    }
1215
1216    public boolean hasNameElement() { 
1217      return this.name != null && !this.name.isEmpty();
1218    }
1219
1220    public boolean hasName() { 
1221      return this.name != null && !this.name.isEmpty();
1222    }
1223
1224    /**
1225     * @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
1226     */
1227    public MessageDefinition setNameElement(StringType value) { 
1228      this.name = value;
1229      return this;
1230    }
1231
1232    /**
1233     * @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.
1234     */
1235    public String getName() { 
1236      return this.name == null ? null : this.name.getValue();
1237    }
1238
1239    /**
1240     * @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.
1241     */
1242    public MessageDefinition setName(String value) { 
1243      if (Utilities.noString(value))
1244        this.name = null;
1245      else {
1246        if (this.name == null)
1247          this.name = new StringType();
1248        this.name.setValue(value);
1249      }
1250      return this;
1251    }
1252
1253    /**
1254     * @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
1255     */
1256    public StringType getTitleElement() { 
1257      if (this.title == null)
1258        if (Configuration.errorOnAutoCreate())
1259          throw new Error("Attempt to auto-create MessageDefinition.title");
1260        else if (Configuration.doAutoCreate())
1261          this.title = new StringType(); // bb
1262      return this.title;
1263    }
1264
1265    public boolean hasTitleElement() { 
1266      return this.title != null && !this.title.isEmpty();
1267    }
1268
1269    public boolean hasTitle() { 
1270      return this.title != null && !this.title.isEmpty();
1271    }
1272
1273    /**
1274     * @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
1275     */
1276    public MessageDefinition setTitleElement(StringType value) { 
1277      this.title = value;
1278      return this;
1279    }
1280
1281    /**
1282     * @return A short, descriptive, user-friendly title for the message definition.
1283     */
1284    public String getTitle() { 
1285      return this.title == null ? null : this.title.getValue();
1286    }
1287
1288    /**
1289     * @param value A short, descriptive, user-friendly title for the message definition.
1290     */
1291    public MessageDefinition setTitle(String value) { 
1292      if (Utilities.noString(value))
1293        this.title = null;
1294      else {
1295        if (this.title == null)
1296          this.title = new StringType();
1297        this.title.setValue(value);
1298      }
1299      return this;
1300    }
1301
1302    /**
1303     * @return {@link #replaces} (A MessageDefinition that is superseded by this definition.)
1304     */
1305    public List<CanonicalType> getReplaces() { 
1306      if (this.replaces == null)
1307        this.replaces = new ArrayList<CanonicalType>();
1308      return this.replaces;
1309    }
1310
1311    /**
1312     * @return Returns a reference to <code>this</code> for easy method chaining
1313     */
1314    public MessageDefinition setReplaces(List<CanonicalType> theReplaces) { 
1315      this.replaces = theReplaces;
1316      return this;
1317    }
1318
1319    public boolean hasReplaces() { 
1320      if (this.replaces == null)
1321        return false;
1322      for (CanonicalType item : this.replaces)
1323        if (!item.isEmpty())
1324          return true;
1325      return false;
1326    }
1327
1328    /**
1329     * @return {@link #replaces} (A MessageDefinition that is superseded by this definition.)
1330     */
1331    public CanonicalType addReplacesElement() {//2 
1332      CanonicalType t = new CanonicalType();
1333      if (this.replaces == null)
1334        this.replaces = new ArrayList<CanonicalType>();
1335      this.replaces.add(t);
1336      return t;
1337    }
1338
1339    /**
1340     * @param value {@link #replaces} (A MessageDefinition that is superseded by this definition.)
1341     */
1342    public MessageDefinition addReplaces(String value) { //1
1343      CanonicalType t = new CanonicalType();
1344      t.setValue(value);
1345      if (this.replaces == null)
1346        this.replaces = new ArrayList<CanonicalType>();
1347      this.replaces.add(t);
1348      return this;
1349    }
1350
1351    /**
1352     * @param value {@link #replaces} (A MessageDefinition that is superseded by this definition.)
1353     */
1354    public boolean hasReplaces(String value) { 
1355      if (this.replaces == null)
1356        return false;
1357      for (CanonicalType v : this.replaces)
1358        if (v.getValue().equals(value)) // canonical(MessageDefinition)
1359          return true;
1360      return false;
1361    }
1362
1363    /**
1364     * @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
1365     */
1366    public Enumeration<PublicationStatus> getStatusElement() { 
1367      if (this.status == null)
1368        if (Configuration.errorOnAutoCreate())
1369          throw new Error("Attempt to auto-create MessageDefinition.status");
1370        else if (Configuration.doAutoCreate())
1371          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
1372      return this.status;
1373    }
1374
1375    public boolean hasStatusElement() { 
1376      return this.status != null && !this.status.isEmpty();
1377    }
1378
1379    public boolean hasStatus() { 
1380      return this.status != null && !this.status.isEmpty();
1381    }
1382
1383    /**
1384     * @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
1385     */
1386    public MessageDefinition setStatusElement(Enumeration<PublicationStatus> value) { 
1387      this.status = value;
1388      return this;
1389    }
1390
1391    /**
1392     * @return The status of this message definition. Enables tracking the life-cycle of the content.
1393     */
1394    public PublicationStatus getStatus() { 
1395      return this.status == null ? null : this.status.getValue();
1396    }
1397
1398    /**
1399     * @param value The status of this message definition. Enables tracking the life-cycle of the content.
1400     */
1401    public MessageDefinition setStatus(PublicationStatus value) { 
1402        if (this.status == null)
1403          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
1404        this.status.setValue(value);
1405      return this;
1406    }
1407
1408    /**
1409     * @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
1410     */
1411    public BooleanType getExperimentalElement() { 
1412      if (this.experimental == null)
1413        if (Configuration.errorOnAutoCreate())
1414          throw new Error("Attempt to auto-create MessageDefinition.experimental");
1415        else if (Configuration.doAutoCreate())
1416          this.experimental = new BooleanType(); // bb
1417      return this.experimental;
1418    }
1419
1420    public boolean hasExperimentalElement() { 
1421      return this.experimental != null && !this.experimental.isEmpty();
1422    }
1423
1424    public boolean hasExperimental() { 
1425      return this.experimental != null && !this.experimental.isEmpty();
1426    }
1427
1428    /**
1429     * @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
1430     */
1431    public MessageDefinition setExperimentalElement(BooleanType value) { 
1432      this.experimental = value;
1433      return this;
1434    }
1435
1436    /**
1437     * @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.
1438     */
1439    public boolean getExperimental() { 
1440      return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
1441    }
1442
1443    /**
1444     * @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.
1445     */
1446    public MessageDefinition setExperimental(boolean value) { 
1447        if (this.experimental == null)
1448          this.experimental = new BooleanType();
1449        this.experimental.setValue(value);
1450      return this;
1451    }
1452
1453    /**
1454     * @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
1455     */
1456    public DateTimeType getDateElement() { 
1457      if (this.date == null)
1458        if (Configuration.errorOnAutoCreate())
1459          throw new Error("Attempt to auto-create MessageDefinition.date");
1460        else if (Configuration.doAutoCreate())
1461          this.date = new DateTimeType(); // bb
1462      return this.date;
1463    }
1464
1465    public boolean hasDateElement() { 
1466      return this.date != null && !this.date.isEmpty();
1467    }
1468
1469    public boolean hasDate() { 
1470      return this.date != null && !this.date.isEmpty();
1471    }
1472
1473    /**
1474     * @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
1475     */
1476    public MessageDefinition setDateElement(DateTimeType value) { 
1477      this.date = value;
1478      return this;
1479    }
1480
1481    /**
1482     * @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.
1483     */
1484    public Date getDate() { 
1485      return this.date == null ? null : this.date.getValue();
1486    }
1487
1488    /**
1489     * @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.
1490     */
1491    public MessageDefinition setDate(Date value) { 
1492        if (this.date == null)
1493          this.date = new DateTimeType();
1494        this.date.setValue(value);
1495      return this;
1496    }
1497
1498    /**
1499     * @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
1500     */
1501    public StringType getPublisherElement() { 
1502      if (this.publisher == null)
1503        if (Configuration.errorOnAutoCreate())
1504          throw new Error("Attempt to auto-create MessageDefinition.publisher");
1505        else if (Configuration.doAutoCreate())
1506          this.publisher = new StringType(); // bb
1507      return this.publisher;
1508    }
1509
1510    public boolean hasPublisherElement() { 
1511      return this.publisher != null && !this.publisher.isEmpty();
1512    }
1513
1514    public boolean hasPublisher() { 
1515      return this.publisher != null && !this.publisher.isEmpty();
1516    }
1517
1518    /**
1519     * @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
1520     */
1521    public MessageDefinition setPublisherElement(StringType value) { 
1522      this.publisher = value;
1523      return this;
1524    }
1525
1526    /**
1527     * @return The name of the organization or individual that published the message definition.
1528     */
1529    public String getPublisher() { 
1530      return this.publisher == null ? null : this.publisher.getValue();
1531    }
1532
1533    /**
1534     * @param value The name of the organization or individual that published the message definition.
1535     */
1536    public MessageDefinition setPublisher(String value) { 
1537      if (Utilities.noString(value))
1538        this.publisher = null;
1539      else {
1540        if (this.publisher == null)
1541          this.publisher = new StringType();
1542        this.publisher.setValue(value);
1543      }
1544      return this;
1545    }
1546
1547    /**
1548     * @return {@link #contact} (Contact details to assist a user in finding and communicating with the publisher.)
1549     */
1550    public List<ContactDetail> getContact() { 
1551      if (this.contact == null)
1552        this.contact = new ArrayList<ContactDetail>();
1553      return this.contact;
1554    }
1555
1556    /**
1557     * @return Returns a reference to <code>this</code> for easy method chaining
1558     */
1559    public MessageDefinition setContact(List<ContactDetail> theContact) { 
1560      this.contact = theContact;
1561      return this;
1562    }
1563
1564    public boolean hasContact() { 
1565      if (this.contact == null)
1566        return false;
1567      for (ContactDetail item : this.contact)
1568        if (!item.isEmpty())
1569          return true;
1570      return false;
1571    }
1572
1573    public ContactDetail addContact() { //3
1574      ContactDetail t = new ContactDetail();
1575      if (this.contact == null)
1576        this.contact = new ArrayList<ContactDetail>();
1577      this.contact.add(t);
1578      return t;
1579    }
1580
1581    public MessageDefinition addContact(ContactDetail t) { //3
1582      if (t == null)
1583        return this;
1584      if (this.contact == null)
1585        this.contact = new ArrayList<ContactDetail>();
1586      this.contact.add(t);
1587      return this;
1588    }
1589
1590    /**
1591     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist
1592     */
1593    public ContactDetail getContactFirstRep() { 
1594      if (getContact().isEmpty()) {
1595        addContact();
1596      }
1597      return getContact().get(0);
1598    }
1599
1600    /**
1601     * @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
1602     */
1603    public MarkdownType getDescriptionElement() { 
1604      if (this.description == null)
1605        if (Configuration.errorOnAutoCreate())
1606          throw new Error("Attempt to auto-create MessageDefinition.description");
1607        else if (Configuration.doAutoCreate())
1608          this.description = new MarkdownType(); // bb
1609      return this.description;
1610    }
1611
1612    public boolean hasDescriptionElement() { 
1613      return this.description != null && !this.description.isEmpty();
1614    }
1615
1616    public boolean hasDescription() { 
1617      return this.description != null && !this.description.isEmpty();
1618    }
1619
1620    /**
1621     * @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
1622     */
1623    public MessageDefinition setDescriptionElement(MarkdownType value) { 
1624      this.description = value;
1625      return this;
1626    }
1627
1628    /**
1629     * @return A free text natural language description of the message definition from a consumer's perspective.
1630     */
1631    public String getDescription() { 
1632      return this.description == null ? null : this.description.getValue();
1633    }
1634
1635    /**
1636     * @param value A free text natural language description of the message definition from a consumer's perspective.
1637     */
1638    public MessageDefinition setDescription(String value) { 
1639      if (value == null)
1640        this.description = null;
1641      else {
1642        if (this.description == null)
1643          this.description = new MarkdownType();
1644        this.description.setValue(value);
1645      }
1646      return this;
1647    }
1648
1649    /**
1650     * @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.)
1651     */
1652    public List<UsageContext> getUseContext() { 
1653      if (this.useContext == null)
1654        this.useContext = new ArrayList<UsageContext>();
1655      return this.useContext;
1656    }
1657
1658    /**
1659     * @return Returns a reference to <code>this</code> for easy method chaining
1660     */
1661    public MessageDefinition setUseContext(List<UsageContext> theUseContext) { 
1662      this.useContext = theUseContext;
1663      return this;
1664    }
1665
1666    public boolean hasUseContext() { 
1667      if (this.useContext == null)
1668        return false;
1669      for (UsageContext item : this.useContext)
1670        if (!item.isEmpty())
1671          return true;
1672      return false;
1673    }
1674
1675    public UsageContext addUseContext() { //3
1676      UsageContext t = new UsageContext();
1677      if (this.useContext == null)
1678        this.useContext = new ArrayList<UsageContext>();
1679      this.useContext.add(t);
1680      return t;
1681    }
1682
1683    public MessageDefinition addUseContext(UsageContext t) { //3
1684      if (t == null)
1685        return this;
1686      if (this.useContext == null)
1687        this.useContext = new ArrayList<UsageContext>();
1688      this.useContext.add(t);
1689      return this;
1690    }
1691
1692    /**
1693     * @return The first repetition of repeating field {@link #useContext}, creating it if it does not already exist
1694     */
1695    public UsageContext getUseContextFirstRep() { 
1696      if (getUseContext().isEmpty()) {
1697        addUseContext();
1698      }
1699      return getUseContext().get(0);
1700    }
1701
1702    /**
1703     * @return {@link #jurisdiction} (A legal or geographic region in which the message definition is intended to be used.)
1704     */
1705    public List<CodeableConcept> getJurisdiction() { 
1706      if (this.jurisdiction == null)
1707        this.jurisdiction = new ArrayList<CodeableConcept>();
1708      return this.jurisdiction;
1709    }
1710
1711    /**
1712     * @return Returns a reference to <code>this</code> for easy method chaining
1713     */
1714    public MessageDefinition setJurisdiction(List<CodeableConcept> theJurisdiction) { 
1715      this.jurisdiction = theJurisdiction;
1716      return this;
1717    }
1718
1719    public boolean hasJurisdiction() { 
1720      if (this.jurisdiction == null)
1721        return false;
1722      for (CodeableConcept item : this.jurisdiction)
1723        if (!item.isEmpty())
1724          return true;
1725      return false;
1726    }
1727
1728    public CodeableConcept addJurisdiction() { //3
1729      CodeableConcept t = new CodeableConcept();
1730      if (this.jurisdiction == null)
1731        this.jurisdiction = new ArrayList<CodeableConcept>();
1732      this.jurisdiction.add(t);
1733      return t;
1734    }
1735
1736    public MessageDefinition addJurisdiction(CodeableConcept t) { //3
1737      if (t == null)
1738        return this;
1739      if (this.jurisdiction == null)
1740        this.jurisdiction = new ArrayList<CodeableConcept>();
1741      this.jurisdiction.add(t);
1742      return this;
1743    }
1744
1745    /**
1746     * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist
1747     */
1748    public CodeableConcept getJurisdictionFirstRep() { 
1749      if (getJurisdiction().isEmpty()) {
1750        addJurisdiction();
1751      }
1752      return getJurisdiction().get(0);
1753    }
1754
1755    /**
1756     * @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
1757     */
1758    public MarkdownType getPurposeElement() { 
1759      if (this.purpose == null)
1760        if (Configuration.errorOnAutoCreate())
1761          throw new Error("Attempt to auto-create MessageDefinition.purpose");
1762        else if (Configuration.doAutoCreate())
1763          this.purpose = new MarkdownType(); // bb
1764      return this.purpose;
1765    }
1766
1767    public boolean hasPurposeElement() { 
1768      return this.purpose != null && !this.purpose.isEmpty();
1769    }
1770
1771    public boolean hasPurpose() { 
1772      return this.purpose != null && !this.purpose.isEmpty();
1773    }
1774
1775    /**
1776     * @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
1777     */
1778    public MessageDefinition setPurposeElement(MarkdownType value) { 
1779      this.purpose = value;
1780      return this;
1781    }
1782
1783    /**
1784     * @return Explanation of why this message definition is needed and why it has been designed as it has.
1785     */
1786    public String getPurpose() { 
1787      return this.purpose == null ? null : this.purpose.getValue();
1788    }
1789
1790    /**
1791     * @param value Explanation of why this message definition is needed and why it has been designed as it has.
1792     */
1793    public MessageDefinition setPurpose(String value) { 
1794      if (value == null)
1795        this.purpose = null;
1796      else {
1797        if (this.purpose == null)
1798          this.purpose = new MarkdownType();
1799        this.purpose.setValue(value);
1800      }
1801      return this;
1802    }
1803
1804    /**
1805     * @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
1806     */
1807    public MarkdownType getCopyrightElement() { 
1808      if (this.copyright == null)
1809        if (Configuration.errorOnAutoCreate())
1810          throw new Error("Attempt to auto-create MessageDefinition.copyright");
1811        else if (Configuration.doAutoCreate())
1812          this.copyright = new MarkdownType(); // bb
1813      return this.copyright;
1814    }
1815
1816    public boolean hasCopyrightElement() { 
1817      return this.copyright != null && !this.copyright.isEmpty();
1818    }
1819
1820    public boolean hasCopyright() { 
1821      return this.copyright != null && !this.copyright.isEmpty();
1822    }
1823
1824    /**
1825     * @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
1826     */
1827    public MessageDefinition setCopyrightElement(MarkdownType value) { 
1828      this.copyright = value;
1829      return this;
1830    }
1831
1832    /**
1833     * @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.
1834     */
1835    public String getCopyright() { 
1836      return this.copyright == null ? null : this.copyright.getValue();
1837    }
1838
1839    /**
1840     * @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.
1841     */
1842    public MessageDefinition setCopyright(String value) { 
1843      if (value == null)
1844        this.copyright = null;
1845      else {
1846        if (this.copyright == null)
1847          this.copyright = new MarkdownType();
1848        this.copyright.setValue(value);
1849      }
1850      return this;
1851    }
1852
1853    /**
1854     * @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
1855     */
1856    public CanonicalType getBaseElement() { 
1857      if (this.base == null)
1858        if (Configuration.errorOnAutoCreate())
1859          throw new Error("Attempt to auto-create MessageDefinition.base");
1860        else if (Configuration.doAutoCreate())
1861          this.base = new CanonicalType(); // bb
1862      return this.base;
1863    }
1864
1865    public boolean hasBaseElement() { 
1866      return this.base != null && !this.base.isEmpty();
1867    }
1868
1869    public boolean hasBase() { 
1870      return this.base != null && !this.base.isEmpty();
1871    }
1872
1873    /**
1874     * @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
1875     */
1876    public MessageDefinition setBaseElement(CanonicalType value) { 
1877      this.base = value;
1878      return this;
1879    }
1880
1881    /**
1882     * @return The MessageDefinition that is the basis for the contents of this resource.
1883     */
1884    public String getBase() { 
1885      return this.base == null ? null : this.base.getValue();
1886    }
1887
1888    /**
1889     * @param value The MessageDefinition that is the basis for the contents of this resource.
1890     */
1891    public MessageDefinition setBase(String value) { 
1892      if (Utilities.noString(value))
1893        this.base = null;
1894      else {
1895        if (this.base == null)
1896          this.base = new CanonicalType();
1897        this.base.setValue(value);
1898      }
1899      return this;
1900    }
1901
1902    /**
1903     * @return {@link #parent} (Identifies a protocol or workflow that this MessageDefinition represents a step in.)
1904     */
1905    public List<CanonicalType> getParent() { 
1906      if (this.parent == null)
1907        this.parent = new ArrayList<CanonicalType>();
1908      return this.parent;
1909    }
1910
1911    /**
1912     * @return Returns a reference to <code>this</code> for easy method chaining
1913     */
1914    public MessageDefinition setParent(List<CanonicalType> theParent) { 
1915      this.parent = theParent;
1916      return this;
1917    }
1918
1919    public boolean hasParent() { 
1920      if (this.parent == null)
1921        return false;
1922      for (CanonicalType item : this.parent)
1923        if (!item.isEmpty())
1924          return true;
1925      return false;
1926    }
1927
1928    /**
1929     * @return {@link #parent} (Identifies a protocol or workflow that this MessageDefinition represents a step in.)
1930     */
1931    public CanonicalType addParentElement() {//2 
1932      CanonicalType t = new CanonicalType();
1933      if (this.parent == null)
1934        this.parent = new ArrayList<CanonicalType>();
1935      this.parent.add(t);
1936      return t;
1937    }
1938
1939    /**
1940     * @param value {@link #parent} (Identifies a protocol or workflow that this MessageDefinition represents a step in.)
1941     */
1942    public MessageDefinition addParent(String value) { //1
1943      CanonicalType t = new CanonicalType();
1944      t.setValue(value);
1945      if (this.parent == null)
1946        this.parent = new ArrayList<CanonicalType>();
1947      this.parent.add(t);
1948      return this;
1949    }
1950
1951    /**
1952     * @param value {@link #parent} (Identifies a protocol or workflow that this MessageDefinition represents a step in.)
1953     */
1954    public boolean hasParent(String value) { 
1955      if (this.parent == null)
1956        return false;
1957      for (CanonicalType v : this.parent)
1958        if (v.getValue().equals(value)) // canonical(ActivityDefinition|PlanDefinition)
1959          return true;
1960      return false;
1961    }
1962
1963    /**
1964     * @return {@link #event} (Event code or link to the EventDefinition.)
1965     */
1966    public Type getEvent() { 
1967      return this.event;
1968    }
1969
1970    /**
1971     * @return {@link #event} (Event code or link to the EventDefinition.)
1972     */
1973    public Coding getEventCoding() throws FHIRException { 
1974      if (this.event == null)
1975        this.event = new Coding();
1976      if (!(this.event instanceof Coding))
1977        throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.event.getClass().getName()+" was encountered");
1978      return (Coding) this.event;
1979    }
1980
1981    public boolean hasEventCoding() { 
1982      return this != null && this.event instanceof Coding;
1983    }
1984
1985    /**
1986     * @return {@link #event} (Event code or link to the EventDefinition.)
1987     */
1988    public UriType getEventUriType() throws FHIRException { 
1989      if (this.event == null)
1990        this.event = new UriType();
1991      if (!(this.event instanceof UriType))
1992        throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.event.getClass().getName()+" was encountered");
1993      return (UriType) this.event;
1994    }
1995
1996    public boolean hasEventUriType() { 
1997      return this != null && this.event instanceof UriType;
1998    }
1999
2000    public boolean hasEvent() { 
2001      return this.event != null && !this.event.isEmpty();
2002    }
2003
2004    /**
2005     * @param value {@link #event} (Event code or link to the EventDefinition.)
2006     */
2007    public MessageDefinition setEvent(Type value) { 
2008      if (value != null && !(value instanceof Coding || value instanceof UriType))
2009        throw new Error("Not the right type for MessageDefinition.event[x]: "+value.fhirType());
2010      this.event = value;
2011      return this;
2012    }
2013
2014    /**
2015     * @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
2016     */
2017    public Enumeration<MessageSignificanceCategory> getCategoryElement() { 
2018      if (this.category == null)
2019        if (Configuration.errorOnAutoCreate())
2020          throw new Error("Attempt to auto-create MessageDefinition.category");
2021        else if (Configuration.doAutoCreate())
2022          this.category = new Enumeration<MessageSignificanceCategory>(new MessageSignificanceCategoryEnumFactory()); // bb
2023      return this.category;
2024    }
2025
2026    public boolean hasCategoryElement() { 
2027      return this.category != null && !this.category.isEmpty();
2028    }
2029
2030    public boolean hasCategory() { 
2031      return this.category != null && !this.category.isEmpty();
2032    }
2033
2034    /**
2035     * @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
2036     */
2037    public MessageDefinition setCategoryElement(Enumeration<MessageSignificanceCategory> value) { 
2038      this.category = value;
2039      return this;
2040    }
2041
2042    /**
2043     * @return The impact of the content of the message.
2044     */
2045    public MessageSignificanceCategory getCategory() { 
2046      return this.category == null ? null : this.category.getValue();
2047    }
2048
2049    /**
2050     * @param value The impact of the content of the message.
2051     */
2052    public MessageDefinition setCategory(MessageSignificanceCategory value) { 
2053      if (value == null)
2054        this.category = null;
2055      else {
2056        if (this.category == null)
2057          this.category = new Enumeration<MessageSignificanceCategory>(new MessageSignificanceCategoryEnumFactory());
2058        this.category.setValue(value);
2059      }
2060      return this;
2061    }
2062
2063    /**
2064     * @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.)
2065     */
2066    public List<MessageDefinitionFocusComponent> getFocus() { 
2067      if (this.focus == null)
2068        this.focus = new ArrayList<MessageDefinitionFocusComponent>();
2069      return this.focus;
2070    }
2071
2072    /**
2073     * @return Returns a reference to <code>this</code> for easy method chaining
2074     */
2075    public MessageDefinition setFocus(List<MessageDefinitionFocusComponent> theFocus) { 
2076      this.focus = theFocus;
2077      return this;
2078    }
2079
2080    public boolean hasFocus() { 
2081      if (this.focus == null)
2082        return false;
2083      for (MessageDefinitionFocusComponent item : this.focus)
2084        if (!item.isEmpty())
2085          return true;
2086      return false;
2087    }
2088
2089    public MessageDefinitionFocusComponent addFocus() { //3
2090      MessageDefinitionFocusComponent t = new MessageDefinitionFocusComponent();
2091      if (this.focus == null)
2092        this.focus = new ArrayList<MessageDefinitionFocusComponent>();
2093      this.focus.add(t);
2094      return t;
2095    }
2096
2097    public MessageDefinition addFocus(MessageDefinitionFocusComponent t) { //3
2098      if (t == null)
2099        return this;
2100      if (this.focus == null)
2101        this.focus = new ArrayList<MessageDefinitionFocusComponent>();
2102      this.focus.add(t);
2103      return this;
2104    }
2105
2106    /**
2107     * @return The first repetition of repeating field {@link #focus}, creating it if it does not already exist
2108     */
2109    public MessageDefinitionFocusComponent getFocusFirstRep() { 
2110      if (getFocus().isEmpty()) {
2111        addFocus();
2112      }
2113      return getFocus().get(0);
2114    }
2115
2116    /**
2117     * @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
2118     */
2119    public Enumeration<MessageheaderResponseRequest> getResponseRequiredElement() { 
2120      if (this.responseRequired == null)
2121        if (Configuration.errorOnAutoCreate())
2122          throw new Error("Attempt to auto-create MessageDefinition.responseRequired");
2123        else if (Configuration.doAutoCreate())
2124          this.responseRequired = new Enumeration<MessageheaderResponseRequest>(new MessageheaderResponseRequestEnumFactory()); // bb
2125      return this.responseRequired;
2126    }
2127
2128    public boolean hasResponseRequiredElement() { 
2129      return this.responseRequired != null && !this.responseRequired.isEmpty();
2130    }
2131
2132    public boolean hasResponseRequired() { 
2133      return this.responseRequired != null && !this.responseRequired.isEmpty();
2134    }
2135
2136    /**
2137     * @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
2138     */
2139    public MessageDefinition setResponseRequiredElement(Enumeration<MessageheaderResponseRequest> value) { 
2140      this.responseRequired = value;
2141      return this;
2142    }
2143
2144    /**
2145     * @return Declare at a message definition level whether a response is required or only upon error or success, or never.
2146     */
2147    public MessageheaderResponseRequest getResponseRequired() { 
2148      return this.responseRequired == null ? null : this.responseRequired.getValue();
2149    }
2150
2151    /**
2152     * @param value Declare at a message definition level whether a response is required or only upon error or success, or never.
2153     */
2154    public MessageDefinition setResponseRequired(MessageheaderResponseRequest value) { 
2155      if (value == null)
2156        this.responseRequired = null;
2157      else {
2158        if (this.responseRequired == null)
2159          this.responseRequired = new Enumeration<MessageheaderResponseRequest>(new MessageheaderResponseRequestEnumFactory());
2160        this.responseRequired.setValue(value);
2161      }
2162      return this;
2163    }
2164
2165    /**
2166     * @return {@link #allowedResponse} (Indicates what types of messages may be sent as an application-level response to this message.)
2167     */
2168    public List<MessageDefinitionAllowedResponseComponent> getAllowedResponse() { 
2169      if (this.allowedResponse == null)
2170        this.allowedResponse = new ArrayList<MessageDefinitionAllowedResponseComponent>();
2171      return this.allowedResponse;
2172    }
2173
2174    /**
2175     * @return Returns a reference to <code>this</code> for easy method chaining
2176     */
2177    public MessageDefinition setAllowedResponse(List<MessageDefinitionAllowedResponseComponent> theAllowedResponse) { 
2178      this.allowedResponse = theAllowedResponse;
2179      return this;
2180    }
2181
2182    public boolean hasAllowedResponse() { 
2183      if (this.allowedResponse == null)
2184        return false;
2185      for (MessageDefinitionAllowedResponseComponent item : this.allowedResponse)
2186        if (!item.isEmpty())
2187          return true;
2188      return false;
2189    }
2190
2191    public MessageDefinitionAllowedResponseComponent addAllowedResponse() { //3
2192      MessageDefinitionAllowedResponseComponent t = new MessageDefinitionAllowedResponseComponent();
2193      if (this.allowedResponse == null)
2194        this.allowedResponse = new ArrayList<MessageDefinitionAllowedResponseComponent>();
2195      this.allowedResponse.add(t);
2196      return t;
2197    }
2198
2199    public MessageDefinition addAllowedResponse(MessageDefinitionAllowedResponseComponent t) { //3
2200      if (t == null)
2201        return this;
2202      if (this.allowedResponse == null)
2203        this.allowedResponse = new ArrayList<MessageDefinitionAllowedResponseComponent>();
2204      this.allowedResponse.add(t);
2205      return this;
2206    }
2207
2208    /**
2209     * @return The first repetition of repeating field {@link #allowedResponse}, creating it if it does not already exist
2210     */
2211    public MessageDefinitionAllowedResponseComponent getAllowedResponseFirstRep() { 
2212      if (getAllowedResponse().isEmpty()) {
2213        addAllowedResponse();
2214      }
2215      return getAllowedResponse().get(0);
2216    }
2217
2218    /**
2219     * @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.)
2220     */
2221    public List<CanonicalType> getGraph() { 
2222      if (this.graph == null)
2223        this.graph = new ArrayList<CanonicalType>();
2224      return this.graph;
2225    }
2226
2227    /**
2228     * @return Returns a reference to <code>this</code> for easy method chaining
2229     */
2230    public MessageDefinition setGraph(List<CanonicalType> theGraph) { 
2231      this.graph = theGraph;
2232      return this;
2233    }
2234
2235    public boolean hasGraph() { 
2236      if (this.graph == null)
2237        return false;
2238      for (CanonicalType item : this.graph)
2239        if (!item.isEmpty())
2240          return true;
2241      return false;
2242    }
2243
2244    /**
2245     * @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.)
2246     */
2247    public CanonicalType addGraphElement() {//2 
2248      CanonicalType t = new CanonicalType();
2249      if (this.graph == null)
2250        this.graph = new ArrayList<CanonicalType>();
2251      this.graph.add(t);
2252      return t;
2253    }
2254
2255    /**
2256     * @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.)
2257     */
2258    public MessageDefinition addGraph(String value) { //1
2259      CanonicalType t = new CanonicalType();
2260      t.setValue(value);
2261      if (this.graph == null)
2262        this.graph = new ArrayList<CanonicalType>();
2263      this.graph.add(t);
2264      return this;
2265    }
2266
2267    /**
2268     * @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.)
2269     */
2270    public boolean hasGraph(String value) { 
2271      if (this.graph == null)
2272        return false;
2273      for (CanonicalType v : this.graph)
2274        if (v.getValue().equals(value)) // canonical(GraphDefinition)
2275          return true;
2276      return false;
2277    }
2278
2279      protected void listChildren(List<Property> children) {
2280        super.listChildren(children);
2281        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));
2282        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));
2283        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));
2284        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));
2285        children.add(new Property("title", "string", "A short, descriptive, user-friendly title for the message definition.", 0, 1, title));
2286        children.add(new Property("replaces", "canonical(MessageDefinition)", "A MessageDefinition that is superseded by this definition.", 0, java.lang.Integer.MAX_VALUE, replaces));
2287        children.add(new Property("status", "code", "The status of this message definition. Enables tracking the life-cycle of the content.", 0, 1, status));
2288        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));
2289        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));
2290        children.add(new Property("publisher", "string", "The name of the organization or individual that published the message definition.", 0, 1, publisher));
2291        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));
2292        children.add(new Property("description", "markdown", "A free text natural language description of the message definition from a consumer's perspective.", 0, 1, description));
2293        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));
2294        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));
2295        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));
2296        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));
2297        children.add(new Property("base", "canonical(MessageDefinition)", "The MessageDefinition that is the basis for the contents of this resource.", 0, 1, base));
2298        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));
2299        children.add(new Property("event[x]", "Coding|uri", "Event code or link to the EventDefinition.", 0, 1, event));
2300        children.add(new Property("category", "code", "The impact of the content of the message.", 0, 1, category));
2301        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));
2302        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));
2303        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));
2304        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));
2305      }
2306
2307      @Override
2308      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2309        switch (_hash) {
2310        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);
2311        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);
2312        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);
2313        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);
2314        case 110371416: /*title*/  return new Property("title", "string", "A short, descriptive, user-friendly title for the message definition.", 0, 1, title);
2315        case -430332865: /*replaces*/  return new Property("replaces", "canonical(MessageDefinition)", "A MessageDefinition that is superseded by this definition.", 0, java.lang.Integer.MAX_VALUE, replaces);
2316        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);
2317        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);
2318        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);
2319        case 1447404028: /*publisher*/  return new Property("publisher", "string", "The name of the organization or individual that published the message definition.", 0, 1, publisher);
2320        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);
2321        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);
2322        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);
2323        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);
2324        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);
2325        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);
2326        case 3016401: /*base*/  return new Property("base", "canonical(MessageDefinition)", "The MessageDefinition that is the basis for the contents of this resource.", 0, 1, base);
2327        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);
2328        case 278115238: /*event[x]*/  return new Property("event[x]", "Coding|uri", "Event code or link to the EventDefinition.", 0, 1, event);
2329        case 96891546: /*event*/  return new Property("event[x]", "Coding|uri", "Event code or link to the EventDefinition.", 0, 1, event);
2330        case -355957084: /*eventCoding*/  return new Property("event[x]", "Coding|uri", "Event code or link to the EventDefinition.", 0, 1, event);
2331        case 278109298: /*eventUri*/  return new Property("event[x]", "Coding|uri", "Event code or link to the EventDefinition.", 0, 1, event);
2332        case 50511102: /*category*/  return new Property("category", "code", "The impact of the content of the message.", 0, 1, category);
2333        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);
2334        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);
2335        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);
2336        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);
2337        default: return super.getNamedProperty(_hash, _name, _checkValid);
2338        }
2339
2340      }
2341
2342      @Override
2343      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2344        switch (hash) {
2345        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
2346        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2347        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
2348        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
2349        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
2350        case -430332865: /*replaces*/ return this.replaces == null ? new Base[0] : this.replaces.toArray(new Base[this.replaces.size()]); // CanonicalType
2351        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
2352        case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType
2353        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
2354        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType
2355        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
2356        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
2357        case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
2358        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept
2359        case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // MarkdownType
2360        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
2361        case 3016401: /*base*/ return this.base == null ? new Base[0] : new Base[] {this.base}; // CanonicalType
2362        case -995424086: /*parent*/ return this.parent == null ? new Base[0] : this.parent.toArray(new Base[this.parent.size()]); // CanonicalType
2363        case 96891546: /*event*/ return this.event == null ? new Base[0] : new Base[] {this.event}; // Type
2364        case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Enumeration<MessageSignificanceCategory>
2365        case 97604824: /*focus*/ return this.focus == null ? new Base[0] : this.focus.toArray(new Base[this.focus.size()]); // MessageDefinitionFocusComponent
2366        case 791597824: /*responseRequired*/ return this.responseRequired == null ? new Base[0] : new Base[] {this.responseRequired}; // Enumeration<MessageheaderResponseRequest>
2367        case -1130933751: /*allowedResponse*/ return this.allowedResponse == null ? new Base[0] : this.allowedResponse.toArray(new Base[this.allowedResponse.size()]); // MessageDefinitionAllowedResponseComponent
2368        case 98615630: /*graph*/ return this.graph == null ? new Base[0] : this.graph.toArray(new Base[this.graph.size()]); // CanonicalType
2369        default: return super.getProperty(hash, name, checkValid);
2370        }
2371
2372      }
2373
2374      @Override
2375      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2376        switch (hash) {
2377        case 116079: // url
2378          this.url = castToUri(value); // UriType
2379          return value;
2380        case -1618432855: // identifier
2381          this.getIdentifier().add(castToIdentifier(value)); // Identifier
2382          return value;
2383        case 351608024: // version
2384          this.version = castToString(value); // StringType
2385          return value;
2386        case 3373707: // name
2387          this.name = castToString(value); // StringType
2388          return value;
2389        case 110371416: // title
2390          this.title = castToString(value); // StringType
2391          return value;
2392        case -430332865: // replaces
2393          this.getReplaces().add(castToCanonical(value)); // CanonicalType
2394          return value;
2395        case -892481550: // status
2396          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
2397          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
2398          return value;
2399        case -404562712: // experimental
2400          this.experimental = castToBoolean(value); // BooleanType
2401          return value;
2402        case 3076014: // date
2403          this.date = castToDateTime(value); // DateTimeType
2404          return value;
2405        case 1447404028: // publisher
2406          this.publisher = castToString(value); // StringType
2407          return value;
2408        case 951526432: // contact
2409          this.getContact().add(castToContactDetail(value)); // ContactDetail
2410          return value;
2411        case -1724546052: // description
2412          this.description = castToMarkdown(value); // MarkdownType
2413          return value;
2414        case -669707736: // useContext
2415          this.getUseContext().add(castToUsageContext(value)); // UsageContext
2416          return value;
2417        case -507075711: // jurisdiction
2418          this.getJurisdiction().add(castToCodeableConcept(value)); // CodeableConcept
2419          return value;
2420        case -220463842: // purpose
2421          this.purpose = castToMarkdown(value); // MarkdownType
2422          return value;
2423        case 1522889671: // copyright
2424          this.copyright = castToMarkdown(value); // MarkdownType
2425          return value;
2426        case 3016401: // base
2427          this.base = castToCanonical(value); // CanonicalType
2428          return value;
2429        case -995424086: // parent
2430          this.getParent().add(castToCanonical(value)); // CanonicalType
2431          return value;
2432        case 96891546: // event
2433          this.event = castToType(value); // Type
2434          return value;
2435        case 50511102: // category
2436          value = new MessageSignificanceCategoryEnumFactory().fromType(castToCode(value));
2437          this.category = (Enumeration) value; // Enumeration<MessageSignificanceCategory>
2438          return value;
2439        case 97604824: // focus
2440          this.getFocus().add((MessageDefinitionFocusComponent) value); // MessageDefinitionFocusComponent
2441          return value;
2442        case 791597824: // responseRequired
2443          value = new MessageheaderResponseRequestEnumFactory().fromType(castToCode(value));
2444          this.responseRequired = (Enumeration) value; // Enumeration<MessageheaderResponseRequest>
2445          return value;
2446        case -1130933751: // allowedResponse
2447          this.getAllowedResponse().add((MessageDefinitionAllowedResponseComponent) value); // MessageDefinitionAllowedResponseComponent
2448          return value;
2449        case 98615630: // graph
2450          this.getGraph().add(castToCanonical(value)); // CanonicalType
2451          return value;
2452        default: return super.setProperty(hash, name, value);
2453        }
2454
2455      }
2456
2457      @Override
2458      public Base setProperty(String name, Base value) throws FHIRException {
2459        if (name.equals("url")) {
2460          this.url = castToUri(value); // UriType
2461        } else if (name.equals("identifier")) {
2462          this.getIdentifier().add(castToIdentifier(value));
2463        } else if (name.equals("version")) {
2464          this.version = castToString(value); // StringType
2465        } else if (name.equals("name")) {
2466          this.name = castToString(value); // StringType
2467        } else if (name.equals("title")) {
2468          this.title = castToString(value); // StringType
2469        } else if (name.equals("replaces")) {
2470          this.getReplaces().add(castToCanonical(value));
2471        } else if (name.equals("status")) {
2472          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
2473          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
2474        } else if (name.equals("experimental")) {
2475          this.experimental = castToBoolean(value); // BooleanType
2476        } else if (name.equals("date")) {
2477          this.date = castToDateTime(value); // DateTimeType
2478        } else if (name.equals("publisher")) {
2479          this.publisher = castToString(value); // StringType
2480        } else if (name.equals("contact")) {
2481          this.getContact().add(castToContactDetail(value));
2482        } else if (name.equals("description")) {
2483          this.description = castToMarkdown(value); // MarkdownType
2484        } else if (name.equals("useContext")) {
2485          this.getUseContext().add(castToUsageContext(value));
2486        } else if (name.equals("jurisdiction")) {
2487          this.getJurisdiction().add(castToCodeableConcept(value));
2488        } else if (name.equals("purpose")) {
2489          this.purpose = castToMarkdown(value); // MarkdownType
2490        } else if (name.equals("copyright")) {
2491          this.copyright = castToMarkdown(value); // MarkdownType
2492        } else if (name.equals("base")) {
2493          this.base = castToCanonical(value); // CanonicalType
2494        } else if (name.equals("parent")) {
2495          this.getParent().add(castToCanonical(value));
2496        } else if (name.equals("event[x]")) {
2497          this.event = castToType(value); // Type
2498        } else if (name.equals("category")) {
2499          value = new MessageSignificanceCategoryEnumFactory().fromType(castToCode(value));
2500          this.category = (Enumeration) value; // Enumeration<MessageSignificanceCategory>
2501        } else if (name.equals("focus")) {
2502          this.getFocus().add((MessageDefinitionFocusComponent) value);
2503        } else if (name.equals("responseRequired")) {
2504          value = new MessageheaderResponseRequestEnumFactory().fromType(castToCode(value));
2505          this.responseRequired = (Enumeration) value; // Enumeration<MessageheaderResponseRequest>
2506        } else if (name.equals("allowedResponse")) {
2507          this.getAllowedResponse().add((MessageDefinitionAllowedResponseComponent) value);
2508        } else if (name.equals("graph")) {
2509          this.getGraph().add(castToCanonical(value));
2510        } else
2511          return super.setProperty(name, value);
2512        return value;
2513      }
2514
2515      @Override
2516      public Base makeProperty(int hash, String name) throws FHIRException {
2517        switch (hash) {
2518        case 116079:  return getUrlElement();
2519        case -1618432855:  return addIdentifier(); 
2520        case 351608024:  return getVersionElement();
2521        case 3373707:  return getNameElement();
2522        case 110371416:  return getTitleElement();
2523        case -430332865:  return addReplacesElement();
2524        case -892481550:  return getStatusElement();
2525        case -404562712:  return getExperimentalElement();
2526        case 3076014:  return getDateElement();
2527        case 1447404028:  return getPublisherElement();
2528        case 951526432:  return addContact(); 
2529        case -1724546052:  return getDescriptionElement();
2530        case -669707736:  return addUseContext(); 
2531        case -507075711:  return addJurisdiction(); 
2532        case -220463842:  return getPurposeElement();
2533        case 1522889671:  return getCopyrightElement();
2534        case 3016401:  return getBaseElement();
2535        case -995424086:  return addParentElement();
2536        case 278115238:  return getEvent(); 
2537        case 96891546:  return getEvent(); 
2538        case 50511102:  return getCategoryElement();
2539        case 97604824:  return addFocus(); 
2540        case 791597824:  return getResponseRequiredElement();
2541        case -1130933751:  return addAllowedResponse(); 
2542        case 98615630:  return addGraphElement();
2543        default: return super.makeProperty(hash, name);
2544        }
2545
2546      }
2547
2548      @Override
2549      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2550        switch (hash) {
2551        case 116079: /*url*/ return new String[] {"uri"};
2552        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2553        case 351608024: /*version*/ return new String[] {"string"};
2554        case 3373707: /*name*/ return new String[] {"string"};
2555        case 110371416: /*title*/ return new String[] {"string"};
2556        case -430332865: /*replaces*/ return new String[] {"canonical"};
2557        case -892481550: /*status*/ return new String[] {"code"};
2558        case -404562712: /*experimental*/ return new String[] {"boolean"};
2559        case 3076014: /*date*/ return new String[] {"dateTime"};
2560        case 1447404028: /*publisher*/ return new String[] {"string"};
2561        case 951526432: /*contact*/ return new String[] {"ContactDetail"};
2562        case -1724546052: /*description*/ return new String[] {"markdown"};
2563        case -669707736: /*useContext*/ return new String[] {"UsageContext"};
2564        case -507075711: /*jurisdiction*/ return new String[] {"CodeableConcept"};
2565        case -220463842: /*purpose*/ return new String[] {"markdown"};
2566        case 1522889671: /*copyright*/ return new String[] {"markdown"};
2567        case 3016401: /*base*/ return new String[] {"canonical"};
2568        case -995424086: /*parent*/ return new String[] {"canonical"};
2569        case 96891546: /*event*/ return new String[] {"Coding", "uri"};
2570        case 50511102: /*category*/ return new String[] {"code"};
2571        case 97604824: /*focus*/ return new String[] {};
2572        case 791597824: /*responseRequired*/ return new String[] {"code"};
2573        case -1130933751: /*allowedResponse*/ return new String[] {};
2574        case 98615630: /*graph*/ return new String[] {"canonical"};
2575        default: return super.getTypesForProperty(hash, name);
2576        }
2577
2578      }
2579
2580      @Override
2581      public Base addChild(String name) throws FHIRException {
2582        if (name.equals("url")) {
2583          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.url");
2584        }
2585        else if (name.equals("identifier")) {
2586          return addIdentifier();
2587        }
2588        else if (name.equals("version")) {
2589          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.version");
2590        }
2591        else if (name.equals("name")) {
2592          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.name");
2593        }
2594        else if (name.equals("title")) {
2595          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.title");
2596        }
2597        else if (name.equals("replaces")) {
2598          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.replaces");
2599        }
2600        else if (name.equals("status")) {
2601          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.status");
2602        }
2603        else if (name.equals("experimental")) {
2604          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.experimental");
2605        }
2606        else if (name.equals("date")) {
2607          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.date");
2608        }
2609        else if (name.equals("publisher")) {
2610          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.publisher");
2611        }
2612        else if (name.equals("contact")) {
2613          return addContact();
2614        }
2615        else if (name.equals("description")) {
2616          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.description");
2617        }
2618        else if (name.equals("useContext")) {
2619          return addUseContext();
2620        }
2621        else if (name.equals("jurisdiction")) {
2622          return addJurisdiction();
2623        }
2624        else if (name.equals("purpose")) {
2625          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.purpose");
2626        }
2627        else if (name.equals("copyright")) {
2628          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.copyright");
2629        }
2630        else if (name.equals("base")) {
2631          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.base");
2632        }
2633        else if (name.equals("parent")) {
2634          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.parent");
2635        }
2636        else if (name.equals("eventCoding")) {
2637          this.event = new Coding();
2638          return this.event;
2639        }
2640        else if (name.equals("eventUri")) {
2641          this.event = new UriType();
2642          return this.event;
2643        }
2644        else if (name.equals("category")) {
2645          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.category");
2646        }
2647        else if (name.equals("focus")) {
2648          return addFocus();
2649        }
2650        else if (name.equals("responseRequired")) {
2651          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.responseRequired");
2652        }
2653        else if (name.equals("allowedResponse")) {
2654          return addAllowedResponse();
2655        }
2656        else if (name.equals("graph")) {
2657          throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.graph");
2658        }
2659        else
2660          return super.addChild(name);
2661      }
2662
2663  public String fhirType() {
2664    return "MessageDefinition";
2665
2666  }
2667
2668      public MessageDefinition copy() {
2669        MessageDefinition dst = new MessageDefinition();
2670        copyValues(dst);
2671        dst.url = url == null ? null : url.copy();
2672        if (identifier != null) {
2673          dst.identifier = new ArrayList<Identifier>();
2674          for (Identifier i : identifier)
2675            dst.identifier.add(i.copy());
2676        };
2677        dst.version = version == null ? null : version.copy();
2678        dst.name = name == null ? null : name.copy();
2679        dst.title = title == null ? null : title.copy();
2680        if (replaces != null) {
2681          dst.replaces = new ArrayList<CanonicalType>();
2682          for (CanonicalType i : replaces)
2683            dst.replaces.add(i.copy());
2684        };
2685        dst.status = status == null ? null : status.copy();
2686        dst.experimental = experimental == null ? null : experimental.copy();
2687        dst.date = date == null ? null : date.copy();
2688        dst.publisher = publisher == null ? null : publisher.copy();
2689        if (contact != null) {
2690          dst.contact = new ArrayList<ContactDetail>();
2691          for (ContactDetail i : contact)
2692            dst.contact.add(i.copy());
2693        };
2694        dst.description = description == null ? null : description.copy();
2695        if (useContext != null) {
2696          dst.useContext = new ArrayList<UsageContext>();
2697          for (UsageContext i : useContext)
2698            dst.useContext.add(i.copy());
2699        };
2700        if (jurisdiction != null) {
2701          dst.jurisdiction = new ArrayList<CodeableConcept>();
2702          for (CodeableConcept i : jurisdiction)
2703            dst.jurisdiction.add(i.copy());
2704        };
2705        dst.purpose = purpose == null ? null : purpose.copy();
2706        dst.copyright = copyright == null ? null : copyright.copy();
2707        dst.base = base == null ? null : base.copy();
2708        if (parent != null) {
2709          dst.parent = new ArrayList<CanonicalType>();
2710          for (CanonicalType i : parent)
2711            dst.parent.add(i.copy());
2712        };
2713        dst.event = event == null ? null : event.copy();
2714        dst.category = category == null ? null : category.copy();
2715        if (focus != null) {
2716          dst.focus = new ArrayList<MessageDefinitionFocusComponent>();
2717          for (MessageDefinitionFocusComponent i : focus)
2718            dst.focus.add(i.copy());
2719        };
2720        dst.responseRequired = responseRequired == null ? null : responseRequired.copy();
2721        if (allowedResponse != null) {
2722          dst.allowedResponse = new ArrayList<MessageDefinitionAllowedResponseComponent>();
2723          for (MessageDefinitionAllowedResponseComponent i : allowedResponse)
2724            dst.allowedResponse.add(i.copy());
2725        };
2726        if (graph != null) {
2727          dst.graph = new ArrayList<CanonicalType>();
2728          for (CanonicalType i : graph)
2729            dst.graph.add(i.copy());
2730        };
2731        return dst;
2732      }
2733
2734      protected MessageDefinition typedCopy() {
2735        return copy();
2736      }
2737
2738      @Override
2739      public boolean equalsDeep(Base other_) {
2740        if (!super.equalsDeep(other_))
2741          return false;
2742        if (!(other_ instanceof MessageDefinition))
2743          return false;
2744        MessageDefinition o = (MessageDefinition) other_;
2745        return compareDeep(identifier, o.identifier, true) && compareDeep(replaces, o.replaces, true) && compareDeep(purpose, o.purpose, true)
2746           && compareDeep(copyright, o.copyright, true) && compareDeep(base, o.base, true) && compareDeep(parent, o.parent, true)
2747           && compareDeep(event, o.event, true) && compareDeep(category, o.category, true) && compareDeep(focus, o.focus, true)
2748           && compareDeep(responseRequired, o.responseRequired, true) && compareDeep(allowedResponse, o.allowedResponse, true)
2749           && compareDeep(graph, o.graph, true);
2750      }
2751
2752      @Override
2753      public boolean equalsShallow(Base other_) {
2754        if (!super.equalsShallow(other_))
2755          return false;
2756        if (!(other_ instanceof MessageDefinition))
2757          return false;
2758        MessageDefinition o = (MessageDefinition) other_;
2759        return compareValues(purpose, o.purpose, true) && compareValues(copyright, o.copyright, true) && compareValues(category, o.category, true)
2760           && compareValues(responseRequired, o.responseRequired, true);
2761      }
2762
2763      public boolean isEmpty() {
2764        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, replaces, purpose
2765          , copyright, base, parent, event, category, focus, responseRequired, allowedResponse
2766          , graph);
2767      }
2768
2769  @Override
2770  public ResourceType getResourceType() {
2771    return ResourceType.MessageDefinition;
2772   }
2773
2774 /**
2775   * Search parameter: <b>date</b>
2776   * <p>
2777   * Description: <b>The message definition publication date</b><br>
2778   * Type: <b>date</b><br>
2779   * Path: <b>MessageDefinition.date</b><br>
2780   * </p>
2781   */
2782  @SearchParamDefinition(name="date", path="MessageDefinition.date", description="The message definition publication date", type="date" )
2783  public static final String SP_DATE = "date";
2784 /**
2785   * <b>Fluent Client</b> search parameter constant for <b>date</b>
2786   * <p>
2787   * Description: <b>The message definition publication date</b><br>
2788   * Type: <b>date</b><br>
2789   * Path: <b>MessageDefinition.date</b><br>
2790   * </p>
2791   */
2792  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
2793
2794 /**
2795   * Search parameter: <b>identifier</b>
2796   * <p>
2797   * Description: <b>External identifier for the message definition</b><br>
2798   * Type: <b>token</b><br>
2799   * Path: <b>MessageDefinition.identifier</b><br>
2800   * </p>
2801   */
2802  @SearchParamDefinition(name="identifier", path="MessageDefinition.identifier", description="External identifier for the message definition", type="token" )
2803  public static final String SP_IDENTIFIER = "identifier";
2804 /**
2805   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2806   * <p>
2807   * Description: <b>External identifier for the message definition</b><br>
2808   * Type: <b>token</b><br>
2809   * Path: <b>MessageDefinition.identifier</b><br>
2810   * </p>
2811   */
2812  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2813
2814 /**
2815   * Search parameter: <b>parent</b>
2816   * <p>
2817   * Description: <b>A resource that is the parent of the definition</b><br>
2818   * Type: <b>token</b><br>
2819   * Path: <b></b><br>
2820   * </p>
2821   */
2822  @SearchParamDefinition(name="parent", path="", description="A resource that is the parent of the definition", type="token" )
2823  public static final String SP_PARENT = "parent";
2824 /**
2825   * <b>Fluent Client</b> search parameter constant for <b>parent</b>
2826   * <p>
2827   * Description: <b>A resource that is the parent of the definition</b><br>
2828   * Type: <b>token</b><br>
2829   * Path: <b></b><br>
2830   * </p>
2831   */
2832  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PARENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PARENT);
2833
2834 /**
2835   * Search parameter: <b>context-type-value</b>
2836   * <p>
2837   * Description: <b>A use context type and value assigned to the message definition</b><br>
2838   * Type: <b>composite</b><br>
2839   * Path: <b></b><br>
2840   * </p>
2841   */
2842  @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"} )
2843  public static final String SP_CONTEXT_TYPE_VALUE = "context-type-value";
2844 /**
2845   * <b>Fluent Client</b> search parameter constant for <b>context-type-value</b>
2846   * <p>
2847   * Description: <b>A use context type and value assigned to the message definition</b><br>
2848   * Type: <b>composite</b><br>
2849   * Path: <b></b><br>
2850   * </p>
2851   */
2852  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);
2853
2854 /**
2855   * Search parameter: <b>jurisdiction</b>
2856   * <p>
2857   * Description: <b>Intended jurisdiction for the message definition</b><br>
2858   * Type: <b>token</b><br>
2859   * Path: <b>MessageDefinition.jurisdiction</b><br>
2860   * </p>
2861   */
2862  @SearchParamDefinition(name="jurisdiction", path="MessageDefinition.jurisdiction", description="Intended jurisdiction for the message definition", type="token" )
2863  public static final String SP_JURISDICTION = "jurisdiction";
2864 /**
2865   * <b>Fluent Client</b> search parameter constant for <b>jurisdiction</b>
2866   * <p>
2867   * Description: <b>Intended jurisdiction for the message definition</b><br>
2868   * Type: <b>token</b><br>
2869   * Path: <b>MessageDefinition.jurisdiction</b><br>
2870   * </p>
2871   */
2872  public static final ca.uhn.fhir.rest.gclient.TokenClientParam JURISDICTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_JURISDICTION);
2873
2874 /**
2875   * Search parameter: <b>description</b>
2876   * <p>
2877   * Description: <b>The description of the message definition</b><br>
2878   * Type: <b>string</b><br>
2879   * Path: <b>MessageDefinition.description</b><br>
2880   * </p>
2881   */
2882  @SearchParamDefinition(name="description", path="MessageDefinition.description", description="The description of the message definition", type="string" )
2883  public static final String SP_DESCRIPTION = "description";
2884 /**
2885   * <b>Fluent Client</b> search parameter constant for <b>description</b>
2886   * <p>
2887   * Description: <b>The description of the message definition</b><br>
2888   * Type: <b>string</b><br>
2889   * Path: <b>MessageDefinition.description</b><br>
2890   * </p>
2891   */
2892  public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION);
2893
2894 /**
2895   * Search parameter: <b>focus</b>
2896   * <p>
2897   * Description: <b>A resource that is a permitted focus of the message</b><br>
2898   * Type: <b>token</b><br>
2899   * Path: <b>MessageDefinition.focus.code</b><br>
2900   * </p>
2901   */
2902  @SearchParamDefinition(name="focus", path="MessageDefinition.focus.code", description="A resource that is a permitted focus of the message", type="token" )
2903  public static final String SP_FOCUS = "focus";
2904 /**
2905   * <b>Fluent Client</b> search parameter constant for <b>focus</b>
2906   * <p>
2907   * Description: <b>A resource that is a permitted focus of the message</b><br>
2908   * Type: <b>token</b><br>
2909   * Path: <b>MessageDefinition.focus.code</b><br>
2910   * </p>
2911   */
2912  public static final ca.uhn.fhir.rest.gclient.TokenClientParam FOCUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FOCUS);
2913
2914 /**
2915   * Search parameter: <b>context-type</b>
2916   * <p>
2917   * Description: <b>A type of use context assigned to the message definition</b><br>
2918   * Type: <b>token</b><br>
2919   * Path: <b>MessageDefinition.useContext.code</b><br>
2920   * </p>
2921   */
2922  @SearchParamDefinition(name="context-type", path="MessageDefinition.useContext.code", description="A type of use context assigned to the message definition", type="token" )
2923  public static final String SP_CONTEXT_TYPE = "context-type";
2924 /**
2925   * <b>Fluent Client</b> search parameter constant for <b>context-type</b>
2926   * <p>
2927   * Description: <b>A type of use context assigned to the message definition</b><br>
2928   * Type: <b>token</b><br>
2929   * Path: <b>MessageDefinition.useContext.code</b><br>
2930   * </p>
2931   */
2932  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT_TYPE);
2933
2934 /**
2935   * Search parameter: <b>title</b>
2936   * <p>
2937   * Description: <b>The human-friendly name of the message definition</b><br>
2938   * Type: <b>string</b><br>
2939   * Path: <b>MessageDefinition.title</b><br>
2940   * </p>
2941   */
2942  @SearchParamDefinition(name="title", path="MessageDefinition.title", description="The human-friendly name of the message definition", type="string" )
2943  public static final String SP_TITLE = "title";
2944 /**
2945   * <b>Fluent Client</b> search parameter constant for <b>title</b>
2946   * <p>
2947   * Description: <b>The human-friendly name of the message definition</b><br>
2948   * Type: <b>string</b><br>
2949   * Path: <b>MessageDefinition.title</b><br>
2950   * </p>
2951   */
2952  public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE);
2953
2954 /**
2955   * Search parameter: <b>version</b>
2956   * <p>
2957   * Description: <b>The business version of the message definition</b><br>
2958   * Type: <b>token</b><br>
2959   * Path: <b>MessageDefinition.version</b><br>
2960   * </p>
2961   */
2962  @SearchParamDefinition(name="version", path="MessageDefinition.version", description="The business version of the message definition", type="token" )
2963  public static final String SP_VERSION = "version";
2964 /**
2965   * <b>Fluent Client</b> search parameter constant for <b>version</b>
2966   * <p>
2967   * Description: <b>The business version of the message definition</b><br>
2968   * Type: <b>token</b><br>
2969   * Path: <b>MessageDefinition.version</b><br>
2970   * </p>
2971   */
2972  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION);
2973
2974 /**
2975   * Search parameter: <b>url</b>
2976   * <p>
2977   * Description: <b>The uri that identifies the message definition</b><br>
2978   * Type: <b>uri</b><br>
2979   * Path: <b>MessageDefinition.url</b><br>
2980   * </p>
2981   */
2982  @SearchParamDefinition(name="url", path="MessageDefinition.url", description="The uri that identifies the message definition", type="uri" )
2983  public static final String SP_URL = "url";
2984 /**
2985   * <b>Fluent Client</b> search parameter constant for <b>url</b>
2986   * <p>
2987   * Description: <b>The uri that identifies the message definition</b><br>
2988   * Type: <b>uri</b><br>
2989   * Path: <b>MessageDefinition.url</b><br>
2990   * </p>
2991   */
2992  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
2993
2994 /**
2995   * Search parameter: <b>context-quantity</b>
2996   * <p>
2997   * Description: <b>A quantity- or range-valued use context assigned to the message definition</b><br>
2998   * Type: <b>quantity</b><br>
2999   * Path: <b>MessageDefinition.useContext.valueQuantity, MessageDefinition.useContext.valueRange</b><br>
3000   * </p>
3001   */
3002  @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" )
3003  public static final String SP_CONTEXT_QUANTITY = "context-quantity";
3004 /**
3005   * <b>Fluent Client</b> search parameter constant for <b>context-quantity</b>
3006   * <p>
3007   * Description: <b>A quantity- or range-valued use context assigned to the message definition</b><br>
3008   * Type: <b>quantity</b><br>
3009   * Path: <b>MessageDefinition.useContext.valueQuantity, MessageDefinition.useContext.valueRange</b><br>
3010   * </p>
3011   */
3012  public static final ca.uhn.fhir.rest.gclient.QuantityClientParam CONTEXT_QUANTITY = new ca.uhn.fhir.rest.gclient.QuantityClientParam(SP_CONTEXT_QUANTITY);
3013
3014 /**
3015   * Search parameter: <b>name</b>
3016   * <p>
3017   * Description: <b>Computationally friendly name of the message definition</b><br>
3018   * Type: <b>string</b><br>
3019   * Path: <b>MessageDefinition.name</b><br>
3020   * </p>
3021   */
3022  @SearchParamDefinition(name="name", path="MessageDefinition.name", description="Computationally friendly name of the message definition", type="string" )
3023  public static final String SP_NAME = "name";
3024 /**
3025   * <b>Fluent Client</b> search parameter constant for <b>name</b>
3026   * <p>
3027   * Description: <b>Computationally friendly name of the message definition</b><br>
3028   * Type: <b>string</b><br>
3029   * Path: <b>MessageDefinition.name</b><br>
3030   * </p>
3031   */
3032  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
3033
3034 /**
3035   * Search parameter: <b>context</b>
3036   * <p>
3037   * Description: <b>A use context assigned to the message definition</b><br>
3038   * Type: <b>token</b><br>
3039   * Path: <b>MessageDefinition.useContext.valueCodeableConcept</b><br>
3040   * </p>
3041   */
3042  @SearchParamDefinition(name="context", path="(MessageDefinition.useContext.value as CodeableConcept)", description="A use context assigned to the message definition", type="token" )
3043  public static final String SP_CONTEXT = "context";
3044 /**
3045   * <b>Fluent Client</b> search parameter constant for <b>context</b>
3046   * <p>
3047   * Description: <b>A use context assigned to the message definition</b><br>
3048   * Type: <b>token</b><br>
3049   * Path: <b>MessageDefinition.useContext.valueCodeableConcept</b><br>
3050   * </p>
3051   */
3052  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT);
3053
3054 /**
3055   * Search parameter: <b>publisher</b>
3056   * <p>
3057   * Description: <b>Name of the publisher of the message definition</b><br>
3058   * Type: <b>string</b><br>
3059   * Path: <b>MessageDefinition.publisher</b><br>
3060   * </p>
3061   */
3062  @SearchParamDefinition(name="publisher", path="MessageDefinition.publisher", description="Name of the publisher of the message definition", type="string" )
3063  public static final String SP_PUBLISHER = "publisher";
3064 /**
3065   * <b>Fluent Client</b> search parameter constant for <b>publisher</b>
3066   * <p>
3067   * Description: <b>Name of the publisher of the message definition</b><br>
3068   * Type: <b>string</b><br>
3069   * Path: <b>MessageDefinition.publisher</b><br>
3070   * </p>
3071   */
3072  public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER);
3073
3074 /**
3075   * Search parameter: <b>event</b>
3076   * <p>
3077   * Description: <b>The event that triggers the message or link to the event definition.</b><br>
3078   * Type: <b>token</b><br>
3079   * Path: <b>MessageDefinition.event[x]</b><br>
3080   * </p>
3081   */
3082  @SearchParamDefinition(name="event", path="MessageDefinition.event", description="The event that triggers the message or link to the event definition.", type="token" )
3083  public static final String SP_EVENT = "event";
3084 /**
3085   * <b>Fluent Client</b> search parameter constant for <b>event</b>
3086   * <p>
3087   * Description: <b>The event that triggers the message or link to the event definition.</b><br>
3088   * Type: <b>token</b><br>
3089   * Path: <b>MessageDefinition.event[x]</b><br>
3090   * </p>
3091   */
3092  public static final ca.uhn.fhir.rest.gclient.TokenClientParam EVENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EVENT);
3093
3094 /**
3095   * Search parameter: <b>category</b>
3096   * <p>
3097   * Description: <b>The behavior associated with the message</b><br>
3098   * Type: <b>token</b><br>
3099   * Path: <b>MessageDefinition.category</b><br>
3100   * </p>
3101   */
3102  @SearchParamDefinition(name="category", path="MessageDefinition.category", description="The behavior associated with the message", type="token" )
3103  public static final String SP_CATEGORY = "category";
3104 /**
3105   * <b>Fluent Client</b> search parameter constant for <b>category</b>
3106   * <p>
3107   * Description: <b>The behavior associated with the message</b><br>
3108   * Type: <b>token</b><br>
3109   * Path: <b>MessageDefinition.category</b><br>
3110   * </p>
3111   */
3112  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY);
3113
3114 /**
3115   * Search parameter: <b>context-type-quantity</b>
3116   * <p>
3117   * Description: <b>A use context type and quantity- or range-based value assigned to the message definition</b><br>
3118   * Type: <b>composite</b><br>
3119   * Path: <b></b><br>
3120   * </p>
3121   */
3122  @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"} )
3123  public static final String SP_CONTEXT_TYPE_QUANTITY = "context-type-quantity";
3124 /**
3125   * <b>Fluent Client</b> search parameter constant for <b>context-type-quantity</b>
3126   * <p>
3127   * Description: <b>A use context type and quantity- or range-based value assigned to the message definition</b><br>
3128   * Type: <b>composite</b><br>
3129   * Path: <b></b><br>
3130   * </p>
3131   */
3132  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);
3133
3134 /**
3135   * Search parameter: <b>status</b>
3136   * <p>
3137   * Description: <b>The current status of the message definition</b><br>
3138   * Type: <b>token</b><br>
3139   * Path: <b>MessageDefinition.status</b><br>
3140   * </p>
3141   */
3142  @SearchParamDefinition(name="status", path="MessageDefinition.status", description="The current status of the message definition", type="token" )
3143  public static final String SP_STATUS = "status";
3144 /**
3145   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3146   * <p>
3147   * Description: <b>The current status of the message definition</b><br>
3148   * Type: <b>token</b><br>
3149   * Path: <b>MessageDefinition.status</b><br>
3150   * </p>
3151   */
3152  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3153
3154
3155}
3156