001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Fri, Jul 15, 2022 11:20+1000 for FHIR v5.0.0-snapshot2
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * Describes a stream of resource state changes identified by trigger criteria and annotated with labels useful to filter projections from this topic.
052 */
053@ResourceDef(name="SubscriptionTopic", profile="http://hl7.org/fhir/StructureDefinition/SubscriptionTopic")
054public class SubscriptionTopic extends CanonicalResource {
055
056    public enum CriteriaNotExistsBehavior {
057        /**
058         * The requested conditional statement will pass if a matching state does not exist (e.g., previous state during create).
059         */
060        TESTPASSES, 
061        /**
062         * The requested conditional statement will fail if a matching state does not exist (e.g., previous state during create).
063         */
064        TESTFAILS, 
065        /**
066         * added to help the parsers with the generic types
067         */
068        NULL;
069        public static CriteriaNotExistsBehavior fromCode(String codeString) throws FHIRException {
070            if (codeString == null || "".equals(codeString))
071                return null;
072        if ("test-passes".equals(codeString))
073          return TESTPASSES;
074        if ("test-fails".equals(codeString))
075          return TESTFAILS;
076        if (Configuration.isAcceptInvalidEnums())
077          return null;
078        else
079          throw new FHIRException("Unknown CriteriaNotExistsBehavior code '"+codeString+"'");
080        }
081        public String toCode() {
082          switch (this) {
083            case TESTPASSES: return "test-passes";
084            case TESTFAILS: return "test-fails";
085            case NULL: return null;
086            default: return "?";
087          }
088        }
089        public String getSystem() {
090          switch (this) {
091            case TESTPASSES: return "http://hl7.org/fhir/subscriptiontopic-cr-behavior";
092            case TESTFAILS: return "http://hl7.org/fhir/subscriptiontopic-cr-behavior";
093            case NULL: return null;
094            default: return "?";
095          }
096        }
097        public String getDefinition() {
098          switch (this) {
099            case TESTPASSES: return "The requested conditional statement will pass if a matching state does not exist (e.g., previous state during create).";
100            case TESTFAILS: return "The requested conditional statement will fail if a matching state does not exist (e.g., previous state during create).";
101            case NULL: return null;
102            default: return "?";
103          }
104        }
105        public String getDisplay() {
106          switch (this) {
107            case TESTPASSES: return "test passes";
108            case TESTFAILS: return "test fails";
109            case NULL: return null;
110            default: return "?";
111          }
112        }
113    }
114
115  public static class CriteriaNotExistsBehaviorEnumFactory implements EnumFactory<CriteriaNotExistsBehavior> {
116    public CriteriaNotExistsBehavior fromCode(String codeString) throws IllegalArgumentException {
117      if (codeString == null || "".equals(codeString))
118            if (codeString == null || "".equals(codeString))
119                return null;
120        if ("test-passes".equals(codeString))
121          return CriteriaNotExistsBehavior.TESTPASSES;
122        if ("test-fails".equals(codeString))
123          return CriteriaNotExistsBehavior.TESTFAILS;
124        throw new IllegalArgumentException("Unknown CriteriaNotExistsBehavior code '"+codeString+"'");
125        }
126        public Enumeration<CriteriaNotExistsBehavior> fromType(Base code) throws FHIRException {
127          if (code == null)
128            return null;
129          if (code.isEmpty())
130            return new Enumeration<CriteriaNotExistsBehavior>(this);
131          String codeString = ((PrimitiveType) code).asStringValue();
132          if (codeString == null || "".equals(codeString))
133            return null;
134        if ("test-passes".equals(codeString))
135          return new Enumeration<CriteriaNotExistsBehavior>(this, CriteriaNotExistsBehavior.TESTPASSES);
136        if ("test-fails".equals(codeString))
137          return new Enumeration<CriteriaNotExistsBehavior>(this, CriteriaNotExistsBehavior.TESTFAILS);
138        throw new FHIRException("Unknown CriteriaNotExistsBehavior code '"+codeString+"'");
139        }
140    public String toCode(CriteriaNotExistsBehavior code) {
141      if (code == CriteriaNotExistsBehavior.TESTPASSES)
142        return "test-passes";
143      if (code == CriteriaNotExistsBehavior.TESTFAILS)
144        return "test-fails";
145      return "?";
146      }
147    public String toSystem(CriteriaNotExistsBehavior code) {
148      return code.getSystem();
149      }
150    }
151
152    public enum InteractionTrigger {
153        /**
154         * Create a new resource with a server assigned id.
155         */
156        CREATE, 
157        /**
158         * Update an existing resource by its id (or create it if it is new).
159         */
160        UPDATE, 
161        /**
162         * Delete a resource.
163         */
164        DELETE, 
165        /**
166         * added to help the parsers with the generic types
167         */
168        NULL;
169        public static InteractionTrigger fromCode(String codeString) throws FHIRException {
170            if (codeString == null || "".equals(codeString))
171                return null;
172        if ("create".equals(codeString))
173          return CREATE;
174        if ("update".equals(codeString))
175          return UPDATE;
176        if ("delete".equals(codeString))
177          return DELETE;
178        if (Configuration.isAcceptInvalidEnums())
179          return null;
180        else
181          throw new FHIRException("Unknown InteractionTrigger code '"+codeString+"'");
182        }
183        public String toCode() {
184          switch (this) {
185            case CREATE: return "create";
186            case UPDATE: return "update";
187            case DELETE: return "delete";
188            case NULL: return null;
189            default: return "?";
190          }
191        }
192        public String getSystem() {
193          switch (this) {
194            case CREATE: return "http://hl7.org/fhir/restful-interaction";
195            case UPDATE: return "http://hl7.org/fhir/restful-interaction";
196            case DELETE: return "http://hl7.org/fhir/restful-interaction";
197            case NULL: return null;
198            default: return "?";
199          }
200        }
201        public String getDefinition() {
202          switch (this) {
203            case CREATE: return "Create a new resource with a server assigned id.";
204            case UPDATE: return "Update an existing resource by its id (or create it if it is new).";
205            case DELETE: return "Delete a resource.";
206            case NULL: return null;
207            default: return "?";
208          }
209        }
210        public String getDisplay() {
211          switch (this) {
212            case CREATE: return "create";
213            case UPDATE: return "update";
214            case DELETE: return "delete";
215            case NULL: return null;
216            default: return "?";
217          }
218        }
219    }
220
221  public static class InteractionTriggerEnumFactory implements EnumFactory<InteractionTrigger> {
222    public InteractionTrigger fromCode(String codeString) throws IllegalArgumentException {
223      if (codeString == null || "".equals(codeString))
224            if (codeString == null || "".equals(codeString))
225                return null;
226        if ("create".equals(codeString))
227          return InteractionTrigger.CREATE;
228        if ("update".equals(codeString))
229          return InteractionTrigger.UPDATE;
230        if ("delete".equals(codeString))
231          return InteractionTrigger.DELETE;
232        throw new IllegalArgumentException("Unknown InteractionTrigger code '"+codeString+"'");
233        }
234        public Enumeration<InteractionTrigger> fromType(Base code) throws FHIRException {
235          if (code == null)
236            return null;
237          if (code.isEmpty())
238            return new Enumeration<InteractionTrigger>(this);
239          String codeString = ((PrimitiveType) code).asStringValue();
240          if (codeString == null || "".equals(codeString))
241            return null;
242        if ("create".equals(codeString))
243          return new Enumeration<InteractionTrigger>(this, InteractionTrigger.CREATE);
244        if ("update".equals(codeString))
245          return new Enumeration<InteractionTrigger>(this, InteractionTrigger.UPDATE);
246        if ("delete".equals(codeString))
247          return new Enumeration<InteractionTrigger>(this, InteractionTrigger.DELETE);
248        throw new FHIRException("Unknown InteractionTrigger code '"+codeString+"'");
249        }
250    public String toCode(InteractionTrigger code) {
251      if (code == InteractionTrigger.CREATE)
252        return "create";
253      if (code == InteractionTrigger.UPDATE)
254        return "update";
255      if (code == InteractionTrigger.DELETE)
256        return "delete";
257      return "?";
258      }
259    public String toSystem(InteractionTrigger code) {
260      return code.getSystem();
261      }
262    }
263
264    @Block()
265    public static class SubscriptionTopicResourceTriggerComponent extends BackboneElement implements IBaseBackboneElement {
266        /**
267         * The human readable description of this resource trigger for the SubscriptionTopic -  for example, "An Encounter enters the 'in-progress' state".
268         */
269        @Child(name = "description", type = {MarkdownType.class}, order=1, min=0, max=1, modifier=false, summary=true)
270        @Description(shortDefinition="Text representation of the resource trigger", formalDefinition="The human readable description of this resource trigger for the SubscriptionTopic -  for example, \"An Encounter enters the 'in-progress' state\"." )
271        protected MarkdownType description;
272
273        /**
274         * URL of the Resource that is the type used in this resource trigger.  Relative URLs are relative to the StructureDefinition root of the implemented FHIR version (e.g., http://hl7.org/fhir/StructureDefinition). For example, "Patient" maps to http://hl7.org/fhir/StructureDefinition/Patient.  For more information, see <a href="elementdefinition-definitions.html#ElementDefinition.type.code">ElementDefinition.type.code</a>.
275         */
276        @Child(name = "resource", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=true)
277        @Description(shortDefinition="Data Type or Resource (reference to definition) for this trigger definition", formalDefinition="URL of the Resource that is the type used in this resource trigger.  Relative URLs are relative to the StructureDefinition root of the implemented FHIR version (e.g., http://hl7.org/fhir/StructureDefinition). For example, \"Patient\" maps to http://hl7.org/fhir/StructureDefinition/Patient.  For more information, see <a href=\"elementdefinition-definitions.html#ElementDefinition.type.code\">ElementDefinition.type.code</a>." )
278        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/defined-types")
279        protected UriType resource;
280
281        /**
282         * The FHIR RESTful interaction which can be used to trigger a notification for the SubscriptionTopic. Multiple values are considered OR joined (e.g., CREATE or UPDATE).
283         */
284        @Child(name = "supportedInteraction", type = {CodeType.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
285        @Description(shortDefinition="create | update | delete", formalDefinition="The FHIR RESTful interaction which can be used to trigger a notification for the SubscriptionTopic. Multiple values are considered OR joined (e.g., CREATE or UPDATE)." )
286        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/interaction-trigger")
287        protected List<Enumeration<InteractionTrigger>> supportedInteraction;
288
289        /**
290         * The FHIR query based rules that the server should use to determine when to trigger a notification for this subscription topic.
291         */
292        @Child(name = "queryCriteria", type = {}, order=4, min=0, max=1, modifier=false, summary=true)
293        @Description(shortDefinition="Query based trigger rule", formalDefinition="The FHIR query based rules that the server should use to determine when to trigger a notification for this subscription topic." )
294        protected SubscriptionTopicResourceTriggerQueryCriteriaComponent queryCriteria;
295
296        /**
297         * The FHIRPath based rules that the server should use to determine when to trigger a notification for this topic.
298         */
299        @Child(name = "fhirPathCriteria", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true)
300        @Description(shortDefinition="FHIRPath based trigger rule", formalDefinition="The FHIRPath based rules that the server should use to determine when to trigger a notification for this topic." )
301        protected StringType fhirPathCriteria;
302
303        private static final long serialVersionUID = -1086940999L;
304
305    /**
306     * Constructor
307     */
308      public SubscriptionTopicResourceTriggerComponent() {
309        super();
310      }
311
312    /**
313     * Constructor
314     */
315      public SubscriptionTopicResourceTriggerComponent(String resource) {
316        super();
317        this.setResource(resource);
318      }
319
320        /**
321         * @return {@link #description} (The human readable description of this resource trigger for the SubscriptionTopic -  for example, "An Encounter enters the 'in-progress' state".). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
322         */
323        public MarkdownType getDescriptionElement() { 
324          if (this.description == null)
325            if (Configuration.errorOnAutoCreate())
326              throw new Error("Attempt to auto-create SubscriptionTopicResourceTriggerComponent.description");
327            else if (Configuration.doAutoCreate())
328              this.description = new MarkdownType(); // bb
329          return this.description;
330        }
331
332        public boolean hasDescriptionElement() { 
333          return this.description != null && !this.description.isEmpty();
334        }
335
336        public boolean hasDescription() { 
337          return this.description != null && !this.description.isEmpty();
338        }
339
340        /**
341         * @param value {@link #description} (The human readable description of this resource trigger for the SubscriptionTopic -  for example, "An Encounter enters the 'in-progress' state".). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
342         */
343        public SubscriptionTopicResourceTriggerComponent setDescriptionElement(MarkdownType value) { 
344          this.description = value;
345          return this;
346        }
347
348        /**
349         * @return The human readable description of this resource trigger for the SubscriptionTopic -  for example, "An Encounter enters the 'in-progress' state".
350         */
351        public String getDescription() { 
352          return this.description == null ? null : this.description.getValue();
353        }
354
355        /**
356         * @param value The human readable description of this resource trigger for the SubscriptionTopic -  for example, "An Encounter enters the 'in-progress' state".
357         */
358        public SubscriptionTopicResourceTriggerComponent setDescription(String value) { 
359          if (value == null)
360            this.description = null;
361          else {
362            if (this.description == null)
363              this.description = new MarkdownType();
364            this.description.setValue(value);
365          }
366          return this;
367        }
368
369        /**
370         * @return {@link #resource} (URL of the Resource that is the type used in this resource trigger.  Relative URLs are relative to the StructureDefinition root of the implemented FHIR version (e.g., http://hl7.org/fhir/StructureDefinition). For example, "Patient" maps to http://hl7.org/fhir/StructureDefinition/Patient.  For more information, see <a href="elementdefinition-definitions.html#ElementDefinition.type.code">ElementDefinition.type.code</a>.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value
371         */
372        public UriType getResourceElement() { 
373          if (this.resource == null)
374            if (Configuration.errorOnAutoCreate())
375              throw new Error("Attempt to auto-create SubscriptionTopicResourceTriggerComponent.resource");
376            else if (Configuration.doAutoCreate())
377              this.resource = new UriType(); // bb
378          return this.resource;
379        }
380
381        public boolean hasResourceElement() { 
382          return this.resource != null && !this.resource.isEmpty();
383        }
384
385        public boolean hasResource() { 
386          return this.resource != null && !this.resource.isEmpty();
387        }
388
389        /**
390         * @param value {@link #resource} (URL of the Resource that is the type used in this resource trigger.  Relative URLs are relative to the StructureDefinition root of the implemented FHIR version (e.g., http://hl7.org/fhir/StructureDefinition). For example, "Patient" maps to http://hl7.org/fhir/StructureDefinition/Patient.  For more information, see <a href="elementdefinition-definitions.html#ElementDefinition.type.code">ElementDefinition.type.code</a>.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value
391         */
392        public SubscriptionTopicResourceTriggerComponent setResourceElement(UriType value) { 
393          this.resource = value;
394          return this;
395        }
396
397        /**
398         * @return URL of the Resource that is the type used in this resource trigger.  Relative URLs are relative to the StructureDefinition root of the implemented FHIR version (e.g., http://hl7.org/fhir/StructureDefinition). For example, "Patient" maps to http://hl7.org/fhir/StructureDefinition/Patient.  For more information, see <a href="elementdefinition-definitions.html#ElementDefinition.type.code">ElementDefinition.type.code</a>.
399         */
400        public String getResource() { 
401          return this.resource == null ? null : this.resource.getValue();
402        }
403
404        /**
405         * @param value URL of the Resource that is the type used in this resource trigger.  Relative URLs are relative to the StructureDefinition root of the implemented FHIR version (e.g., http://hl7.org/fhir/StructureDefinition). For example, "Patient" maps to http://hl7.org/fhir/StructureDefinition/Patient.  For more information, see <a href="elementdefinition-definitions.html#ElementDefinition.type.code">ElementDefinition.type.code</a>.
406         */
407        public SubscriptionTopicResourceTriggerComponent setResource(String value) { 
408            if (this.resource == null)
409              this.resource = new UriType();
410            this.resource.setValue(value);
411          return this;
412        }
413
414        /**
415         * @return {@link #supportedInteraction} (The FHIR RESTful interaction which can be used to trigger a notification for the SubscriptionTopic. Multiple values are considered OR joined (e.g., CREATE or UPDATE).)
416         */
417        public List<Enumeration<InteractionTrigger>> getSupportedInteraction() { 
418          if (this.supportedInteraction == null)
419            this.supportedInteraction = new ArrayList<Enumeration<InteractionTrigger>>();
420          return this.supportedInteraction;
421        }
422
423        /**
424         * @return Returns a reference to <code>this</code> for easy method chaining
425         */
426        public SubscriptionTopicResourceTriggerComponent setSupportedInteraction(List<Enumeration<InteractionTrigger>> theSupportedInteraction) { 
427          this.supportedInteraction = theSupportedInteraction;
428          return this;
429        }
430
431        public boolean hasSupportedInteraction() { 
432          if (this.supportedInteraction == null)
433            return false;
434          for (Enumeration<InteractionTrigger> item : this.supportedInteraction)
435            if (!item.isEmpty())
436              return true;
437          return false;
438        }
439
440        /**
441         * @return {@link #supportedInteraction} (The FHIR RESTful interaction which can be used to trigger a notification for the SubscriptionTopic. Multiple values are considered OR joined (e.g., CREATE or UPDATE).)
442         */
443        public Enumeration<InteractionTrigger> addSupportedInteractionElement() {//2 
444          Enumeration<InteractionTrigger> t = new Enumeration<InteractionTrigger>(new InteractionTriggerEnumFactory());
445          if (this.supportedInteraction == null)
446            this.supportedInteraction = new ArrayList<Enumeration<InteractionTrigger>>();
447          this.supportedInteraction.add(t);
448          return t;
449        }
450
451        /**
452         * @param value {@link #supportedInteraction} (The FHIR RESTful interaction which can be used to trigger a notification for the SubscriptionTopic. Multiple values are considered OR joined (e.g., CREATE or UPDATE).)
453         */
454        public SubscriptionTopicResourceTriggerComponent addSupportedInteraction(InteractionTrigger value) { //1
455          Enumeration<InteractionTrigger> t = new Enumeration<InteractionTrigger>(new InteractionTriggerEnumFactory());
456          t.setValue(value);
457          if (this.supportedInteraction == null)
458            this.supportedInteraction = new ArrayList<Enumeration<InteractionTrigger>>();
459          this.supportedInteraction.add(t);
460          return this;
461        }
462
463        /**
464         * @param value {@link #supportedInteraction} (The FHIR RESTful interaction which can be used to trigger a notification for the SubscriptionTopic. Multiple values are considered OR joined (e.g., CREATE or UPDATE).)
465         */
466        public boolean hasSupportedInteraction(InteractionTrigger value) { 
467          if (this.supportedInteraction == null)
468            return false;
469          for (Enumeration<InteractionTrigger> v : this.supportedInteraction)
470            if (v.getValue().equals(value)) // code
471              return true;
472          return false;
473        }
474
475        /**
476         * @return {@link #queryCriteria} (The FHIR query based rules that the server should use to determine when to trigger a notification for this subscription topic.)
477         */
478        public SubscriptionTopicResourceTriggerQueryCriteriaComponent getQueryCriteria() { 
479          if (this.queryCriteria == null)
480            if (Configuration.errorOnAutoCreate())
481              throw new Error("Attempt to auto-create SubscriptionTopicResourceTriggerComponent.queryCriteria");
482            else if (Configuration.doAutoCreate())
483              this.queryCriteria = new SubscriptionTopicResourceTriggerQueryCriteriaComponent(); // cc
484          return this.queryCriteria;
485        }
486
487        public boolean hasQueryCriteria() { 
488          return this.queryCriteria != null && !this.queryCriteria.isEmpty();
489        }
490
491        /**
492         * @param value {@link #queryCriteria} (The FHIR query based rules that the server should use to determine when to trigger a notification for this subscription topic.)
493         */
494        public SubscriptionTopicResourceTriggerComponent setQueryCriteria(SubscriptionTopicResourceTriggerQueryCriteriaComponent value) { 
495          this.queryCriteria = value;
496          return this;
497        }
498
499        /**
500         * @return {@link #fhirPathCriteria} (The FHIRPath based rules that the server should use to determine when to trigger a notification for this topic.). This is the underlying object with id, value and extensions. The accessor "getFhirPathCriteria" gives direct access to the value
501         */
502        public StringType getFhirPathCriteriaElement() { 
503          if (this.fhirPathCriteria == null)
504            if (Configuration.errorOnAutoCreate())
505              throw new Error("Attempt to auto-create SubscriptionTopicResourceTriggerComponent.fhirPathCriteria");
506            else if (Configuration.doAutoCreate())
507              this.fhirPathCriteria = new StringType(); // bb
508          return this.fhirPathCriteria;
509        }
510
511        public boolean hasFhirPathCriteriaElement() { 
512          return this.fhirPathCriteria != null && !this.fhirPathCriteria.isEmpty();
513        }
514
515        public boolean hasFhirPathCriteria() { 
516          return this.fhirPathCriteria != null && !this.fhirPathCriteria.isEmpty();
517        }
518
519        /**
520         * @param value {@link #fhirPathCriteria} (The FHIRPath based rules that the server should use to determine when to trigger a notification for this topic.). This is the underlying object with id, value and extensions. The accessor "getFhirPathCriteria" gives direct access to the value
521         */
522        public SubscriptionTopicResourceTriggerComponent setFhirPathCriteriaElement(StringType value) { 
523          this.fhirPathCriteria = value;
524          return this;
525        }
526
527        /**
528         * @return The FHIRPath based rules that the server should use to determine when to trigger a notification for this topic.
529         */
530        public String getFhirPathCriteria() { 
531          return this.fhirPathCriteria == null ? null : this.fhirPathCriteria.getValue();
532        }
533
534        /**
535         * @param value The FHIRPath based rules that the server should use to determine when to trigger a notification for this topic.
536         */
537        public SubscriptionTopicResourceTriggerComponent setFhirPathCriteria(String value) { 
538          if (Utilities.noString(value))
539            this.fhirPathCriteria = null;
540          else {
541            if (this.fhirPathCriteria == null)
542              this.fhirPathCriteria = new StringType();
543            this.fhirPathCriteria.setValue(value);
544          }
545          return this;
546        }
547
548        protected void listChildren(List<Property> children) {
549          super.listChildren(children);
550          children.add(new Property("description", "markdown", "The human readable description of this resource trigger for the SubscriptionTopic -  for example, \"An Encounter enters the 'in-progress' state\".", 0, 1, description));
551          children.add(new Property("resource", "uri", "URL of the Resource that is the type used in this resource trigger.  Relative URLs are relative to the StructureDefinition root of the implemented FHIR version (e.g., http://hl7.org/fhir/StructureDefinition). For example, \"Patient\" maps to http://hl7.org/fhir/StructureDefinition/Patient.  For more information, see <a href=\"elementdefinition-definitions.html#ElementDefinition.type.code\">ElementDefinition.type.code</a>.", 0, 1, resource));
552          children.add(new Property("supportedInteraction", "code", "The FHIR RESTful interaction which can be used to trigger a notification for the SubscriptionTopic. Multiple values are considered OR joined (e.g., CREATE or UPDATE).", 0, java.lang.Integer.MAX_VALUE, supportedInteraction));
553          children.add(new Property("queryCriteria", "", "The FHIR query based rules that the server should use to determine when to trigger a notification for this subscription topic.", 0, 1, queryCriteria));
554          children.add(new Property("fhirPathCriteria", "string", "The FHIRPath based rules that the server should use to determine when to trigger a notification for this topic.", 0, 1, fhirPathCriteria));
555        }
556
557        @Override
558        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
559          switch (_hash) {
560          case -1724546052: /*description*/  return new Property("description", "markdown", "The human readable description of this resource trigger for the SubscriptionTopic -  for example, \"An Encounter enters the 'in-progress' state\".", 0, 1, description);
561          case -341064690: /*resource*/  return new Property("resource", "uri", "URL of the Resource that is the type used in this resource trigger.  Relative URLs are relative to the StructureDefinition root of the implemented FHIR version (e.g., http://hl7.org/fhir/StructureDefinition). For example, \"Patient\" maps to http://hl7.org/fhir/StructureDefinition/Patient.  For more information, see <a href=\"elementdefinition-definitions.html#ElementDefinition.type.code\">ElementDefinition.type.code</a>.", 0, 1, resource);
562          case 1838450820: /*supportedInteraction*/  return new Property("supportedInteraction", "code", "The FHIR RESTful interaction which can be used to trigger a notification for the SubscriptionTopic. Multiple values are considered OR joined (e.g., CREATE or UPDATE).", 0, java.lang.Integer.MAX_VALUE, supportedInteraction);
563          case -545123257: /*queryCriteria*/  return new Property("queryCriteria", "", "The FHIR query based rules that the server should use to determine when to trigger a notification for this subscription topic.", 0, 1, queryCriteria);
564          case 1929785263: /*fhirPathCriteria*/  return new Property("fhirPathCriteria", "string", "The FHIRPath based rules that the server should use to determine when to trigger a notification for this topic.", 0, 1, fhirPathCriteria);
565          default: return super.getNamedProperty(_hash, _name, _checkValid);
566          }
567
568        }
569
570      @Override
571      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
572        switch (hash) {
573        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
574        case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // UriType
575        case 1838450820: /*supportedInteraction*/ return this.supportedInteraction == null ? new Base[0] : this.supportedInteraction.toArray(new Base[this.supportedInteraction.size()]); // Enumeration<InteractionTrigger>
576        case -545123257: /*queryCriteria*/ return this.queryCriteria == null ? new Base[0] : new Base[] {this.queryCriteria}; // SubscriptionTopicResourceTriggerQueryCriteriaComponent
577        case 1929785263: /*fhirPathCriteria*/ return this.fhirPathCriteria == null ? new Base[0] : new Base[] {this.fhirPathCriteria}; // StringType
578        default: return super.getProperty(hash, name, checkValid);
579        }
580
581      }
582
583      @Override
584      public Base setProperty(int hash, String name, Base value) throws FHIRException {
585        switch (hash) {
586        case -1724546052: // description
587          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
588          return value;
589        case -341064690: // resource
590          this.resource = TypeConvertor.castToUri(value); // UriType
591          return value;
592        case 1838450820: // supportedInteraction
593          value = new InteractionTriggerEnumFactory().fromType(TypeConvertor.castToCode(value));
594          this.getSupportedInteraction().add((Enumeration) value); // Enumeration<InteractionTrigger>
595          return value;
596        case -545123257: // queryCriteria
597          this.queryCriteria = (SubscriptionTopicResourceTriggerQueryCriteriaComponent) value; // SubscriptionTopicResourceTriggerQueryCriteriaComponent
598          return value;
599        case 1929785263: // fhirPathCriteria
600          this.fhirPathCriteria = TypeConvertor.castToString(value); // StringType
601          return value;
602        default: return super.setProperty(hash, name, value);
603        }
604
605      }
606
607      @Override
608      public Base setProperty(String name, Base value) throws FHIRException {
609        if (name.equals("description")) {
610          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
611        } else if (name.equals("resource")) {
612          this.resource = TypeConvertor.castToUri(value); // UriType
613        } else if (name.equals("supportedInteraction")) {
614          value = new InteractionTriggerEnumFactory().fromType(TypeConvertor.castToCode(value));
615          this.getSupportedInteraction().add((Enumeration) value);
616        } else if (name.equals("queryCriteria")) {
617          this.queryCriteria = (SubscriptionTopicResourceTriggerQueryCriteriaComponent) value; // SubscriptionTopicResourceTriggerQueryCriteriaComponent
618        } else if (name.equals("fhirPathCriteria")) {
619          this.fhirPathCriteria = TypeConvertor.castToString(value); // StringType
620        } else
621          return super.setProperty(name, value);
622        return value;
623      }
624
625      @Override
626      public Base makeProperty(int hash, String name) throws FHIRException {
627        switch (hash) {
628        case -1724546052:  return getDescriptionElement();
629        case -341064690:  return getResourceElement();
630        case 1838450820:  return addSupportedInteractionElement();
631        case -545123257:  return getQueryCriteria();
632        case 1929785263:  return getFhirPathCriteriaElement();
633        default: return super.makeProperty(hash, name);
634        }
635
636      }
637
638      @Override
639      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
640        switch (hash) {
641        case -1724546052: /*description*/ return new String[] {"markdown"};
642        case -341064690: /*resource*/ return new String[] {"uri"};
643        case 1838450820: /*supportedInteraction*/ return new String[] {"code"};
644        case -545123257: /*queryCriteria*/ return new String[] {};
645        case 1929785263: /*fhirPathCriteria*/ return new String[] {"string"};
646        default: return super.getTypesForProperty(hash, name);
647        }
648
649      }
650
651      @Override
652      public Base addChild(String name) throws FHIRException {
653        if (name.equals("description")) {
654          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.resourceTrigger.description");
655        }
656        else if (name.equals("resource")) {
657          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.resourceTrigger.resource");
658        }
659        else if (name.equals("supportedInteraction")) {
660          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.resourceTrigger.supportedInteraction");
661        }
662        else if (name.equals("queryCriteria")) {
663          this.queryCriteria = new SubscriptionTopicResourceTriggerQueryCriteriaComponent();
664          return this.queryCriteria;
665        }
666        else if (name.equals("fhirPathCriteria")) {
667          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.resourceTrigger.fhirPathCriteria");
668        }
669        else
670          return super.addChild(name);
671      }
672
673      public SubscriptionTopicResourceTriggerComponent copy() {
674        SubscriptionTopicResourceTriggerComponent dst = new SubscriptionTopicResourceTriggerComponent();
675        copyValues(dst);
676        return dst;
677      }
678
679      public void copyValues(SubscriptionTopicResourceTriggerComponent dst) {
680        super.copyValues(dst);
681        dst.description = description == null ? null : description.copy();
682        dst.resource = resource == null ? null : resource.copy();
683        if (supportedInteraction != null) {
684          dst.supportedInteraction = new ArrayList<Enumeration<InteractionTrigger>>();
685          for (Enumeration<InteractionTrigger> i : supportedInteraction)
686            dst.supportedInteraction.add(i.copy());
687        };
688        dst.queryCriteria = queryCriteria == null ? null : queryCriteria.copy();
689        dst.fhirPathCriteria = fhirPathCriteria == null ? null : fhirPathCriteria.copy();
690      }
691
692      @Override
693      public boolean equalsDeep(Base other_) {
694        if (!super.equalsDeep(other_))
695          return false;
696        if (!(other_ instanceof SubscriptionTopicResourceTriggerComponent))
697          return false;
698        SubscriptionTopicResourceTriggerComponent o = (SubscriptionTopicResourceTriggerComponent) other_;
699        return compareDeep(description, o.description, true) && compareDeep(resource, o.resource, true)
700           && compareDeep(supportedInteraction, o.supportedInteraction, true) && compareDeep(queryCriteria, o.queryCriteria, true)
701           && compareDeep(fhirPathCriteria, o.fhirPathCriteria, true);
702      }
703
704      @Override
705      public boolean equalsShallow(Base other_) {
706        if (!super.equalsShallow(other_))
707          return false;
708        if (!(other_ instanceof SubscriptionTopicResourceTriggerComponent))
709          return false;
710        SubscriptionTopicResourceTriggerComponent o = (SubscriptionTopicResourceTriggerComponent) other_;
711        return compareValues(description, o.description, true) && compareValues(resource, o.resource, true)
712           && compareValues(supportedInteraction, o.supportedInteraction, true) && compareValues(fhirPathCriteria, o.fhirPathCriteria, true)
713          ;
714      }
715
716      public boolean isEmpty() {
717        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(description, resource, supportedInteraction
718          , queryCriteria, fhirPathCriteria);
719      }
720
721  public String fhirType() {
722    return "SubscriptionTopic.resourceTrigger";
723
724  }
725
726  }
727
728    @Block()
729    public static class SubscriptionTopicResourceTriggerQueryCriteriaComponent extends BackboneElement implements IBaseBackboneElement {
730        /**
731         * The FHIR query based rules are applied to the previous resource state (e.g., state before an update).
732         */
733        @Child(name = "previous", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true)
734        @Description(shortDefinition="Rule applied to previous resource state", formalDefinition="The FHIR query based rules are applied to the previous resource state (e.g., state before an update)." )
735        protected StringType previous;
736
737        /**
738         * For "create" interactions, should the "previous" criteria count as an automatic pass or an automatic fail.
739         */
740        @Child(name = "resultForCreate", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true)
741        @Description(shortDefinition="test-passes | test-fails", formalDefinition="For \"create\" interactions, should the \"previous\" criteria count as an automatic pass or an automatic fail." )
742        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/subscriptiontopic-cr-behavior")
743        protected Enumeration<CriteriaNotExistsBehavior> resultForCreate;
744
745        /**
746         * The FHIR query based rules are applied to the current resource state (e.g., state after an update).
747         */
748        @Child(name = "current", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
749        @Description(shortDefinition="Rule applied to current resource state", formalDefinition="The FHIR query based rules are applied to the current resource state (e.g., state after an update)." )
750        protected StringType current;
751
752        /**
753         * For "delete" interactions, should the "current" criteria count as an automatic pass or an automatic fail.
754         */
755        @Child(name = "resultForDelete", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=true)
756        @Description(shortDefinition="test-passes | test-fails", formalDefinition="For \"delete\" interactions, should the \"current\" criteria count as an automatic pass or an automatic fail." )
757        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/subscriptiontopic-cr-behavior")
758        protected Enumeration<CriteriaNotExistsBehavior> resultForDelete;
759
760        /**
761         * If set to true, both current and previous criteria must evaluate true to  trigger a notification for this topic.  Otherwise a notification for this topic will be triggered if either one evaluates to true.
762         */
763        @Child(name = "requireBoth", type = {BooleanType.class}, order=5, min=0, max=1, modifier=false, summary=true)
764        @Description(shortDefinition="Both must be true flag", formalDefinition="If set to true, both current and previous criteria must evaluate true to  trigger a notification for this topic.  Otherwise a notification for this topic will be triggered if either one evaluates to true." )
765        protected BooleanType requireBoth;
766
767        private static final long serialVersionUID = -291746067L;
768
769    /**
770     * Constructor
771     */
772      public SubscriptionTopicResourceTriggerQueryCriteriaComponent() {
773        super();
774      }
775
776        /**
777         * @return {@link #previous} (The FHIR query based rules are applied to the previous resource state (e.g., state before an update).). This is the underlying object with id, value and extensions. The accessor "getPrevious" gives direct access to the value
778         */
779        public StringType getPreviousElement() { 
780          if (this.previous == null)
781            if (Configuration.errorOnAutoCreate())
782              throw new Error("Attempt to auto-create SubscriptionTopicResourceTriggerQueryCriteriaComponent.previous");
783            else if (Configuration.doAutoCreate())
784              this.previous = new StringType(); // bb
785          return this.previous;
786        }
787
788        public boolean hasPreviousElement() { 
789          return this.previous != null && !this.previous.isEmpty();
790        }
791
792        public boolean hasPrevious() { 
793          return this.previous != null && !this.previous.isEmpty();
794        }
795
796        /**
797         * @param value {@link #previous} (The FHIR query based rules are applied to the previous resource state (e.g., state before an update).). This is the underlying object with id, value and extensions. The accessor "getPrevious" gives direct access to the value
798         */
799        public SubscriptionTopicResourceTriggerQueryCriteriaComponent setPreviousElement(StringType value) { 
800          this.previous = value;
801          return this;
802        }
803
804        /**
805         * @return The FHIR query based rules are applied to the previous resource state (e.g., state before an update).
806         */
807        public String getPrevious() { 
808          return this.previous == null ? null : this.previous.getValue();
809        }
810
811        /**
812         * @param value The FHIR query based rules are applied to the previous resource state (e.g., state before an update).
813         */
814        public SubscriptionTopicResourceTriggerQueryCriteriaComponent setPrevious(String value) { 
815          if (Utilities.noString(value))
816            this.previous = null;
817          else {
818            if (this.previous == null)
819              this.previous = new StringType();
820            this.previous.setValue(value);
821          }
822          return this;
823        }
824
825        /**
826         * @return {@link #resultForCreate} (For "create" interactions, should the "previous" criteria count as an automatic pass or an automatic fail.). This is the underlying object with id, value and extensions. The accessor "getResultForCreate" gives direct access to the value
827         */
828        public Enumeration<CriteriaNotExistsBehavior> getResultForCreateElement() { 
829          if (this.resultForCreate == null)
830            if (Configuration.errorOnAutoCreate())
831              throw new Error("Attempt to auto-create SubscriptionTopicResourceTriggerQueryCriteriaComponent.resultForCreate");
832            else if (Configuration.doAutoCreate())
833              this.resultForCreate = new Enumeration<CriteriaNotExistsBehavior>(new CriteriaNotExistsBehaviorEnumFactory()); // bb
834          return this.resultForCreate;
835        }
836
837        public boolean hasResultForCreateElement() { 
838          return this.resultForCreate != null && !this.resultForCreate.isEmpty();
839        }
840
841        public boolean hasResultForCreate() { 
842          return this.resultForCreate != null && !this.resultForCreate.isEmpty();
843        }
844
845        /**
846         * @param value {@link #resultForCreate} (For "create" interactions, should the "previous" criteria count as an automatic pass or an automatic fail.). This is the underlying object with id, value and extensions. The accessor "getResultForCreate" gives direct access to the value
847         */
848        public SubscriptionTopicResourceTriggerQueryCriteriaComponent setResultForCreateElement(Enumeration<CriteriaNotExistsBehavior> value) { 
849          this.resultForCreate = value;
850          return this;
851        }
852
853        /**
854         * @return For "create" interactions, should the "previous" criteria count as an automatic pass or an automatic fail.
855         */
856        public CriteriaNotExistsBehavior getResultForCreate() { 
857          return this.resultForCreate == null ? null : this.resultForCreate.getValue();
858        }
859
860        /**
861         * @param value For "create" interactions, should the "previous" criteria count as an automatic pass or an automatic fail.
862         */
863        public SubscriptionTopicResourceTriggerQueryCriteriaComponent setResultForCreate(CriteriaNotExistsBehavior value) { 
864          if (value == null)
865            this.resultForCreate = null;
866          else {
867            if (this.resultForCreate == null)
868              this.resultForCreate = new Enumeration<CriteriaNotExistsBehavior>(new CriteriaNotExistsBehaviorEnumFactory());
869            this.resultForCreate.setValue(value);
870          }
871          return this;
872        }
873
874        /**
875         * @return {@link #current} (The FHIR query based rules are applied to the current resource state (e.g., state after an update).). This is the underlying object with id, value and extensions. The accessor "getCurrent" gives direct access to the value
876         */
877        public StringType getCurrentElement() { 
878          if (this.current == null)
879            if (Configuration.errorOnAutoCreate())
880              throw new Error("Attempt to auto-create SubscriptionTopicResourceTriggerQueryCriteriaComponent.current");
881            else if (Configuration.doAutoCreate())
882              this.current = new StringType(); // bb
883          return this.current;
884        }
885
886        public boolean hasCurrentElement() { 
887          return this.current != null && !this.current.isEmpty();
888        }
889
890        public boolean hasCurrent() { 
891          return this.current != null && !this.current.isEmpty();
892        }
893
894        /**
895         * @param value {@link #current} (The FHIR query based rules are applied to the current resource state (e.g., state after an update).). This is the underlying object with id, value and extensions. The accessor "getCurrent" gives direct access to the value
896         */
897        public SubscriptionTopicResourceTriggerQueryCriteriaComponent setCurrentElement(StringType value) { 
898          this.current = value;
899          return this;
900        }
901
902        /**
903         * @return The FHIR query based rules are applied to the current resource state (e.g., state after an update).
904         */
905        public String getCurrent() { 
906          return this.current == null ? null : this.current.getValue();
907        }
908
909        /**
910         * @param value The FHIR query based rules are applied to the current resource state (e.g., state after an update).
911         */
912        public SubscriptionTopicResourceTriggerQueryCriteriaComponent setCurrent(String value) { 
913          if (Utilities.noString(value))
914            this.current = null;
915          else {
916            if (this.current == null)
917              this.current = new StringType();
918            this.current.setValue(value);
919          }
920          return this;
921        }
922
923        /**
924         * @return {@link #resultForDelete} (For "delete" interactions, should the "current" criteria count as an automatic pass or an automatic fail.). This is the underlying object with id, value and extensions. The accessor "getResultForDelete" gives direct access to the value
925         */
926        public Enumeration<CriteriaNotExistsBehavior> getResultForDeleteElement() { 
927          if (this.resultForDelete == null)
928            if (Configuration.errorOnAutoCreate())
929              throw new Error("Attempt to auto-create SubscriptionTopicResourceTriggerQueryCriteriaComponent.resultForDelete");
930            else if (Configuration.doAutoCreate())
931              this.resultForDelete = new Enumeration<CriteriaNotExistsBehavior>(new CriteriaNotExistsBehaviorEnumFactory()); // bb
932          return this.resultForDelete;
933        }
934
935        public boolean hasResultForDeleteElement() { 
936          return this.resultForDelete != null && !this.resultForDelete.isEmpty();
937        }
938
939        public boolean hasResultForDelete() { 
940          return this.resultForDelete != null && !this.resultForDelete.isEmpty();
941        }
942
943        /**
944         * @param value {@link #resultForDelete} (For "delete" interactions, should the "current" criteria count as an automatic pass or an automatic fail.). This is the underlying object with id, value and extensions. The accessor "getResultForDelete" gives direct access to the value
945         */
946        public SubscriptionTopicResourceTriggerQueryCriteriaComponent setResultForDeleteElement(Enumeration<CriteriaNotExistsBehavior> value) { 
947          this.resultForDelete = value;
948          return this;
949        }
950
951        /**
952         * @return For "delete" interactions, should the "current" criteria count as an automatic pass or an automatic fail.
953         */
954        public CriteriaNotExistsBehavior getResultForDelete() { 
955          return this.resultForDelete == null ? null : this.resultForDelete.getValue();
956        }
957
958        /**
959         * @param value For "delete" interactions, should the "current" criteria count as an automatic pass or an automatic fail.
960         */
961        public SubscriptionTopicResourceTriggerQueryCriteriaComponent setResultForDelete(CriteriaNotExistsBehavior value) { 
962          if (value == null)
963            this.resultForDelete = null;
964          else {
965            if (this.resultForDelete == null)
966              this.resultForDelete = new Enumeration<CriteriaNotExistsBehavior>(new CriteriaNotExistsBehaviorEnumFactory());
967            this.resultForDelete.setValue(value);
968          }
969          return this;
970        }
971
972        /**
973         * @return {@link #requireBoth} (If set to true, both current and previous criteria must evaluate true to  trigger a notification for this topic.  Otherwise a notification for this topic will be triggered if either one evaluates to true.). This is the underlying object with id, value and extensions. The accessor "getRequireBoth" gives direct access to the value
974         */
975        public BooleanType getRequireBothElement() { 
976          if (this.requireBoth == null)
977            if (Configuration.errorOnAutoCreate())
978              throw new Error("Attempt to auto-create SubscriptionTopicResourceTriggerQueryCriteriaComponent.requireBoth");
979            else if (Configuration.doAutoCreate())
980              this.requireBoth = new BooleanType(); // bb
981          return this.requireBoth;
982        }
983
984        public boolean hasRequireBothElement() { 
985          return this.requireBoth != null && !this.requireBoth.isEmpty();
986        }
987
988        public boolean hasRequireBoth() { 
989          return this.requireBoth != null && !this.requireBoth.isEmpty();
990        }
991
992        /**
993         * @param value {@link #requireBoth} (If set to true, both current and previous criteria must evaluate true to  trigger a notification for this topic.  Otherwise a notification for this topic will be triggered if either one evaluates to true.). This is the underlying object with id, value and extensions. The accessor "getRequireBoth" gives direct access to the value
994         */
995        public SubscriptionTopicResourceTriggerQueryCriteriaComponent setRequireBothElement(BooleanType value) { 
996          this.requireBoth = value;
997          return this;
998        }
999
1000        /**
1001         * @return If set to true, both current and previous criteria must evaluate true to  trigger a notification for this topic.  Otherwise a notification for this topic will be triggered if either one evaluates to true.
1002         */
1003        public boolean getRequireBoth() { 
1004          return this.requireBoth == null || this.requireBoth.isEmpty() ? false : this.requireBoth.getValue();
1005        }
1006
1007        /**
1008         * @param value If set to true, both current and previous criteria must evaluate true to  trigger a notification for this topic.  Otherwise a notification for this topic will be triggered if either one evaluates to true.
1009         */
1010        public SubscriptionTopicResourceTriggerQueryCriteriaComponent setRequireBoth(boolean value) { 
1011            if (this.requireBoth == null)
1012              this.requireBoth = new BooleanType();
1013            this.requireBoth.setValue(value);
1014          return this;
1015        }
1016
1017        protected void listChildren(List<Property> children) {
1018          super.listChildren(children);
1019          children.add(new Property("previous", "string", "The FHIR query based rules are applied to the previous resource state (e.g., state before an update).", 0, 1, previous));
1020          children.add(new Property("resultForCreate", "code", "For \"create\" interactions, should the \"previous\" criteria count as an automatic pass or an automatic fail.", 0, 1, resultForCreate));
1021          children.add(new Property("current", "string", "The FHIR query based rules are applied to the current resource state (e.g., state after an update).", 0, 1, current));
1022          children.add(new Property("resultForDelete", "code", "For \"delete\" interactions, should the \"current\" criteria count as an automatic pass or an automatic fail.", 0, 1, resultForDelete));
1023          children.add(new Property("requireBoth", "boolean", "If set to true, both current and previous criteria must evaluate true to  trigger a notification for this topic.  Otherwise a notification for this topic will be triggered if either one evaluates to true.", 0, 1, requireBoth));
1024        }
1025
1026        @Override
1027        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1028          switch (_hash) {
1029          case -1273775369: /*previous*/  return new Property("previous", "string", "The FHIR query based rules are applied to the previous resource state (e.g., state before an update).", 0, 1, previous);
1030          case -407976056: /*resultForCreate*/  return new Property("resultForCreate", "code", "For \"create\" interactions, should the \"previous\" criteria count as an automatic pass or an automatic fail.", 0, 1, resultForCreate);
1031          case 1126940025: /*current*/  return new Property("current", "string", "The FHIR query based rules are applied to the current resource state (e.g., state after an update).", 0, 1, current);
1032          case -391140297: /*resultForDelete*/  return new Property("resultForDelete", "code", "For \"delete\" interactions, should the \"current\" criteria count as an automatic pass or an automatic fail.", 0, 1, resultForDelete);
1033          case 362116742: /*requireBoth*/  return new Property("requireBoth", "boolean", "If set to true, both current and previous criteria must evaluate true to  trigger a notification for this topic.  Otherwise a notification for this topic will be triggered if either one evaluates to true.", 0, 1, requireBoth);
1034          default: return super.getNamedProperty(_hash, _name, _checkValid);
1035          }
1036
1037        }
1038
1039      @Override
1040      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1041        switch (hash) {
1042        case -1273775369: /*previous*/ return this.previous == null ? new Base[0] : new Base[] {this.previous}; // StringType
1043        case -407976056: /*resultForCreate*/ return this.resultForCreate == null ? new Base[0] : new Base[] {this.resultForCreate}; // Enumeration<CriteriaNotExistsBehavior>
1044        case 1126940025: /*current*/ return this.current == null ? new Base[0] : new Base[] {this.current}; // StringType
1045        case -391140297: /*resultForDelete*/ return this.resultForDelete == null ? new Base[0] : new Base[] {this.resultForDelete}; // Enumeration<CriteriaNotExistsBehavior>
1046        case 362116742: /*requireBoth*/ return this.requireBoth == null ? new Base[0] : new Base[] {this.requireBoth}; // BooleanType
1047        default: return super.getProperty(hash, name, checkValid);
1048        }
1049
1050      }
1051
1052      @Override
1053      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1054        switch (hash) {
1055        case -1273775369: // previous
1056          this.previous = TypeConvertor.castToString(value); // StringType
1057          return value;
1058        case -407976056: // resultForCreate
1059          value = new CriteriaNotExistsBehaviorEnumFactory().fromType(TypeConvertor.castToCode(value));
1060          this.resultForCreate = (Enumeration) value; // Enumeration<CriteriaNotExistsBehavior>
1061          return value;
1062        case 1126940025: // current
1063          this.current = TypeConvertor.castToString(value); // StringType
1064          return value;
1065        case -391140297: // resultForDelete
1066          value = new CriteriaNotExistsBehaviorEnumFactory().fromType(TypeConvertor.castToCode(value));
1067          this.resultForDelete = (Enumeration) value; // Enumeration<CriteriaNotExistsBehavior>
1068          return value;
1069        case 362116742: // requireBoth
1070          this.requireBoth = TypeConvertor.castToBoolean(value); // BooleanType
1071          return value;
1072        default: return super.setProperty(hash, name, value);
1073        }
1074
1075      }
1076
1077      @Override
1078      public Base setProperty(String name, Base value) throws FHIRException {
1079        if (name.equals("previous")) {
1080          this.previous = TypeConvertor.castToString(value); // StringType
1081        } else if (name.equals("resultForCreate")) {
1082          value = new CriteriaNotExistsBehaviorEnumFactory().fromType(TypeConvertor.castToCode(value));
1083          this.resultForCreate = (Enumeration) value; // Enumeration<CriteriaNotExistsBehavior>
1084        } else if (name.equals("current")) {
1085          this.current = TypeConvertor.castToString(value); // StringType
1086        } else if (name.equals("resultForDelete")) {
1087          value = new CriteriaNotExistsBehaviorEnumFactory().fromType(TypeConvertor.castToCode(value));
1088          this.resultForDelete = (Enumeration) value; // Enumeration<CriteriaNotExistsBehavior>
1089        } else if (name.equals("requireBoth")) {
1090          this.requireBoth = TypeConvertor.castToBoolean(value); // BooleanType
1091        } else
1092          return super.setProperty(name, value);
1093        return value;
1094      }
1095
1096      @Override
1097      public Base makeProperty(int hash, String name) throws FHIRException {
1098        switch (hash) {
1099        case -1273775369:  return getPreviousElement();
1100        case -407976056:  return getResultForCreateElement();
1101        case 1126940025:  return getCurrentElement();
1102        case -391140297:  return getResultForDeleteElement();
1103        case 362116742:  return getRequireBothElement();
1104        default: return super.makeProperty(hash, name);
1105        }
1106
1107      }
1108
1109      @Override
1110      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1111        switch (hash) {
1112        case -1273775369: /*previous*/ return new String[] {"string"};
1113        case -407976056: /*resultForCreate*/ return new String[] {"code"};
1114        case 1126940025: /*current*/ return new String[] {"string"};
1115        case -391140297: /*resultForDelete*/ return new String[] {"code"};
1116        case 362116742: /*requireBoth*/ return new String[] {"boolean"};
1117        default: return super.getTypesForProperty(hash, name);
1118        }
1119
1120      }
1121
1122      @Override
1123      public Base addChild(String name) throws FHIRException {
1124        if (name.equals("previous")) {
1125          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.resourceTrigger.queryCriteria.previous");
1126        }
1127        else if (name.equals("resultForCreate")) {
1128          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.resourceTrigger.queryCriteria.resultForCreate");
1129        }
1130        else if (name.equals("current")) {
1131          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.resourceTrigger.queryCriteria.current");
1132        }
1133        else if (name.equals("resultForDelete")) {
1134          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.resourceTrigger.queryCriteria.resultForDelete");
1135        }
1136        else if (name.equals("requireBoth")) {
1137          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.resourceTrigger.queryCriteria.requireBoth");
1138        }
1139        else
1140          return super.addChild(name);
1141      }
1142
1143      public SubscriptionTopicResourceTriggerQueryCriteriaComponent copy() {
1144        SubscriptionTopicResourceTriggerQueryCriteriaComponent dst = new SubscriptionTopicResourceTriggerQueryCriteriaComponent();
1145        copyValues(dst);
1146        return dst;
1147      }
1148
1149      public void copyValues(SubscriptionTopicResourceTriggerQueryCriteriaComponent dst) {
1150        super.copyValues(dst);
1151        dst.previous = previous == null ? null : previous.copy();
1152        dst.resultForCreate = resultForCreate == null ? null : resultForCreate.copy();
1153        dst.current = current == null ? null : current.copy();
1154        dst.resultForDelete = resultForDelete == null ? null : resultForDelete.copy();
1155        dst.requireBoth = requireBoth == null ? null : requireBoth.copy();
1156      }
1157
1158      @Override
1159      public boolean equalsDeep(Base other_) {
1160        if (!super.equalsDeep(other_))
1161          return false;
1162        if (!(other_ instanceof SubscriptionTopicResourceTriggerQueryCriteriaComponent))
1163          return false;
1164        SubscriptionTopicResourceTriggerQueryCriteriaComponent o = (SubscriptionTopicResourceTriggerQueryCriteriaComponent) other_;
1165        return compareDeep(previous, o.previous, true) && compareDeep(resultForCreate, o.resultForCreate, true)
1166           && compareDeep(current, o.current, true) && compareDeep(resultForDelete, o.resultForDelete, true)
1167           && compareDeep(requireBoth, o.requireBoth, true);
1168      }
1169
1170      @Override
1171      public boolean equalsShallow(Base other_) {
1172        if (!super.equalsShallow(other_))
1173          return false;
1174        if (!(other_ instanceof SubscriptionTopicResourceTriggerQueryCriteriaComponent))
1175          return false;
1176        SubscriptionTopicResourceTriggerQueryCriteriaComponent o = (SubscriptionTopicResourceTriggerQueryCriteriaComponent) other_;
1177        return compareValues(previous, o.previous, true) && compareValues(resultForCreate, o.resultForCreate, true)
1178           && compareValues(current, o.current, true) && compareValues(resultForDelete, o.resultForDelete, true)
1179           && compareValues(requireBoth, o.requireBoth, true);
1180      }
1181
1182      public boolean isEmpty() {
1183        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(previous, resultForCreate
1184          , current, resultForDelete, requireBoth);
1185      }
1186
1187  public String fhirType() {
1188    return "SubscriptionTopic.resourceTrigger.queryCriteria";
1189
1190  }
1191
1192  }
1193
1194    @Block()
1195    public static class SubscriptionTopicEventTriggerComponent extends BackboneElement implements IBaseBackboneElement {
1196        /**
1197         * The human readable description of an event to trigger a notification for the SubscriptionTopic - for example, "Patient Admission, as defined in HL7v2 via message ADT^A01". Multiple values are considered OR joined (e.g., matching any single event listed).
1198         */
1199        @Child(name = "description", type = {MarkdownType.class}, order=1, min=0, max=1, modifier=false, summary=true)
1200        @Description(shortDefinition="Text representation of the event trigger", formalDefinition="The human readable description of an event to trigger a notification for the SubscriptionTopic - for example, \"Patient Admission, as defined in HL7v2 via message ADT^A01\". Multiple values are considered OR joined (e.g., matching any single event listed)." )
1201        protected MarkdownType description;
1202
1203        /**
1204         * A well-defined event which can be used to trigger notifications from the SubscriptionTopic.
1205         */
1206        @Child(name = "event", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=true)
1207        @Description(shortDefinition="Event which can trigger a notification from the SubscriptionTopic", formalDefinition="A well-defined event which can be used to trigger notifications from the SubscriptionTopic." )
1208        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://terminology.hl7.org/ValueSet/v2-0003")
1209        protected CodeableConcept event;
1210
1211        /**
1212         * URL of the Resource that is the focus type used in this event trigger.  Relative URLs are relative to the StructureDefinition root of the implemented FHIR version (e.g., http://hl7.org/fhir/StructureDefinition). For example, "Patient" maps to http://hl7.org/fhir/StructureDefinition/Patient.  For more information, see <a href="elementdefinition-definitions.html#ElementDefinition.type.code">ElementDefinition.type.code</a>.
1213         */
1214        @Child(name = "resource", type = {UriType.class}, order=3, min=1, max=1, modifier=false, summary=true)
1215        @Description(shortDefinition="Data Type or Resource (reference to definition) for this trigger definition", formalDefinition="URL of the Resource that is the focus type used in this event trigger.  Relative URLs are relative to the StructureDefinition root of the implemented FHIR version (e.g., http://hl7.org/fhir/StructureDefinition). For example, \"Patient\" maps to http://hl7.org/fhir/StructureDefinition/Patient.  For more information, see <a href=\"elementdefinition-definitions.html#ElementDefinition.type.code\">ElementDefinition.type.code</a>." )
1216        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/defined-types")
1217        protected UriType resource;
1218
1219        private static final long serialVersionUID = 1818872110L;
1220
1221    /**
1222     * Constructor
1223     */
1224      public SubscriptionTopicEventTriggerComponent() {
1225        super();
1226      }
1227
1228    /**
1229     * Constructor
1230     */
1231      public SubscriptionTopicEventTriggerComponent(CodeableConcept event, String resource) {
1232        super();
1233        this.setEvent(event);
1234        this.setResource(resource);
1235      }
1236
1237        /**
1238         * @return {@link #description} (The human readable description of an event to trigger a notification for the SubscriptionTopic - for example, "Patient Admission, as defined in HL7v2 via message ADT^A01". Multiple values are considered OR joined (e.g., matching any single event listed).). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1239         */
1240        public MarkdownType getDescriptionElement() { 
1241          if (this.description == null)
1242            if (Configuration.errorOnAutoCreate())
1243              throw new Error("Attempt to auto-create SubscriptionTopicEventTriggerComponent.description");
1244            else if (Configuration.doAutoCreate())
1245              this.description = new MarkdownType(); // bb
1246          return this.description;
1247        }
1248
1249        public boolean hasDescriptionElement() { 
1250          return this.description != null && !this.description.isEmpty();
1251        }
1252
1253        public boolean hasDescription() { 
1254          return this.description != null && !this.description.isEmpty();
1255        }
1256
1257        /**
1258         * @param value {@link #description} (The human readable description of an event to trigger a notification for the SubscriptionTopic - for example, "Patient Admission, as defined in HL7v2 via message ADT^A01". Multiple values are considered OR joined (e.g., matching any single event listed).). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1259         */
1260        public SubscriptionTopicEventTriggerComponent setDescriptionElement(MarkdownType value) { 
1261          this.description = value;
1262          return this;
1263        }
1264
1265        /**
1266         * @return The human readable description of an event to trigger a notification for the SubscriptionTopic - for example, "Patient Admission, as defined in HL7v2 via message ADT^A01". Multiple values are considered OR joined (e.g., matching any single event listed).
1267         */
1268        public String getDescription() { 
1269          return this.description == null ? null : this.description.getValue();
1270        }
1271
1272        /**
1273         * @param value The human readable description of an event to trigger a notification for the SubscriptionTopic - for example, "Patient Admission, as defined in HL7v2 via message ADT^A01". Multiple values are considered OR joined (e.g., matching any single event listed).
1274         */
1275        public SubscriptionTopicEventTriggerComponent setDescription(String value) { 
1276          if (value == null)
1277            this.description = null;
1278          else {
1279            if (this.description == null)
1280              this.description = new MarkdownType();
1281            this.description.setValue(value);
1282          }
1283          return this;
1284        }
1285
1286        /**
1287         * @return {@link #event} (A well-defined event which can be used to trigger notifications from the SubscriptionTopic.)
1288         */
1289        public CodeableConcept getEvent() { 
1290          if (this.event == null)
1291            if (Configuration.errorOnAutoCreate())
1292              throw new Error("Attempt to auto-create SubscriptionTopicEventTriggerComponent.event");
1293            else if (Configuration.doAutoCreate())
1294              this.event = new CodeableConcept(); // cc
1295          return this.event;
1296        }
1297
1298        public boolean hasEvent() { 
1299          return this.event != null && !this.event.isEmpty();
1300        }
1301
1302        /**
1303         * @param value {@link #event} (A well-defined event which can be used to trigger notifications from the SubscriptionTopic.)
1304         */
1305        public SubscriptionTopicEventTriggerComponent setEvent(CodeableConcept value) { 
1306          this.event = value;
1307          return this;
1308        }
1309
1310        /**
1311         * @return {@link #resource} (URL of the Resource that is the focus type used in this event trigger.  Relative URLs are relative to the StructureDefinition root of the implemented FHIR version (e.g., http://hl7.org/fhir/StructureDefinition). For example, "Patient" maps to http://hl7.org/fhir/StructureDefinition/Patient.  For more information, see <a href="elementdefinition-definitions.html#ElementDefinition.type.code">ElementDefinition.type.code</a>.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value
1312         */
1313        public UriType getResourceElement() { 
1314          if (this.resource == null)
1315            if (Configuration.errorOnAutoCreate())
1316              throw new Error("Attempt to auto-create SubscriptionTopicEventTriggerComponent.resource");
1317            else if (Configuration.doAutoCreate())
1318              this.resource = new UriType(); // bb
1319          return this.resource;
1320        }
1321
1322        public boolean hasResourceElement() { 
1323          return this.resource != null && !this.resource.isEmpty();
1324        }
1325
1326        public boolean hasResource() { 
1327          return this.resource != null && !this.resource.isEmpty();
1328        }
1329
1330        /**
1331         * @param value {@link #resource} (URL of the Resource that is the focus type used in this event trigger.  Relative URLs are relative to the StructureDefinition root of the implemented FHIR version (e.g., http://hl7.org/fhir/StructureDefinition). For example, "Patient" maps to http://hl7.org/fhir/StructureDefinition/Patient.  For more information, see <a href="elementdefinition-definitions.html#ElementDefinition.type.code">ElementDefinition.type.code</a>.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value
1332         */
1333        public SubscriptionTopicEventTriggerComponent setResourceElement(UriType value) { 
1334          this.resource = value;
1335          return this;
1336        }
1337
1338        /**
1339         * @return URL of the Resource that is the focus type used in this event trigger.  Relative URLs are relative to the StructureDefinition root of the implemented FHIR version (e.g., http://hl7.org/fhir/StructureDefinition). For example, "Patient" maps to http://hl7.org/fhir/StructureDefinition/Patient.  For more information, see <a href="elementdefinition-definitions.html#ElementDefinition.type.code">ElementDefinition.type.code</a>.
1340         */
1341        public String getResource() { 
1342          return this.resource == null ? null : this.resource.getValue();
1343        }
1344
1345        /**
1346         * @param value URL of the Resource that is the focus type used in this event trigger.  Relative URLs are relative to the StructureDefinition root of the implemented FHIR version (e.g., http://hl7.org/fhir/StructureDefinition). For example, "Patient" maps to http://hl7.org/fhir/StructureDefinition/Patient.  For more information, see <a href="elementdefinition-definitions.html#ElementDefinition.type.code">ElementDefinition.type.code</a>.
1347         */
1348        public SubscriptionTopicEventTriggerComponent setResource(String value) { 
1349            if (this.resource == null)
1350              this.resource = new UriType();
1351            this.resource.setValue(value);
1352          return this;
1353        }
1354
1355        protected void listChildren(List<Property> children) {
1356          super.listChildren(children);
1357          children.add(new Property("description", "markdown", "The human readable description of an event to trigger a notification for the SubscriptionTopic - for example, \"Patient Admission, as defined in HL7v2 via message ADT^A01\". Multiple values are considered OR joined (e.g., matching any single event listed).", 0, 1, description));
1358          children.add(new Property("event", "CodeableConcept", "A well-defined event which can be used to trigger notifications from the SubscriptionTopic.", 0, 1, event));
1359          children.add(new Property("resource", "uri", "URL of the Resource that is the focus type used in this event trigger.  Relative URLs are relative to the StructureDefinition root of the implemented FHIR version (e.g., http://hl7.org/fhir/StructureDefinition). For example, \"Patient\" maps to http://hl7.org/fhir/StructureDefinition/Patient.  For more information, see <a href=\"elementdefinition-definitions.html#ElementDefinition.type.code\">ElementDefinition.type.code</a>.", 0, 1, resource));
1360        }
1361
1362        @Override
1363        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1364          switch (_hash) {
1365          case -1724546052: /*description*/  return new Property("description", "markdown", "The human readable description of an event to trigger a notification for the SubscriptionTopic - for example, \"Patient Admission, as defined in HL7v2 via message ADT^A01\". Multiple values are considered OR joined (e.g., matching any single event listed).", 0, 1, description);
1366          case 96891546: /*event*/  return new Property("event", "CodeableConcept", "A well-defined event which can be used to trigger notifications from the SubscriptionTopic.", 0, 1, event);
1367          case -341064690: /*resource*/  return new Property("resource", "uri", "URL of the Resource that is the focus type used in this event trigger.  Relative URLs are relative to the StructureDefinition root of the implemented FHIR version (e.g., http://hl7.org/fhir/StructureDefinition). For example, \"Patient\" maps to http://hl7.org/fhir/StructureDefinition/Patient.  For more information, see <a href=\"elementdefinition-definitions.html#ElementDefinition.type.code\">ElementDefinition.type.code</a>.", 0, 1, resource);
1368          default: return super.getNamedProperty(_hash, _name, _checkValid);
1369          }
1370
1371        }
1372
1373      @Override
1374      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1375        switch (hash) {
1376        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
1377        case 96891546: /*event*/ return this.event == null ? new Base[0] : new Base[] {this.event}; // CodeableConcept
1378        case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // UriType
1379        default: return super.getProperty(hash, name, checkValid);
1380        }
1381
1382      }
1383
1384      @Override
1385      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1386        switch (hash) {
1387        case -1724546052: // description
1388          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
1389          return value;
1390        case 96891546: // event
1391          this.event = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1392          return value;
1393        case -341064690: // resource
1394          this.resource = TypeConvertor.castToUri(value); // UriType
1395          return value;
1396        default: return super.setProperty(hash, name, value);
1397        }
1398
1399      }
1400
1401      @Override
1402      public Base setProperty(String name, Base value) throws FHIRException {
1403        if (name.equals("description")) {
1404          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
1405        } else if (name.equals("event")) {
1406          this.event = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1407        } else if (name.equals("resource")) {
1408          this.resource = TypeConvertor.castToUri(value); // UriType
1409        } else
1410          return super.setProperty(name, value);
1411        return value;
1412      }
1413
1414      @Override
1415      public Base makeProperty(int hash, String name) throws FHIRException {
1416        switch (hash) {
1417        case -1724546052:  return getDescriptionElement();
1418        case 96891546:  return getEvent();
1419        case -341064690:  return getResourceElement();
1420        default: return super.makeProperty(hash, name);
1421        }
1422
1423      }
1424
1425      @Override
1426      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1427        switch (hash) {
1428        case -1724546052: /*description*/ return new String[] {"markdown"};
1429        case 96891546: /*event*/ return new String[] {"CodeableConcept"};
1430        case -341064690: /*resource*/ return new String[] {"uri"};
1431        default: return super.getTypesForProperty(hash, name);
1432        }
1433
1434      }
1435
1436      @Override
1437      public Base addChild(String name) throws FHIRException {
1438        if (name.equals("description")) {
1439          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.eventTrigger.description");
1440        }
1441        else if (name.equals("event")) {
1442          this.event = new CodeableConcept();
1443          return this.event;
1444        }
1445        else if (name.equals("resource")) {
1446          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.eventTrigger.resource");
1447        }
1448        else
1449          return super.addChild(name);
1450      }
1451
1452      public SubscriptionTopicEventTriggerComponent copy() {
1453        SubscriptionTopicEventTriggerComponent dst = new SubscriptionTopicEventTriggerComponent();
1454        copyValues(dst);
1455        return dst;
1456      }
1457
1458      public void copyValues(SubscriptionTopicEventTriggerComponent dst) {
1459        super.copyValues(dst);
1460        dst.description = description == null ? null : description.copy();
1461        dst.event = event == null ? null : event.copy();
1462        dst.resource = resource == null ? null : resource.copy();
1463      }
1464
1465      @Override
1466      public boolean equalsDeep(Base other_) {
1467        if (!super.equalsDeep(other_))
1468          return false;
1469        if (!(other_ instanceof SubscriptionTopicEventTriggerComponent))
1470          return false;
1471        SubscriptionTopicEventTriggerComponent o = (SubscriptionTopicEventTriggerComponent) other_;
1472        return compareDeep(description, o.description, true) && compareDeep(event, o.event, true) && compareDeep(resource, o.resource, true)
1473          ;
1474      }
1475
1476      @Override
1477      public boolean equalsShallow(Base other_) {
1478        if (!super.equalsShallow(other_))
1479          return false;
1480        if (!(other_ instanceof SubscriptionTopicEventTriggerComponent))
1481          return false;
1482        SubscriptionTopicEventTriggerComponent o = (SubscriptionTopicEventTriggerComponent) other_;
1483        return compareValues(description, o.description, true) && compareValues(resource, o.resource, true)
1484          ;
1485      }
1486
1487      public boolean isEmpty() {
1488        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(description, event, resource
1489          );
1490      }
1491
1492  public String fhirType() {
1493    return "SubscriptionTopic.eventTrigger";
1494
1495  }
1496
1497  }
1498
1499    @Block()
1500    public static class SubscriptionTopicCanFilterByComponent extends BackboneElement implements IBaseBackboneElement {
1501        /**
1502         * Description of how this filtering parameter is intended to be used.
1503         */
1504        @Child(name = "description", type = {MarkdownType.class}, order=1, min=0, max=1, modifier=false, summary=true)
1505        @Description(shortDefinition="Description of this filter parameter", formalDefinition="Description of how this filtering parameter is intended to be used." )
1506        protected MarkdownType description;
1507
1508        /**
1509         * URL of the Resource that is the type used in this filter. This is the "focus" of the topic (or one of them if there are more than one). It will be the same, a generality, or a specificity of SubscriptionTopic.resourceTrigger.resource or SubscriptionTopic.eventTrigger.resource when they are present.
1510         */
1511        @Child(name = "resource", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true)
1512        @Description(shortDefinition="URL of the triggering Resource that this filter applies to", formalDefinition="URL of the Resource that is the type used in this filter. This is the \"focus\" of the topic (or one of them if there are more than one). It will be the same, a generality, or a specificity of SubscriptionTopic.resourceTrigger.resource or SubscriptionTopic.eventTrigger.resource when they are present." )
1513        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/defined-types")
1514        protected UriType resource;
1515
1516        /**
1517         * Either the canonical URL to a search parameter (like "http://hl7.org/fhir/SearchParameter/encounter-patient") or topic-defined parameter (like "hub.event") which is a label for the filter.
1518         */
1519        @Child(name = "filterParameter", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=true)
1520        @Description(shortDefinition="Human-readable and computation-friendly name for a filter parameter usable by subscriptions on this topic, via Subscription.filterBy.filterParameter", formalDefinition="Either the canonical URL to a search parameter (like \"http://hl7.org/fhir/SearchParameter/encounter-patient\") or topic-defined parameter (like \"hub.event\") which is a label for the filter." )
1521        protected StringType filterParameter;
1522
1523        /**
1524         * Either the canonical URL to a search parameter (like "http://hl7.org/fhir/SearchParameter/encounter-patient") or the officially-defined URI for a shared filter concept (like "http://example.org/concepts/shared-common-event").
1525         */
1526        @Child(name = "filterDefinition", type = {UriType.class}, order=4, min=0, max=1, modifier=false, summary=true)
1527        @Description(shortDefinition="Canonical URL for a filterParameter definition", formalDefinition="Either the canonical URL to a search parameter (like \"http://hl7.org/fhir/SearchParameter/encounter-patient\") or the officially-defined URI for a shared filter concept (like \"http://example.org/concepts/shared-common-event\")." )
1528        protected UriType filterDefinition;
1529
1530        /**
1531         * Allowable operators to apply when determining matches (Search Modifiers).  If the filterParameter is a SearchParameter, this list of modifiers SHALL be a strict subset of the modifiers defined on that SearchParameter.
1532         */
1533        @Child(name = "modifier", type = {CodeType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1534        @Description(shortDefinition="= | eq | ne | gt | lt | ge | le | sa | eb | ap | above | below | in | not-in | of-type", formalDefinition="Allowable operators to apply when determining matches (Search Modifiers).  If the filterParameter is a SearchParameter, this list of modifiers SHALL be a strict subset of the modifiers defined on that SearchParameter." )
1535        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/subscription-search-modifier")
1536        protected List<Enumeration<SubscriptionSearchModifier>> modifier;
1537
1538        private static final long serialVersionUID = 1579878218L;
1539
1540    /**
1541     * Constructor
1542     */
1543      public SubscriptionTopicCanFilterByComponent() {
1544        super();
1545      }
1546
1547    /**
1548     * Constructor
1549     */
1550      public SubscriptionTopicCanFilterByComponent(String filterParameter) {
1551        super();
1552        this.setFilterParameter(filterParameter);
1553      }
1554
1555        /**
1556         * @return {@link #description} (Description of how this filtering parameter is intended to be used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1557         */
1558        public MarkdownType getDescriptionElement() { 
1559          if (this.description == null)
1560            if (Configuration.errorOnAutoCreate())
1561              throw new Error("Attempt to auto-create SubscriptionTopicCanFilterByComponent.description");
1562            else if (Configuration.doAutoCreate())
1563              this.description = new MarkdownType(); // bb
1564          return this.description;
1565        }
1566
1567        public boolean hasDescriptionElement() { 
1568          return this.description != null && !this.description.isEmpty();
1569        }
1570
1571        public boolean hasDescription() { 
1572          return this.description != null && !this.description.isEmpty();
1573        }
1574
1575        /**
1576         * @param value {@link #description} (Description of how this filtering parameter is intended to be used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1577         */
1578        public SubscriptionTopicCanFilterByComponent setDescriptionElement(MarkdownType value) { 
1579          this.description = value;
1580          return this;
1581        }
1582
1583        /**
1584         * @return Description of how this filtering parameter is intended to be used.
1585         */
1586        public String getDescription() { 
1587          return this.description == null ? null : this.description.getValue();
1588        }
1589
1590        /**
1591         * @param value Description of how this filtering parameter is intended to be used.
1592         */
1593        public SubscriptionTopicCanFilterByComponent setDescription(String value) { 
1594          if (value == null)
1595            this.description = null;
1596          else {
1597            if (this.description == null)
1598              this.description = new MarkdownType();
1599            this.description.setValue(value);
1600          }
1601          return this;
1602        }
1603
1604        /**
1605         * @return {@link #resource} (URL of the Resource that is the type used in this filter. This is the "focus" of the topic (or one of them if there are more than one). It will be the same, a generality, or a specificity of SubscriptionTopic.resourceTrigger.resource or SubscriptionTopic.eventTrigger.resource when they are present.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value
1606         */
1607        public UriType getResourceElement() { 
1608          if (this.resource == null)
1609            if (Configuration.errorOnAutoCreate())
1610              throw new Error("Attempt to auto-create SubscriptionTopicCanFilterByComponent.resource");
1611            else if (Configuration.doAutoCreate())
1612              this.resource = new UriType(); // bb
1613          return this.resource;
1614        }
1615
1616        public boolean hasResourceElement() { 
1617          return this.resource != null && !this.resource.isEmpty();
1618        }
1619
1620        public boolean hasResource() { 
1621          return this.resource != null && !this.resource.isEmpty();
1622        }
1623
1624        /**
1625         * @param value {@link #resource} (URL of the Resource that is the type used in this filter. This is the "focus" of the topic (or one of them if there are more than one). It will be the same, a generality, or a specificity of SubscriptionTopic.resourceTrigger.resource or SubscriptionTopic.eventTrigger.resource when they are present.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value
1626         */
1627        public SubscriptionTopicCanFilterByComponent setResourceElement(UriType value) { 
1628          this.resource = value;
1629          return this;
1630        }
1631
1632        /**
1633         * @return URL of the Resource that is the type used in this filter. This is the "focus" of the topic (or one of them if there are more than one). It will be the same, a generality, or a specificity of SubscriptionTopic.resourceTrigger.resource or SubscriptionTopic.eventTrigger.resource when they are present.
1634         */
1635        public String getResource() { 
1636          return this.resource == null ? null : this.resource.getValue();
1637        }
1638
1639        /**
1640         * @param value URL of the Resource that is the type used in this filter. This is the "focus" of the topic (or one of them if there are more than one). It will be the same, a generality, or a specificity of SubscriptionTopic.resourceTrigger.resource or SubscriptionTopic.eventTrigger.resource when they are present.
1641         */
1642        public SubscriptionTopicCanFilterByComponent setResource(String value) { 
1643          if (Utilities.noString(value))
1644            this.resource = null;
1645          else {
1646            if (this.resource == null)
1647              this.resource = new UriType();
1648            this.resource.setValue(value);
1649          }
1650          return this;
1651        }
1652
1653        /**
1654         * @return {@link #filterParameter} (Either the canonical URL to a search parameter (like "http://hl7.org/fhir/SearchParameter/encounter-patient") or topic-defined parameter (like "hub.event") which is a label for the filter.). This is the underlying object with id, value and extensions. The accessor "getFilterParameter" gives direct access to the value
1655         */
1656        public StringType getFilterParameterElement() { 
1657          if (this.filterParameter == null)
1658            if (Configuration.errorOnAutoCreate())
1659              throw new Error("Attempt to auto-create SubscriptionTopicCanFilterByComponent.filterParameter");
1660            else if (Configuration.doAutoCreate())
1661              this.filterParameter = new StringType(); // bb
1662          return this.filterParameter;
1663        }
1664
1665        public boolean hasFilterParameterElement() { 
1666          return this.filterParameter != null && !this.filterParameter.isEmpty();
1667        }
1668
1669        public boolean hasFilterParameter() { 
1670          return this.filterParameter != null && !this.filterParameter.isEmpty();
1671        }
1672
1673        /**
1674         * @param value {@link #filterParameter} (Either the canonical URL to a search parameter (like "http://hl7.org/fhir/SearchParameter/encounter-patient") or topic-defined parameter (like "hub.event") which is a label for the filter.). This is the underlying object with id, value and extensions. The accessor "getFilterParameter" gives direct access to the value
1675         */
1676        public SubscriptionTopicCanFilterByComponent setFilterParameterElement(StringType value) { 
1677          this.filterParameter = value;
1678          return this;
1679        }
1680
1681        /**
1682         * @return Either the canonical URL to a search parameter (like "http://hl7.org/fhir/SearchParameter/encounter-patient") or topic-defined parameter (like "hub.event") which is a label for the filter.
1683         */
1684        public String getFilterParameter() { 
1685          return this.filterParameter == null ? null : this.filterParameter.getValue();
1686        }
1687
1688        /**
1689         * @param value Either the canonical URL to a search parameter (like "http://hl7.org/fhir/SearchParameter/encounter-patient") or topic-defined parameter (like "hub.event") which is a label for the filter.
1690         */
1691        public SubscriptionTopicCanFilterByComponent setFilterParameter(String value) { 
1692            if (this.filterParameter == null)
1693              this.filterParameter = new StringType();
1694            this.filterParameter.setValue(value);
1695          return this;
1696        }
1697
1698        /**
1699         * @return {@link #filterDefinition} (Either the canonical URL to a search parameter (like "http://hl7.org/fhir/SearchParameter/encounter-patient") or the officially-defined URI for a shared filter concept (like "http://example.org/concepts/shared-common-event").). This is the underlying object with id, value and extensions. The accessor "getFilterDefinition" gives direct access to the value
1700         */
1701        public UriType getFilterDefinitionElement() { 
1702          if (this.filterDefinition == null)
1703            if (Configuration.errorOnAutoCreate())
1704              throw new Error("Attempt to auto-create SubscriptionTopicCanFilterByComponent.filterDefinition");
1705            else if (Configuration.doAutoCreate())
1706              this.filterDefinition = new UriType(); // bb
1707          return this.filterDefinition;
1708        }
1709
1710        public boolean hasFilterDefinitionElement() { 
1711          return this.filterDefinition != null && !this.filterDefinition.isEmpty();
1712        }
1713
1714        public boolean hasFilterDefinition() { 
1715          return this.filterDefinition != null && !this.filterDefinition.isEmpty();
1716        }
1717
1718        /**
1719         * @param value {@link #filterDefinition} (Either the canonical URL to a search parameter (like "http://hl7.org/fhir/SearchParameter/encounter-patient") or the officially-defined URI for a shared filter concept (like "http://example.org/concepts/shared-common-event").). This is the underlying object with id, value and extensions. The accessor "getFilterDefinition" gives direct access to the value
1720         */
1721        public SubscriptionTopicCanFilterByComponent setFilterDefinitionElement(UriType value) { 
1722          this.filterDefinition = value;
1723          return this;
1724        }
1725
1726        /**
1727         * @return Either the canonical URL to a search parameter (like "http://hl7.org/fhir/SearchParameter/encounter-patient") or the officially-defined URI for a shared filter concept (like "http://example.org/concepts/shared-common-event").
1728         */
1729        public String getFilterDefinition() { 
1730          return this.filterDefinition == null ? null : this.filterDefinition.getValue();
1731        }
1732
1733        /**
1734         * @param value Either the canonical URL to a search parameter (like "http://hl7.org/fhir/SearchParameter/encounter-patient") or the officially-defined URI for a shared filter concept (like "http://example.org/concepts/shared-common-event").
1735         */
1736        public SubscriptionTopicCanFilterByComponent setFilterDefinition(String value) { 
1737          if (Utilities.noString(value))
1738            this.filterDefinition = null;
1739          else {
1740            if (this.filterDefinition == null)
1741              this.filterDefinition = new UriType();
1742            this.filterDefinition.setValue(value);
1743          }
1744          return this;
1745        }
1746
1747        /**
1748         * @return {@link #modifier} (Allowable operators to apply when determining matches (Search Modifiers).  If the filterParameter is a SearchParameter, this list of modifiers SHALL be a strict subset of the modifiers defined on that SearchParameter.)
1749         */
1750        public List<Enumeration<SubscriptionSearchModifier>> getModifier() { 
1751          if (this.modifier == null)
1752            this.modifier = new ArrayList<Enumeration<SubscriptionSearchModifier>>();
1753          return this.modifier;
1754        }
1755
1756        /**
1757         * @return Returns a reference to <code>this</code> for easy method chaining
1758         */
1759        public SubscriptionTopicCanFilterByComponent setModifier(List<Enumeration<SubscriptionSearchModifier>> theModifier) { 
1760          this.modifier = theModifier;
1761          return this;
1762        }
1763
1764        public boolean hasModifier() { 
1765          if (this.modifier == null)
1766            return false;
1767          for (Enumeration<SubscriptionSearchModifier> item : this.modifier)
1768            if (!item.isEmpty())
1769              return true;
1770          return false;
1771        }
1772
1773        /**
1774         * @return {@link #modifier} (Allowable operators to apply when determining matches (Search Modifiers).  If the filterParameter is a SearchParameter, this list of modifiers SHALL be a strict subset of the modifiers defined on that SearchParameter.)
1775         */
1776        public Enumeration<SubscriptionSearchModifier> addModifierElement() {//2 
1777          Enumeration<SubscriptionSearchModifier> t = new Enumeration<SubscriptionSearchModifier>(new SubscriptionSearchModifierEnumFactory());
1778          if (this.modifier == null)
1779            this.modifier = new ArrayList<Enumeration<SubscriptionSearchModifier>>();
1780          this.modifier.add(t);
1781          return t;
1782        }
1783
1784        /**
1785         * @param value {@link #modifier} (Allowable operators to apply when determining matches (Search Modifiers).  If the filterParameter is a SearchParameter, this list of modifiers SHALL be a strict subset of the modifiers defined on that SearchParameter.)
1786         */
1787        public SubscriptionTopicCanFilterByComponent addModifier(SubscriptionSearchModifier value) { //1
1788          Enumeration<SubscriptionSearchModifier> t = new Enumeration<SubscriptionSearchModifier>(new SubscriptionSearchModifierEnumFactory());
1789          t.setValue(value);
1790          if (this.modifier == null)
1791            this.modifier = new ArrayList<Enumeration<SubscriptionSearchModifier>>();
1792          this.modifier.add(t);
1793          return this;
1794        }
1795
1796        /**
1797         * @param value {@link #modifier} (Allowable operators to apply when determining matches (Search Modifiers).  If the filterParameter is a SearchParameter, this list of modifiers SHALL be a strict subset of the modifiers defined on that SearchParameter.)
1798         */
1799        public boolean hasModifier(SubscriptionSearchModifier value) { 
1800          if (this.modifier == null)
1801            return false;
1802          for (Enumeration<SubscriptionSearchModifier> v : this.modifier)
1803            if (v.getValue().equals(value)) // code
1804              return true;
1805          return false;
1806        }
1807
1808        protected void listChildren(List<Property> children) {
1809          super.listChildren(children);
1810          children.add(new Property("description", "markdown", "Description of how this filtering parameter is intended to be used.", 0, 1, description));
1811          children.add(new Property("resource", "uri", "URL of the Resource that is the type used in this filter. This is the \"focus\" of the topic (or one of them if there are more than one). It will be the same, a generality, or a specificity of SubscriptionTopic.resourceTrigger.resource or SubscriptionTopic.eventTrigger.resource when they are present.", 0, 1, resource));
1812          children.add(new Property("filterParameter", "string", "Either the canonical URL to a search parameter (like \"http://hl7.org/fhir/SearchParameter/encounter-patient\") or topic-defined parameter (like \"hub.event\") which is a label for the filter.", 0, 1, filterParameter));
1813          children.add(new Property("filterDefinition", "uri", "Either the canonical URL to a search parameter (like \"http://hl7.org/fhir/SearchParameter/encounter-patient\") or the officially-defined URI for a shared filter concept (like \"http://example.org/concepts/shared-common-event\").", 0, 1, filterDefinition));
1814          children.add(new Property("modifier", "code", "Allowable operators to apply when determining matches (Search Modifiers).  If the filterParameter is a SearchParameter, this list of modifiers SHALL be a strict subset of the modifiers defined on that SearchParameter.", 0, java.lang.Integer.MAX_VALUE, modifier));
1815        }
1816
1817        @Override
1818        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1819          switch (_hash) {
1820          case -1724546052: /*description*/  return new Property("description", "markdown", "Description of how this filtering parameter is intended to be used.", 0, 1, description);
1821          case -341064690: /*resource*/  return new Property("resource", "uri", "URL of the Resource that is the type used in this filter. This is the \"focus\" of the topic (or one of them if there are more than one). It will be the same, a generality, or a specificity of SubscriptionTopic.resourceTrigger.resource or SubscriptionTopic.eventTrigger.resource when they are present.", 0, 1, resource);
1822          case 618257: /*filterParameter*/  return new Property("filterParameter", "string", "Either the canonical URL to a search parameter (like \"http://hl7.org/fhir/SearchParameter/encounter-patient\") or topic-defined parameter (like \"hub.event\") which is a label for the filter.", 0, 1, filterParameter);
1823          case -1453988117: /*filterDefinition*/  return new Property("filterDefinition", "uri", "Either the canonical URL to a search parameter (like \"http://hl7.org/fhir/SearchParameter/encounter-patient\") or the officially-defined URI for a shared filter concept (like \"http://example.org/concepts/shared-common-event\").", 0, 1, filterDefinition);
1824          case -615513385: /*modifier*/  return new Property("modifier", "code", "Allowable operators to apply when determining matches (Search Modifiers).  If the filterParameter is a SearchParameter, this list of modifiers SHALL be a strict subset of the modifiers defined on that SearchParameter.", 0, java.lang.Integer.MAX_VALUE, modifier);
1825          default: return super.getNamedProperty(_hash, _name, _checkValid);
1826          }
1827
1828        }
1829
1830      @Override
1831      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1832        switch (hash) {
1833        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
1834        case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // UriType
1835        case 618257: /*filterParameter*/ return this.filterParameter == null ? new Base[0] : new Base[] {this.filterParameter}; // StringType
1836        case -1453988117: /*filterDefinition*/ return this.filterDefinition == null ? new Base[0] : new Base[] {this.filterDefinition}; // UriType
1837        case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // Enumeration<SubscriptionSearchModifier>
1838        default: return super.getProperty(hash, name, checkValid);
1839        }
1840
1841      }
1842
1843      @Override
1844      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1845        switch (hash) {
1846        case -1724546052: // description
1847          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
1848          return value;
1849        case -341064690: // resource
1850          this.resource = TypeConvertor.castToUri(value); // UriType
1851          return value;
1852        case 618257: // filterParameter
1853          this.filterParameter = TypeConvertor.castToString(value); // StringType
1854          return value;
1855        case -1453988117: // filterDefinition
1856          this.filterDefinition = TypeConvertor.castToUri(value); // UriType
1857          return value;
1858        case -615513385: // modifier
1859          value = new SubscriptionSearchModifierEnumFactory().fromType(TypeConvertor.castToCode(value));
1860          this.getModifier().add((Enumeration) value); // Enumeration<SubscriptionSearchModifier>
1861          return value;
1862        default: return super.setProperty(hash, name, value);
1863        }
1864
1865      }
1866
1867      @Override
1868      public Base setProperty(String name, Base value) throws FHIRException {
1869        if (name.equals("description")) {
1870          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
1871        } else if (name.equals("resource")) {
1872          this.resource = TypeConvertor.castToUri(value); // UriType
1873        } else if (name.equals("filterParameter")) {
1874          this.filterParameter = TypeConvertor.castToString(value); // StringType
1875        } else if (name.equals("filterDefinition")) {
1876          this.filterDefinition = TypeConvertor.castToUri(value); // UriType
1877        } else if (name.equals("modifier")) {
1878          value = new SubscriptionSearchModifierEnumFactory().fromType(TypeConvertor.castToCode(value));
1879          this.getModifier().add((Enumeration) value);
1880        } else
1881          return super.setProperty(name, value);
1882        return value;
1883      }
1884
1885      @Override
1886      public Base makeProperty(int hash, String name) throws FHIRException {
1887        switch (hash) {
1888        case -1724546052:  return getDescriptionElement();
1889        case -341064690:  return getResourceElement();
1890        case 618257:  return getFilterParameterElement();
1891        case -1453988117:  return getFilterDefinitionElement();
1892        case -615513385:  return addModifierElement();
1893        default: return super.makeProperty(hash, name);
1894        }
1895
1896      }
1897
1898      @Override
1899      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1900        switch (hash) {
1901        case -1724546052: /*description*/ return new String[] {"markdown"};
1902        case -341064690: /*resource*/ return new String[] {"uri"};
1903        case 618257: /*filterParameter*/ return new String[] {"string"};
1904        case -1453988117: /*filterDefinition*/ return new String[] {"uri"};
1905        case -615513385: /*modifier*/ return new String[] {"code"};
1906        default: return super.getTypesForProperty(hash, name);
1907        }
1908
1909      }
1910
1911      @Override
1912      public Base addChild(String name) throws FHIRException {
1913        if (name.equals("description")) {
1914          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.canFilterBy.description");
1915        }
1916        else if (name.equals("resource")) {
1917          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.canFilterBy.resource");
1918        }
1919        else if (name.equals("filterParameter")) {
1920          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.canFilterBy.filterParameter");
1921        }
1922        else if (name.equals("filterDefinition")) {
1923          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.canFilterBy.filterDefinition");
1924        }
1925        else if (name.equals("modifier")) {
1926          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.canFilterBy.modifier");
1927        }
1928        else
1929          return super.addChild(name);
1930      }
1931
1932      public SubscriptionTopicCanFilterByComponent copy() {
1933        SubscriptionTopicCanFilterByComponent dst = new SubscriptionTopicCanFilterByComponent();
1934        copyValues(dst);
1935        return dst;
1936      }
1937
1938      public void copyValues(SubscriptionTopicCanFilterByComponent dst) {
1939        super.copyValues(dst);
1940        dst.description = description == null ? null : description.copy();
1941        dst.resource = resource == null ? null : resource.copy();
1942        dst.filterParameter = filterParameter == null ? null : filterParameter.copy();
1943        dst.filterDefinition = filterDefinition == null ? null : filterDefinition.copy();
1944        if (modifier != null) {
1945          dst.modifier = new ArrayList<Enumeration<SubscriptionSearchModifier>>();
1946          for (Enumeration<SubscriptionSearchModifier> i : modifier)
1947            dst.modifier.add(i.copy());
1948        };
1949      }
1950
1951      @Override
1952      public boolean equalsDeep(Base other_) {
1953        if (!super.equalsDeep(other_))
1954          return false;
1955        if (!(other_ instanceof SubscriptionTopicCanFilterByComponent))
1956          return false;
1957        SubscriptionTopicCanFilterByComponent o = (SubscriptionTopicCanFilterByComponent) other_;
1958        return compareDeep(description, o.description, true) && compareDeep(resource, o.resource, true)
1959           && compareDeep(filterParameter, o.filterParameter, true) && compareDeep(filterDefinition, o.filterDefinition, true)
1960           && compareDeep(modifier, o.modifier, true);
1961      }
1962
1963      @Override
1964      public boolean equalsShallow(Base other_) {
1965        if (!super.equalsShallow(other_))
1966          return false;
1967        if (!(other_ instanceof SubscriptionTopicCanFilterByComponent))
1968          return false;
1969        SubscriptionTopicCanFilterByComponent o = (SubscriptionTopicCanFilterByComponent) other_;
1970        return compareValues(description, o.description, true) && compareValues(resource, o.resource, true)
1971           && compareValues(filterParameter, o.filterParameter, true) && compareValues(filterDefinition, o.filterDefinition, true)
1972           && compareValues(modifier, o.modifier, true);
1973      }
1974
1975      public boolean isEmpty() {
1976        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(description, resource, filterParameter
1977          , filterDefinition, modifier);
1978      }
1979
1980  public String fhirType() {
1981    return "SubscriptionTopic.canFilterBy";
1982
1983  }
1984
1985  }
1986
1987    @Block()
1988    public static class SubscriptionTopicNotificationShapeComponent extends BackboneElement implements IBaseBackboneElement {
1989        /**
1990         * URL of the Resource that is the type used in this shape. This is the "focus" of the topic (or one of them if there are more than one) and the root resource for this shape definition. It will be the same, a generality, or a specificity of SubscriptionTopic.resourceTrigger.resource or SubscriptionTopic.eventTrigger.resource when they are present.
1991         */
1992        @Child(name = "resource", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=true)
1993        @Description(shortDefinition="URL of the Resource that is the focus (main) resource in a notification shape", formalDefinition="URL of the Resource that is the type used in this shape. This is the \"focus\" of the topic (or one of them if there are more than one) and the root resource for this shape definition. It will be the same, a generality, or a specificity of SubscriptionTopic.resourceTrigger.resource or SubscriptionTopic.eventTrigger.resource when they are present." )
1994        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/defined-types")
1995        protected UriType resource;
1996
1997        /**
1998         * Search-style _include directives, rooted in the resource for this shape. Servers SHOULD include resources listed here, if they exist and the user is authorized to receive them.  Clients SHOULD be prepared to receive these additional resources, but SHALL function properly without them.
1999         */
2000        @Child(name = "include", type = {StringType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2001        @Description(shortDefinition="Include directives, rooted in the resource for this shape", formalDefinition="Search-style _include directives, rooted in the resource for this shape. Servers SHOULD include resources listed here, if they exist and the user is authorized to receive them.  Clients SHOULD be prepared to receive these additional resources, but SHALL function properly without them." )
2002        protected List<StringType> include;
2003
2004        /**
2005         * Search-style _revinclude directives, rooted in the resource for this shape. Servers SHOULD include resources listed here, if they exist and the user is authorized to receive them.  Clients SHOULD be prepared to receive these additional resources, but SHALL function properly without them.
2006         */
2007        @Child(name = "revInclude", type = {StringType.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2008        @Description(shortDefinition="Reverse include directives, rooted in the resource for this shape", formalDefinition="Search-style _revinclude directives, rooted in the resource for this shape. Servers SHOULD include resources listed here, if they exist and the user is authorized to receive them.  Clients SHOULD be prepared to receive these additional resources, but SHALL function properly without them." )
2009        protected List<StringType> revInclude;
2010
2011        private static final long serialVersionUID = -1718592091L;
2012
2013    /**
2014     * Constructor
2015     */
2016      public SubscriptionTopicNotificationShapeComponent() {
2017        super();
2018      }
2019
2020    /**
2021     * Constructor
2022     */
2023      public SubscriptionTopicNotificationShapeComponent(String resource) {
2024        super();
2025        this.setResource(resource);
2026      }
2027
2028        /**
2029         * @return {@link #resource} (URL of the Resource that is the type used in this shape. This is the "focus" of the topic (or one of them if there are more than one) and the root resource for this shape definition. It will be the same, a generality, or a specificity of SubscriptionTopic.resourceTrigger.resource or SubscriptionTopic.eventTrigger.resource when they are present.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value
2030         */
2031        public UriType getResourceElement() { 
2032          if (this.resource == null)
2033            if (Configuration.errorOnAutoCreate())
2034              throw new Error("Attempt to auto-create SubscriptionTopicNotificationShapeComponent.resource");
2035            else if (Configuration.doAutoCreate())
2036              this.resource = new UriType(); // bb
2037          return this.resource;
2038        }
2039
2040        public boolean hasResourceElement() { 
2041          return this.resource != null && !this.resource.isEmpty();
2042        }
2043
2044        public boolean hasResource() { 
2045          return this.resource != null && !this.resource.isEmpty();
2046        }
2047
2048        /**
2049         * @param value {@link #resource} (URL of the Resource that is the type used in this shape. This is the "focus" of the topic (or one of them if there are more than one) and the root resource for this shape definition. It will be the same, a generality, or a specificity of SubscriptionTopic.resourceTrigger.resource or SubscriptionTopic.eventTrigger.resource when they are present.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value
2050         */
2051        public SubscriptionTopicNotificationShapeComponent setResourceElement(UriType value) { 
2052          this.resource = value;
2053          return this;
2054        }
2055
2056        /**
2057         * @return URL of the Resource that is the type used in this shape. This is the "focus" of the topic (or one of them if there are more than one) and the root resource for this shape definition. It will be the same, a generality, or a specificity of SubscriptionTopic.resourceTrigger.resource or SubscriptionTopic.eventTrigger.resource when they are present.
2058         */
2059        public String getResource() { 
2060          return this.resource == null ? null : this.resource.getValue();
2061        }
2062
2063        /**
2064         * @param value URL of the Resource that is the type used in this shape. This is the "focus" of the topic (or one of them if there are more than one) and the root resource for this shape definition. It will be the same, a generality, or a specificity of SubscriptionTopic.resourceTrigger.resource or SubscriptionTopic.eventTrigger.resource when they are present.
2065         */
2066        public SubscriptionTopicNotificationShapeComponent setResource(String value) { 
2067            if (this.resource == null)
2068              this.resource = new UriType();
2069            this.resource.setValue(value);
2070          return this;
2071        }
2072
2073        /**
2074         * @return {@link #include} (Search-style _include directives, rooted in the resource for this shape. Servers SHOULD include resources listed here, if they exist and the user is authorized to receive them.  Clients SHOULD be prepared to receive these additional resources, but SHALL function properly without them.)
2075         */
2076        public List<StringType> getInclude() { 
2077          if (this.include == null)
2078            this.include = new ArrayList<StringType>();
2079          return this.include;
2080        }
2081
2082        /**
2083         * @return Returns a reference to <code>this</code> for easy method chaining
2084         */
2085        public SubscriptionTopicNotificationShapeComponent setInclude(List<StringType> theInclude) { 
2086          this.include = theInclude;
2087          return this;
2088        }
2089
2090        public boolean hasInclude() { 
2091          if (this.include == null)
2092            return false;
2093          for (StringType item : this.include)
2094            if (!item.isEmpty())
2095              return true;
2096          return false;
2097        }
2098
2099        /**
2100         * @return {@link #include} (Search-style _include directives, rooted in the resource for this shape. Servers SHOULD include resources listed here, if they exist and the user is authorized to receive them.  Clients SHOULD be prepared to receive these additional resources, but SHALL function properly without them.)
2101         */
2102        public StringType addIncludeElement() {//2 
2103          StringType t = new StringType();
2104          if (this.include == null)
2105            this.include = new ArrayList<StringType>();
2106          this.include.add(t);
2107          return t;
2108        }
2109
2110        /**
2111         * @param value {@link #include} (Search-style _include directives, rooted in the resource for this shape. Servers SHOULD include resources listed here, if they exist and the user is authorized to receive them.  Clients SHOULD be prepared to receive these additional resources, but SHALL function properly without them.)
2112         */
2113        public SubscriptionTopicNotificationShapeComponent addInclude(String value) { //1
2114          StringType t = new StringType();
2115          t.setValue(value);
2116          if (this.include == null)
2117            this.include = new ArrayList<StringType>();
2118          this.include.add(t);
2119          return this;
2120        }
2121
2122        /**
2123         * @param value {@link #include} (Search-style _include directives, rooted in the resource for this shape. Servers SHOULD include resources listed here, if they exist and the user is authorized to receive them.  Clients SHOULD be prepared to receive these additional resources, but SHALL function properly without them.)
2124         */
2125        public boolean hasInclude(String value) { 
2126          if (this.include == null)
2127            return false;
2128          for (StringType v : this.include)
2129            if (v.getValue().equals(value)) // string
2130              return true;
2131          return false;
2132        }
2133
2134        /**
2135         * @return {@link #revInclude} (Search-style _revinclude directives, rooted in the resource for this shape. Servers SHOULD include resources listed here, if they exist and the user is authorized to receive them.  Clients SHOULD be prepared to receive these additional resources, but SHALL function properly without them.)
2136         */
2137        public List<StringType> getRevInclude() { 
2138          if (this.revInclude == null)
2139            this.revInclude = new ArrayList<StringType>();
2140          return this.revInclude;
2141        }
2142
2143        /**
2144         * @return Returns a reference to <code>this</code> for easy method chaining
2145         */
2146        public SubscriptionTopicNotificationShapeComponent setRevInclude(List<StringType> theRevInclude) { 
2147          this.revInclude = theRevInclude;
2148          return this;
2149        }
2150
2151        public boolean hasRevInclude() { 
2152          if (this.revInclude == null)
2153            return false;
2154          for (StringType item : this.revInclude)
2155            if (!item.isEmpty())
2156              return true;
2157          return false;
2158        }
2159
2160        /**
2161         * @return {@link #revInclude} (Search-style _revinclude directives, rooted in the resource for this shape. Servers SHOULD include resources listed here, if they exist and the user is authorized to receive them.  Clients SHOULD be prepared to receive these additional resources, but SHALL function properly without them.)
2162         */
2163        public StringType addRevIncludeElement() {//2 
2164          StringType t = new StringType();
2165          if (this.revInclude == null)
2166            this.revInclude = new ArrayList<StringType>();
2167          this.revInclude.add(t);
2168          return t;
2169        }
2170
2171        /**
2172         * @param value {@link #revInclude} (Search-style _revinclude directives, rooted in the resource for this shape. Servers SHOULD include resources listed here, if they exist and the user is authorized to receive them.  Clients SHOULD be prepared to receive these additional resources, but SHALL function properly without them.)
2173         */
2174        public SubscriptionTopicNotificationShapeComponent addRevInclude(String value) { //1
2175          StringType t = new StringType();
2176          t.setValue(value);
2177          if (this.revInclude == null)
2178            this.revInclude = new ArrayList<StringType>();
2179          this.revInclude.add(t);
2180          return this;
2181        }
2182
2183        /**
2184         * @param value {@link #revInclude} (Search-style _revinclude directives, rooted in the resource for this shape. Servers SHOULD include resources listed here, if they exist and the user is authorized to receive them.  Clients SHOULD be prepared to receive these additional resources, but SHALL function properly without them.)
2185         */
2186        public boolean hasRevInclude(String value) { 
2187          if (this.revInclude == null)
2188            return false;
2189          for (StringType v : this.revInclude)
2190            if (v.getValue().equals(value)) // string
2191              return true;
2192          return false;
2193        }
2194
2195        protected void listChildren(List<Property> children) {
2196          super.listChildren(children);
2197          children.add(new Property("resource", "uri", "URL of the Resource that is the type used in this shape. This is the \"focus\" of the topic (or one of them if there are more than one) and the root resource for this shape definition. It will be the same, a generality, or a specificity of SubscriptionTopic.resourceTrigger.resource or SubscriptionTopic.eventTrigger.resource when they are present.", 0, 1, resource));
2198          children.add(new Property("include", "string", "Search-style _include directives, rooted in the resource for this shape. Servers SHOULD include resources listed here, if they exist and the user is authorized to receive them.  Clients SHOULD be prepared to receive these additional resources, but SHALL function properly without them.", 0, java.lang.Integer.MAX_VALUE, include));
2199          children.add(new Property("revInclude", "string", "Search-style _revinclude directives, rooted in the resource for this shape. Servers SHOULD include resources listed here, if they exist and the user is authorized to receive them.  Clients SHOULD be prepared to receive these additional resources, but SHALL function properly without them.", 0, java.lang.Integer.MAX_VALUE, revInclude));
2200        }
2201
2202        @Override
2203        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2204          switch (_hash) {
2205          case -341064690: /*resource*/  return new Property("resource", "uri", "URL of the Resource that is the type used in this shape. This is the \"focus\" of the topic (or one of them if there are more than one) and the root resource for this shape definition. It will be the same, a generality, or a specificity of SubscriptionTopic.resourceTrigger.resource or SubscriptionTopic.eventTrigger.resource when they are present.", 0, 1, resource);
2206          case 1942574248: /*include*/  return new Property("include", "string", "Search-style _include directives, rooted in the resource for this shape. Servers SHOULD include resources listed here, if they exist and the user is authorized to receive them.  Clients SHOULD be prepared to receive these additional resources, but SHALL function properly without them.", 0, java.lang.Integer.MAX_VALUE, include);
2207          case 8439429: /*revInclude*/  return new Property("revInclude", "string", "Search-style _revinclude directives, rooted in the resource for this shape. Servers SHOULD include resources listed here, if they exist and the user is authorized to receive them.  Clients SHOULD be prepared to receive these additional resources, but SHALL function properly without them.", 0, java.lang.Integer.MAX_VALUE, revInclude);
2208          default: return super.getNamedProperty(_hash, _name, _checkValid);
2209          }
2210
2211        }
2212
2213      @Override
2214      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2215        switch (hash) {
2216        case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // UriType
2217        case 1942574248: /*include*/ return this.include == null ? new Base[0] : this.include.toArray(new Base[this.include.size()]); // StringType
2218        case 8439429: /*revInclude*/ return this.revInclude == null ? new Base[0] : this.revInclude.toArray(new Base[this.revInclude.size()]); // StringType
2219        default: return super.getProperty(hash, name, checkValid);
2220        }
2221
2222      }
2223
2224      @Override
2225      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2226        switch (hash) {
2227        case -341064690: // resource
2228          this.resource = TypeConvertor.castToUri(value); // UriType
2229          return value;
2230        case 1942574248: // include
2231          this.getInclude().add(TypeConvertor.castToString(value)); // StringType
2232          return value;
2233        case 8439429: // revInclude
2234          this.getRevInclude().add(TypeConvertor.castToString(value)); // StringType
2235          return value;
2236        default: return super.setProperty(hash, name, value);
2237        }
2238
2239      }
2240
2241      @Override
2242      public Base setProperty(String name, Base value) throws FHIRException {
2243        if (name.equals("resource")) {
2244          this.resource = TypeConvertor.castToUri(value); // UriType
2245        } else if (name.equals("include")) {
2246          this.getInclude().add(TypeConvertor.castToString(value));
2247        } else if (name.equals("revInclude")) {
2248          this.getRevInclude().add(TypeConvertor.castToString(value));
2249        } else
2250          return super.setProperty(name, value);
2251        return value;
2252      }
2253
2254      @Override
2255      public Base makeProperty(int hash, String name) throws FHIRException {
2256        switch (hash) {
2257        case -341064690:  return getResourceElement();
2258        case 1942574248:  return addIncludeElement();
2259        case 8439429:  return addRevIncludeElement();
2260        default: return super.makeProperty(hash, name);
2261        }
2262
2263      }
2264
2265      @Override
2266      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2267        switch (hash) {
2268        case -341064690: /*resource*/ return new String[] {"uri"};
2269        case 1942574248: /*include*/ return new String[] {"string"};
2270        case 8439429: /*revInclude*/ return new String[] {"string"};
2271        default: return super.getTypesForProperty(hash, name);
2272        }
2273
2274      }
2275
2276      @Override
2277      public Base addChild(String name) throws FHIRException {
2278        if (name.equals("resource")) {
2279          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.notificationShape.resource");
2280        }
2281        else if (name.equals("include")) {
2282          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.notificationShape.include");
2283        }
2284        else if (name.equals("revInclude")) {
2285          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.notificationShape.revInclude");
2286        }
2287        else
2288          return super.addChild(name);
2289      }
2290
2291      public SubscriptionTopicNotificationShapeComponent copy() {
2292        SubscriptionTopicNotificationShapeComponent dst = new SubscriptionTopicNotificationShapeComponent();
2293        copyValues(dst);
2294        return dst;
2295      }
2296
2297      public void copyValues(SubscriptionTopicNotificationShapeComponent dst) {
2298        super.copyValues(dst);
2299        dst.resource = resource == null ? null : resource.copy();
2300        if (include != null) {
2301          dst.include = new ArrayList<StringType>();
2302          for (StringType i : include)
2303            dst.include.add(i.copy());
2304        };
2305        if (revInclude != null) {
2306          dst.revInclude = new ArrayList<StringType>();
2307          for (StringType i : revInclude)
2308            dst.revInclude.add(i.copy());
2309        };
2310      }
2311
2312      @Override
2313      public boolean equalsDeep(Base other_) {
2314        if (!super.equalsDeep(other_))
2315          return false;
2316        if (!(other_ instanceof SubscriptionTopicNotificationShapeComponent))
2317          return false;
2318        SubscriptionTopicNotificationShapeComponent o = (SubscriptionTopicNotificationShapeComponent) other_;
2319        return compareDeep(resource, o.resource, true) && compareDeep(include, o.include, true) && compareDeep(revInclude, o.revInclude, true)
2320          ;
2321      }
2322
2323      @Override
2324      public boolean equalsShallow(Base other_) {
2325        if (!super.equalsShallow(other_))
2326          return false;
2327        if (!(other_ instanceof SubscriptionTopicNotificationShapeComponent))
2328          return false;
2329        SubscriptionTopicNotificationShapeComponent o = (SubscriptionTopicNotificationShapeComponent) other_;
2330        return compareValues(resource, o.resource, true) && compareValues(include, o.include, true) && compareValues(revInclude, o.revInclude, true)
2331          ;
2332      }
2333
2334      public boolean isEmpty() {
2335        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(resource, include, revInclude
2336          );
2337      }
2338
2339  public String fhirType() {
2340    return "SubscriptionTopic.notificationShape";
2341
2342  }
2343
2344  }
2345
2346    /**
2347     * An absolute URI that is used to identify this subscription topic when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this subscription topic is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the subscription topic is stored on different servers.
2348     */
2349    @Child(name = "url", type = {UriType.class}, order=0, min=1, max=1, modifier=false, summary=true)
2350    @Description(shortDefinition="Canonical identifier for this subscription topic definition, represented as a URI (globally unique)", formalDefinition="An absolute URI that is used to identify this subscription topic when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this subscription topic is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the subscription topic is stored on different servers." )
2351    protected UriType url;
2352
2353    /**
2354     * Business identifiers assigned to this subscription topic by the performer and/or other systems.  These identifiers remain constant as the resource is updated and propagates from server to server.
2355     */
2356    @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2357    @Description(shortDefinition="Business Identifier for this subscription topic", formalDefinition="Business identifiers assigned to this subscription topic by the performer and/or other systems.  These identifiers remain constant as the resource is updated and propagates from server to server." )
2358    protected List<Identifier> identifier;
2359
2360    /**
2361     * The identifier that is used to identify this version of the subscription topic when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the Topic 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 are orderable.
2362     */
2363    @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
2364    @Description(shortDefinition="Business version of the subscription topic", formalDefinition="The identifier that is used to identify this version of the subscription topic when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the Topic 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 are orderable." )
2365    protected StringType version;
2366
2367    /**
2368     * A short, descriptive, user-friendly title for the SubscriptionTopic, for example, "admission".
2369     */
2370    @Child(name = "title", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
2371    @Description(shortDefinition="Name for this subscription topic (Human friendly)", formalDefinition="A short, descriptive, user-friendly title for the SubscriptionTopic, for example, \"admission\"." )
2372    protected StringType title;
2373
2374    /**
2375     * The canonical URL pointing to another FHIR-defined SubscriptionTopic that is adhered to in whole or in part by this SubscriptionTopic.
2376     */
2377    @Child(name = "derivedFrom", type = {CanonicalType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2378    @Description(shortDefinition="Based on FHIR protocol or definition", formalDefinition="The canonical URL pointing to another FHIR-defined SubscriptionTopic that is adhered to in whole or in part by this SubscriptionTopic." )
2379    protected List<CanonicalType> derivedFrom;
2380
2381    /**
2382     * The current state of the SubscriptionTopic.
2383     */
2384    @Child(name = "status", type = {CodeType.class}, order=5, min=1, max=1, modifier=true, summary=true)
2385    @Description(shortDefinition="draft | active | retired | unknown", formalDefinition="The current state of the SubscriptionTopic." )
2386    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/publication-status")
2387    protected Enumeration<PublicationStatus> status;
2388
2389    /**
2390     * A flag to indicate that this TopSubscriptionTopicic is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
2391     */
2392    @Child(name = "experimental", type = {BooleanType.class}, order=6, min=0, max=1, modifier=true, summary=true)
2393    @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="A flag to indicate that this TopSubscriptionTopicic is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." )
2394    protected BooleanType experimental;
2395
2396    /**
2397     * For draft definitions, indicates the date of initial creation.  For active definitions, represents the date of activation.  For withdrawn definitions, indicates the date of withdrawal.
2398     */
2399    @Child(name = "date", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=true)
2400    @Description(shortDefinition="Date status first applied", formalDefinition="For draft definitions, indicates the date of initial creation.  For active definitions, represents the date of activation.  For withdrawn definitions, indicates the date of withdrawal." )
2401    protected DateTimeType date;
2402
2403    /**
2404     * Helps establish the "authority/credibility" of the SubscriptionTopic.  May also allow for contact.
2405     */
2406    @Child(name = "publisher", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=true)
2407    @Description(shortDefinition="The name of the individual or organization that published the SubscriptionTopic", formalDefinition="Helps establish the \"authority/credibility\" of the SubscriptionTopic.  May also allow for contact." )
2408    protected StringType publisher;
2409
2410    /**
2411     * Contact details to assist a user in finding and communicating with the publisher.
2412     */
2413    @Child(name = "contact", type = {ContactDetail.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2414    @Description(shortDefinition="Contact details for the publisher", formalDefinition="Contact details to assist a user in finding and communicating with the publisher." )
2415    protected List<ContactDetail> contact;
2416
2417    /**
2418     * A free text natural language description of the Topic from the consumer's perspective.
2419     */
2420    @Child(name = "description", type = {MarkdownType.class}, order=10, min=0, max=1, modifier=false, summary=false)
2421    @Description(shortDefinition="Natural language description of the SubscriptionTopic", formalDefinition="A free text natural language description of the Topic from the consumer's perspective." )
2422    protected MarkdownType description;
2423
2424    /**
2425     * 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 of code system definitions.
2426     */
2427    @Child(name = "useContext", type = {UsageContext.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2428    @Description(shortDefinition="Content intends to support these contexts", formalDefinition="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 of code system definitions." )
2429    protected List<UsageContext> useContext;
2430
2431    /**
2432     * A jurisdiction in which the Topic is intended to be used.
2433     */
2434    @Child(name = "jurisdiction", type = {CodeableConcept.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2435    @Description(shortDefinition="Intended jurisdiction of the SubscriptionTopic (if applicable)", formalDefinition="A jurisdiction in which the Topic is intended to be used." )
2436    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/jurisdiction")
2437    protected List<CodeableConcept> jurisdiction;
2438
2439    /**
2440     * Explains why this Topic is needed and why it has been designed as it has.
2441     */
2442    @Child(name = "purpose", type = {MarkdownType.class}, order=13, min=0, max=1, modifier=false, summary=false)
2443    @Description(shortDefinition="Why this SubscriptionTopic is defined", formalDefinition="Explains why this Topic is needed and why it has been designed as it has." )
2444    protected MarkdownType purpose;
2445
2446    /**
2447     * A copyright statement relating to the SubscriptionTopic and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the SubscriptionTopic.
2448     */
2449    @Child(name = "copyright", type = {MarkdownType.class}, order=14, min=0, max=1, modifier=false, summary=false)
2450    @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the SubscriptionTopic and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the SubscriptionTopic." )
2451    protected MarkdownType copyright;
2452
2453    /**
2454     * The date on which the asset content was approved by the publisher. Approval happens once when the content is officially approved for usage.
2455     */
2456    @Child(name = "approvalDate", type = {DateType.class}, order=15, min=0, max=1, modifier=false, summary=false)
2457    @Description(shortDefinition="When SubscriptionTopic is/was approved by publisher", formalDefinition="The date on which the asset content was approved by the publisher. Approval happens once when the content is officially approved for usage." )
2458    protected DateType approvalDate;
2459
2460    /**
2461     * The date on which the asset content was last reviewed. Review happens periodically after that, but doesn't change the original approval date.
2462     */
2463    @Child(name = "lastReviewDate", type = {DateType.class}, order=16, min=0, max=1, modifier=false, summary=false)
2464    @Description(shortDefinition="Date the Subscription Topic was last reviewed by the publisher", formalDefinition="The date on which the asset content was last reviewed. Review happens periodically after that, but doesn't change the original approval date." )
2465    protected DateType lastReviewDate;
2466
2467    /**
2468     * The period during which the SubscriptionTopic content was or is planned to be effective.
2469     */
2470    @Child(name = "effectivePeriod", type = {Period.class}, order=17, min=0, max=1, modifier=false, summary=true)
2471    @Description(shortDefinition="The effective date range for the SubscriptionTopic", formalDefinition="The period during which the SubscriptionTopic content was or is planned to be effective." )
2472    protected Period effectivePeriod;
2473
2474    /**
2475     * A definition of a resource-based event that triggers a notification based on the SubscriptionTopic. The criteria may be just a human readable description and/or a full FHIR search string or FHIRPath expression. Multiple triggers are considered OR joined (e.g., a resource update matching ANY of the definitions will trigger a notification).
2476     */
2477    @Child(name = "resourceTrigger", type = {}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2478    @Description(shortDefinition="Definition of a resource-based trigger for the subscription topic", formalDefinition="A definition of a resource-based event that triggers a notification based on the SubscriptionTopic. The criteria may be just a human readable description and/or a full FHIR search string or FHIRPath expression. Multiple triggers are considered OR joined (e.g., a resource update matching ANY of the definitions will trigger a notification)." )
2479    protected List<SubscriptionTopicResourceTriggerComponent> resourceTrigger;
2480
2481    /**
2482     * Event definition which can be used to trigger the SubscriptionTopic.
2483     */
2484    @Child(name = "eventTrigger", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2485    @Description(shortDefinition="Event definitions the SubscriptionTopic", formalDefinition="Event definition which can be used to trigger the SubscriptionTopic." )
2486    protected List<SubscriptionTopicEventTriggerComponent> eventTrigger;
2487
2488    /**
2489     * List of properties by which Subscriptions on the SubscriptionTopic can be filtered. May be defined Search Parameters (e.g., Encounter.patient) or parameters defined within this SubscriptionTopic context (e.g., hub.event).
2490     */
2491    @Child(name = "canFilterBy", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2492    @Description(shortDefinition="Properties by which a Subscription can filter notifications from the SubscriptionTopic", formalDefinition="List of properties by which Subscriptions on the SubscriptionTopic can be filtered. May be defined Search Parameters (e.g., Encounter.patient) or parameters defined within this SubscriptionTopic context (e.g., hub.event)." )
2493    protected List<SubscriptionTopicCanFilterByComponent> canFilterBy;
2494
2495    /**
2496     * List of properties to describe the shape (e.g., resources) included in notifications from this Subscription Topic.
2497     */
2498    @Child(name = "notificationShape", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2499    @Description(shortDefinition="Properties for describing the shape of notifications generated by this topic", formalDefinition="List of properties to describe the shape (e.g., resources) included in notifications from this Subscription Topic." )
2500    protected List<SubscriptionTopicNotificationShapeComponent> notificationShape;
2501
2502    private static final long serialVersionUID = -1726252832L;
2503
2504  /**
2505   * Constructor
2506   */
2507    public SubscriptionTopic() {
2508      super();
2509    }
2510
2511  /**
2512   * Constructor
2513   */
2514    public SubscriptionTopic(String url, PublicationStatus status) {
2515      super();
2516      this.setUrl(url);
2517      this.setStatus(status);
2518    }
2519
2520    /**
2521     * @return {@link #url} (An absolute URI that is used to identify this subscription topic when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this subscription topic is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the subscription topic is stored on different servers.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
2522     */
2523    public UriType getUrlElement() { 
2524      if (this.url == null)
2525        if (Configuration.errorOnAutoCreate())
2526          throw new Error("Attempt to auto-create SubscriptionTopic.url");
2527        else if (Configuration.doAutoCreate())
2528          this.url = new UriType(); // bb
2529      return this.url;
2530    }
2531
2532    public boolean hasUrlElement() { 
2533      return this.url != null && !this.url.isEmpty();
2534    }
2535
2536    public boolean hasUrl() { 
2537      return this.url != null && !this.url.isEmpty();
2538    }
2539
2540    /**
2541     * @param value {@link #url} (An absolute URI that is used to identify this subscription topic when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this subscription topic is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the subscription topic is stored on different servers.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
2542     */
2543    public SubscriptionTopic setUrlElement(UriType value) { 
2544      this.url = value;
2545      return this;
2546    }
2547
2548    /**
2549     * @return An absolute URI that is used to identify this subscription topic when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this subscription topic is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the subscription topic is stored on different servers.
2550     */
2551    public String getUrl() { 
2552      return this.url == null ? null : this.url.getValue();
2553    }
2554
2555    /**
2556     * @param value An absolute URI that is used to identify this subscription topic when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this subscription topic is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the subscription topic is stored on different servers.
2557     */
2558    public SubscriptionTopic setUrl(String value) { 
2559        if (this.url == null)
2560          this.url = new UriType();
2561        this.url.setValue(value);
2562      return this;
2563    }
2564
2565    /**
2566     * @return {@link #identifier} (Business identifiers assigned to this subscription topic by the performer and/or other systems.  These identifiers remain constant as the resource is updated and propagates from server to server.)
2567     */
2568    public List<Identifier> getIdentifier() { 
2569      if (this.identifier == null)
2570        this.identifier = new ArrayList<Identifier>();
2571      return this.identifier;
2572    }
2573
2574    /**
2575     * @return Returns a reference to <code>this</code> for easy method chaining
2576     */
2577    public SubscriptionTopic setIdentifier(List<Identifier> theIdentifier) { 
2578      this.identifier = theIdentifier;
2579      return this;
2580    }
2581
2582    public boolean hasIdentifier() { 
2583      if (this.identifier == null)
2584        return false;
2585      for (Identifier item : this.identifier)
2586        if (!item.isEmpty())
2587          return true;
2588      return false;
2589    }
2590
2591    public Identifier addIdentifier() { //3
2592      Identifier t = new Identifier();
2593      if (this.identifier == null)
2594        this.identifier = new ArrayList<Identifier>();
2595      this.identifier.add(t);
2596      return t;
2597    }
2598
2599    public SubscriptionTopic addIdentifier(Identifier t) { //3
2600      if (t == null)
2601        return this;
2602      if (this.identifier == null)
2603        this.identifier = new ArrayList<Identifier>();
2604      this.identifier.add(t);
2605      return this;
2606    }
2607
2608    /**
2609     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
2610     */
2611    public Identifier getIdentifierFirstRep() { 
2612      if (getIdentifier().isEmpty()) {
2613        addIdentifier();
2614      }
2615      return getIdentifier().get(0);
2616    }
2617
2618    /**
2619     * @return {@link #version} (The identifier that is used to identify this version of the subscription topic when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the Topic 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 are orderable.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
2620     */
2621    public StringType getVersionElement() { 
2622      if (this.version == null)
2623        if (Configuration.errorOnAutoCreate())
2624          throw new Error("Attempt to auto-create SubscriptionTopic.version");
2625        else if (Configuration.doAutoCreate())
2626          this.version = new StringType(); // bb
2627      return this.version;
2628    }
2629
2630    public boolean hasVersionElement() { 
2631      return this.version != null && !this.version.isEmpty();
2632    }
2633
2634    public boolean hasVersion() { 
2635      return this.version != null && !this.version.isEmpty();
2636    }
2637
2638    /**
2639     * @param value {@link #version} (The identifier that is used to identify this version of the subscription topic when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the Topic 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 are orderable.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
2640     */
2641    public SubscriptionTopic setVersionElement(StringType value) { 
2642      this.version = value;
2643      return this;
2644    }
2645
2646    /**
2647     * @return The identifier that is used to identify this version of the subscription topic when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the Topic 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 are orderable.
2648     */
2649    public String getVersion() { 
2650      return this.version == null ? null : this.version.getValue();
2651    }
2652
2653    /**
2654     * @param value The identifier that is used to identify this version of the subscription topic when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the Topic 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 are orderable.
2655     */
2656    public SubscriptionTopic setVersion(String value) { 
2657      if (Utilities.noString(value))
2658        this.version = null;
2659      else {
2660        if (this.version == null)
2661          this.version = new StringType();
2662        this.version.setValue(value);
2663      }
2664      return this;
2665    }
2666
2667    /**
2668     * @return {@link #title} (A short, descriptive, user-friendly title for the SubscriptionTopic, for example, "admission".). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
2669     */
2670    public StringType getTitleElement() { 
2671      if (this.title == null)
2672        if (Configuration.errorOnAutoCreate())
2673          throw new Error("Attempt to auto-create SubscriptionTopic.title");
2674        else if (Configuration.doAutoCreate())
2675          this.title = new StringType(); // bb
2676      return this.title;
2677    }
2678
2679    public boolean hasTitleElement() { 
2680      return this.title != null && !this.title.isEmpty();
2681    }
2682
2683    public boolean hasTitle() { 
2684      return this.title != null && !this.title.isEmpty();
2685    }
2686
2687    /**
2688     * @param value {@link #title} (A short, descriptive, user-friendly title for the SubscriptionTopic, for example, "admission".). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
2689     */
2690    public SubscriptionTopic setTitleElement(StringType value) { 
2691      this.title = value;
2692      return this;
2693    }
2694
2695    /**
2696     * @return A short, descriptive, user-friendly title for the SubscriptionTopic, for example, "admission".
2697     */
2698    public String getTitle() { 
2699      return this.title == null ? null : this.title.getValue();
2700    }
2701
2702    /**
2703     * @param value A short, descriptive, user-friendly title for the SubscriptionTopic, for example, "admission".
2704     */
2705    public SubscriptionTopic setTitle(String value) { 
2706      if (Utilities.noString(value))
2707        this.title = null;
2708      else {
2709        if (this.title == null)
2710          this.title = new StringType();
2711        this.title.setValue(value);
2712      }
2713      return this;
2714    }
2715
2716    /**
2717     * @return {@link #derivedFrom} (The canonical URL pointing to another FHIR-defined SubscriptionTopic that is adhered to in whole or in part by this SubscriptionTopic.)
2718     */
2719    public List<CanonicalType> getDerivedFrom() { 
2720      if (this.derivedFrom == null)
2721        this.derivedFrom = new ArrayList<CanonicalType>();
2722      return this.derivedFrom;
2723    }
2724
2725    /**
2726     * @return Returns a reference to <code>this</code> for easy method chaining
2727     */
2728    public SubscriptionTopic setDerivedFrom(List<CanonicalType> theDerivedFrom) { 
2729      this.derivedFrom = theDerivedFrom;
2730      return this;
2731    }
2732
2733    public boolean hasDerivedFrom() { 
2734      if (this.derivedFrom == null)
2735        return false;
2736      for (CanonicalType item : this.derivedFrom)
2737        if (!item.isEmpty())
2738          return true;
2739      return false;
2740    }
2741
2742    /**
2743     * @return {@link #derivedFrom} (The canonical URL pointing to another FHIR-defined SubscriptionTopic that is adhered to in whole or in part by this SubscriptionTopic.)
2744     */
2745    public CanonicalType addDerivedFromElement() {//2 
2746      CanonicalType t = new CanonicalType();
2747      if (this.derivedFrom == null)
2748        this.derivedFrom = new ArrayList<CanonicalType>();
2749      this.derivedFrom.add(t);
2750      return t;
2751    }
2752
2753    /**
2754     * @param value {@link #derivedFrom} (The canonical URL pointing to another FHIR-defined SubscriptionTopic that is adhered to in whole or in part by this SubscriptionTopic.)
2755     */
2756    public SubscriptionTopic addDerivedFrom(String value) { //1
2757      CanonicalType t = new CanonicalType();
2758      t.setValue(value);
2759      if (this.derivedFrom == null)
2760        this.derivedFrom = new ArrayList<CanonicalType>();
2761      this.derivedFrom.add(t);
2762      return this;
2763    }
2764
2765    /**
2766     * @param value {@link #derivedFrom} (The canonical URL pointing to another FHIR-defined SubscriptionTopic that is adhered to in whole or in part by this SubscriptionTopic.)
2767     */
2768    public boolean hasDerivedFrom(String value) { 
2769      if (this.derivedFrom == null)
2770        return false;
2771      for (CanonicalType v : this.derivedFrom)
2772        if (v.getValue().equals(value)) // canonical
2773          return true;
2774      return false;
2775    }
2776
2777    /**
2778     * @return {@link #status} (The current state of the SubscriptionTopic.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2779     */
2780    public Enumeration<PublicationStatus> getStatusElement() { 
2781      if (this.status == null)
2782        if (Configuration.errorOnAutoCreate())
2783          throw new Error("Attempt to auto-create SubscriptionTopic.status");
2784        else if (Configuration.doAutoCreate())
2785          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
2786      return this.status;
2787    }
2788
2789    public boolean hasStatusElement() { 
2790      return this.status != null && !this.status.isEmpty();
2791    }
2792
2793    public boolean hasStatus() { 
2794      return this.status != null && !this.status.isEmpty();
2795    }
2796
2797    /**
2798     * @param value {@link #status} (The current state of the SubscriptionTopic.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2799     */
2800    public SubscriptionTopic setStatusElement(Enumeration<PublicationStatus> value) { 
2801      this.status = value;
2802      return this;
2803    }
2804
2805    /**
2806     * @return The current state of the SubscriptionTopic.
2807     */
2808    public PublicationStatus getStatus() { 
2809      return this.status == null ? null : this.status.getValue();
2810    }
2811
2812    /**
2813     * @param value The current state of the SubscriptionTopic.
2814     */
2815    public SubscriptionTopic setStatus(PublicationStatus value) { 
2816        if (this.status == null)
2817          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
2818        this.status.setValue(value);
2819      return this;
2820    }
2821
2822    /**
2823     * @return {@link #experimental} (A flag to indicate that this TopSubscriptionTopicic 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
2824     */
2825    public BooleanType getExperimentalElement() { 
2826      if (this.experimental == null)
2827        if (Configuration.errorOnAutoCreate())
2828          throw new Error("Attempt to auto-create SubscriptionTopic.experimental");
2829        else if (Configuration.doAutoCreate())
2830          this.experimental = new BooleanType(); // bb
2831      return this.experimental;
2832    }
2833
2834    public boolean hasExperimentalElement() { 
2835      return this.experimental != null && !this.experimental.isEmpty();
2836    }
2837
2838    public boolean hasExperimental() { 
2839      return this.experimental != null && !this.experimental.isEmpty();
2840    }
2841
2842    /**
2843     * @param value {@link #experimental} (A flag to indicate that this TopSubscriptionTopicic 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
2844     */
2845    public SubscriptionTopic setExperimentalElement(BooleanType value) { 
2846      this.experimental = value;
2847      return this;
2848    }
2849
2850    /**
2851     * @return A flag to indicate that this TopSubscriptionTopicic is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
2852     */
2853    public boolean getExperimental() { 
2854      return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
2855    }
2856
2857    /**
2858     * @param value A flag to indicate that this TopSubscriptionTopicic is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
2859     */
2860    public SubscriptionTopic setExperimental(boolean value) { 
2861        if (this.experimental == null)
2862          this.experimental = new BooleanType();
2863        this.experimental.setValue(value);
2864      return this;
2865    }
2866
2867    /**
2868     * @return {@link #date} (For draft definitions, indicates the date of initial creation.  For active definitions, represents the date of activation.  For withdrawn definitions, indicates the date of withdrawal.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
2869     */
2870    public DateTimeType getDateElement() { 
2871      if (this.date == null)
2872        if (Configuration.errorOnAutoCreate())
2873          throw new Error("Attempt to auto-create SubscriptionTopic.date");
2874        else if (Configuration.doAutoCreate())
2875          this.date = new DateTimeType(); // bb
2876      return this.date;
2877    }
2878
2879    public boolean hasDateElement() { 
2880      return this.date != null && !this.date.isEmpty();
2881    }
2882
2883    public boolean hasDate() { 
2884      return this.date != null && !this.date.isEmpty();
2885    }
2886
2887    /**
2888     * @param value {@link #date} (For draft definitions, indicates the date of initial creation.  For active definitions, represents the date of activation.  For withdrawn definitions, indicates the date of withdrawal.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
2889     */
2890    public SubscriptionTopic setDateElement(DateTimeType value) { 
2891      this.date = value;
2892      return this;
2893    }
2894
2895    /**
2896     * @return For draft definitions, indicates the date of initial creation.  For active definitions, represents the date of activation.  For withdrawn definitions, indicates the date of withdrawal.
2897     */
2898    public Date getDate() { 
2899      return this.date == null ? null : this.date.getValue();
2900    }
2901
2902    /**
2903     * @param value For draft definitions, indicates the date of initial creation.  For active definitions, represents the date of activation.  For withdrawn definitions, indicates the date of withdrawal.
2904     */
2905    public SubscriptionTopic setDate(Date value) { 
2906      if (value == null)
2907        this.date = null;
2908      else {
2909        if (this.date == null)
2910          this.date = new DateTimeType();
2911        this.date.setValue(value);
2912      }
2913      return this;
2914    }
2915
2916    /**
2917     * @return {@link #publisher} (Helps establish the "authority/credibility" of the SubscriptionTopic.  May also allow for contact.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
2918     */
2919    public StringType getPublisherElement() { 
2920      if (this.publisher == null)
2921        if (Configuration.errorOnAutoCreate())
2922          throw new Error("Attempt to auto-create SubscriptionTopic.publisher");
2923        else if (Configuration.doAutoCreate())
2924          this.publisher = new StringType(); // bb
2925      return this.publisher;
2926    }
2927
2928    public boolean hasPublisherElement() { 
2929      return this.publisher != null && !this.publisher.isEmpty();
2930    }
2931
2932    public boolean hasPublisher() { 
2933      return this.publisher != null && !this.publisher.isEmpty();
2934    }
2935
2936    /**
2937     * @param value {@link #publisher} (Helps establish the "authority/credibility" of the SubscriptionTopic.  May also allow for contact.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
2938     */
2939    public SubscriptionTopic setPublisherElement(StringType value) { 
2940      this.publisher = value;
2941      return this;
2942    }
2943
2944    /**
2945     * @return Helps establish the "authority/credibility" of the SubscriptionTopic.  May also allow for contact.
2946     */
2947    public String getPublisher() { 
2948      return this.publisher == null ? null : this.publisher.getValue();
2949    }
2950
2951    /**
2952     * @param value Helps establish the "authority/credibility" of the SubscriptionTopic.  May also allow for contact.
2953     */
2954    public SubscriptionTopic setPublisher(String value) { 
2955      if (Utilities.noString(value))
2956        this.publisher = null;
2957      else {
2958        if (this.publisher == null)
2959          this.publisher = new StringType();
2960        this.publisher.setValue(value);
2961      }
2962      return this;
2963    }
2964
2965    /**
2966     * @return {@link #contact} (Contact details to assist a user in finding and communicating with the publisher.)
2967     */
2968    public List<ContactDetail> getContact() { 
2969      if (this.contact == null)
2970        this.contact = new ArrayList<ContactDetail>();
2971      return this.contact;
2972    }
2973
2974    /**
2975     * @return Returns a reference to <code>this</code> for easy method chaining
2976     */
2977    public SubscriptionTopic setContact(List<ContactDetail> theContact) { 
2978      this.contact = theContact;
2979      return this;
2980    }
2981
2982    public boolean hasContact() { 
2983      if (this.contact == null)
2984        return false;
2985      for (ContactDetail item : this.contact)
2986        if (!item.isEmpty())
2987          return true;
2988      return false;
2989    }
2990
2991    public ContactDetail addContact() { //3
2992      ContactDetail t = new ContactDetail();
2993      if (this.contact == null)
2994        this.contact = new ArrayList<ContactDetail>();
2995      this.contact.add(t);
2996      return t;
2997    }
2998
2999    public SubscriptionTopic addContact(ContactDetail t) { //3
3000      if (t == null)
3001        return this;
3002      if (this.contact == null)
3003        this.contact = new ArrayList<ContactDetail>();
3004      this.contact.add(t);
3005      return this;
3006    }
3007
3008    /**
3009     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist {3}
3010     */
3011    public ContactDetail getContactFirstRep() { 
3012      if (getContact().isEmpty()) {
3013        addContact();
3014      }
3015      return getContact().get(0);
3016    }
3017
3018    /**
3019     * @return {@link #description} (A free text natural language description of the Topic from the consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
3020     */
3021    public MarkdownType getDescriptionElement() { 
3022      if (this.description == null)
3023        if (Configuration.errorOnAutoCreate())
3024          throw new Error("Attempt to auto-create SubscriptionTopic.description");
3025        else if (Configuration.doAutoCreate())
3026          this.description = new MarkdownType(); // bb
3027      return this.description;
3028    }
3029
3030    public boolean hasDescriptionElement() { 
3031      return this.description != null && !this.description.isEmpty();
3032    }
3033
3034    public boolean hasDescription() { 
3035      return this.description != null && !this.description.isEmpty();
3036    }
3037
3038    /**
3039     * @param value {@link #description} (A free text natural language description of the Topic from the consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
3040     */
3041    public SubscriptionTopic setDescriptionElement(MarkdownType value) { 
3042      this.description = value;
3043      return this;
3044    }
3045
3046    /**
3047     * @return A free text natural language description of the Topic from the consumer's perspective.
3048     */
3049    public String getDescription() { 
3050      return this.description == null ? null : this.description.getValue();
3051    }
3052
3053    /**
3054     * @param value A free text natural language description of the Topic from the consumer's perspective.
3055     */
3056    public SubscriptionTopic setDescription(String value) { 
3057      if (value == null)
3058        this.description = null;
3059      else {
3060        if (this.description == null)
3061          this.description = new MarkdownType();
3062        this.description.setValue(value);
3063      }
3064      return this;
3065    }
3066
3067    /**
3068     * @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 of code system definitions.)
3069     */
3070    public List<UsageContext> getUseContext() { 
3071      if (this.useContext == null)
3072        this.useContext = new ArrayList<UsageContext>();
3073      return this.useContext;
3074    }
3075
3076    /**
3077     * @return Returns a reference to <code>this</code> for easy method chaining
3078     */
3079    public SubscriptionTopic setUseContext(List<UsageContext> theUseContext) { 
3080      this.useContext = theUseContext;
3081      return this;
3082    }
3083
3084    public boolean hasUseContext() { 
3085      if (this.useContext == null)
3086        return false;
3087      for (UsageContext item : this.useContext)
3088        if (!item.isEmpty())
3089          return true;
3090      return false;
3091    }
3092
3093    public UsageContext addUseContext() { //3
3094      UsageContext t = new UsageContext();
3095      if (this.useContext == null)
3096        this.useContext = new ArrayList<UsageContext>();
3097      this.useContext.add(t);
3098      return t;
3099    }
3100
3101    public SubscriptionTopic addUseContext(UsageContext t) { //3
3102      if (t == null)
3103        return this;
3104      if (this.useContext == null)
3105        this.useContext = new ArrayList<UsageContext>();
3106      this.useContext.add(t);
3107      return this;
3108    }
3109
3110    /**
3111     * @return The first repetition of repeating field {@link #useContext}, creating it if it does not already exist {3}
3112     */
3113    public UsageContext getUseContextFirstRep() { 
3114      if (getUseContext().isEmpty()) {
3115        addUseContext();
3116      }
3117      return getUseContext().get(0);
3118    }
3119
3120    /**
3121     * @return {@link #jurisdiction} (A jurisdiction in which the Topic is intended to be used.)
3122     */
3123    public List<CodeableConcept> getJurisdiction() { 
3124      if (this.jurisdiction == null)
3125        this.jurisdiction = new ArrayList<CodeableConcept>();
3126      return this.jurisdiction;
3127    }
3128
3129    /**
3130     * @return Returns a reference to <code>this</code> for easy method chaining
3131     */
3132    public SubscriptionTopic setJurisdiction(List<CodeableConcept> theJurisdiction) { 
3133      this.jurisdiction = theJurisdiction;
3134      return this;
3135    }
3136
3137    public boolean hasJurisdiction() { 
3138      if (this.jurisdiction == null)
3139        return false;
3140      for (CodeableConcept item : this.jurisdiction)
3141        if (!item.isEmpty())
3142          return true;
3143      return false;
3144    }
3145
3146    public CodeableConcept addJurisdiction() { //3
3147      CodeableConcept t = new CodeableConcept();
3148      if (this.jurisdiction == null)
3149        this.jurisdiction = new ArrayList<CodeableConcept>();
3150      this.jurisdiction.add(t);
3151      return t;
3152    }
3153
3154    public SubscriptionTopic addJurisdiction(CodeableConcept t) { //3
3155      if (t == null)
3156        return this;
3157      if (this.jurisdiction == null)
3158        this.jurisdiction = new ArrayList<CodeableConcept>();
3159      this.jurisdiction.add(t);
3160      return this;
3161    }
3162
3163    /**
3164     * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist {3}
3165     */
3166    public CodeableConcept getJurisdictionFirstRep() { 
3167      if (getJurisdiction().isEmpty()) {
3168        addJurisdiction();
3169      }
3170      return getJurisdiction().get(0);
3171    }
3172
3173    /**
3174     * @return {@link #purpose} (Explains why this Topic 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
3175     */
3176    public MarkdownType getPurposeElement() { 
3177      if (this.purpose == null)
3178        if (Configuration.errorOnAutoCreate())
3179          throw new Error("Attempt to auto-create SubscriptionTopic.purpose");
3180        else if (Configuration.doAutoCreate())
3181          this.purpose = new MarkdownType(); // bb
3182      return this.purpose;
3183    }
3184
3185    public boolean hasPurposeElement() { 
3186      return this.purpose != null && !this.purpose.isEmpty();
3187    }
3188
3189    public boolean hasPurpose() { 
3190      return this.purpose != null && !this.purpose.isEmpty();
3191    }
3192
3193    /**
3194     * @param value {@link #purpose} (Explains why this Topic 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
3195     */
3196    public SubscriptionTopic setPurposeElement(MarkdownType value) { 
3197      this.purpose = value;
3198      return this;
3199    }
3200
3201    /**
3202     * @return Explains why this Topic is needed and why it has been designed as it has.
3203     */
3204    public String getPurpose() { 
3205      return this.purpose == null ? null : this.purpose.getValue();
3206    }
3207
3208    /**
3209     * @param value Explains why this Topic is needed and why it has been designed as it has.
3210     */
3211    public SubscriptionTopic setPurpose(String value) { 
3212      if (value == null)
3213        this.purpose = null;
3214      else {
3215        if (this.purpose == null)
3216          this.purpose = new MarkdownType();
3217        this.purpose.setValue(value);
3218      }
3219      return this;
3220    }
3221
3222    /**
3223     * @return {@link #copyright} (A copyright statement relating to the SubscriptionTopic and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the SubscriptionTopic.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
3224     */
3225    public MarkdownType getCopyrightElement() { 
3226      if (this.copyright == null)
3227        if (Configuration.errorOnAutoCreate())
3228          throw new Error("Attempt to auto-create SubscriptionTopic.copyright");
3229        else if (Configuration.doAutoCreate())
3230          this.copyright = new MarkdownType(); // bb
3231      return this.copyright;
3232    }
3233
3234    public boolean hasCopyrightElement() { 
3235      return this.copyright != null && !this.copyright.isEmpty();
3236    }
3237
3238    public boolean hasCopyright() { 
3239      return this.copyright != null && !this.copyright.isEmpty();
3240    }
3241
3242    /**
3243     * @param value {@link #copyright} (A copyright statement relating to the SubscriptionTopic and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the SubscriptionTopic.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
3244     */
3245    public SubscriptionTopic setCopyrightElement(MarkdownType value) { 
3246      this.copyright = value;
3247      return this;
3248    }
3249
3250    /**
3251     * @return A copyright statement relating to the SubscriptionTopic and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the SubscriptionTopic.
3252     */
3253    public String getCopyright() { 
3254      return this.copyright == null ? null : this.copyright.getValue();
3255    }
3256
3257    /**
3258     * @param value A copyright statement relating to the SubscriptionTopic and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the SubscriptionTopic.
3259     */
3260    public SubscriptionTopic setCopyright(String value) { 
3261      if (value == null)
3262        this.copyright = null;
3263      else {
3264        if (this.copyright == null)
3265          this.copyright = new MarkdownType();
3266        this.copyright.setValue(value);
3267      }
3268      return this;
3269    }
3270
3271    /**
3272     * @return {@link #approvalDate} (The date on which the asset content was approved by the publisher. Approval happens once when the content is officially approved for usage.). This is the underlying object with id, value and extensions. The accessor "getApprovalDate" gives direct access to the value
3273     */
3274    public DateType getApprovalDateElement() { 
3275      if (this.approvalDate == null)
3276        if (Configuration.errorOnAutoCreate())
3277          throw new Error("Attempt to auto-create SubscriptionTopic.approvalDate");
3278        else if (Configuration.doAutoCreate())
3279          this.approvalDate = new DateType(); // bb
3280      return this.approvalDate;
3281    }
3282
3283    public boolean hasApprovalDateElement() { 
3284      return this.approvalDate != null && !this.approvalDate.isEmpty();
3285    }
3286
3287    public boolean hasApprovalDate() { 
3288      return this.approvalDate != null && !this.approvalDate.isEmpty();
3289    }
3290
3291    /**
3292     * @param value {@link #approvalDate} (The date on which the asset content was approved by the publisher. Approval happens once when the content is officially approved for usage.). This is the underlying object with id, value and extensions. The accessor "getApprovalDate" gives direct access to the value
3293     */
3294    public SubscriptionTopic setApprovalDateElement(DateType value) { 
3295      this.approvalDate = value;
3296      return this;
3297    }
3298
3299    /**
3300     * @return The date on which the asset content was approved by the publisher. Approval happens once when the content is officially approved for usage.
3301     */
3302    public Date getApprovalDate() { 
3303      return this.approvalDate == null ? null : this.approvalDate.getValue();
3304    }
3305
3306    /**
3307     * @param value The date on which the asset content was approved by the publisher. Approval happens once when the content is officially approved for usage.
3308     */
3309    public SubscriptionTopic setApprovalDate(Date value) { 
3310      if (value == null)
3311        this.approvalDate = null;
3312      else {
3313        if (this.approvalDate == null)
3314          this.approvalDate = new DateType();
3315        this.approvalDate.setValue(value);
3316      }
3317      return this;
3318    }
3319
3320    /**
3321     * @return {@link #lastReviewDate} (The date on which the asset content was last reviewed. Review happens periodically after that, but doesn't change the original approval date.). This is the underlying object with id, value and extensions. The accessor "getLastReviewDate" gives direct access to the value
3322     */
3323    public DateType getLastReviewDateElement() { 
3324      if (this.lastReviewDate == null)
3325        if (Configuration.errorOnAutoCreate())
3326          throw new Error("Attempt to auto-create SubscriptionTopic.lastReviewDate");
3327        else if (Configuration.doAutoCreate())
3328          this.lastReviewDate = new DateType(); // bb
3329      return this.lastReviewDate;
3330    }
3331
3332    public boolean hasLastReviewDateElement() { 
3333      return this.lastReviewDate != null && !this.lastReviewDate.isEmpty();
3334    }
3335
3336    public boolean hasLastReviewDate() { 
3337      return this.lastReviewDate != null && !this.lastReviewDate.isEmpty();
3338    }
3339
3340    /**
3341     * @param value {@link #lastReviewDate} (The date on which the asset content was last reviewed. Review happens periodically after that, but doesn't change the original approval date.). This is the underlying object with id, value and extensions. The accessor "getLastReviewDate" gives direct access to the value
3342     */
3343    public SubscriptionTopic setLastReviewDateElement(DateType value) { 
3344      this.lastReviewDate = value;
3345      return this;
3346    }
3347
3348    /**
3349     * @return The date on which the asset content was last reviewed. Review happens periodically after that, but doesn't change the original approval date.
3350     */
3351    public Date getLastReviewDate() { 
3352      return this.lastReviewDate == null ? null : this.lastReviewDate.getValue();
3353    }
3354
3355    /**
3356     * @param value The date on which the asset content was last reviewed. Review happens periodically after that, but doesn't change the original approval date.
3357     */
3358    public SubscriptionTopic setLastReviewDate(Date value) { 
3359      if (value == null)
3360        this.lastReviewDate = null;
3361      else {
3362        if (this.lastReviewDate == null)
3363          this.lastReviewDate = new DateType();
3364        this.lastReviewDate.setValue(value);
3365      }
3366      return this;
3367    }
3368
3369    /**
3370     * @return {@link #effectivePeriod} (The period during which the SubscriptionTopic content was or is planned to be effective.)
3371     */
3372    public Period getEffectivePeriod() { 
3373      if (this.effectivePeriod == null)
3374        if (Configuration.errorOnAutoCreate())
3375          throw new Error("Attempt to auto-create SubscriptionTopic.effectivePeriod");
3376        else if (Configuration.doAutoCreate())
3377          this.effectivePeriod = new Period(); // cc
3378      return this.effectivePeriod;
3379    }
3380
3381    public boolean hasEffectivePeriod() { 
3382      return this.effectivePeriod != null && !this.effectivePeriod.isEmpty();
3383    }
3384
3385    /**
3386     * @param value {@link #effectivePeriod} (The period during which the SubscriptionTopic content was or is planned to be effective.)
3387     */
3388    public SubscriptionTopic setEffectivePeriod(Period value) { 
3389      this.effectivePeriod = value;
3390      return this;
3391    }
3392
3393    /**
3394     * @return {@link #resourceTrigger} (A definition of a resource-based event that triggers a notification based on the SubscriptionTopic. The criteria may be just a human readable description and/or a full FHIR search string or FHIRPath expression. Multiple triggers are considered OR joined (e.g., a resource update matching ANY of the definitions will trigger a notification).)
3395     */
3396    public List<SubscriptionTopicResourceTriggerComponent> getResourceTrigger() { 
3397      if (this.resourceTrigger == null)
3398        this.resourceTrigger = new ArrayList<SubscriptionTopicResourceTriggerComponent>();
3399      return this.resourceTrigger;
3400    }
3401
3402    /**
3403     * @return Returns a reference to <code>this</code> for easy method chaining
3404     */
3405    public SubscriptionTopic setResourceTrigger(List<SubscriptionTopicResourceTriggerComponent> theResourceTrigger) { 
3406      this.resourceTrigger = theResourceTrigger;
3407      return this;
3408    }
3409
3410    public boolean hasResourceTrigger() { 
3411      if (this.resourceTrigger == null)
3412        return false;
3413      for (SubscriptionTopicResourceTriggerComponent item : this.resourceTrigger)
3414        if (!item.isEmpty())
3415          return true;
3416      return false;
3417    }
3418
3419    public SubscriptionTopicResourceTriggerComponent addResourceTrigger() { //3
3420      SubscriptionTopicResourceTriggerComponent t = new SubscriptionTopicResourceTriggerComponent();
3421      if (this.resourceTrigger == null)
3422        this.resourceTrigger = new ArrayList<SubscriptionTopicResourceTriggerComponent>();
3423      this.resourceTrigger.add(t);
3424      return t;
3425    }
3426
3427    public SubscriptionTopic addResourceTrigger(SubscriptionTopicResourceTriggerComponent t) { //3
3428      if (t == null)
3429        return this;
3430      if (this.resourceTrigger == null)
3431        this.resourceTrigger = new ArrayList<SubscriptionTopicResourceTriggerComponent>();
3432      this.resourceTrigger.add(t);
3433      return this;
3434    }
3435
3436    /**
3437     * @return The first repetition of repeating field {@link #resourceTrigger}, creating it if it does not already exist {3}
3438     */
3439    public SubscriptionTopicResourceTriggerComponent getResourceTriggerFirstRep() { 
3440      if (getResourceTrigger().isEmpty()) {
3441        addResourceTrigger();
3442      }
3443      return getResourceTrigger().get(0);
3444    }
3445
3446    /**
3447     * @return {@link #eventTrigger} (Event definition which can be used to trigger the SubscriptionTopic.)
3448     */
3449    public List<SubscriptionTopicEventTriggerComponent> getEventTrigger() { 
3450      if (this.eventTrigger == null)
3451        this.eventTrigger = new ArrayList<SubscriptionTopicEventTriggerComponent>();
3452      return this.eventTrigger;
3453    }
3454
3455    /**
3456     * @return Returns a reference to <code>this</code> for easy method chaining
3457     */
3458    public SubscriptionTopic setEventTrigger(List<SubscriptionTopicEventTriggerComponent> theEventTrigger) { 
3459      this.eventTrigger = theEventTrigger;
3460      return this;
3461    }
3462
3463    public boolean hasEventTrigger() { 
3464      if (this.eventTrigger == null)
3465        return false;
3466      for (SubscriptionTopicEventTriggerComponent item : this.eventTrigger)
3467        if (!item.isEmpty())
3468          return true;
3469      return false;
3470    }
3471
3472    public SubscriptionTopicEventTriggerComponent addEventTrigger() { //3
3473      SubscriptionTopicEventTriggerComponent t = new SubscriptionTopicEventTriggerComponent();
3474      if (this.eventTrigger == null)
3475        this.eventTrigger = new ArrayList<SubscriptionTopicEventTriggerComponent>();
3476      this.eventTrigger.add(t);
3477      return t;
3478    }
3479
3480    public SubscriptionTopic addEventTrigger(SubscriptionTopicEventTriggerComponent t) { //3
3481      if (t == null)
3482        return this;
3483      if (this.eventTrigger == null)
3484        this.eventTrigger = new ArrayList<SubscriptionTopicEventTriggerComponent>();
3485      this.eventTrigger.add(t);
3486      return this;
3487    }
3488
3489    /**
3490     * @return The first repetition of repeating field {@link #eventTrigger}, creating it if it does not already exist {3}
3491     */
3492    public SubscriptionTopicEventTriggerComponent getEventTriggerFirstRep() { 
3493      if (getEventTrigger().isEmpty()) {
3494        addEventTrigger();
3495      }
3496      return getEventTrigger().get(0);
3497    }
3498
3499    /**
3500     * @return {@link #canFilterBy} (List of properties by which Subscriptions on the SubscriptionTopic can be filtered. May be defined Search Parameters (e.g., Encounter.patient) or parameters defined within this SubscriptionTopic context (e.g., hub.event).)
3501     */
3502    public List<SubscriptionTopicCanFilterByComponent> getCanFilterBy() { 
3503      if (this.canFilterBy == null)
3504        this.canFilterBy = new ArrayList<SubscriptionTopicCanFilterByComponent>();
3505      return this.canFilterBy;
3506    }
3507
3508    /**
3509     * @return Returns a reference to <code>this</code> for easy method chaining
3510     */
3511    public SubscriptionTopic setCanFilterBy(List<SubscriptionTopicCanFilterByComponent> theCanFilterBy) { 
3512      this.canFilterBy = theCanFilterBy;
3513      return this;
3514    }
3515
3516    public boolean hasCanFilterBy() { 
3517      if (this.canFilterBy == null)
3518        return false;
3519      for (SubscriptionTopicCanFilterByComponent item : this.canFilterBy)
3520        if (!item.isEmpty())
3521          return true;
3522      return false;
3523    }
3524
3525    public SubscriptionTopicCanFilterByComponent addCanFilterBy() { //3
3526      SubscriptionTopicCanFilterByComponent t = new SubscriptionTopicCanFilterByComponent();
3527      if (this.canFilterBy == null)
3528        this.canFilterBy = new ArrayList<SubscriptionTopicCanFilterByComponent>();
3529      this.canFilterBy.add(t);
3530      return t;
3531    }
3532
3533    public SubscriptionTopic addCanFilterBy(SubscriptionTopicCanFilterByComponent t) { //3
3534      if (t == null)
3535        return this;
3536      if (this.canFilterBy == null)
3537        this.canFilterBy = new ArrayList<SubscriptionTopicCanFilterByComponent>();
3538      this.canFilterBy.add(t);
3539      return this;
3540    }
3541
3542    /**
3543     * @return The first repetition of repeating field {@link #canFilterBy}, creating it if it does not already exist {3}
3544     */
3545    public SubscriptionTopicCanFilterByComponent getCanFilterByFirstRep() { 
3546      if (getCanFilterBy().isEmpty()) {
3547        addCanFilterBy();
3548      }
3549      return getCanFilterBy().get(0);
3550    }
3551
3552    /**
3553     * @return {@link #notificationShape} (List of properties to describe the shape (e.g., resources) included in notifications from this Subscription Topic.)
3554     */
3555    public List<SubscriptionTopicNotificationShapeComponent> getNotificationShape() { 
3556      if (this.notificationShape == null)
3557        this.notificationShape = new ArrayList<SubscriptionTopicNotificationShapeComponent>();
3558      return this.notificationShape;
3559    }
3560
3561    /**
3562     * @return Returns a reference to <code>this</code> for easy method chaining
3563     */
3564    public SubscriptionTopic setNotificationShape(List<SubscriptionTopicNotificationShapeComponent> theNotificationShape) { 
3565      this.notificationShape = theNotificationShape;
3566      return this;
3567    }
3568
3569    public boolean hasNotificationShape() { 
3570      if (this.notificationShape == null)
3571        return false;
3572      for (SubscriptionTopicNotificationShapeComponent item : this.notificationShape)
3573        if (!item.isEmpty())
3574          return true;
3575      return false;
3576    }
3577
3578    public SubscriptionTopicNotificationShapeComponent addNotificationShape() { //3
3579      SubscriptionTopicNotificationShapeComponent t = new SubscriptionTopicNotificationShapeComponent();
3580      if (this.notificationShape == null)
3581        this.notificationShape = new ArrayList<SubscriptionTopicNotificationShapeComponent>();
3582      this.notificationShape.add(t);
3583      return t;
3584    }
3585
3586    public SubscriptionTopic addNotificationShape(SubscriptionTopicNotificationShapeComponent t) { //3
3587      if (t == null)
3588        return this;
3589      if (this.notificationShape == null)
3590        this.notificationShape = new ArrayList<SubscriptionTopicNotificationShapeComponent>();
3591      this.notificationShape.add(t);
3592      return this;
3593    }
3594
3595    /**
3596     * @return The first repetition of repeating field {@link #notificationShape}, creating it if it does not already exist {3}
3597     */
3598    public SubscriptionTopicNotificationShapeComponent getNotificationShapeFirstRep() { 
3599      if (getNotificationShape().isEmpty()) {
3600        addNotificationShape();
3601      }
3602      return getNotificationShape().get(0);
3603    }
3604
3605    /**
3606     * not supported on this implementation
3607     */
3608    @Override
3609    public int getNameMax() { 
3610      return 0;
3611    }
3612    /**
3613     * @return {@link #name} (A natural language name identifying the subscription topic. 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
3614     */
3615    public StringType getNameElement() { 
3616      throw new Error("The resource type \"SubscriptionTopic\" does not implement the property \"name\"");
3617    }
3618
3619    public boolean hasNameElement() { 
3620      return false;
3621    }
3622    public boolean hasName() {
3623      return false;
3624    }
3625
3626    /**
3627     * @param value {@link #name} (A natural language name identifying the subscription topic. 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
3628     */
3629    public SubscriptionTopic setNameElement(StringType value) { 
3630      throw new Error("The resource type \"SubscriptionTopic\" does not implement the property \"name\"");
3631    }
3632    public String getName() { 
3633      throw new Error("The resource type \"SubscriptionTopic\" does not implement the property \"name\"");
3634    }
3635    /**
3636     * @param value A natural language name identifying the subscription topic. This name should be usable as an identifier for the module by machine processing applications such as code generation.
3637     */
3638    public SubscriptionTopic setName(String value) { 
3639      throw new Error("The resource type \"SubscriptionTopic\" does not implement the property \"name\"");
3640    }
3641      protected void listChildren(List<Property> children) {
3642        super.listChildren(children);
3643        children.add(new Property("url", "uri", "An absolute URI that is used to identify this subscription topic when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this subscription topic is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the subscription topic is stored on different servers.", 0, 1, url));
3644        children.add(new Property("identifier", "Identifier", "Business identifiers assigned to this subscription topic by the performer and/or other systems.  These identifiers remain constant as the resource is updated and propagates from server to server.", 0, java.lang.Integer.MAX_VALUE, identifier));
3645        children.add(new Property("version", "string", "The identifier that is used to identify this version of the subscription topic when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the Topic 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 are orderable.", 0, 1, version));
3646        children.add(new Property("title", "string", "A short, descriptive, user-friendly title for the SubscriptionTopic, for example, \"admission\".", 0, 1, title));
3647        children.add(new Property("derivedFrom", "canonical(SubscriptionTopic)", "The canonical URL pointing to another FHIR-defined SubscriptionTopic that is adhered to in whole or in part by this SubscriptionTopic.", 0, java.lang.Integer.MAX_VALUE, derivedFrom));
3648        children.add(new Property("status", "code", "The current state of the SubscriptionTopic.", 0, 1, status));
3649        children.add(new Property("experimental", "boolean", "A flag to indicate that this TopSubscriptionTopicic is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, 1, experimental));
3650        children.add(new Property("date", "dateTime", "For draft definitions, indicates the date of initial creation.  For active definitions, represents the date of activation.  For withdrawn definitions, indicates the date of withdrawal.", 0, 1, date));
3651        children.add(new Property("publisher", "string", "Helps establish the \"authority/credibility\" of the SubscriptionTopic.  May also allow for contact.", 0, 1, publisher));
3652        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));
3653        children.add(new Property("description", "markdown", "A free text natural language description of the Topic from the consumer's perspective.", 0, 1, description));
3654        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 of code system definitions.", 0, java.lang.Integer.MAX_VALUE, useContext));
3655        children.add(new Property("jurisdiction", "CodeableConcept", "A jurisdiction in which the Topic is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction));
3656        children.add(new Property("purpose", "markdown", "Explains why this Topic is needed and why it has been designed as it has.", 0, 1, purpose));
3657        children.add(new Property("copyright", "markdown", "A copyright statement relating to the SubscriptionTopic and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the SubscriptionTopic.", 0, 1, copyright));
3658        children.add(new Property("approvalDate", "date", "The date on which the asset content was approved by the publisher. Approval happens once when the content is officially approved for usage.", 0, 1, approvalDate));
3659        children.add(new Property("lastReviewDate", "date", "The date on which the asset content was last reviewed. Review happens periodically after that, but doesn't change the original approval date.", 0, 1, lastReviewDate));
3660        children.add(new Property("effectivePeriod", "Period", "The period during which the SubscriptionTopic content was or is planned to be effective.", 0, 1, effectivePeriod));
3661        children.add(new Property("resourceTrigger", "", "A definition of a resource-based event that triggers a notification based on the SubscriptionTopic. The criteria may be just a human readable description and/or a full FHIR search string or FHIRPath expression. Multiple triggers are considered OR joined (e.g., a resource update matching ANY of the definitions will trigger a notification).", 0, java.lang.Integer.MAX_VALUE, resourceTrigger));
3662        children.add(new Property("eventTrigger", "", "Event definition which can be used to trigger the SubscriptionTopic.", 0, java.lang.Integer.MAX_VALUE, eventTrigger));
3663        children.add(new Property("canFilterBy", "", "List of properties by which Subscriptions on the SubscriptionTopic can be filtered. May be defined Search Parameters (e.g., Encounter.patient) or parameters defined within this SubscriptionTopic context (e.g., hub.event).", 0, java.lang.Integer.MAX_VALUE, canFilterBy));
3664        children.add(new Property("notificationShape", "", "List of properties to describe the shape (e.g., resources) included in notifications from this Subscription Topic.", 0, java.lang.Integer.MAX_VALUE, notificationShape));
3665      }
3666
3667      @Override
3668      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3669        switch (_hash) {
3670        case 116079: /*url*/  return new Property("url", "uri", "An absolute URI that is used to identify this subscription topic when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this subscription topic is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the subscription topic is stored on different servers.", 0, 1, url);
3671        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Business identifiers assigned to this subscription topic by the performer and/or other systems.  These identifiers remain constant as the resource is updated and propagates from server to server.", 0, java.lang.Integer.MAX_VALUE, identifier);
3672        case 351608024: /*version*/  return new Property("version", "string", "The identifier that is used to identify this version of the subscription topic when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the Topic 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 are orderable.", 0, 1, version);
3673        case 110371416: /*title*/  return new Property("title", "string", "A short, descriptive, user-friendly title for the SubscriptionTopic, for example, \"admission\".", 0, 1, title);
3674        case 1077922663: /*derivedFrom*/  return new Property("derivedFrom", "canonical(SubscriptionTopic)", "The canonical URL pointing to another FHIR-defined SubscriptionTopic that is adhered to in whole or in part by this SubscriptionTopic.", 0, java.lang.Integer.MAX_VALUE, derivedFrom);
3675        case -892481550: /*status*/  return new Property("status", "code", "The current state of the SubscriptionTopic.", 0, 1, status);
3676        case -404562712: /*experimental*/  return new Property("experimental", "boolean", "A flag to indicate that this TopSubscriptionTopicic is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, 1, experimental);
3677        case 3076014: /*date*/  return new Property("date", "dateTime", "For draft definitions, indicates the date of initial creation.  For active definitions, represents the date of activation.  For withdrawn definitions, indicates the date of withdrawal.", 0, 1, date);
3678        case 1447404028: /*publisher*/  return new Property("publisher", "string", "Helps establish the \"authority/credibility\" of the SubscriptionTopic.  May also allow for contact.", 0, 1, publisher);
3679        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);
3680        case -1724546052: /*description*/  return new Property("description", "markdown", "A free text natural language description of the Topic from the consumer's perspective.", 0, 1, description);
3681        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 of code system definitions.", 0, java.lang.Integer.MAX_VALUE, useContext);
3682        case -507075711: /*jurisdiction*/  return new Property("jurisdiction", "CodeableConcept", "A jurisdiction in which the Topic is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction);
3683        case -220463842: /*purpose*/  return new Property("purpose", "markdown", "Explains why this Topic is needed and why it has been designed as it has.", 0, 1, purpose);
3684        case 1522889671: /*copyright*/  return new Property("copyright", "markdown", "A copyright statement relating to the SubscriptionTopic and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the SubscriptionTopic.", 0, 1, copyright);
3685        case 223539345: /*approvalDate*/  return new Property("approvalDate", "date", "The date on which the asset content was approved by the publisher. Approval happens once when the content is officially approved for usage.", 0, 1, approvalDate);
3686        case -1687512484: /*lastReviewDate*/  return new Property("lastReviewDate", "date", "The date on which the asset content was last reviewed. Review happens periodically after that, but doesn't change the original approval date.", 0, 1, lastReviewDate);
3687        case -403934648: /*effectivePeriod*/  return new Property("effectivePeriod", "Period", "The period during which the SubscriptionTopic content was or is planned to be effective.", 0, 1, effectivePeriod);
3688        case -424927798: /*resourceTrigger*/  return new Property("resourceTrigger", "", "A definition of a resource-based event that triggers a notification based on the SubscriptionTopic. The criteria may be just a human readable description and/or a full FHIR search string or FHIRPath expression. Multiple triggers are considered OR joined (e.g., a resource update matching ANY of the definitions will trigger a notification).", 0, java.lang.Integer.MAX_VALUE, resourceTrigger);
3689        case -151635522: /*eventTrigger*/  return new Property("eventTrigger", "", "Event definition which can be used to trigger the SubscriptionTopic.", 0, java.lang.Integer.MAX_VALUE, eventTrigger);
3690        case -1299519009: /*canFilterBy*/  return new Property("canFilterBy", "", "List of properties by which Subscriptions on the SubscriptionTopic can be filtered. May be defined Search Parameters (e.g., Encounter.patient) or parameters defined within this SubscriptionTopic context (e.g., hub.event).", 0, java.lang.Integer.MAX_VALUE, canFilterBy);
3691        case -1583369866: /*notificationShape*/  return new Property("notificationShape", "", "List of properties to describe the shape (e.g., resources) included in notifications from this Subscription Topic.", 0, java.lang.Integer.MAX_VALUE, notificationShape);
3692        default: return super.getNamedProperty(_hash, _name, _checkValid);
3693        }
3694
3695      }
3696
3697      @Override
3698      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3699        switch (hash) {
3700        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
3701        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
3702        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
3703        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
3704        case 1077922663: /*derivedFrom*/ return this.derivedFrom == null ? new Base[0] : this.derivedFrom.toArray(new Base[this.derivedFrom.size()]); // CanonicalType
3705        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
3706        case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType
3707        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
3708        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType
3709        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
3710        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
3711        case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
3712        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept
3713        case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // MarkdownType
3714        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
3715        case 223539345: /*approvalDate*/ return this.approvalDate == null ? new Base[0] : new Base[] {this.approvalDate}; // DateType
3716        case -1687512484: /*lastReviewDate*/ return this.lastReviewDate == null ? new Base[0] : new Base[] {this.lastReviewDate}; // DateType
3717        case -403934648: /*effectivePeriod*/ return this.effectivePeriod == null ? new Base[0] : new Base[] {this.effectivePeriod}; // Period
3718        case -424927798: /*resourceTrigger*/ return this.resourceTrigger == null ? new Base[0] : this.resourceTrigger.toArray(new Base[this.resourceTrigger.size()]); // SubscriptionTopicResourceTriggerComponent
3719        case -151635522: /*eventTrigger*/ return this.eventTrigger == null ? new Base[0] : this.eventTrigger.toArray(new Base[this.eventTrigger.size()]); // SubscriptionTopicEventTriggerComponent
3720        case -1299519009: /*canFilterBy*/ return this.canFilterBy == null ? new Base[0] : this.canFilterBy.toArray(new Base[this.canFilterBy.size()]); // SubscriptionTopicCanFilterByComponent
3721        case -1583369866: /*notificationShape*/ return this.notificationShape == null ? new Base[0] : this.notificationShape.toArray(new Base[this.notificationShape.size()]); // SubscriptionTopicNotificationShapeComponent
3722        default: return super.getProperty(hash, name, checkValid);
3723        }
3724
3725      }
3726
3727      @Override
3728      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3729        switch (hash) {
3730        case 116079: // url
3731          this.url = TypeConvertor.castToUri(value); // UriType
3732          return value;
3733        case -1618432855: // identifier
3734          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
3735          return value;
3736        case 351608024: // version
3737          this.version = TypeConvertor.castToString(value); // StringType
3738          return value;
3739        case 110371416: // title
3740          this.title = TypeConvertor.castToString(value); // StringType
3741          return value;
3742        case 1077922663: // derivedFrom
3743          this.getDerivedFrom().add(TypeConvertor.castToCanonical(value)); // CanonicalType
3744          return value;
3745        case -892481550: // status
3746          value = new PublicationStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
3747          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
3748          return value;
3749        case -404562712: // experimental
3750          this.experimental = TypeConvertor.castToBoolean(value); // BooleanType
3751          return value;
3752        case 3076014: // date
3753          this.date = TypeConvertor.castToDateTime(value); // DateTimeType
3754          return value;
3755        case 1447404028: // publisher
3756          this.publisher = TypeConvertor.castToString(value); // StringType
3757          return value;
3758        case 951526432: // contact
3759          this.getContact().add(TypeConvertor.castToContactDetail(value)); // ContactDetail
3760          return value;
3761        case -1724546052: // description
3762          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
3763          return value;
3764        case -669707736: // useContext
3765          this.getUseContext().add(TypeConvertor.castToUsageContext(value)); // UsageContext
3766          return value;
3767        case -507075711: // jurisdiction
3768          this.getJurisdiction().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
3769          return value;
3770        case -220463842: // purpose
3771          this.purpose = TypeConvertor.castToMarkdown(value); // MarkdownType
3772          return value;
3773        case 1522889671: // copyright
3774          this.copyright = TypeConvertor.castToMarkdown(value); // MarkdownType
3775          return value;
3776        case 223539345: // approvalDate
3777          this.approvalDate = TypeConvertor.castToDate(value); // DateType
3778          return value;
3779        case -1687512484: // lastReviewDate
3780          this.lastReviewDate = TypeConvertor.castToDate(value); // DateType
3781          return value;
3782        case -403934648: // effectivePeriod
3783          this.effectivePeriod = TypeConvertor.castToPeriod(value); // Period
3784          return value;
3785        case -424927798: // resourceTrigger
3786          this.getResourceTrigger().add((SubscriptionTopicResourceTriggerComponent) value); // SubscriptionTopicResourceTriggerComponent
3787          return value;
3788        case -151635522: // eventTrigger
3789          this.getEventTrigger().add((SubscriptionTopicEventTriggerComponent) value); // SubscriptionTopicEventTriggerComponent
3790          return value;
3791        case -1299519009: // canFilterBy
3792          this.getCanFilterBy().add((SubscriptionTopicCanFilterByComponent) value); // SubscriptionTopicCanFilterByComponent
3793          return value;
3794        case -1583369866: // notificationShape
3795          this.getNotificationShape().add((SubscriptionTopicNotificationShapeComponent) value); // SubscriptionTopicNotificationShapeComponent
3796          return value;
3797        default: return super.setProperty(hash, name, value);
3798        }
3799
3800      }
3801
3802      @Override
3803      public Base setProperty(String name, Base value) throws FHIRException {
3804        if (name.equals("url")) {
3805          this.url = TypeConvertor.castToUri(value); // UriType
3806        } else if (name.equals("identifier")) {
3807          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
3808        } else if (name.equals("version")) {
3809          this.version = TypeConvertor.castToString(value); // StringType
3810        } else if (name.equals("title")) {
3811          this.title = TypeConvertor.castToString(value); // StringType
3812        } else if (name.equals("derivedFrom")) {
3813          this.getDerivedFrom().add(TypeConvertor.castToCanonical(value));
3814        } else if (name.equals("status")) {
3815          value = new PublicationStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
3816          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
3817        } else if (name.equals("experimental")) {
3818          this.experimental = TypeConvertor.castToBoolean(value); // BooleanType
3819        } else if (name.equals("date")) {
3820          this.date = TypeConvertor.castToDateTime(value); // DateTimeType
3821        } else if (name.equals("publisher")) {
3822          this.publisher = TypeConvertor.castToString(value); // StringType
3823        } else if (name.equals("contact")) {
3824          this.getContact().add(TypeConvertor.castToContactDetail(value));
3825        } else if (name.equals("description")) {
3826          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
3827        } else if (name.equals("useContext")) {
3828          this.getUseContext().add(TypeConvertor.castToUsageContext(value));
3829        } else if (name.equals("jurisdiction")) {
3830          this.getJurisdiction().add(TypeConvertor.castToCodeableConcept(value));
3831        } else if (name.equals("purpose")) {
3832          this.purpose = TypeConvertor.castToMarkdown(value); // MarkdownType
3833        } else if (name.equals("copyright")) {
3834          this.copyright = TypeConvertor.castToMarkdown(value); // MarkdownType
3835        } else if (name.equals("approvalDate")) {
3836          this.approvalDate = TypeConvertor.castToDate(value); // DateType
3837        } else if (name.equals("lastReviewDate")) {
3838          this.lastReviewDate = TypeConvertor.castToDate(value); // DateType
3839        } else if (name.equals("effectivePeriod")) {
3840          this.effectivePeriod = TypeConvertor.castToPeriod(value); // Period
3841        } else if (name.equals("resourceTrigger")) {
3842          this.getResourceTrigger().add((SubscriptionTopicResourceTriggerComponent) value);
3843        } else if (name.equals("eventTrigger")) {
3844          this.getEventTrigger().add((SubscriptionTopicEventTriggerComponent) value);
3845        } else if (name.equals("canFilterBy")) {
3846          this.getCanFilterBy().add((SubscriptionTopicCanFilterByComponent) value);
3847        } else if (name.equals("notificationShape")) {
3848          this.getNotificationShape().add((SubscriptionTopicNotificationShapeComponent) value);
3849        } else
3850          return super.setProperty(name, value);
3851        return value;
3852      }
3853
3854      @Override
3855      public Base makeProperty(int hash, String name) throws FHIRException {
3856        switch (hash) {
3857        case 116079:  return getUrlElement();
3858        case -1618432855:  return addIdentifier(); 
3859        case 351608024:  return getVersionElement();
3860        case 110371416:  return getTitleElement();
3861        case 1077922663:  return addDerivedFromElement();
3862        case -892481550:  return getStatusElement();
3863        case -404562712:  return getExperimentalElement();
3864        case 3076014:  return getDateElement();
3865        case 1447404028:  return getPublisherElement();
3866        case 951526432:  return addContact(); 
3867        case -1724546052:  return getDescriptionElement();
3868        case -669707736:  return addUseContext(); 
3869        case -507075711:  return addJurisdiction(); 
3870        case -220463842:  return getPurposeElement();
3871        case 1522889671:  return getCopyrightElement();
3872        case 223539345:  return getApprovalDateElement();
3873        case -1687512484:  return getLastReviewDateElement();
3874        case -403934648:  return getEffectivePeriod();
3875        case -424927798:  return addResourceTrigger(); 
3876        case -151635522:  return addEventTrigger(); 
3877        case -1299519009:  return addCanFilterBy(); 
3878        case -1583369866:  return addNotificationShape(); 
3879        default: return super.makeProperty(hash, name);
3880        }
3881
3882      }
3883
3884      @Override
3885      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3886        switch (hash) {
3887        case 116079: /*url*/ return new String[] {"uri"};
3888        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
3889        case 351608024: /*version*/ return new String[] {"string"};
3890        case 110371416: /*title*/ return new String[] {"string"};
3891        case 1077922663: /*derivedFrom*/ return new String[] {"canonical"};
3892        case -892481550: /*status*/ return new String[] {"code"};
3893        case -404562712: /*experimental*/ return new String[] {"boolean"};
3894        case 3076014: /*date*/ return new String[] {"dateTime"};
3895        case 1447404028: /*publisher*/ return new String[] {"string"};
3896        case 951526432: /*contact*/ return new String[] {"ContactDetail"};
3897        case -1724546052: /*description*/ return new String[] {"markdown"};
3898        case -669707736: /*useContext*/ return new String[] {"UsageContext"};
3899        case -507075711: /*jurisdiction*/ return new String[] {"CodeableConcept"};
3900        case -220463842: /*purpose*/ return new String[] {"markdown"};
3901        case 1522889671: /*copyright*/ return new String[] {"markdown"};
3902        case 223539345: /*approvalDate*/ return new String[] {"date"};
3903        case -1687512484: /*lastReviewDate*/ return new String[] {"date"};
3904        case -403934648: /*effectivePeriod*/ return new String[] {"Period"};
3905        case -424927798: /*resourceTrigger*/ return new String[] {};
3906        case -151635522: /*eventTrigger*/ return new String[] {};
3907        case -1299519009: /*canFilterBy*/ return new String[] {};
3908        case -1583369866: /*notificationShape*/ return new String[] {};
3909        default: return super.getTypesForProperty(hash, name);
3910        }
3911
3912      }
3913
3914      @Override
3915      public Base addChild(String name) throws FHIRException {
3916        if (name.equals("url")) {
3917          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.url");
3918        }
3919        else if (name.equals("identifier")) {
3920          return addIdentifier();
3921        }
3922        else if (name.equals("version")) {
3923          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.version");
3924        }
3925        else if (name.equals("title")) {
3926          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.title");
3927        }
3928        else if (name.equals("derivedFrom")) {
3929          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.derivedFrom");
3930        }
3931        else if (name.equals("status")) {
3932          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.status");
3933        }
3934        else if (name.equals("experimental")) {
3935          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.experimental");
3936        }
3937        else if (name.equals("date")) {
3938          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.date");
3939        }
3940        else if (name.equals("publisher")) {
3941          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.publisher");
3942        }
3943        else if (name.equals("contact")) {
3944          return addContact();
3945        }
3946        else if (name.equals("description")) {
3947          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.description");
3948        }
3949        else if (name.equals("useContext")) {
3950          return addUseContext();
3951        }
3952        else if (name.equals("jurisdiction")) {
3953          return addJurisdiction();
3954        }
3955        else if (name.equals("purpose")) {
3956          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.purpose");
3957        }
3958        else if (name.equals("copyright")) {
3959          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.copyright");
3960        }
3961        else if (name.equals("approvalDate")) {
3962          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.approvalDate");
3963        }
3964        else if (name.equals("lastReviewDate")) {
3965          throw new FHIRException("Cannot call addChild on a primitive type SubscriptionTopic.lastReviewDate");
3966        }
3967        else if (name.equals("effectivePeriod")) {
3968          this.effectivePeriod = new Period();
3969          return this.effectivePeriod;
3970        }
3971        else if (name.equals("resourceTrigger")) {
3972          return addResourceTrigger();
3973        }
3974        else if (name.equals("eventTrigger")) {
3975          return addEventTrigger();
3976        }
3977        else if (name.equals("canFilterBy")) {
3978          return addCanFilterBy();
3979        }
3980        else if (name.equals("notificationShape")) {
3981          return addNotificationShape();
3982        }
3983        else
3984          return super.addChild(name);
3985      }
3986
3987  public String fhirType() {
3988    return "SubscriptionTopic";
3989
3990  }
3991
3992      public SubscriptionTopic copy() {
3993        SubscriptionTopic dst = new SubscriptionTopic();
3994        copyValues(dst);
3995        return dst;
3996      }
3997
3998      public void copyValues(SubscriptionTopic dst) {
3999        super.copyValues(dst);
4000        dst.url = url == null ? null : url.copy();
4001        if (identifier != null) {
4002          dst.identifier = new ArrayList<Identifier>();
4003          for (Identifier i : identifier)
4004            dst.identifier.add(i.copy());
4005        };
4006        dst.version = version == null ? null : version.copy();
4007        dst.title = title == null ? null : title.copy();
4008        if (derivedFrom != null) {
4009          dst.derivedFrom = new ArrayList<CanonicalType>();
4010          for (CanonicalType i : derivedFrom)
4011            dst.derivedFrom.add(i.copy());
4012        };
4013        dst.status = status == null ? null : status.copy();
4014        dst.experimental = experimental == null ? null : experimental.copy();
4015        dst.date = date == null ? null : date.copy();
4016        dst.publisher = publisher == null ? null : publisher.copy();
4017        if (contact != null) {
4018          dst.contact = new ArrayList<ContactDetail>();
4019          for (ContactDetail i : contact)
4020            dst.contact.add(i.copy());
4021        };
4022        dst.description = description == null ? null : description.copy();
4023        if (useContext != null) {
4024          dst.useContext = new ArrayList<UsageContext>();
4025          for (UsageContext i : useContext)
4026            dst.useContext.add(i.copy());
4027        };
4028        if (jurisdiction != null) {
4029          dst.jurisdiction = new ArrayList<CodeableConcept>();
4030          for (CodeableConcept i : jurisdiction)
4031            dst.jurisdiction.add(i.copy());
4032        };
4033        dst.purpose = purpose == null ? null : purpose.copy();
4034        dst.copyright = copyright == null ? null : copyright.copy();
4035        dst.approvalDate = approvalDate == null ? null : approvalDate.copy();
4036        dst.lastReviewDate = lastReviewDate == null ? null : lastReviewDate.copy();
4037        dst.effectivePeriod = effectivePeriod == null ? null : effectivePeriod.copy();
4038        if (resourceTrigger != null) {
4039          dst.resourceTrigger = new ArrayList<SubscriptionTopicResourceTriggerComponent>();
4040          for (SubscriptionTopicResourceTriggerComponent i : resourceTrigger)
4041            dst.resourceTrigger.add(i.copy());
4042        };
4043        if (eventTrigger != null) {
4044          dst.eventTrigger = new ArrayList<SubscriptionTopicEventTriggerComponent>();
4045          for (SubscriptionTopicEventTriggerComponent i : eventTrigger)
4046            dst.eventTrigger.add(i.copy());
4047        };
4048        if (canFilterBy != null) {
4049          dst.canFilterBy = new ArrayList<SubscriptionTopicCanFilterByComponent>();
4050          for (SubscriptionTopicCanFilterByComponent i : canFilterBy)
4051            dst.canFilterBy.add(i.copy());
4052        };
4053        if (notificationShape != null) {
4054          dst.notificationShape = new ArrayList<SubscriptionTopicNotificationShapeComponent>();
4055          for (SubscriptionTopicNotificationShapeComponent i : notificationShape)
4056            dst.notificationShape.add(i.copy());
4057        };
4058      }
4059
4060      protected SubscriptionTopic typedCopy() {
4061        return copy();
4062      }
4063
4064      @Override
4065      public boolean equalsDeep(Base other_) {
4066        if (!super.equalsDeep(other_))
4067          return false;
4068        if (!(other_ instanceof SubscriptionTopic))
4069          return false;
4070        SubscriptionTopic o = (SubscriptionTopic) other_;
4071        return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true)
4072           && compareDeep(title, o.title, true) && compareDeep(derivedFrom, o.derivedFrom, true) && compareDeep(status, o.status, true)
4073           && compareDeep(experimental, o.experimental, true) && compareDeep(date, o.date, true) && compareDeep(publisher, o.publisher, true)
4074           && compareDeep(contact, o.contact, true) && compareDeep(description, o.description, true) && compareDeep(useContext, o.useContext, true)
4075           && compareDeep(jurisdiction, o.jurisdiction, true) && compareDeep(purpose, o.purpose, true) && compareDeep(copyright, o.copyright, true)
4076           && compareDeep(approvalDate, o.approvalDate, true) && compareDeep(lastReviewDate, o.lastReviewDate, true)
4077           && compareDeep(effectivePeriod, o.effectivePeriod, true) && compareDeep(resourceTrigger, o.resourceTrigger, true)
4078           && compareDeep(eventTrigger, o.eventTrigger, true) && compareDeep(canFilterBy, o.canFilterBy, true)
4079           && compareDeep(notificationShape, o.notificationShape, true);
4080      }
4081
4082      @Override
4083      public boolean equalsShallow(Base other_) {
4084        if (!super.equalsShallow(other_))
4085          return false;
4086        if (!(other_ instanceof SubscriptionTopic))
4087          return false;
4088        SubscriptionTopic o = (SubscriptionTopic) other_;
4089        return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(title, o.title, true)
4090           && compareValues(derivedFrom, o.derivedFrom, true) && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true)
4091           && compareValues(date, o.date, true) && compareValues(publisher, o.publisher, true) && compareValues(description, o.description, true)
4092           && compareValues(purpose, o.purpose, true) && compareValues(copyright, o.copyright, true) && compareValues(approvalDate, o.approvalDate, true)
4093           && compareValues(lastReviewDate, o.lastReviewDate, true);
4094      }
4095
4096      public boolean isEmpty() {
4097        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(url, identifier, version
4098          , title, derivedFrom, status, experimental, date, publisher, contact, description
4099          , useContext, jurisdiction, purpose, copyright, approvalDate, lastReviewDate, effectivePeriod
4100          , resourceTrigger, eventTrigger, canFilterBy, notificationShape);
4101      }
4102
4103  @Override
4104  public ResourceType getResourceType() {
4105    return ResourceType.SubscriptionTopic;
4106   }
4107
4108 /**
4109   * Search parameter: <b>date</b>
4110   * <p>
4111   * Description: <b>Date status first applied</b><br>
4112   * Type: <b>date</b><br>
4113   * Path: <b>SubscriptionTopic.date</b><br>
4114   * </p>
4115   */
4116  @SearchParamDefinition(name="date", path="SubscriptionTopic.date", description="Date status first applied", type="date" )
4117  public static final String SP_DATE = "date";
4118 /**
4119   * <b>Fluent Client</b> search parameter constant for <b>date</b>
4120   * <p>
4121   * Description: <b>Date status first applied</b><br>
4122   * Type: <b>date</b><br>
4123   * Path: <b>SubscriptionTopic.date</b><br>
4124   * </p>
4125   */
4126  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
4127
4128 /**
4129   * Search parameter: <b>derived-or-self</b>
4130   * <p>
4131   * Description: <b>A server defined search that matches either the url or derivedFrom</b><br>
4132   * Type: <b>uri</b><br>
4133   * Path: <b>SubscriptionTopic.url | SubscriptionTopic.derivedFrom</b><br>
4134   * </p>
4135   */
4136  @SearchParamDefinition(name="derived-or-self", path="SubscriptionTopic.url | SubscriptionTopic.derivedFrom", description="A server defined search that matches either the url or derivedFrom", type="uri" )
4137  public static final String SP_DERIVED_OR_SELF = "derived-or-self";
4138 /**
4139   * <b>Fluent Client</b> search parameter constant for <b>derived-or-self</b>
4140   * <p>
4141   * Description: <b>A server defined search that matches either the url or derivedFrom</b><br>
4142   * Type: <b>uri</b><br>
4143   * Path: <b>SubscriptionTopic.url | SubscriptionTopic.derivedFrom</b><br>
4144   * </p>
4145   */
4146  public static final ca.uhn.fhir.rest.gclient.UriClientParam DERIVED_OR_SELF = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_DERIVED_OR_SELF);
4147
4148 /**
4149   * Search parameter: <b>identifier</b>
4150   * <p>
4151   * Description: <b>Business Identifier for SubscriptionTopic</b><br>
4152   * Type: <b>token</b><br>
4153   * Path: <b>SubscriptionTopic.identifier</b><br>
4154   * </p>
4155   */
4156  @SearchParamDefinition(name="identifier", path="SubscriptionTopic.identifier", description="Business Identifier for SubscriptionTopic", type="token" )
4157  public static final String SP_IDENTIFIER = "identifier";
4158 /**
4159   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
4160   * <p>
4161   * Description: <b>Business Identifier for SubscriptionTopic</b><br>
4162   * Type: <b>token</b><br>
4163   * Path: <b>SubscriptionTopic.identifier</b><br>
4164   * </p>
4165   */
4166  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
4167
4168 /**
4169   * Search parameter: <b>resource</b>
4170   * <p>
4171   * Description: <b>Allowed Data type or Resource (reference to definition) for this definition, searches resourceTrigger, eventTrigger, and notificationShape for matches.</b><br>
4172   * Type: <b>uri</b><br>
4173   * Path: <b>SubscriptionTopic.resourceTrigger.resource</b><br>
4174   * </p>
4175   */
4176  @SearchParamDefinition(name="resource", path="SubscriptionTopic.resourceTrigger.resource", description="Allowed Data type or Resource (reference to definition) for this definition, searches resourceTrigger, eventTrigger, and notificationShape for matches.", type="uri" )
4177  public static final String SP_RESOURCE = "resource";
4178 /**
4179   * <b>Fluent Client</b> search parameter constant for <b>resource</b>
4180   * <p>
4181   * Description: <b>Allowed Data type or Resource (reference to definition) for this definition, searches resourceTrigger, eventTrigger, and notificationShape for matches.</b><br>
4182   * Type: <b>uri</b><br>
4183   * Path: <b>SubscriptionTopic.resourceTrigger.resource</b><br>
4184   * </p>
4185   */
4186  public static final ca.uhn.fhir.rest.gclient.UriClientParam RESOURCE = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_RESOURCE);
4187
4188 /**
4189   * Search parameter: <b>status</b>
4190   * <p>
4191   * Description: <b>draft | active | retired | unknown</b><br>
4192   * Type: <b>token</b><br>
4193   * Path: <b>SubscriptionTopic.status</b><br>
4194   * </p>
4195   */
4196  @SearchParamDefinition(name="status", path="SubscriptionTopic.status", description="draft | active | retired | unknown", type="token" )
4197  public static final String SP_STATUS = "status";
4198 /**
4199   * <b>Fluent Client</b> search parameter constant for <b>status</b>
4200   * <p>
4201   * Description: <b>draft | active | retired | unknown</b><br>
4202   * Type: <b>token</b><br>
4203   * Path: <b>SubscriptionTopic.status</b><br>
4204   * </p>
4205   */
4206  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
4207
4208 /**
4209   * Search parameter: <b>title</b>
4210   * <p>
4211   * Description: <b>Name for this SubscriptionTopic (Human friendly)</b><br>
4212   * Type: <b>string</b><br>
4213   * Path: <b>SubscriptionTopic.title</b><br>
4214   * </p>
4215   */
4216  @SearchParamDefinition(name="title", path="SubscriptionTopic.title", description="Name for this SubscriptionTopic (Human friendly)", type="string" )
4217  public static final String SP_TITLE = "title";
4218 /**
4219   * <b>Fluent Client</b> search parameter constant for <b>title</b>
4220   * <p>
4221   * Description: <b>Name for this SubscriptionTopic (Human friendly)</b><br>
4222   * Type: <b>string</b><br>
4223   * Path: <b>SubscriptionTopic.title</b><br>
4224   * </p>
4225   */
4226  public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE);
4227
4228 /**
4229   * Search parameter: <b>trigger-description</b>
4230   * <p>
4231   * Description: <b>Text representation of the trigger</b><br>
4232   * Type: <b>string</b><br>
4233   * Path: <b>SubscriptionTopic.resourceTrigger.description</b><br>
4234   * </p>
4235   */
4236  @SearchParamDefinition(name="trigger-description", path="SubscriptionTopic.resourceTrigger.description", description="Text representation of the trigger", type="string" )
4237  public static final String SP_TRIGGER_DESCRIPTION = "trigger-description";
4238 /**
4239   * <b>Fluent Client</b> search parameter constant for <b>trigger-description</b>
4240   * <p>
4241   * Description: <b>Text representation of the trigger</b><br>
4242   * Type: <b>string</b><br>
4243   * Path: <b>SubscriptionTopic.resourceTrigger.description</b><br>
4244   * </p>
4245   */
4246  public static final ca.uhn.fhir.rest.gclient.StringClientParam TRIGGER_DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TRIGGER_DESCRIPTION);
4247
4248 /**
4249   * Search parameter: <b>url</b>
4250   * <p>
4251   * Description: <b>Logical canonical URL to reference this SubscriptionTopic (globally unique)</b><br>
4252   * Type: <b>uri</b><br>
4253   * Path: <b>SubscriptionTopic.url</b><br>
4254   * </p>
4255   */
4256  @SearchParamDefinition(name="url", path="SubscriptionTopic.url", description="Logical canonical URL to reference this SubscriptionTopic (globally unique)", type="uri" )
4257  public static final String SP_URL = "url";
4258 /**
4259   * <b>Fluent Client</b> search parameter constant for <b>url</b>
4260   * <p>
4261   * Description: <b>Logical canonical URL to reference this SubscriptionTopic (globally unique)</b><br>
4262   * Type: <b>uri</b><br>
4263   * Path: <b>SubscriptionTopic.url</b><br>
4264   * </p>
4265   */
4266  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
4267
4268 /**
4269   * Search parameter: <b>version</b>
4270   * <p>
4271   * Description: <b>Business version of the SubscriptionTopic</b><br>
4272   * Type: <b>token</b><br>
4273   * Path: <b>SubscriptionTopic.version</b><br>
4274   * </p>
4275   */
4276  @SearchParamDefinition(name="version", path="SubscriptionTopic.version", description="Business version of the SubscriptionTopic", type="token" )
4277  public static final String SP_VERSION = "version";
4278 /**
4279   * <b>Fluent Client</b> search parameter constant for <b>version</b>
4280   * <p>
4281   * Description: <b>Business version of the SubscriptionTopic</b><br>
4282   * Type: <b>token</b><br>
4283   * Path: <b>SubscriptionTopic.version</b><br>
4284   * </p>
4285   */
4286  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION);
4287
4288
4289}
4290