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