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