001package org.hl7.fhir.dstu2016may.model;
002
003
004
005
006/*
007  Copyright (c) 2011+, HL7, Inc.
008  All rights reserved.
009  
010  Redistribution and use in source and binary forms, with or without modification, 
011  are permitted provided that the following conditions are met:
012  
013   * Redistributions of source code must retain the above copyright notice, this 
014     list of conditions and the following disclaimer.
015   * Redistributions in binary form must reproduce the above copyright notice, 
016     this list of conditions and the following disclaimer in the documentation 
017     and/or other materials provided with the distribution.
018   * Neither the name of HL7 nor the names of its contributors may be used to 
019     endorse or promote products derived from this software without specific 
020     prior written permission.
021  
022  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
023  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
024  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
025  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
026  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
027  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
028  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
029  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
030  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
031  POSSIBILITY OF SUCH DAMAGE.
032  
033*/
034
035// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0
036import java.util.ArrayList;
037import java.util.Date;
038import java.util.List;
039
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.IBaseDatatypeElement;
042import org.hl7.fhir.instance.model.api.ICompositeType;
043import org.hl7.fhir.utilities.Utilities;
044
045import ca.uhn.fhir.model.api.annotation.Block;
046import ca.uhn.fhir.model.api.annotation.Child;
047import ca.uhn.fhir.model.api.annotation.DatatypeDef;
048import ca.uhn.fhir.model.api.annotation.Description;
049/**
050 * The ModuleMetadata structure defines the common metadata elements used by quality improvement artifacts. This information includes descriptive and topical metadata to enable repository searches, as well as governance and evidentiary support information.
051 */
052@DatatypeDef(name="ModuleMetadata")
053public class ModuleMetadata extends Type implements ICompositeType {
054
055    public enum ModuleMetadataType {
056        /**
057         * The resource is a description of a knowledge module
058         */
059        MODULE, 
060        /**
061         * The resource is a shareable library of formalized knowledge
062         */
063        LIBRARY, 
064        /**
065         * An Event-Condition-Action Rule Artifact
066         */
067        DECISIONSUPPORTRULE, 
068        /**
069         * A Documentation Template Artifact
070         */
071        DOCUMENTATIONTEMPLATE, 
072        /**
073         * An Order Set Artifact
074         */
075        ORDERSET, 
076        /**
077         * added to help the parsers
078         */
079        NULL;
080        public static ModuleMetadataType fromCode(String codeString) throws FHIRException {
081            if (codeString == null || "".equals(codeString))
082                return null;
083        if ("module".equals(codeString))
084          return MODULE;
085        if ("library".equals(codeString))
086          return LIBRARY;
087        if ("decision-support-rule".equals(codeString))
088          return DECISIONSUPPORTRULE;
089        if ("documentation-template".equals(codeString))
090          return DOCUMENTATIONTEMPLATE;
091        if ("order-set".equals(codeString))
092          return ORDERSET;
093        throw new FHIRException("Unknown ModuleMetadataType code '"+codeString+"'");
094        }
095        public String toCode() {
096          switch (this) {
097            case MODULE: return "module";
098            case LIBRARY: return "library";
099            case DECISIONSUPPORTRULE: return "decision-support-rule";
100            case DOCUMENTATIONTEMPLATE: return "documentation-template";
101            case ORDERSET: return "order-set";
102            case NULL: return null;
103            default: return "?";
104          }
105        }
106        public String getSystem() {
107          switch (this) {
108            case MODULE: return "http://hl7.org/fhir/module-metadata-type";
109            case LIBRARY: return "http://hl7.org/fhir/module-metadata-type";
110            case DECISIONSUPPORTRULE: return "http://hl7.org/fhir/module-metadata-type";
111            case DOCUMENTATIONTEMPLATE: return "http://hl7.org/fhir/module-metadata-type";
112            case ORDERSET: return "http://hl7.org/fhir/module-metadata-type";
113            case NULL: return null;
114            default: return "?";
115          }
116        }
117        public String getDefinition() {
118          switch (this) {
119            case MODULE: return "The resource is a description of a knowledge module";
120            case LIBRARY: return "The resource is a shareable library of formalized knowledge";
121            case DECISIONSUPPORTRULE: return "An Event-Condition-Action Rule Artifact";
122            case DOCUMENTATIONTEMPLATE: return "A Documentation Template Artifact";
123            case ORDERSET: return "An Order Set Artifact";
124            case NULL: return null;
125            default: return "?";
126          }
127        }
128        public String getDisplay() {
129          switch (this) {
130            case MODULE: return "Module";
131            case LIBRARY: return "Library";
132            case DECISIONSUPPORTRULE: return "Decision Support Rule";
133            case DOCUMENTATIONTEMPLATE: return "Documentation Template";
134            case ORDERSET: return "Order Set";
135            case NULL: return null;
136            default: return "?";
137          }
138        }
139    }
140
141  public static class ModuleMetadataTypeEnumFactory implements EnumFactory<ModuleMetadataType> {
142    public ModuleMetadataType fromCode(String codeString) throws IllegalArgumentException {
143      if (codeString == null || "".equals(codeString))
144            if (codeString == null || "".equals(codeString))
145                return null;
146        if ("module".equals(codeString))
147          return ModuleMetadataType.MODULE;
148        if ("library".equals(codeString))
149          return ModuleMetadataType.LIBRARY;
150        if ("decision-support-rule".equals(codeString))
151          return ModuleMetadataType.DECISIONSUPPORTRULE;
152        if ("documentation-template".equals(codeString))
153          return ModuleMetadataType.DOCUMENTATIONTEMPLATE;
154        if ("order-set".equals(codeString))
155          return ModuleMetadataType.ORDERSET;
156        throw new IllegalArgumentException("Unknown ModuleMetadataType code '"+codeString+"'");
157        }
158        public Enumeration<ModuleMetadataType> fromType(Base code) throws FHIRException {
159          if (code == null || code.isEmpty())
160            return null;
161          String codeString = ((PrimitiveType) code).asStringValue();
162          if (codeString == null || "".equals(codeString))
163            return null;
164        if ("module".equals(codeString))
165          return new Enumeration<ModuleMetadataType>(this, ModuleMetadataType.MODULE);
166        if ("library".equals(codeString))
167          return new Enumeration<ModuleMetadataType>(this, ModuleMetadataType.LIBRARY);
168        if ("decision-support-rule".equals(codeString))
169          return new Enumeration<ModuleMetadataType>(this, ModuleMetadataType.DECISIONSUPPORTRULE);
170        if ("documentation-template".equals(codeString))
171          return new Enumeration<ModuleMetadataType>(this, ModuleMetadataType.DOCUMENTATIONTEMPLATE);
172        if ("order-set".equals(codeString))
173          return new Enumeration<ModuleMetadataType>(this, ModuleMetadataType.ORDERSET);
174        throw new FHIRException("Unknown ModuleMetadataType code '"+codeString+"'");
175        }
176    public String toCode(ModuleMetadataType code) {
177      if (code == ModuleMetadataType.MODULE)
178        return "module";
179      if (code == ModuleMetadataType.LIBRARY)
180        return "library";
181      if (code == ModuleMetadataType.DECISIONSUPPORTRULE)
182        return "decision-support-rule";
183      if (code == ModuleMetadataType.DOCUMENTATIONTEMPLATE)
184        return "documentation-template";
185      if (code == ModuleMetadataType.ORDERSET)
186        return "order-set";
187      return "?";
188      }
189    public String toSystem(ModuleMetadataType code) {
190      return code.getSystem();
191      }
192    }
193
194    public enum ModuleMetadataStatus {
195        /**
196         * The module is in draft state
197         */
198        DRAFT, 
199        /**
200         * The module is active
201         */
202        ACTIVE, 
203        /**
204         * The module is inactive, either rejected before publication, or retired after publication
205         */
206        INACTIVE, 
207        /**
208         * added to help the parsers
209         */
210        NULL;
211        public static ModuleMetadataStatus fromCode(String codeString) throws FHIRException {
212            if (codeString == null || "".equals(codeString))
213                return null;
214        if ("draft".equals(codeString))
215          return DRAFT;
216        if ("active".equals(codeString))
217          return ACTIVE;
218        if ("inactive".equals(codeString))
219          return INACTIVE;
220        throw new FHIRException("Unknown ModuleMetadataStatus code '"+codeString+"'");
221        }
222        public String toCode() {
223          switch (this) {
224            case DRAFT: return "draft";
225            case ACTIVE: return "active";
226            case INACTIVE: return "inactive";
227            case NULL: return null;
228            default: return "?";
229          }
230        }
231        public String getSystem() {
232          switch (this) {
233            case DRAFT: return "http://hl7.org/fhir/module-metadata-status";
234            case ACTIVE: return "http://hl7.org/fhir/module-metadata-status";
235            case INACTIVE: return "http://hl7.org/fhir/module-metadata-status";
236            case NULL: return null;
237            default: return "?";
238          }
239        }
240        public String getDefinition() {
241          switch (this) {
242            case DRAFT: return "The module is in draft state";
243            case ACTIVE: return "The module is active";
244            case INACTIVE: return "The module is inactive, either rejected before publication, or retired after publication";
245            case NULL: return null;
246            default: return "?";
247          }
248        }
249        public String getDisplay() {
250          switch (this) {
251            case DRAFT: return "Draft";
252            case ACTIVE: return "Active";
253            case INACTIVE: return "Inactive";
254            case NULL: return null;
255            default: return "?";
256          }
257        }
258    }
259
260  public static class ModuleMetadataStatusEnumFactory implements EnumFactory<ModuleMetadataStatus> {
261    public ModuleMetadataStatus fromCode(String codeString) throws IllegalArgumentException {
262      if (codeString == null || "".equals(codeString))
263            if (codeString == null || "".equals(codeString))
264                return null;
265        if ("draft".equals(codeString))
266          return ModuleMetadataStatus.DRAFT;
267        if ("active".equals(codeString))
268          return ModuleMetadataStatus.ACTIVE;
269        if ("inactive".equals(codeString))
270          return ModuleMetadataStatus.INACTIVE;
271        throw new IllegalArgumentException("Unknown ModuleMetadataStatus code '"+codeString+"'");
272        }
273        public Enumeration<ModuleMetadataStatus> fromType(Base code) throws FHIRException {
274          if (code == null || code.isEmpty())
275            return null;
276          String codeString = ((PrimitiveType) code).asStringValue();
277          if (codeString == null || "".equals(codeString))
278            return null;
279        if ("draft".equals(codeString))
280          return new Enumeration<ModuleMetadataStatus>(this, ModuleMetadataStatus.DRAFT);
281        if ("active".equals(codeString))
282          return new Enumeration<ModuleMetadataStatus>(this, ModuleMetadataStatus.ACTIVE);
283        if ("inactive".equals(codeString))
284          return new Enumeration<ModuleMetadataStatus>(this, ModuleMetadataStatus.INACTIVE);
285        throw new FHIRException("Unknown ModuleMetadataStatus code '"+codeString+"'");
286        }
287    public String toCode(ModuleMetadataStatus code) {
288      if (code == ModuleMetadataStatus.DRAFT)
289        return "draft";
290      if (code == ModuleMetadataStatus.ACTIVE)
291        return "active";
292      if (code == ModuleMetadataStatus.INACTIVE)
293        return "inactive";
294      return "?";
295      }
296    public String toSystem(ModuleMetadataStatus code) {
297      return code.getSystem();
298      }
299    }
300
301    public enum ModuleMetadataContributorType {
302        /**
303         * An author of the content of the module
304         */
305        AUTHOR, 
306        /**
307         * An editor of the content of the module
308         */
309        EDITOR, 
310        /**
311         * A reviewer of the content of the module
312         */
313        REVIEWER, 
314        /**
315         * An endorser of the content of the module
316         */
317        ENDORSER, 
318        /**
319         * added to help the parsers
320         */
321        NULL;
322        public static ModuleMetadataContributorType fromCode(String codeString) throws FHIRException {
323            if (codeString == null || "".equals(codeString))
324                return null;
325        if ("author".equals(codeString))
326          return AUTHOR;
327        if ("editor".equals(codeString))
328          return EDITOR;
329        if ("reviewer".equals(codeString))
330          return REVIEWER;
331        if ("endorser".equals(codeString))
332          return ENDORSER;
333        throw new FHIRException("Unknown ModuleMetadataContributorType code '"+codeString+"'");
334        }
335        public String toCode() {
336          switch (this) {
337            case AUTHOR: return "author";
338            case EDITOR: return "editor";
339            case REVIEWER: return "reviewer";
340            case ENDORSER: return "endorser";
341            case NULL: return null;
342            default: return "?";
343          }
344        }
345        public String getSystem() {
346          switch (this) {
347            case AUTHOR: return "http://hl7.org/fhir/module-metadata-contributor";
348            case EDITOR: return "http://hl7.org/fhir/module-metadata-contributor";
349            case REVIEWER: return "http://hl7.org/fhir/module-metadata-contributor";
350            case ENDORSER: return "http://hl7.org/fhir/module-metadata-contributor";
351            case NULL: return null;
352            default: return "?";
353          }
354        }
355        public String getDefinition() {
356          switch (this) {
357            case AUTHOR: return "An author of the content of the module";
358            case EDITOR: return "An editor of the content of the module";
359            case REVIEWER: return "A reviewer of the content of the module";
360            case ENDORSER: return "An endorser of the content of the module";
361            case NULL: return null;
362            default: return "?";
363          }
364        }
365        public String getDisplay() {
366          switch (this) {
367            case AUTHOR: return "Author";
368            case EDITOR: return "Editor";
369            case REVIEWER: return "Reviewer";
370            case ENDORSER: return "Endorser";
371            case NULL: return null;
372            default: return "?";
373          }
374        }
375    }
376
377  public static class ModuleMetadataContributorTypeEnumFactory implements EnumFactory<ModuleMetadataContributorType> {
378    public ModuleMetadataContributorType fromCode(String codeString) throws IllegalArgumentException {
379      if (codeString == null || "".equals(codeString))
380            if (codeString == null || "".equals(codeString))
381                return null;
382        if ("author".equals(codeString))
383          return ModuleMetadataContributorType.AUTHOR;
384        if ("editor".equals(codeString))
385          return ModuleMetadataContributorType.EDITOR;
386        if ("reviewer".equals(codeString))
387          return ModuleMetadataContributorType.REVIEWER;
388        if ("endorser".equals(codeString))
389          return ModuleMetadataContributorType.ENDORSER;
390        throw new IllegalArgumentException("Unknown ModuleMetadataContributorType code '"+codeString+"'");
391        }
392        public Enumeration<ModuleMetadataContributorType> fromType(Base code) throws FHIRException {
393          if (code == null || code.isEmpty())
394            return null;
395          String codeString = ((PrimitiveType) code).asStringValue();
396          if (codeString == null || "".equals(codeString))
397            return null;
398        if ("author".equals(codeString))
399          return new Enumeration<ModuleMetadataContributorType>(this, ModuleMetadataContributorType.AUTHOR);
400        if ("editor".equals(codeString))
401          return new Enumeration<ModuleMetadataContributorType>(this, ModuleMetadataContributorType.EDITOR);
402        if ("reviewer".equals(codeString))
403          return new Enumeration<ModuleMetadataContributorType>(this, ModuleMetadataContributorType.REVIEWER);
404        if ("endorser".equals(codeString))
405          return new Enumeration<ModuleMetadataContributorType>(this, ModuleMetadataContributorType.ENDORSER);
406        throw new FHIRException("Unknown ModuleMetadataContributorType code '"+codeString+"'");
407        }
408    public String toCode(ModuleMetadataContributorType code) {
409      if (code == ModuleMetadataContributorType.AUTHOR)
410        return "author";
411      if (code == ModuleMetadataContributorType.EDITOR)
412        return "editor";
413      if (code == ModuleMetadataContributorType.REVIEWER)
414        return "reviewer";
415      if (code == ModuleMetadataContributorType.ENDORSER)
416        return "endorser";
417      return "?";
418      }
419    public String toSystem(ModuleMetadataContributorType code) {
420      return code.getSystem();
421      }
422    }
423
424    public enum ModuleMetadataResourceType {
425        /**
426         * Additional documentation for the module. This would include additional instructions on usage as well additional information on clinical context or appropriateness
427         */
428        DOCUMENTATION, 
429        /**
430         * A summary of the justification for the artifact including supporting evidence, relevant guidelines, or other clinically important information. This information is intended to provide a way to make the justification for the module available to the consumer of interventions or results produced by the artifact
431         */
432        JUSTIFICATION, 
433        /**
434         * Bibliographic citation for papers, references, or other relevant material for the module. This is intended to allow for citation of related material, but that was not necessarily specifically prepared in connection with this module
435         */
436        CITATION, 
437        /**
438         * The previous version of the module
439         */
440        PREDECESSOR, 
441        /**
442         * The next version of the module
443         */
444        SUCCESSOR, 
445        /**
446         * The module is derived from the resource. This is intended to capture the relationship when a particular module is based on the content of another module, but is modified to capture either a different set of overall requirements, or a more specific set of requirements such as those involved in a particular institution or clinical setting
447         */
448        DERIVEDFROM, 
449        /**
450         * added to help the parsers
451         */
452        NULL;
453        public static ModuleMetadataResourceType fromCode(String codeString) throws FHIRException {
454            if (codeString == null || "".equals(codeString))
455                return null;
456        if ("documentation".equals(codeString))
457          return DOCUMENTATION;
458        if ("justification".equals(codeString))
459          return JUSTIFICATION;
460        if ("citation".equals(codeString))
461          return CITATION;
462        if ("predecessor".equals(codeString))
463          return PREDECESSOR;
464        if ("successor".equals(codeString))
465          return SUCCESSOR;
466        if ("derived-from".equals(codeString))
467          return DERIVEDFROM;
468        throw new FHIRException("Unknown ModuleMetadataResourceType code '"+codeString+"'");
469        }
470        public String toCode() {
471          switch (this) {
472            case DOCUMENTATION: return "documentation";
473            case JUSTIFICATION: return "justification";
474            case CITATION: return "citation";
475            case PREDECESSOR: return "predecessor";
476            case SUCCESSOR: return "successor";
477            case DERIVEDFROM: return "derived-from";
478            case NULL: return null;
479            default: return "?";
480          }
481        }
482        public String getSystem() {
483          switch (this) {
484            case DOCUMENTATION: return "http://hl7.org/fhir/module-metadata-resource-type";
485            case JUSTIFICATION: return "http://hl7.org/fhir/module-metadata-resource-type";
486            case CITATION: return "http://hl7.org/fhir/module-metadata-resource-type";
487            case PREDECESSOR: return "http://hl7.org/fhir/module-metadata-resource-type";
488            case SUCCESSOR: return "http://hl7.org/fhir/module-metadata-resource-type";
489            case DERIVEDFROM: return "http://hl7.org/fhir/module-metadata-resource-type";
490            case NULL: return null;
491            default: return "?";
492          }
493        }
494        public String getDefinition() {
495          switch (this) {
496            case DOCUMENTATION: return "Additional documentation for the module. This would include additional instructions on usage as well additional information on clinical context or appropriateness";
497            case JUSTIFICATION: return "A summary of the justification for the artifact including supporting evidence, relevant guidelines, or other clinically important information. This information is intended to provide a way to make the justification for the module available to the consumer of interventions or results produced by the artifact";
498            case CITATION: return "Bibliographic citation for papers, references, or other relevant material for the module. This is intended to allow for citation of related material, but that was not necessarily specifically prepared in connection with this module";
499            case PREDECESSOR: return "The previous version of the module";
500            case SUCCESSOR: return "The next version of the module";
501            case DERIVEDFROM: return "The module is derived from the resource. This is intended to capture the relationship when a particular module is based on the content of another module, but is modified to capture either a different set of overall requirements, or a more specific set of requirements such as those involved in a particular institution or clinical setting";
502            case NULL: return null;
503            default: return "?";
504          }
505        }
506        public String getDisplay() {
507          switch (this) {
508            case DOCUMENTATION: return "Documentation";
509            case JUSTIFICATION: return "Justification";
510            case CITATION: return "Citation";
511            case PREDECESSOR: return "Predecessor";
512            case SUCCESSOR: return "Successor";
513            case DERIVEDFROM: return "Derived From";
514            case NULL: return null;
515            default: return "?";
516          }
517        }
518    }
519
520  public static class ModuleMetadataResourceTypeEnumFactory implements EnumFactory<ModuleMetadataResourceType> {
521    public ModuleMetadataResourceType fromCode(String codeString) throws IllegalArgumentException {
522      if (codeString == null || "".equals(codeString))
523            if (codeString == null || "".equals(codeString))
524                return null;
525        if ("documentation".equals(codeString))
526          return ModuleMetadataResourceType.DOCUMENTATION;
527        if ("justification".equals(codeString))
528          return ModuleMetadataResourceType.JUSTIFICATION;
529        if ("citation".equals(codeString))
530          return ModuleMetadataResourceType.CITATION;
531        if ("predecessor".equals(codeString))
532          return ModuleMetadataResourceType.PREDECESSOR;
533        if ("successor".equals(codeString))
534          return ModuleMetadataResourceType.SUCCESSOR;
535        if ("derived-from".equals(codeString))
536          return ModuleMetadataResourceType.DERIVEDFROM;
537        throw new IllegalArgumentException("Unknown ModuleMetadataResourceType code '"+codeString+"'");
538        }
539        public Enumeration<ModuleMetadataResourceType> fromType(Base code) throws FHIRException {
540          if (code == null || code.isEmpty())
541            return null;
542          String codeString = ((PrimitiveType) code).asStringValue();
543          if (codeString == null || "".equals(codeString))
544            return null;
545        if ("documentation".equals(codeString))
546          return new Enumeration<ModuleMetadataResourceType>(this, ModuleMetadataResourceType.DOCUMENTATION);
547        if ("justification".equals(codeString))
548          return new Enumeration<ModuleMetadataResourceType>(this, ModuleMetadataResourceType.JUSTIFICATION);
549        if ("citation".equals(codeString))
550          return new Enumeration<ModuleMetadataResourceType>(this, ModuleMetadataResourceType.CITATION);
551        if ("predecessor".equals(codeString))
552          return new Enumeration<ModuleMetadataResourceType>(this, ModuleMetadataResourceType.PREDECESSOR);
553        if ("successor".equals(codeString))
554          return new Enumeration<ModuleMetadataResourceType>(this, ModuleMetadataResourceType.SUCCESSOR);
555        if ("derived-from".equals(codeString))
556          return new Enumeration<ModuleMetadataResourceType>(this, ModuleMetadataResourceType.DERIVEDFROM);
557        throw new FHIRException("Unknown ModuleMetadataResourceType code '"+codeString+"'");
558        }
559    public String toCode(ModuleMetadataResourceType code) {
560      if (code == ModuleMetadataResourceType.DOCUMENTATION)
561        return "documentation";
562      if (code == ModuleMetadataResourceType.JUSTIFICATION)
563        return "justification";
564      if (code == ModuleMetadataResourceType.CITATION)
565        return "citation";
566      if (code == ModuleMetadataResourceType.PREDECESSOR)
567        return "predecessor";
568      if (code == ModuleMetadataResourceType.SUCCESSOR)
569        return "successor";
570      if (code == ModuleMetadataResourceType.DERIVEDFROM)
571        return "derived-from";
572      return "?";
573      }
574    public String toSystem(ModuleMetadataResourceType code) {
575      return code.getSystem();
576      }
577    }
578
579    @Block()
580    public static class ModuleMetadataCoverageComponent extends Element implements IBaseDatatypeElement {
581        /**
582         * Specifies the focus of the coverage attribute.
583         */
584        @Child(name = "focus", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false)
585        @Description(shortDefinition="patient-gender | patient-age-group | clinical-focus | target-user | workflow-setting | workflow-task | clinical-venue | jurisdiction", formalDefinition="Specifies the focus of the coverage attribute." )
586        protected Coding focus;
587
588        /**
589         * Provides a value for the coverage attribute. Different values are appropriate in different focus areas, as specified in the description of values for focus.
590         */
591        @Child(name = "value", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=false)
592        @Description(shortDefinition="Value of the coverage attribute", formalDefinition="Provides a value for the coverage attribute. Different values are appropriate in different focus areas, as specified in the description of values for focus." )
593        protected CodeableConcept value;
594
595        private static final long serialVersionUID = 65126300L;
596
597    /**
598     * Constructor
599     */
600      public ModuleMetadataCoverageComponent() {
601        super();
602      }
603
604    /**
605     * Constructor
606     */
607      public ModuleMetadataCoverageComponent(Coding focus, CodeableConcept value) {
608        super();
609        this.focus = focus;
610        this.value = value;
611      }
612
613        /**
614         * @return {@link #focus} (Specifies the focus of the coverage attribute.)
615         */
616        public Coding getFocus() { 
617          if (this.focus == null)
618            if (Configuration.errorOnAutoCreate())
619              throw new Error("Attempt to auto-create ModuleMetadataCoverageComponent.focus");
620            else if (Configuration.doAutoCreate())
621              this.focus = new Coding(); // cc
622          return this.focus;
623        }
624
625        public boolean hasFocus() { 
626          return this.focus != null && !this.focus.isEmpty();
627        }
628
629        /**
630         * @param value {@link #focus} (Specifies the focus of the coverage attribute.)
631         */
632        public ModuleMetadataCoverageComponent setFocus(Coding value) { 
633          this.focus = value;
634          return this;
635        }
636
637        /**
638         * @return {@link #value} (Provides a value for the coverage attribute. Different values are appropriate in different focus areas, as specified in the description of values for focus.)
639         */
640        public CodeableConcept getValue() { 
641          if (this.value == null)
642            if (Configuration.errorOnAutoCreate())
643              throw new Error("Attempt to auto-create ModuleMetadataCoverageComponent.value");
644            else if (Configuration.doAutoCreate())
645              this.value = new CodeableConcept(); // cc
646          return this.value;
647        }
648
649        public boolean hasValue() { 
650          return this.value != null && !this.value.isEmpty();
651        }
652
653        /**
654         * @param value {@link #value} (Provides a value for the coverage attribute. Different values are appropriate in different focus areas, as specified in the description of values for focus.)
655         */
656        public ModuleMetadataCoverageComponent setValue(CodeableConcept value) { 
657          this.value = value;
658          return this;
659        }
660
661        protected void listChildren(List<Property> childrenList) {
662          super.listChildren(childrenList);
663          childrenList.add(new Property("focus", "Coding", "Specifies the focus of the coverage attribute.", 0, java.lang.Integer.MAX_VALUE, focus));
664          childrenList.add(new Property("value", "CodeableConcept", "Provides a value for the coverage attribute. Different values are appropriate in different focus areas, as specified in the description of values for focus.", 0, java.lang.Integer.MAX_VALUE, value));
665        }
666
667      @Override
668      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
669        switch (hash) {
670        case 97604824: /*focus*/ return this.focus == null ? new Base[0] : new Base[] {this.focus}; // Coding
671        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // CodeableConcept
672        default: return super.getProperty(hash, name, checkValid);
673        }
674
675      }
676
677      @Override
678      public void setProperty(int hash, String name, Base value) throws FHIRException {
679        switch (hash) {
680        case 97604824: // focus
681          this.focus = castToCoding(value); // Coding
682          break;
683        case 111972721: // value
684          this.value = castToCodeableConcept(value); // CodeableConcept
685          break;
686        default: super.setProperty(hash, name, value);
687        }
688
689      }
690
691      @Override
692      public void setProperty(String name, Base value) throws FHIRException {
693        if (name.equals("focus"))
694          this.focus = castToCoding(value); // Coding
695        else if (name.equals("value"))
696          this.value = castToCodeableConcept(value); // CodeableConcept
697        else
698          super.setProperty(name, value);
699      }
700
701      @Override
702      public Base makeProperty(int hash, String name) throws FHIRException {
703        switch (hash) {
704        case 97604824:  return getFocus(); // Coding
705        case 111972721:  return getValue(); // CodeableConcept
706        default: return super.makeProperty(hash, name);
707        }
708
709      }
710
711      @Override
712      public Base addChild(String name) throws FHIRException {
713        if (name.equals("focus")) {
714          this.focus = new Coding();
715          return this.focus;
716        }
717        else if (name.equals("value")) {
718          this.value = new CodeableConcept();
719          return this.value;
720        }
721        else
722          return super.addChild(name);
723      }
724
725      public ModuleMetadataCoverageComponent copy() {
726        ModuleMetadataCoverageComponent dst = new ModuleMetadataCoverageComponent();
727        copyValues(dst);
728        dst.focus = focus == null ? null : focus.copy();
729        dst.value = value == null ? null : value.copy();
730        return dst;
731      }
732
733      @Override
734      public boolean equalsDeep(Base other) {
735        if (!super.equalsDeep(other))
736          return false;
737        if (!(other instanceof ModuleMetadataCoverageComponent))
738          return false;
739        ModuleMetadataCoverageComponent o = (ModuleMetadataCoverageComponent) other;
740        return compareDeep(focus, o.focus, true) && compareDeep(value, o.value, true);
741      }
742
743      @Override
744      public boolean equalsShallow(Base other) {
745        if (!super.equalsShallow(other))
746          return false;
747        if (!(other instanceof ModuleMetadataCoverageComponent))
748          return false;
749        ModuleMetadataCoverageComponent o = (ModuleMetadataCoverageComponent) other;
750        return true;
751      }
752
753      public boolean isEmpty() {
754        return super.isEmpty() && (focus == null || focus.isEmpty()) && (value == null || value.isEmpty())
755          ;
756      }
757
758  public String fhirType() {
759    return "ModuleMetadata.coverage";
760
761  }
762
763  }
764
765    @Block()
766    public static class ModuleMetadataContributorComponent extends Element implements IBaseDatatypeElement {
767        /**
768         * The type of contributor.
769         */
770        @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
771        @Description(shortDefinition="author | editor | reviewer | endorser", formalDefinition="The type of contributor." )
772        protected Enumeration<ModuleMetadataContributorType> type;
773
774        /**
775         * The name of the individual or organization responsible for the contribution.
776         */
777        @Child(name = "name", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false)
778        @Description(shortDefinition="Name of the contributor", formalDefinition="The name of the individual or organization responsible for the contribution." )
779        protected StringType name;
780
781        /**
782         * Contacts to assist a user in finding and communicating with the contributor.
783         */
784        @Child(name = "contact", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
785        @Description(shortDefinition="Contact details of the contributor", formalDefinition="Contacts to assist a user in finding and communicating with the contributor." )
786        protected List<ModuleMetadataContributorContactComponent> contact;
787
788        private static final long serialVersionUID = 1033333886L;
789
790    /**
791     * Constructor
792     */
793      public ModuleMetadataContributorComponent() {
794        super();
795      }
796
797    /**
798     * Constructor
799     */
800      public ModuleMetadataContributorComponent(Enumeration<ModuleMetadataContributorType> type, StringType name) {
801        super();
802        this.type = type;
803        this.name = name;
804      }
805
806        /**
807         * @return {@link #type} (The type of contributor.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
808         */
809        public Enumeration<ModuleMetadataContributorType> getTypeElement() { 
810          if (this.type == null)
811            if (Configuration.errorOnAutoCreate())
812              throw new Error("Attempt to auto-create ModuleMetadataContributorComponent.type");
813            else if (Configuration.doAutoCreate())
814              this.type = new Enumeration<ModuleMetadataContributorType>(new ModuleMetadataContributorTypeEnumFactory()); // bb
815          return this.type;
816        }
817
818        public boolean hasTypeElement() { 
819          return this.type != null && !this.type.isEmpty();
820        }
821
822        public boolean hasType() { 
823          return this.type != null && !this.type.isEmpty();
824        }
825
826        /**
827         * @param value {@link #type} (The type of contributor.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
828         */
829        public ModuleMetadataContributorComponent setTypeElement(Enumeration<ModuleMetadataContributorType> value) { 
830          this.type = value;
831          return this;
832        }
833
834        /**
835         * @return The type of contributor.
836         */
837        public ModuleMetadataContributorType getType() { 
838          return this.type == null ? null : this.type.getValue();
839        }
840
841        /**
842         * @param value The type of contributor.
843         */
844        public ModuleMetadataContributorComponent setType(ModuleMetadataContributorType value) { 
845            if (this.type == null)
846              this.type = new Enumeration<ModuleMetadataContributorType>(new ModuleMetadataContributorTypeEnumFactory());
847            this.type.setValue(value);
848          return this;
849        }
850
851        /**
852         * @return {@link #name} (The name of the individual or organization responsible for the contribution.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
853         */
854        public StringType getNameElement() { 
855          if (this.name == null)
856            if (Configuration.errorOnAutoCreate())
857              throw new Error("Attempt to auto-create ModuleMetadataContributorComponent.name");
858            else if (Configuration.doAutoCreate())
859              this.name = new StringType(); // bb
860          return this.name;
861        }
862
863        public boolean hasNameElement() { 
864          return this.name != null && !this.name.isEmpty();
865        }
866
867        public boolean hasName() { 
868          return this.name != null && !this.name.isEmpty();
869        }
870
871        /**
872         * @param value {@link #name} (The name of the individual or organization responsible for the contribution.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
873         */
874        public ModuleMetadataContributorComponent setNameElement(StringType value) { 
875          this.name = value;
876          return this;
877        }
878
879        /**
880         * @return The name of the individual or organization responsible for the contribution.
881         */
882        public String getName() { 
883          return this.name == null ? null : this.name.getValue();
884        }
885
886        /**
887         * @param value The name of the individual or organization responsible for the contribution.
888         */
889        public ModuleMetadataContributorComponent setName(String value) { 
890            if (this.name == null)
891              this.name = new StringType();
892            this.name.setValue(value);
893          return this;
894        }
895
896        /**
897         * @return {@link #contact} (Contacts to assist a user in finding and communicating with the contributor.)
898         */
899        public List<ModuleMetadataContributorContactComponent> getContact() { 
900          if (this.contact == null)
901            this.contact = new ArrayList<ModuleMetadataContributorContactComponent>();
902          return this.contact;
903        }
904
905        public boolean hasContact() { 
906          if (this.contact == null)
907            return false;
908          for (ModuleMetadataContributorContactComponent item : this.contact)
909            if (!item.isEmpty())
910              return true;
911          return false;
912        }
913
914        /**
915         * @return {@link #contact} (Contacts to assist a user in finding and communicating with the contributor.)
916         */
917    // syntactic sugar
918        public ModuleMetadataContributorContactComponent addContact() { //3
919          ModuleMetadataContributorContactComponent t = new ModuleMetadataContributorContactComponent();
920          if (this.contact == null)
921            this.contact = new ArrayList<ModuleMetadataContributorContactComponent>();
922          this.contact.add(t);
923          return t;
924        }
925
926    // syntactic sugar
927        public ModuleMetadataContributorComponent addContact(ModuleMetadataContributorContactComponent t) { //3
928          if (t == null)
929            return this;
930          if (this.contact == null)
931            this.contact = new ArrayList<ModuleMetadataContributorContactComponent>();
932          this.contact.add(t);
933          return this;
934        }
935
936        protected void listChildren(List<Property> childrenList) {
937          super.listChildren(childrenList);
938          childrenList.add(new Property("type", "code", "The type of contributor.", 0, java.lang.Integer.MAX_VALUE, type));
939          childrenList.add(new Property("name", "string", "The name of the individual or organization responsible for the contribution.", 0, java.lang.Integer.MAX_VALUE, name));
940          childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the contributor.", 0, java.lang.Integer.MAX_VALUE, contact));
941        }
942
943      @Override
944      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
945        switch (hash) {
946        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<ModuleMetadataContributorType>
947        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
948        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ModuleMetadataContributorContactComponent
949        default: return super.getProperty(hash, name, checkValid);
950        }
951
952      }
953
954      @Override
955      public void setProperty(int hash, String name, Base value) throws FHIRException {
956        switch (hash) {
957        case 3575610: // type
958          this.type = new ModuleMetadataContributorTypeEnumFactory().fromType(value); // Enumeration<ModuleMetadataContributorType>
959          break;
960        case 3373707: // name
961          this.name = castToString(value); // StringType
962          break;
963        case 951526432: // contact
964          this.getContact().add((ModuleMetadataContributorContactComponent) value); // ModuleMetadataContributorContactComponent
965          break;
966        default: super.setProperty(hash, name, value);
967        }
968
969      }
970
971      @Override
972      public void setProperty(String name, Base value) throws FHIRException {
973        if (name.equals("type"))
974          this.type = new ModuleMetadataContributorTypeEnumFactory().fromType(value); // Enumeration<ModuleMetadataContributorType>
975        else if (name.equals("name"))
976          this.name = castToString(value); // StringType
977        else if (name.equals("contact"))
978          this.getContact().add((ModuleMetadataContributorContactComponent) value);
979        else
980          super.setProperty(name, value);
981      }
982
983      @Override
984      public Base makeProperty(int hash, String name) throws FHIRException {
985        switch (hash) {
986        case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration<ModuleMetadataContributorType>
987        case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType
988        case 951526432:  return addContact(); // ModuleMetadataContributorContactComponent
989        default: return super.makeProperty(hash, name);
990        }
991
992      }
993
994      @Override
995      public Base addChild(String name) throws FHIRException {
996        if (name.equals("type")) {
997          throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.type");
998        }
999        else if (name.equals("name")) {
1000          throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.name");
1001        }
1002        else if (name.equals("contact")) {
1003          return addContact();
1004        }
1005        else
1006          return super.addChild(name);
1007      }
1008
1009      public ModuleMetadataContributorComponent copy() {
1010        ModuleMetadataContributorComponent dst = new ModuleMetadataContributorComponent();
1011        copyValues(dst);
1012        dst.type = type == null ? null : type.copy();
1013        dst.name = name == null ? null : name.copy();
1014        if (contact != null) {
1015          dst.contact = new ArrayList<ModuleMetadataContributorContactComponent>();
1016          for (ModuleMetadataContributorContactComponent i : contact)
1017            dst.contact.add(i.copy());
1018        };
1019        return dst;
1020      }
1021
1022      @Override
1023      public boolean equalsDeep(Base other) {
1024        if (!super.equalsDeep(other))
1025          return false;
1026        if (!(other instanceof ModuleMetadataContributorComponent))
1027          return false;
1028        ModuleMetadataContributorComponent o = (ModuleMetadataContributorComponent) other;
1029        return compareDeep(type, o.type, true) && compareDeep(name, o.name, true) && compareDeep(contact, o.contact, true)
1030          ;
1031      }
1032
1033      @Override
1034      public boolean equalsShallow(Base other) {
1035        if (!super.equalsShallow(other))
1036          return false;
1037        if (!(other instanceof ModuleMetadataContributorComponent))
1038          return false;
1039        ModuleMetadataContributorComponent o = (ModuleMetadataContributorComponent) other;
1040        return compareValues(type, o.type, true) && compareValues(name, o.name, true);
1041      }
1042
1043      public boolean isEmpty() {
1044        return super.isEmpty() && (type == null || type.isEmpty()) && (name == null || name.isEmpty())
1045           && (contact == null || contact.isEmpty());
1046      }
1047
1048  public String fhirType() {
1049    return "ModuleMetadata.contributor";
1050
1051  }
1052
1053  }
1054
1055    @Block()
1056    public static class ModuleMetadataContributorContactComponent extends Element implements IBaseDatatypeElement {
1057        /**
1058         * The name of an individual to contact regarding the contribution.
1059         */
1060        @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
1061        @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the contribution." )
1062        protected StringType name;
1063
1064        /**
1065         * Contact details for the individual (if a name was provided) or the contributor.
1066         */
1067        @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1068        @Description(shortDefinition="Contact details for an individual or contributor", formalDefinition="Contact details for the individual (if a name was provided) or the contributor." )
1069        protected List<ContactPoint> telecom;
1070
1071        private static final long serialVersionUID = -1179697803L;
1072
1073    /**
1074     * Constructor
1075     */
1076      public ModuleMetadataContributorContactComponent() {
1077        super();
1078      }
1079
1080        /**
1081         * @return {@link #name} (The name of an individual to contact regarding the contribution.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1082         */
1083        public StringType getNameElement() { 
1084          if (this.name == null)
1085            if (Configuration.errorOnAutoCreate())
1086              throw new Error("Attempt to auto-create ModuleMetadataContributorContactComponent.name");
1087            else if (Configuration.doAutoCreate())
1088              this.name = new StringType(); // bb
1089          return this.name;
1090        }
1091
1092        public boolean hasNameElement() { 
1093          return this.name != null && !this.name.isEmpty();
1094        }
1095
1096        public boolean hasName() { 
1097          return this.name != null && !this.name.isEmpty();
1098        }
1099
1100        /**
1101         * @param value {@link #name} (The name of an individual to contact regarding the contribution.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1102         */
1103        public ModuleMetadataContributorContactComponent setNameElement(StringType value) { 
1104          this.name = value;
1105          return this;
1106        }
1107
1108        /**
1109         * @return The name of an individual to contact regarding the contribution.
1110         */
1111        public String getName() { 
1112          return this.name == null ? null : this.name.getValue();
1113        }
1114
1115        /**
1116         * @param value The name of an individual to contact regarding the contribution.
1117         */
1118        public ModuleMetadataContributorContactComponent setName(String value) { 
1119          if (Utilities.noString(value))
1120            this.name = null;
1121          else {
1122            if (this.name == null)
1123              this.name = new StringType();
1124            this.name.setValue(value);
1125          }
1126          return this;
1127        }
1128
1129        /**
1130         * @return {@link #telecom} (Contact details for the individual (if a name was provided) or the contributor.)
1131         */
1132        public List<ContactPoint> getTelecom() { 
1133          if (this.telecom == null)
1134            this.telecom = new ArrayList<ContactPoint>();
1135          return this.telecom;
1136        }
1137
1138        public boolean hasTelecom() { 
1139          if (this.telecom == null)
1140            return false;
1141          for (ContactPoint item : this.telecom)
1142            if (!item.isEmpty())
1143              return true;
1144          return false;
1145        }
1146
1147        /**
1148         * @return {@link #telecom} (Contact details for the individual (if a name was provided) or the contributor.)
1149         */
1150    // syntactic sugar
1151        public ContactPoint addTelecom() { //3
1152          ContactPoint t = new ContactPoint();
1153          if (this.telecom == null)
1154            this.telecom = new ArrayList<ContactPoint>();
1155          this.telecom.add(t);
1156          return t;
1157        }
1158
1159    // syntactic sugar
1160        public ModuleMetadataContributorContactComponent addTelecom(ContactPoint t) { //3
1161          if (t == null)
1162            return this;
1163          if (this.telecom == null)
1164            this.telecom = new ArrayList<ContactPoint>();
1165          this.telecom.add(t);
1166          return this;
1167        }
1168
1169        protected void listChildren(List<Property> childrenList) {
1170          super.listChildren(childrenList);
1171          childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the contribution.", 0, java.lang.Integer.MAX_VALUE, name));
1172          childrenList.add(new Property("telecom", "ContactPoint", "Contact details for the individual (if a name was provided) or the contributor.", 0, java.lang.Integer.MAX_VALUE, telecom));
1173        }
1174
1175      @Override
1176      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1177        switch (hash) {
1178        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
1179        case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint
1180        default: return super.getProperty(hash, name, checkValid);
1181        }
1182
1183      }
1184
1185      @Override
1186      public void setProperty(int hash, String name, Base value) throws FHIRException {
1187        switch (hash) {
1188        case 3373707: // name
1189          this.name = castToString(value); // StringType
1190          break;
1191        case -1429363305: // telecom
1192          this.getTelecom().add(castToContactPoint(value)); // ContactPoint
1193          break;
1194        default: super.setProperty(hash, name, value);
1195        }
1196
1197      }
1198
1199      @Override
1200      public void setProperty(String name, Base value) throws FHIRException {
1201        if (name.equals("name"))
1202          this.name = castToString(value); // StringType
1203        else if (name.equals("telecom"))
1204          this.getTelecom().add(castToContactPoint(value));
1205        else
1206          super.setProperty(name, value);
1207      }
1208
1209      @Override
1210      public Base makeProperty(int hash, String name) throws FHIRException {
1211        switch (hash) {
1212        case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType
1213        case -1429363305:  return addTelecom(); // ContactPoint
1214        default: return super.makeProperty(hash, name);
1215        }
1216
1217      }
1218
1219      @Override
1220      public Base addChild(String name) throws FHIRException {
1221        if (name.equals("name")) {
1222          throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.name");
1223        }
1224        else if (name.equals("telecom")) {
1225          return addTelecom();
1226        }
1227        else
1228          return super.addChild(name);
1229      }
1230
1231      public ModuleMetadataContributorContactComponent copy() {
1232        ModuleMetadataContributorContactComponent dst = new ModuleMetadataContributorContactComponent();
1233        copyValues(dst);
1234        dst.name = name == null ? null : name.copy();
1235        if (telecom != null) {
1236          dst.telecom = new ArrayList<ContactPoint>();
1237          for (ContactPoint i : telecom)
1238            dst.telecom.add(i.copy());
1239        };
1240        return dst;
1241      }
1242
1243      @Override
1244      public boolean equalsDeep(Base other) {
1245        if (!super.equalsDeep(other))
1246          return false;
1247        if (!(other instanceof ModuleMetadataContributorContactComponent))
1248          return false;
1249        ModuleMetadataContributorContactComponent o = (ModuleMetadataContributorContactComponent) other;
1250        return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true);
1251      }
1252
1253      @Override
1254      public boolean equalsShallow(Base other) {
1255        if (!super.equalsShallow(other))
1256          return false;
1257        if (!(other instanceof ModuleMetadataContributorContactComponent))
1258          return false;
1259        ModuleMetadataContributorContactComponent o = (ModuleMetadataContributorContactComponent) other;
1260        return compareValues(name, o.name, true);
1261      }
1262
1263      public boolean isEmpty() {
1264        return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty())
1265          ;
1266      }
1267
1268  public String fhirType() {
1269    return "ModuleMetadata.contributor.contact";
1270
1271  }
1272
1273  }
1274
1275    @Block()
1276    public static class ModuleMetadataContactComponent extends Element implements IBaseDatatypeElement {
1277        /**
1278         * The name of an individual to contact regarding the module.
1279         */
1280        @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
1281        @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the module." )
1282        protected StringType name;
1283
1284        /**
1285         * Contact details for the individual (if a name was provided) or the publisher.
1286         */
1287        @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1288        @Description(shortDefinition="Contact details for an individual or publisher", formalDefinition="Contact details for the individual (if a name was provided) or the publisher." )
1289        protected List<ContactPoint> telecom;
1290
1291        private static final long serialVersionUID = -1179697803L;
1292
1293    /**
1294     * Constructor
1295     */
1296      public ModuleMetadataContactComponent() {
1297        super();
1298      }
1299
1300        /**
1301         * @return {@link #name} (The name of an individual to contact regarding the module.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1302         */
1303        public StringType getNameElement() { 
1304          if (this.name == null)
1305            if (Configuration.errorOnAutoCreate())
1306              throw new Error("Attempt to auto-create ModuleMetadataContactComponent.name");
1307            else if (Configuration.doAutoCreate())
1308              this.name = new StringType(); // bb
1309          return this.name;
1310        }
1311
1312        public boolean hasNameElement() { 
1313          return this.name != null && !this.name.isEmpty();
1314        }
1315
1316        public boolean hasName() { 
1317          return this.name != null && !this.name.isEmpty();
1318        }
1319
1320        /**
1321         * @param value {@link #name} (The name of an individual to contact regarding the module.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1322         */
1323        public ModuleMetadataContactComponent setNameElement(StringType value) { 
1324          this.name = value;
1325          return this;
1326        }
1327
1328        /**
1329         * @return The name of an individual to contact regarding the module.
1330         */
1331        public String getName() { 
1332          return this.name == null ? null : this.name.getValue();
1333        }
1334
1335        /**
1336         * @param value The name of an individual to contact regarding the module.
1337         */
1338        public ModuleMetadataContactComponent setName(String value) { 
1339          if (Utilities.noString(value))
1340            this.name = null;
1341          else {
1342            if (this.name == null)
1343              this.name = new StringType();
1344            this.name.setValue(value);
1345          }
1346          return this;
1347        }
1348
1349        /**
1350         * @return {@link #telecom} (Contact details for the individual (if a name was provided) or the publisher.)
1351         */
1352        public List<ContactPoint> getTelecom() { 
1353          if (this.telecom == null)
1354            this.telecom = new ArrayList<ContactPoint>();
1355          return this.telecom;
1356        }
1357
1358        public boolean hasTelecom() { 
1359          if (this.telecom == null)
1360            return false;
1361          for (ContactPoint item : this.telecom)
1362            if (!item.isEmpty())
1363              return true;
1364          return false;
1365        }
1366
1367        /**
1368         * @return {@link #telecom} (Contact details for the individual (if a name was provided) or the publisher.)
1369         */
1370    // syntactic sugar
1371        public ContactPoint addTelecom() { //3
1372          ContactPoint t = new ContactPoint();
1373          if (this.telecom == null)
1374            this.telecom = new ArrayList<ContactPoint>();
1375          this.telecom.add(t);
1376          return t;
1377        }
1378
1379    // syntactic sugar
1380        public ModuleMetadataContactComponent addTelecom(ContactPoint t) { //3
1381          if (t == null)
1382            return this;
1383          if (this.telecom == null)
1384            this.telecom = new ArrayList<ContactPoint>();
1385          this.telecom.add(t);
1386          return this;
1387        }
1388
1389        protected void listChildren(List<Property> childrenList) {
1390          super.listChildren(childrenList);
1391          childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the module.", 0, java.lang.Integer.MAX_VALUE, name));
1392          childrenList.add(new Property("telecom", "ContactPoint", "Contact details for the individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom));
1393        }
1394
1395      @Override
1396      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1397        switch (hash) {
1398        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
1399        case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint
1400        default: return super.getProperty(hash, name, checkValid);
1401        }
1402
1403      }
1404
1405      @Override
1406      public void setProperty(int hash, String name, Base value) throws FHIRException {
1407        switch (hash) {
1408        case 3373707: // name
1409          this.name = castToString(value); // StringType
1410          break;
1411        case -1429363305: // telecom
1412          this.getTelecom().add(castToContactPoint(value)); // ContactPoint
1413          break;
1414        default: super.setProperty(hash, name, value);
1415        }
1416
1417      }
1418
1419      @Override
1420      public void setProperty(String name, Base value) throws FHIRException {
1421        if (name.equals("name"))
1422          this.name = castToString(value); // StringType
1423        else if (name.equals("telecom"))
1424          this.getTelecom().add(castToContactPoint(value));
1425        else
1426          super.setProperty(name, value);
1427      }
1428
1429      @Override
1430      public Base makeProperty(int hash, String name) throws FHIRException {
1431        switch (hash) {
1432        case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType
1433        case -1429363305:  return addTelecom(); // ContactPoint
1434        default: return super.makeProperty(hash, name);
1435        }
1436
1437      }
1438
1439      @Override
1440      public Base addChild(String name) throws FHIRException {
1441        if (name.equals("name")) {
1442          throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.name");
1443        }
1444        else if (name.equals("telecom")) {
1445          return addTelecom();
1446        }
1447        else
1448          return super.addChild(name);
1449      }
1450
1451      public ModuleMetadataContactComponent copy() {
1452        ModuleMetadataContactComponent dst = new ModuleMetadataContactComponent();
1453        copyValues(dst);
1454        dst.name = name == null ? null : name.copy();
1455        if (telecom != null) {
1456          dst.telecom = new ArrayList<ContactPoint>();
1457          for (ContactPoint i : telecom)
1458            dst.telecom.add(i.copy());
1459        };
1460        return dst;
1461      }
1462
1463      @Override
1464      public boolean equalsDeep(Base other) {
1465        if (!super.equalsDeep(other))
1466          return false;
1467        if (!(other instanceof ModuleMetadataContactComponent))
1468          return false;
1469        ModuleMetadataContactComponent o = (ModuleMetadataContactComponent) other;
1470        return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true);
1471      }
1472
1473      @Override
1474      public boolean equalsShallow(Base other) {
1475        if (!super.equalsShallow(other))
1476          return false;
1477        if (!(other instanceof ModuleMetadataContactComponent))
1478          return false;
1479        ModuleMetadataContactComponent o = (ModuleMetadataContactComponent) other;
1480        return compareValues(name, o.name, true);
1481      }
1482
1483      public boolean isEmpty() {
1484        return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty())
1485          ;
1486      }
1487
1488  public String fhirType() {
1489    return "ModuleMetadata.contact";
1490
1491  }
1492
1493  }
1494
1495    @Block()
1496    public static class ModuleMetadataRelatedResourceComponent extends Element implements IBaseDatatypeElement {
1497        /**
1498         * The type of related resource.
1499         */
1500        @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
1501        @Description(shortDefinition="documentation | justification | citation | predecessor | successor | derived-from", formalDefinition="The type of related resource." )
1502        protected Enumeration<ModuleMetadataResourceType> type;
1503
1504        /**
1505         * The document being referenced, represented as an attachment. This is exclusive with the resource element.
1506         */
1507        @Child(name = "document", type = {Attachment.class}, order=2, min=0, max=1, modifier=false, summary=false)
1508        @Description(shortDefinition="The related document", formalDefinition="The document being referenced, represented as an attachment. This is exclusive with the resource element." )
1509        protected Attachment document;
1510
1511        /**
1512         * The related resource, such as a library, value set, profile, or other module.
1513         */
1514        @Child(name = "resource", type = {}, order=3, min=0, max=1, modifier=false, summary=false)
1515        @Description(shortDefinition="The related resource", formalDefinition="The related resource, such as a library, value set, profile, or other module." )
1516        protected Reference resource;
1517
1518        /**
1519         * The actual object that is the target of the reference (The related resource, such as a library, value set, profile, or other module.)
1520         */
1521        protected Resource resourceTarget;
1522
1523        private static final long serialVersionUID = -1400982664L;
1524
1525    /**
1526     * Constructor
1527     */
1528      public ModuleMetadataRelatedResourceComponent() {
1529        super();
1530      }
1531
1532    /**
1533     * Constructor
1534     */
1535      public ModuleMetadataRelatedResourceComponent(Enumeration<ModuleMetadataResourceType> type) {
1536        super();
1537        this.type = type;
1538      }
1539
1540        /**
1541         * @return {@link #type} (The type of related resource.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1542         */
1543        public Enumeration<ModuleMetadataResourceType> getTypeElement() { 
1544          if (this.type == null)
1545            if (Configuration.errorOnAutoCreate())
1546              throw new Error("Attempt to auto-create ModuleMetadataRelatedResourceComponent.type");
1547            else if (Configuration.doAutoCreate())
1548              this.type = new Enumeration<ModuleMetadataResourceType>(new ModuleMetadataResourceTypeEnumFactory()); // bb
1549          return this.type;
1550        }
1551
1552        public boolean hasTypeElement() { 
1553          return this.type != null && !this.type.isEmpty();
1554        }
1555
1556        public boolean hasType() { 
1557          return this.type != null && !this.type.isEmpty();
1558        }
1559
1560        /**
1561         * @param value {@link #type} (The type of related resource.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1562         */
1563        public ModuleMetadataRelatedResourceComponent setTypeElement(Enumeration<ModuleMetadataResourceType> value) { 
1564          this.type = value;
1565          return this;
1566        }
1567
1568        /**
1569         * @return The type of related resource.
1570         */
1571        public ModuleMetadataResourceType getType() { 
1572          return this.type == null ? null : this.type.getValue();
1573        }
1574
1575        /**
1576         * @param value The type of related resource.
1577         */
1578        public ModuleMetadataRelatedResourceComponent setType(ModuleMetadataResourceType value) { 
1579            if (this.type == null)
1580              this.type = new Enumeration<ModuleMetadataResourceType>(new ModuleMetadataResourceTypeEnumFactory());
1581            this.type.setValue(value);
1582          return this;
1583        }
1584
1585        /**
1586         * @return {@link #document} (The document being referenced, represented as an attachment. This is exclusive with the resource element.)
1587         */
1588        public Attachment getDocument() { 
1589          if (this.document == null)
1590            if (Configuration.errorOnAutoCreate())
1591              throw new Error("Attempt to auto-create ModuleMetadataRelatedResourceComponent.document");
1592            else if (Configuration.doAutoCreate())
1593              this.document = new Attachment(); // cc
1594          return this.document;
1595        }
1596
1597        public boolean hasDocument() { 
1598          return this.document != null && !this.document.isEmpty();
1599        }
1600
1601        /**
1602         * @param value {@link #document} (The document being referenced, represented as an attachment. This is exclusive with the resource element.)
1603         */
1604        public ModuleMetadataRelatedResourceComponent setDocument(Attachment value) { 
1605          this.document = value;
1606          return this;
1607        }
1608
1609        /**
1610         * @return {@link #resource} (The related resource, such as a library, value set, profile, or other module.)
1611         */
1612        public Reference getResource() { 
1613          if (this.resource == null)
1614            if (Configuration.errorOnAutoCreate())
1615              throw new Error("Attempt to auto-create ModuleMetadataRelatedResourceComponent.resource");
1616            else if (Configuration.doAutoCreate())
1617              this.resource = new Reference(); // cc
1618          return this.resource;
1619        }
1620
1621        public boolean hasResource() { 
1622          return this.resource != null && !this.resource.isEmpty();
1623        }
1624
1625        /**
1626         * @param value {@link #resource} (The related resource, such as a library, value set, profile, or other module.)
1627         */
1628        public ModuleMetadataRelatedResourceComponent setResource(Reference value) { 
1629          this.resource = value;
1630          return this;
1631        }
1632
1633        /**
1634         * @return {@link #resource} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The related resource, such as a library, value set, profile, or other module.)
1635         */
1636        public Resource getResourceTarget() { 
1637          return this.resourceTarget;
1638        }
1639
1640        /**
1641         * @param value {@link #resource} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The related resource, such as a library, value set, profile, or other module.)
1642         */
1643        public ModuleMetadataRelatedResourceComponent setResourceTarget(Resource value) { 
1644          this.resourceTarget = value;
1645          return this;
1646        }
1647
1648        protected void listChildren(List<Property> childrenList) {
1649          super.listChildren(childrenList);
1650          childrenList.add(new Property("type", "code", "The type of related resource.", 0, java.lang.Integer.MAX_VALUE, type));
1651          childrenList.add(new Property("document", "Attachment", "The document being referenced, represented as an attachment. This is exclusive with the resource element.", 0, java.lang.Integer.MAX_VALUE, document));
1652          childrenList.add(new Property("resource", "Reference(Any)", "The related resource, such as a library, value set, profile, or other module.", 0, java.lang.Integer.MAX_VALUE, resource));
1653        }
1654
1655      @Override
1656      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1657        switch (hash) {
1658        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<ModuleMetadataResourceType>
1659        case 861720859: /*document*/ return this.document == null ? new Base[0] : new Base[] {this.document}; // Attachment
1660        case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Reference
1661        default: return super.getProperty(hash, name, checkValid);
1662        }
1663
1664      }
1665
1666      @Override
1667      public void setProperty(int hash, String name, Base value) throws FHIRException {
1668        switch (hash) {
1669        case 3575610: // type
1670          this.type = new ModuleMetadataResourceTypeEnumFactory().fromType(value); // Enumeration<ModuleMetadataResourceType>
1671          break;
1672        case 861720859: // document
1673          this.document = castToAttachment(value); // Attachment
1674          break;
1675        case -341064690: // resource
1676          this.resource = castToReference(value); // Reference
1677          break;
1678        default: super.setProperty(hash, name, value);
1679        }
1680
1681      }
1682
1683      @Override
1684      public void setProperty(String name, Base value) throws FHIRException {
1685        if (name.equals("type"))
1686          this.type = new ModuleMetadataResourceTypeEnumFactory().fromType(value); // Enumeration<ModuleMetadataResourceType>
1687        else if (name.equals("document"))
1688          this.document = castToAttachment(value); // Attachment
1689        else if (name.equals("resource"))
1690          this.resource = castToReference(value); // Reference
1691        else
1692          super.setProperty(name, value);
1693      }
1694
1695      @Override
1696      public Base makeProperty(int hash, String name) throws FHIRException {
1697        switch (hash) {
1698        case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration<ModuleMetadataResourceType>
1699        case 861720859:  return getDocument(); // Attachment
1700        case -341064690:  return getResource(); // Reference
1701        default: return super.makeProperty(hash, name);
1702        }
1703
1704      }
1705
1706      @Override
1707      public Base addChild(String name) throws FHIRException {
1708        if (name.equals("type")) {
1709          throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.type");
1710        }
1711        else if (name.equals("document")) {
1712          this.document = new Attachment();
1713          return this.document;
1714        }
1715        else if (name.equals("resource")) {
1716          this.resource = new Reference();
1717          return this.resource;
1718        }
1719        else
1720          return super.addChild(name);
1721      }
1722
1723      public ModuleMetadataRelatedResourceComponent copy() {
1724        ModuleMetadataRelatedResourceComponent dst = new ModuleMetadataRelatedResourceComponent();
1725        copyValues(dst);
1726        dst.type = type == null ? null : type.copy();
1727        dst.document = document == null ? null : document.copy();
1728        dst.resource = resource == null ? null : resource.copy();
1729        return dst;
1730      }
1731
1732      @Override
1733      public boolean equalsDeep(Base other) {
1734        if (!super.equalsDeep(other))
1735          return false;
1736        if (!(other instanceof ModuleMetadataRelatedResourceComponent))
1737          return false;
1738        ModuleMetadataRelatedResourceComponent o = (ModuleMetadataRelatedResourceComponent) other;
1739        return compareDeep(type, o.type, true) && compareDeep(document, o.document, true) && compareDeep(resource, o.resource, true)
1740          ;
1741      }
1742
1743      @Override
1744      public boolean equalsShallow(Base other) {
1745        if (!super.equalsShallow(other))
1746          return false;
1747        if (!(other instanceof ModuleMetadataRelatedResourceComponent))
1748          return false;
1749        ModuleMetadataRelatedResourceComponent o = (ModuleMetadataRelatedResourceComponent) other;
1750        return compareValues(type, o.type, true);
1751      }
1752
1753      public boolean isEmpty() {
1754        return super.isEmpty() && (type == null || type.isEmpty()) && (document == null || document.isEmpty())
1755           && (resource == null || resource.isEmpty());
1756      }
1757
1758  public String fhirType() {
1759    return "ModuleMetadata.relatedResource";
1760
1761  }
1762
1763  }
1764
1765    /**
1766     * An absolute URL that is used to identify this module when it is referenced. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this module definition is (or will be) published.
1767     */
1768    @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true)
1769    @Description(shortDefinition="Logical URL to reference this module", formalDefinition="An absolute URL that is used to identify this module when it is referenced. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this module definition is (or will be) published." )
1770    protected UriType url;
1771
1772    /**
1773     * A logical identifier for the module such as the CMS or NQF identifiers for a measure artifact.
1774     */
1775    @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1776    @Description(shortDefinition="Logical identifier(s) for the module", formalDefinition="A logical identifier for the module such as the CMS or NQF identifiers for a measure artifact." )
1777    protected List<Identifier> identifier;
1778
1779    /**
1780     * The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. Note that the version is required for non-experimental published artifact.
1781     */
1782    @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
1783    @Description(shortDefinition="The version of the module, if any", formalDefinition="The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. Note that the version is required for non-experimental published artifact." )
1784    protected StringType version;
1785
1786    /**
1787     * A machine-friendly name for the module. This name should be usable as an identifier for the module by machine processing applications such as code generation.
1788     */
1789    @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
1790    @Description(shortDefinition="A machine-friendly name for the module", formalDefinition="A machine-friendly name for the module. This name should be usable as an identifier for the module by machine processing applications such as code generation." )
1791    protected StringType name;
1792
1793    /**
1794     * A short, descriptive, user-friendly title for the module.
1795     */
1796    @Child(name = "title", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
1797    @Description(shortDefinition="A user-friendly title for the module", formalDefinition="A short, descriptive, user-friendly title for the module." )
1798    protected StringType title;
1799
1800    /**
1801     * Identifies the type of knowledge module, such as a rule, library, documentation template, or measure.
1802     */
1803    @Child(name = "type", type = {CodeType.class}, order=5, min=1, max=1, modifier=true, summary=true)
1804    @Description(shortDefinition="module | library | decision-support-rule | documentation-template | order-set", formalDefinition="Identifies the type of knowledge module, such as a rule, library, documentation template, or measure." )
1805    protected Enumeration<ModuleMetadataType> type;
1806
1807    /**
1808     * The status of the module.
1809     */
1810    @Child(name = "status", type = {CodeType.class}, order=6, min=1, max=1, modifier=true, summary=true)
1811    @Description(shortDefinition="draft | active | inactive", formalDefinition="The status of the module." )
1812    protected Enumeration<ModuleMetadataStatus> status;
1813
1814    /**
1815     * Determines whether the module was developed for testing purposes (or education/evaluation/marketing), and is not intended to be used in production environments.
1816     */
1817    @Child(name = "experimental", type = {BooleanType.class}, order=7, min=0, max=1, modifier=true, summary=true)
1818    @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="Determines whether the module was developed for testing purposes (or education/evaluation/marketing), and is not intended to be used in production environments." )
1819    protected BooleanType experimental;
1820
1821    /**
1822     * A free text natural language description of the module from the consumer's perspective.
1823     */
1824    @Child(name = "description", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false)
1825    @Description(shortDefinition="Natural language description of the module", formalDefinition="A free text natural language description of the module from the consumer's perspective." )
1826    protected StringType description;
1827
1828    /**
1829     * A brief description of the purpose of the module.
1830     */
1831    @Child(name = "purpose", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=false)
1832    @Description(shortDefinition="Describes the purpose of the module", formalDefinition="A brief description of the purpose of the module." )
1833    protected StringType purpose;
1834
1835    /**
1836     * A detailed description of how the module is used from a clinical perspective.
1837     */
1838    @Child(name = "usage", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false)
1839    @Description(shortDefinition="Describes the clinical usage of the module", formalDefinition="A detailed description of how the module is used from a clinical perspective." )
1840    protected StringType usage;
1841
1842    /**
1843     * The date on which the module was published.
1844     */
1845    @Child(name = "publicationDate", type = {DateType.class}, order=11, min=0, max=1, modifier=false, summary=false)
1846    @Description(shortDefinition="Publication date for this version of the module", formalDefinition="The date on which the module was published." )
1847    protected DateType publicationDate;
1848
1849    /**
1850     * The date on which the module content was last reviewed.
1851     */
1852    @Child(name = "lastReviewDate", type = {DateType.class}, order=12, min=0, max=1, modifier=false, summary=false)
1853    @Description(shortDefinition="Last review date for the module", formalDefinition="The date on which the module content was last reviewed." )
1854    protected DateType lastReviewDate;
1855
1856    /**
1857     * The period during which the module content is effective.
1858     */
1859    @Child(name = "effectivePeriod", type = {Period.class}, order=13, min=0, max=1, modifier=false, summary=false)
1860    @Description(shortDefinition="The effective date range for the module", formalDefinition="The period during which the module content is effective." )
1861    protected Period effectivePeriod;
1862
1863    /**
1864     * Specifies various attributes of the patient population for whom and/or environment of care in which the knowledge module is applicable.
1865     */
1866    @Child(name = "coverage", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1867    @Description(shortDefinition="Describes the context of use for this module", formalDefinition="Specifies various attributes of the patient population for whom and/or environment of care in which the knowledge module is applicable." )
1868    protected List<ModuleMetadataCoverageComponent> coverage;
1869
1870    /**
1871     * Clinical topics related to the content of the module.
1872     */
1873    @Child(name = "topic", type = {CodeableConcept.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1874    @Description(shortDefinition="Descriptional topics for the module", formalDefinition="Clinical topics related to the content of the module." )
1875    protected List<CodeableConcept> topic;
1876
1877    /**
1878     * A contributor to the content of the module, including authors, editors, reviewers, and endorsers.
1879     */
1880    @Child(name = "contributor", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1881    @Description(shortDefinition="A content contributor", formalDefinition="A contributor to the content of the module, including authors, editors, reviewers, and endorsers." )
1882    protected List<ModuleMetadataContributorComponent> contributor;
1883
1884    /**
1885     * The name of the individual or organization that published the module (also known as the steward for the module). This information is required for non-experimental published artifacts.
1886     */
1887    @Child(name = "publisher", type = {StringType.class}, order=17, min=0, max=1, modifier=false, summary=false)
1888    @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the module (also known as the steward for the module). This information is required for non-experimental published artifacts." )
1889    protected StringType publisher;
1890
1891    /**
1892     * Contacts to assist a user in finding and communicating with the publisher.
1893     */
1894    @Child(name = "contact", type = {}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1895    @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." )
1896    protected List<ModuleMetadataContactComponent> contact;
1897
1898    /**
1899     * A copyright statement relating to the module and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the module.
1900     */
1901    @Child(name = "copyright", type = {StringType.class}, order=19, min=0, max=1, modifier=false, summary=false)
1902    @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the module and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the module." )
1903    protected StringType copyright;
1904
1905    /**
1906     * Related resources such as additional documentation, justification, or bibliographic references.
1907     */
1908    @Child(name = "relatedResource", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1909    @Description(shortDefinition="Related resources for the module", formalDefinition="Related resources such as additional documentation, justification, or bibliographic references." )
1910    protected List<ModuleMetadataRelatedResourceComponent> relatedResource;
1911
1912    private static final long serialVersionUID = 1528493169L;
1913
1914  /**
1915   * Constructor
1916   */
1917    public ModuleMetadata() {
1918      super();
1919    }
1920
1921  /**
1922   * Constructor
1923   */
1924    public ModuleMetadata(Enumeration<ModuleMetadataType> type, Enumeration<ModuleMetadataStatus> status) {
1925      super();
1926      this.type = type;
1927      this.status = status;
1928    }
1929
1930    /**
1931     * @return {@link #url} (An absolute URL that is used to identify this module when it is referenced. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this module definition is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
1932     */
1933    public UriType getUrlElement() { 
1934      if (this.url == null)
1935        if (Configuration.errorOnAutoCreate())
1936          throw new Error("Attempt to auto-create ModuleMetadata.url");
1937        else if (Configuration.doAutoCreate())
1938          this.url = new UriType(); // bb
1939      return this.url;
1940    }
1941
1942    public boolean hasUrlElement() { 
1943      return this.url != null && !this.url.isEmpty();
1944    }
1945
1946    public boolean hasUrl() { 
1947      return this.url != null && !this.url.isEmpty();
1948    }
1949
1950    /**
1951     * @param value {@link #url} (An absolute URL that is used to identify this module when it is referenced. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this module definition is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
1952     */
1953    public ModuleMetadata setUrlElement(UriType value) { 
1954      this.url = value;
1955      return this;
1956    }
1957
1958    /**
1959     * @return An absolute URL that is used to identify this module when it is referenced. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this module definition is (or will be) published.
1960     */
1961    public String getUrl() { 
1962      return this.url == null ? null : this.url.getValue();
1963    }
1964
1965    /**
1966     * @param value An absolute URL that is used to identify this module when it is referenced. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this module definition is (or will be) published.
1967     */
1968    public ModuleMetadata setUrl(String value) { 
1969      if (Utilities.noString(value))
1970        this.url = null;
1971      else {
1972        if (this.url == null)
1973          this.url = new UriType();
1974        this.url.setValue(value);
1975      }
1976      return this;
1977    }
1978
1979    /**
1980     * @return {@link #identifier} (A logical identifier for the module such as the CMS or NQF identifiers for a measure artifact.)
1981     */
1982    public List<Identifier> getIdentifier() { 
1983      if (this.identifier == null)
1984        this.identifier = new ArrayList<Identifier>();
1985      return this.identifier;
1986    }
1987
1988    public boolean hasIdentifier() { 
1989      if (this.identifier == null)
1990        return false;
1991      for (Identifier item : this.identifier)
1992        if (!item.isEmpty())
1993          return true;
1994      return false;
1995    }
1996
1997    /**
1998     * @return {@link #identifier} (A logical identifier for the module such as the CMS or NQF identifiers for a measure artifact.)
1999     */
2000    // syntactic sugar
2001    public Identifier addIdentifier() { //3
2002      Identifier t = new Identifier();
2003      if (this.identifier == null)
2004        this.identifier = new ArrayList<Identifier>();
2005      this.identifier.add(t);
2006      return t;
2007    }
2008
2009    // syntactic sugar
2010    public ModuleMetadata addIdentifier(Identifier t) { //3
2011      if (t == null)
2012        return this;
2013      if (this.identifier == null)
2014        this.identifier = new ArrayList<Identifier>();
2015      this.identifier.add(t);
2016      return this;
2017    }
2018
2019    /**
2020     * @return {@link #version} (The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. Note that the version is required for non-experimental published artifact.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
2021     */
2022    public StringType getVersionElement() { 
2023      if (this.version == null)
2024        if (Configuration.errorOnAutoCreate())
2025          throw new Error("Attempt to auto-create ModuleMetadata.version");
2026        else if (Configuration.doAutoCreate())
2027          this.version = new StringType(); // bb
2028      return this.version;
2029    }
2030
2031    public boolean hasVersionElement() { 
2032      return this.version != null && !this.version.isEmpty();
2033    }
2034
2035    public boolean hasVersion() { 
2036      return this.version != null && !this.version.isEmpty();
2037    }
2038
2039    /**
2040     * @param value {@link #version} (The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. Note that the version is required for non-experimental published artifact.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
2041     */
2042    public ModuleMetadata setVersionElement(StringType value) { 
2043      this.version = value;
2044      return this;
2045    }
2046
2047    /**
2048     * @return The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. Note that the version is required for non-experimental published artifact.
2049     */
2050    public String getVersion() { 
2051      return this.version == null ? null : this.version.getValue();
2052    }
2053
2054    /**
2055     * @param value The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. Note that the version is required for non-experimental published artifact.
2056     */
2057    public ModuleMetadata setVersion(String value) { 
2058      if (Utilities.noString(value))
2059        this.version = null;
2060      else {
2061        if (this.version == null)
2062          this.version = new StringType();
2063        this.version.setValue(value);
2064      }
2065      return this;
2066    }
2067
2068    /**
2069     * @return {@link #name} (A machine-friendly name for the module. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2070     */
2071    public StringType getNameElement() { 
2072      if (this.name == null)
2073        if (Configuration.errorOnAutoCreate())
2074          throw new Error("Attempt to auto-create ModuleMetadata.name");
2075        else if (Configuration.doAutoCreate())
2076          this.name = new StringType(); // bb
2077      return this.name;
2078    }
2079
2080    public boolean hasNameElement() { 
2081      return this.name != null && !this.name.isEmpty();
2082    }
2083
2084    public boolean hasName() { 
2085      return this.name != null && !this.name.isEmpty();
2086    }
2087
2088    /**
2089     * @param value {@link #name} (A machine-friendly name for the module. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2090     */
2091    public ModuleMetadata setNameElement(StringType value) { 
2092      this.name = value;
2093      return this;
2094    }
2095
2096    /**
2097     * @return A machine-friendly name for the module. This name should be usable as an identifier for the module by machine processing applications such as code generation.
2098     */
2099    public String getName() { 
2100      return this.name == null ? null : this.name.getValue();
2101    }
2102
2103    /**
2104     * @param value A machine-friendly name for the module. This name should be usable as an identifier for the module by machine processing applications such as code generation.
2105     */
2106    public ModuleMetadata setName(String value) { 
2107      if (Utilities.noString(value))
2108        this.name = null;
2109      else {
2110        if (this.name == null)
2111          this.name = new StringType();
2112        this.name.setValue(value);
2113      }
2114      return this;
2115    }
2116
2117    /**
2118     * @return {@link #title} (A short, descriptive, user-friendly title for the module.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
2119     */
2120    public StringType getTitleElement() { 
2121      if (this.title == null)
2122        if (Configuration.errorOnAutoCreate())
2123          throw new Error("Attempt to auto-create ModuleMetadata.title");
2124        else if (Configuration.doAutoCreate())
2125          this.title = new StringType(); // bb
2126      return this.title;
2127    }
2128
2129    public boolean hasTitleElement() { 
2130      return this.title != null && !this.title.isEmpty();
2131    }
2132
2133    public boolean hasTitle() { 
2134      return this.title != null && !this.title.isEmpty();
2135    }
2136
2137    /**
2138     * @param value {@link #title} (A short, descriptive, user-friendly title for the module.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
2139     */
2140    public ModuleMetadata setTitleElement(StringType value) { 
2141      this.title = value;
2142      return this;
2143    }
2144
2145    /**
2146     * @return A short, descriptive, user-friendly title for the module.
2147     */
2148    public String getTitle() { 
2149      return this.title == null ? null : this.title.getValue();
2150    }
2151
2152    /**
2153     * @param value A short, descriptive, user-friendly title for the module.
2154     */
2155    public ModuleMetadata setTitle(String value) { 
2156      if (Utilities.noString(value))
2157        this.title = null;
2158      else {
2159        if (this.title == null)
2160          this.title = new StringType();
2161        this.title.setValue(value);
2162      }
2163      return this;
2164    }
2165
2166    /**
2167     * @return {@link #type} (Identifies the type of knowledge module, such as a rule, library, documentation template, or measure.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
2168     */
2169    public Enumeration<ModuleMetadataType> getTypeElement() { 
2170      if (this.type == null)
2171        if (Configuration.errorOnAutoCreate())
2172          throw new Error("Attempt to auto-create ModuleMetadata.type");
2173        else if (Configuration.doAutoCreate())
2174          this.type = new Enumeration<ModuleMetadataType>(new ModuleMetadataTypeEnumFactory()); // bb
2175      return this.type;
2176    }
2177
2178    public boolean hasTypeElement() { 
2179      return this.type != null && !this.type.isEmpty();
2180    }
2181
2182    public boolean hasType() { 
2183      return this.type != null && !this.type.isEmpty();
2184    }
2185
2186    /**
2187     * @param value {@link #type} (Identifies the type of knowledge module, such as a rule, library, documentation template, or measure.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
2188     */
2189    public ModuleMetadata setTypeElement(Enumeration<ModuleMetadataType> value) { 
2190      this.type = value;
2191      return this;
2192    }
2193
2194    /**
2195     * @return Identifies the type of knowledge module, such as a rule, library, documentation template, or measure.
2196     */
2197    public ModuleMetadataType getType() { 
2198      return this.type == null ? null : this.type.getValue();
2199    }
2200
2201    /**
2202     * @param value Identifies the type of knowledge module, such as a rule, library, documentation template, or measure.
2203     */
2204    public ModuleMetadata setType(ModuleMetadataType value) { 
2205        if (this.type == null)
2206          this.type = new Enumeration<ModuleMetadataType>(new ModuleMetadataTypeEnumFactory());
2207        this.type.setValue(value);
2208      return this;
2209    }
2210
2211    /**
2212     * @return {@link #status} (The status of the module.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2213     */
2214    public Enumeration<ModuleMetadataStatus> getStatusElement() { 
2215      if (this.status == null)
2216        if (Configuration.errorOnAutoCreate())
2217          throw new Error("Attempt to auto-create ModuleMetadata.status");
2218        else if (Configuration.doAutoCreate())
2219          this.status = new Enumeration<ModuleMetadataStatus>(new ModuleMetadataStatusEnumFactory()); // bb
2220      return this.status;
2221    }
2222
2223    public boolean hasStatusElement() { 
2224      return this.status != null && !this.status.isEmpty();
2225    }
2226
2227    public boolean hasStatus() { 
2228      return this.status != null && !this.status.isEmpty();
2229    }
2230
2231    /**
2232     * @param value {@link #status} (The status of the module.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2233     */
2234    public ModuleMetadata setStatusElement(Enumeration<ModuleMetadataStatus> value) { 
2235      this.status = value;
2236      return this;
2237    }
2238
2239    /**
2240     * @return The status of the module.
2241     */
2242    public ModuleMetadataStatus getStatus() { 
2243      return this.status == null ? null : this.status.getValue();
2244    }
2245
2246    /**
2247     * @param value The status of the module.
2248     */
2249    public ModuleMetadata setStatus(ModuleMetadataStatus value) { 
2250        if (this.status == null)
2251          this.status = new Enumeration<ModuleMetadataStatus>(new ModuleMetadataStatusEnumFactory());
2252        this.status.setValue(value);
2253      return this;
2254    }
2255
2256    /**
2257     * @return {@link #experimental} (Determines whether the module was developed for testing purposes (or education/evaluation/marketing), and is not intended to be used in production environments.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
2258     */
2259    public BooleanType getExperimentalElement() { 
2260      if (this.experimental == null)
2261        if (Configuration.errorOnAutoCreate())
2262          throw new Error("Attempt to auto-create ModuleMetadata.experimental");
2263        else if (Configuration.doAutoCreate())
2264          this.experimental = new BooleanType(); // bb
2265      return this.experimental;
2266    }
2267
2268    public boolean hasExperimentalElement() { 
2269      return this.experimental != null && !this.experimental.isEmpty();
2270    }
2271
2272    public boolean hasExperimental() { 
2273      return this.experimental != null && !this.experimental.isEmpty();
2274    }
2275
2276    /**
2277     * @param value {@link #experimental} (Determines whether the module was developed for testing purposes (or education/evaluation/marketing), and is not intended to be used in production environments.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
2278     */
2279    public ModuleMetadata setExperimentalElement(BooleanType value) { 
2280      this.experimental = value;
2281      return this;
2282    }
2283
2284    /**
2285     * @return Determines whether the module was developed for testing purposes (or education/evaluation/marketing), and is not intended to be used in production environments.
2286     */
2287    public boolean getExperimental() { 
2288      return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
2289    }
2290
2291    /**
2292     * @param value Determines whether the module was developed for testing purposes (or education/evaluation/marketing), and is not intended to be used in production environments.
2293     */
2294    public ModuleMetadata setExperimental(boolean value) { 
2295        if (this.experimental == null)
2296          this.experimental = new BooleanType();
2297        this.experimental.setValue(value);
2298      return this;
2299    }
2300
2301    /**
2302     * @return {@link #description} (A free text natural language description of the module from the consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2303     */
2304    public StringType getDescriptionElement() { 
2305      if (this.description == null)
2306        if (Configuration.errorOnAutoCreate())
2307          throw new Error("Attempt to auto-create ModuleMetadata.description");
2308        else if (Configuration.doAutoCreate())
2309          this.description = new StringType(); // bb
2310      return this.description;
2311    }
2312
2313    public boolean hasDescriptionElement() { 
2314      return this.description != null && !this.description.isEmpty();
2315    }
2316
2317    public boolean hasDescription() { 
2318      return this.description != null && !this.description.isEmpty();
2319    }
2320
2321    /**
2322     * @param value {@link #description} (A free text natural language description of the module from the consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2323     */
2324    public ModuleMetadata setDescriptionElement(StringType value) { 
2325      this.description = value;
2326      return this;
2327    }
2328
2329    /**
2330     * @return A free text natural language description of the module from the consumer's perspective.
2331     */
2332    public String getDescription() { 
2333      return this.description == null ? null : this.description.getValue();
2334    }
2335
2336    /**
2337     * @param value A free text natural language description of the module from the consumer's perspective.
2338     */
2339    public ModuleMetadata setDescription(String value) { 
2340      if (Utilities.noString(value))
2341        this.description = null;
2342      else {
2343        if (this.description == null)
2344          this.description = new StringType();
2345        this.description.setValue(value);
2346      }
2347      return this;
2348    }
2349
2350    /**
2351     * @return {@link #purpose} (A brief description of the purpose of the module.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
2352     */
2353    public StringType getPurposeElement() { 
2354      if (this.purpose == null)
2355        if (Configuration.errorOnAutoCreate())
2356          throw new Error("Attempt to auto-create ModuleMetadata.purpose");
2357        else if (Configuration.doAutoCreate())
2358          this.purpose = new StringType(); // bb
2359      return this.purpose;
2360    }
2361
2362    public boolean hasPurposeElement() { 
2363      return this.purpose != null && !this.purpose.isEmpty();
2364    }
2365
2366    public boolean hasPurpose() { 
2367      return this.purpose != null && !this.purpose.isEmpty();
2368    }
2369
2370    /**
2371     * @param value {@link #purpose} (A brief description of the purpose of the module.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
2372     */
2373    public ModuleMetadata setPurposeElement(StringType value) { 
2374      this.purpose = value;
2375      return this;
2376    }
2377
2378    /**
2379     * @return A brief description of the purpose of the module.
2380     */
2381    public String getPurpose() { 
2382      return this.purpose == null ? null : this.purpose.getValue();
2383    }
2384
2385    /**
2386     * @param value A brief description of the purpose of the module.
2387     */
2388    public ModuleMetadata setPurpose(String value) { 
2389      if (Utilities.noString(value))
2390        this.purpose = null;
2391      else {
2392        if (this.purpose == null)
2393          this.purpose = new StringType();
2394        this.purpose.setValue(value);
2395      }
2396      return this;
2397    }
2398
2399    /**
2400     * @return {@link #usage} (A detailed description of how the module is used from a clinical perspective.). This is the underlying object with id, value and extensions. The accessor "getUsage" gives direct access to the value
2401     */
2402    public StringType getUsageElement() { 
2403      if (this.usage == null)
2404        if (Configuration.errorOnAutoCreate())
2405          throw new Error("Attempt to auto-create ModuleMetadata.usage");
2406        else if (Configuration.doAutoCreate())
2407          this.usage = new StringType(); // bb
2408      return this.usage;
2409    }
2410
2411    public boolean hasUsageElement() { 
2412      return this.usage != null && !this.usage.isEmpty();
2413    }
2414
2415    public boolean hasUsage() { 
2416      return this.usage != null && !this.usage.isEmpty();
2417    }
2418
2419    /**
2420     * @param value {@link #usage} (A detailed description of how the module is used from a clinical perspective.). This is the underlying object with id, value and extensions. The accessor "getUsage" gives direct access to the value
2421     */
2422    public ModuleMetadata setUsageElement(StringType value) { 
2423      this.usage = value;
2424      return this;
2425    }
2426
2427    /**
2428     * @return A detailed description of how the module is used from a clinical perspective.
2429     */
2430    public String getUsage() { 
2431      return this.usage == null ? null : this.usage.getValue();
2432    }
2433
2434    /**
2435     * @param value A detailed description of how the module is used from a clinical perspective.
2436     */
2437    public ModuleMetadata setUsage(String value) { 
2438      if (Utilities.noString(value))
2439        this.usage = null;
2440      else {
2441        if (this.usage == null)
2442          this.usage = new StringType();
2443        this.usage.setValue(value);
2444      }
2445      return this;
2446    }
2447
2448    /**
2449     * @return {@link #publicationDate} (The date on which the module was published.). This is the underlying object with id, value and extensions. The accessor "getPublicationDate" gives direct access to the value
2450     */
2451    public DateType getPublicationDateElement() { 
2452      if (this.publicationDate == null)
2453        if (Configuration.errorOnAutoCreate())
2454          throw new Error("Attempt to auto-create ModuleMetadata.publicationDate");
2455        else if (Configuration.doAutoCreate())
2456          this.publicationDate = new DateType(); // bb
2457      return this.publicationDate;
2458    }
2459
2460    public boolean hasPublicationDateElement() { 
2461      return this.publicationDate != null && !this.publicationDate.isEmpty();
2462    }
2463
2464    public boolean hasPublicationDate() { 
2465      return this.publicationDate != null && !this.publicationDate.isEmpty();
2466    }
2467
2468    /**
2469     * @param value {@link #publicationDate} (The date on which the module was published.). This is the underlying object with id, value and extensions. The accessor "getPublicationDate" gives direct access to the value
2470     */
2471    public ModuleMetadata setPublicationDateElement(DateType value) { 
2472      this.publicationDate = value;
2473      return this;
2474    }
2475
2476    /**
2477     * @return The date on which the module was published.
2478     */
2479    public Date getPublicationDate() { 
2480      return this.publicationDate == null ? null : this.publicationDate.getValue();
2481    }
2482
2483    /**
2484     * @param value The date on which the module was published.
2485     */
2486    public ModuleMetadata setPublicationDate(Date value) { 
2487      if (value == null)
2488        this.publicationDate = null;
2489      else {
2490        if (this.publicationDate == null)
2491          this.publicationDate = new DateType();
2492        this.publicationDate.setValue(value);
2493      }
2494      return this;
2495    }
2496
2497    /**
2498     * @return {@link #lastReviewDate} (The date on which the module content was last reviewed.). This is the underlying object with id, value and extensions. The accessor "getLastReviewDate" gives direct access to the value
2499     */
2500    public DateType getLastReviewDateElement() { 
2501      if (this.lastReviewDate == null)
2502        if (Configuration.errorOnAutoCreate())
2503          throw new Error("Attempt to auto-create ModuleMetadata.lastReviewDate");
2504        else if (Configuration.doAutoCreate())
2505          this.lastReviewDate = new DateType(); // bb
2506      return this.lastReviewDate;
2507    }
2508
2509    public boolean hasLastReviewDateElement() { 
2510      return this.lastReviewDate != null && !this.lastReviewDate.isEmpty();
2511    }
2512
2513    public boolean hasLastReviewDate() { 
2514      return this.lastReviewDate != null && !this.lastReviewDate.isEmpty();
2515    }
2516
2517    /**
2518     * @param value {@link #lastReviewDate} (The date on which the module content was last reviewed.). This is the underlying object with id, value and extensions. The accessor "getLastReviewDate" gives direct access to the value
2519     */
2520    public ModuleMetadata setLastReviewDateElement(DateType value) { 
2521      this.lastReviewDate = value;
2522      return this;
2523    }
2524
2525    /**
2526     * @return The date on which the module content was last reviewed.
2527     */
2528    public Date getLastReviewDate() { 
2529      return this.lastReviewDate == null ? null : this.lastReviewDate.getValue();
2530    }
2531
2532    /**
2533     * @param value The date on which the module content was last reviewed.
2534     */
2535    public ModuleMetadata setLastReviewDate(Date value) { 
2536      if (value == null)
2537        this.lastReviewDate = null;
2538      else {
2539        if (this.lastReviewDate == null)
2540          this.lastReviewDate = new DateType();
2541        this.lastReviewDate.setValue(value);
2542      }
2543      return this;
2544    }
2545
2546    /**
2547     * @return {@link #effectivePeriod} (The period during which the module content is effective.)
2548     */
2549    public Period getEffectivePeriod() { 
2550      if (this.effectivePeriod == null)
2551        if (Configuration.errorOnAutoCreate())
2552          throw new Error("Attempt to auto-create ModuleMetadata.effectivePeriod");
2553        else if (Configuration.doAutoCreate())
2554          this.effectivePeriod = new Period(); // cc
2555      return this.effectivePeriod;
2556    }
2557
2558    public boolean hasEffectivePeriod() { 
2559      return this.effectivePeriod != null && !this.effectivePeriod.isEmpty();
2560    }
2561
2562    /**
2563     * @param value {@link #effectivePeriod} (The period during which the module content is effective.)
2564     */
2565    public ModuleMetadata setEffectivePeriod(Period value) { 
2566      this.effectivePeriod = value;
2567      return this;
2568    }
2569
2570    /**
2571     * @return {@link #coverage} (Specifies various attributes of the patient population for whom and/or environment of care in which, the knowledge module is applicable.)
2572     */
2573    public List<ModuleMetadataCoverageComponent> getCoverage() { 
2574      if (this.coverage == null)
2575        this.coverage = new ArrayList<ModuleMetadataCoverageComponent>();
2576      return this.coverage;
2577    }
2578
2579    public boolean hasCoverage() { 
2580      if (this.coverage == null)
2581        return false;
2582      for (ModuleMetadataCoverageComponent item : this.coverage)
2583        if (!item.isEmpty())
2584          return true;
2585      return false;
2586    }
2587
2588    /**
2589     * @return {@link #coverage} (Specifies various attributes of the patient population for whom and/or environment of care in which, the knowledge module is applicable.)
2590     */
2591    // syntactic sugar
2592    public ModuleMetadataCoverageComponent addCoverage() { //3
2593      ModuleMetadataCoverageComponent t = new ModuleMetadataCoverageComponent();
2594      if (this.coverage == null)
2595        this.coverage = new ArrayList<ModuleMetadataCoverageComponent>();
2596      this.coverage.add(t);
2597      return t;
2598    }
2599
2600    // syntactic sugar
2601    public ModuleMetadata addCoverage(ModuleMetadataCoverageComponent t) { //3
2602      if (t == null)
2603        return this;
2604      if (this.coverage == null)
2605        this.coverage = new ArrayList<ModuleMetadataCoverageComponent>();
2606      this.coverage.add(t);
2607      return this;
2608    }
2609
2610    /**
2611     * @return {@link #topic} (Clinical topics related to the content of the module.)
2612     */
2613    public List<CodeableConcept> getTopic() { 
2614      if (this.topic == null)
2615        this.topic = new ArrayList<CodeableConcept>();
2616      return this.topic;
2617    }
2618
2619    public boolean hasTopic() { 
2620      if (this.topic == null)
2621        return false;
2622      for (CodeableConcept item : this.topic)
2623        if (!item.isEmpty())
2624          return true;
2625      return false;
2626    }
2627
2628    /**
2629     * @return {@link #topic} (Clinical topics related to the content of the module.)
2630     */
2631    // syntactic sugar
2632    public CodeableConcept addTopic() { //3
2633      CodeableConcept t = new CodeableConcept();
2634      if (this.topic == null)
2635        this.topic = new ArrayList<CodeableConcept>();
2636      this.topic.add(t);
2637      return t;
2638    }
2639
2640    // syntactic sugar
2641    public ModuleMetadata addTopic(CodeableConcept t) { //3
2642      if (t == null)
2643        return this;
2644      if (this.topic == null)
2645        this.topic = new ArrayList<CodeableConcept>();
2646      this.topic.add(t);
2647      return this;
2648    }
2649
2650    /**
2651     * @return {@link #contributor} (A contributor to the content of the module, including authors, editors, reviewers, and endorsers.)
2652     */
2653    public List<ModuleMetadataContributorComponent> getContributor() { 
2654      if (this.contributor == null)
2655        this.contributor = new ArrayList<ModuleMetadataContributorComponent>();
2656      return this.contributor;
2657    }
2658
2659    public boolean hasContributor() { 
2660      if (this.contributor == null)
2661        return false;
2662      for (ModuleMetadataContributorComponent item : this.contributor)
2663        if (!item.isEmpty())
2664          return true;
2665      return false;
2666    }
2667
2668    /**
2669     * @return {@link #contributor} (A contributor to the content of the module, including authors, editors, reviewers, and endorsers.)
2670     */
2671    // syntactic sugar
2672    public ModuleMetadataContributorComponent addContributor() { //3
2673      ModuleMetadataContributorComponent t = new ModuleMetadataContributorComponent();
2674      if (this.contributor == null)
2675        this.contributor = new ArrayList<ModuleMetadataContributorComponent>();
2676      this.contributor.add(t);
2677      return t;
2678    }
2679
2680    // syntactic sugar
2681    public ModuleMetadata addContributor(ModuleMetadataContributorComponent t) { //3
2682      if (t == null)
2683        return this;
2684      if (this.contributor == null)
2685        this.contributor = new ArrayList<ModuleMetadataContributorComponent>();
2686      this.contributor.add(t);
2687      return this;
2688    }
2689
2690    /**
2691     * @return {@link #publisher} (The name of the individual or organization that published the module (also known as the steward for the module). This information is required for non-experimental published artifacts.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
2692     */
2693    public StringType getPublisherElement() { 
2694      if (this.publisher == null)
2695        if (Configuration.errorOnAutoCreate())
2696          throw new Error("Attempt to auto-create ModuleMetadata.publisher");
2697        else if (Configuration.doAutoCreate())
2698          this.publisher = new StringType(); // bb
2699      return this.publisher;
2700    }
2701
2702    public boolean hasPublisherElement() { 
2703      return this.publisher != null && !this.publisher.isEmpty();
2704    }
2705
2706    public boolean hasPublisher() { 
2707      return this.publisher != null && !this.publisher.isEmpty();
2708    }
2709
2710    /**
2711     * @param value {@link #publisher} (The name of the individual or organization that published the module (also known as the steward for the module). This information is required for non-experimental published artifacts.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
2712     */
2713    public ModuleMetadata setPublisherElement(StringType value) { 
2714      this.publisher = value;
2715      return this;
2716    }
2717
2718    /**
2719     * @return The name of the individual or organization that published the module (also known as the steward for the module). This information is required for non-experimental published artifacts.
2720     */
2721    public String getPublisher() { 
2722      return this.publisher == null ? null : this.publisher.getValue();
2723    }
2724
2725    /**
2726     * @param value The name of the individual or organization that published the module (also known as the steward for the module). This information is required for non-experimental published artifacts.
2727     */
2728    public ModuleMetadata setPublisher(String value) { 
2729      if (Utilities.noString(value))
2730        this.publisher = null;
2731      else {
2732        if (this.publisher == null)
2733          this.publisher = new StringType();
2734        this.publisher.setValue(value);
2735      }
2736      return this;
2737    }
2738
2739    /**
2740     * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.)
2741     */
2742    public List<ModuleMetadataContactComponent> getContact() { 
2743      if (this.contact == null)
2744        this.contact = new ArrayList<ModuleMetadataContactComponent>();
2745      return this.contact;
2746    }
2747
2748    public boolean hasContact() { 
2749      if (this.contact == null)
2750        return false;
2751      for (ModuleMetadataContactComponent item : this.contact)
2752        if (!item.isEmpty())
2753          return true;
2754      return false;
2755    }
2756
2757    /**
2758     * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.)
2759     */
2760    // syntactic sugar
2761    public ModuleMetadataContactComponent addContact() { //3
2762      ModuleMetadataContactComponent t = new ModuleMetadataContactComponent();
2763      if (this.contact == null)
2764        this.contact = new ArrayList<ModuleMetadataContactComponent>();
2765      this.contact.add(t);
2766      return t;
2767    }
2768
2769    // syntactic sugar
2770    public ModuleMetadata addContact(ModuleMetadataContactComponent t) { //3
2771      if (t == null)
2772        return this;
2773      if (this.contact == null)
2774        this.contact = new ArrayList<ModuleMetadataContactComponent>();
2775      this.contact.add(t);
2776      return this;
2777    }
2778
2779    /**
2780     * @return {@link #copyright} (A copyright statement relating to the module and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the module.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
2781     */
2782    public StringType getCopyrightElement() { 
2783      if (this.copyright == null)
2784        if (Configuration.errorOnAutoCreate())
2785          throw new Error("Attempt to auto-create ModuleMetadata.copyright");
2786        else if (Configuration.doAutoCreate())
2787          this.copyright = new StringType(); // bb
2788      return this.copyright;
2789    }
2790
2791    public boolean hasCopyrightElement() { 
2792      return this.copyright != null && !this.copyright.isEmpty();
2793    }
2794
2795    public boolean hasCopyright() { 
2796      return this.copyright != null && !this.copyright.isEmpty();
2797    }
2798
2799    /**
2800     * @param value {@link #copyright} (A copyright statement relating to the module and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the module.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
2801     */
2802    public ModuleMetadata setCopyrightElement(StringType value) { 
2803      this.copyright = value;
2804      return this;
2805    }
2806
2807    /**
2808     * @return A copyright statement relating to the module and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the module.
2809     */
2810    public String getCopyright() { 
2811      return this.copyright == null ? null : this.copyright.getValue();
2812    }
2813
2814    /**
2815     * @param value A copyright statement relating to the module and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the module.
2816     */
2817    public ModuleMetadata setCopyright(String value) { 
2818      if (Utilities.noString(value))
2819        this.copyright = null;
2820      else {
2821        if (this.copyright == null)
2822          this.copyright = new StringType();
2823        this.copyright.setValue(value);
2824      }
2825      return this;
2826    }
2827
2828    /**
2829     * @return {@link #relatedResource} (Related resources such as additional documentation, justification, or bibliographic references.)
2830     */
2831    public List<ModuleMetadataRelatedResourceComponent> getRelatedResource() { 
2832      if (this.relatedResource == null)
2833        this.relatedResource = new ArrayList<ModuleMetadataRelatedResourceComponent>();
2834      return this.relatedResource;
2835    }
2836
2837    public boolean hasRelatedResource() { 
2838      if (this.relatedResource == null)
2839        return false;
2840      for (ModuleMetadataRelatedResourceComponent item : this.relatedResource)
2841        if (!item.isEmpty())
2842          return true;
2843      return false;
2844    }
2845
2846    /**
2847     * @return {@link #relatedResource} (Related resources such as additional documentation, justification, or bibliographic references.)
2848     */
2849    // syntactic sugar
2850    public ModuleMetadataRelatedResourceComponent addRelatedResource() { //3
2851      ModuleMetadataRelatedResourceComponent t = new ModuleMetadataRelatedResourceComponent();
2852      if (this.relatedResource == null)
2853        this.relatedResource = new ArrayList<ModuleMetadataRelatedResourceComponent>();
2854      this.relatedResource.add(t);
2855      return t;
2856    }
2857
2858    // syntactic sugar
2859    public ModuleMetadata addRelatedResource(ModuleMetadataRelatedResourceComponent t) { //3
2860      if (t == null)
2861        return this;
2862      if (this.relatedResource == null)
2863        this.relatedResource = new ArrayList<ModuleMetadataRelatedResourceComponent>();
2864      this.relatedResource.add(t);
2865      return this;
2866    }
2867
2868      protected void listChildren(List<Property> childrenList) {
2869        super.listChildren(childrenList);
2870        childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this module when it is referenced. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this module definition is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url));
2871        childrenList.add(new Property("identifier", "Identifier", "A logical identifier for the module such as the CMS or NQF identifiers for a measure artifact.", 0, java.lang.Integer.MAX_VALUE, identifier));
2872        childrenList.add(new Property("version", "string", "The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. Note that the version is required for non-experimental published artifact.", 0, java.lang.Integer.MAX_VALUE, version));
2873        childrenList.add(new Property("name", "string", "A machine-friendly name for the module. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, java.lang.Integer.MAX_VALUE, name));
2874        childrenList.add(new Property("title", "string", "A short, descriptive, user-friendly title for the module.", 0, java.lang.Integer.MAX_VALUE, title));
2875        childrenList.add(new Property("type", "code", "Identifies the type of knowledge module, such as a rule, library, documentation template, or measure.", 0, java.lang.Integer.MAX_VALUE, type));
2876        childrenList.add(new Property("status", "code", "The status of the module.", 0, java.lang.Integer.MAX_VALUE, status));
2877        childrenList.add(new Property("experimental", "boolean", "Determines whether the module was developed for testing purposes (or education/evaluation/marketing), and is not intended to be used in production environments.", 0, java.lang.Integer.MAX_VALUE, experimental));
2878        childrenList.add(new Property("description", "string", "A free text natural language description of the module from the consumer's perspective.", 0, java.lang.Integer.MAX_VALUE, description));
2879        childrenList.add(new Property("purpose", "string", "A brief description of the purpose of the module.", 0, java.lang.Integer.MAX_VALUE, purpose));
2880        childrenList.add(new Property("usage", "string", "A detailed description of how the module is used from a clinical perspective.", 0, java.lang.Integer.MAX_VALUE, usage));
2881        childrenList.add(new Property("publicationDate", "date", "The date on which the module was published.", 0, java.lang.Integer.MAX_VALUE, publicationDate));
2882        childrenList.add(new Property("lastReviewDate", "date", "The date on which the module content was last reviewed.", 0, java.lang.Integer.MAX_VALUE, lastReviewDate));
2883        childrenList.add(new Property("effectivePeriod", "Period", "The period during which the module content is effective.", 0, java.lang.Integer.MAX_VALUE, effectivePeriod));
2884        childrenList.add(new Property("coverage", "", "Specifies various attributes of the patient population for whom and/or environment of care in which, the knowledge module is applicable.", 0, java.lang.Integer.MAX_VALUE, coverage));
2885        childrenList.add(new Property("topic", "CodeableConcept", "Clinical topics related to the content of the module.", 0, java.lang.Integer.MAX_VALUE, topic));
2886        childrenList.add(new Property("contributor", "", "A contributor to the content of the module, including authors, editors, reviewers, and endorsers.", 0, java.lang.Integer.MAX_VALUE, contributor));
2887        childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the module (also known as the steward for the module). This information is required for non-experimental published artifacts.", 0, java.lang.Integer.MAX_VALUE, publisher));
2888        childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact));
2889        childrenList.add(new Property("copyright", "string", "A copyright statement relating to the module and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the module.", 0, java.lang.Integer.MAX_VALUE, copyright));
2890        childrenList.add(new Property("relatedResource", "", "Related resources such as additional documentation, justification, or bibliographic references.", 0, java.lang.Integer.MAX_VALUE, relatedResource));
2891      }
2892
2893      @Override
2894      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2895        switch (hash) {
2896        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
2897        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2898        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
2899        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
2900        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
2901        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<ModuleMetadataType>
2902        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<ModuleMetadataStatus>
2903        case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType
2904        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
2905        case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // StringType
2906        case 111574433: /*usage*/ return this.usage == null ? new Base[0] : new Base[] {this.usage}; // StringType
2907        case 1470566394: /*publicationDate*/ return this.publicationDate == null ? new Base[0] : new Base[] {this.publicationDate}; // DateType
2908        case -1687512484: /*lastReviewDate*/ return this.lastReviewDate == null ? new Base[0] : new Base[] {this.lastReviewDate}; // DateType
2909        case -403934648: /*effectivePeriod*/ return this.effectivePeriod == null ? new Base[0] : new Base[] {this.effectivePeriod}; // Period
2910        case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : this.coverage.toArray(new Base[this.coverage.size()]); // ModuleMetadataCoverageComponent
2911        case 110546223: /*topic*/ return this.topic == null ? new Base[0] : this.topic.toArray(new Base[this.topic.size()]); // CodeableConcept
2912        case -1895276325: /*contributor*/ return this.contributor == null ? new Base[0] : this.contributor.toArray(new Base[this.contributor.size()]); // ModuleMetadataContributorComponent
2913        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType
2914        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ModuleMetadataContactComponent
2915        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // StringType
2916        case 1554540889: /*relatedResource*/ return this.relatedResource == null ? new Base[0] : this.relatedResource.toArray(new Base[this.relatedResource.size()]); // ModuleMetadataRelatedResourceComponent
2917        default: return super.getProperty(hash, name, checkValid);
2918        }
2919
2920      }
2921
2922      @Override
2923      public void setProperty(int hash, String name, Base value) throws FHIRException {
2924        switch (hash) {
2925        case 116079: // url
2926          this.url = castToUri(value); // UriType
2927          break;
2928        case -1618432855: // identifier
2929          this.getIdentifier().add(castToIdentifier(value)); // Identifier
2930          break;
2931        case 351608024: // version
2932          this.version = castToString(value); // StringType
2933          break;
2934        case 3373707: // name
2935          this.name = castToString(value); // StringType
2936          break;
2937        case 110371416: // title
2938          this.title = castToString(value); // StringType
2939          break;
2940        case 3575610: // type
2941          this.type = new ModuleMetadataTypeEnumFactory().fromType(value); // Enumeration<ModuleMetadataType>
2942          break;
2943        case -892481550: // status
2944          this.status = new ModuleMetadataStatusEnumFactory().fromType(value); // Enumeration<ModuleMetadataStatus>
2945          break;
2946        case -404562712: // experimental
2947          this.experimental = castToBoolean(value); // BooleanType
2948          break;
2949        case -1724546052: // description
2950          this.description = castToString(value); // StringType
2951          break;
2952        case -220463842: // purpose
2953          this.purpose = castToString(value); // StringType
2954          break;
2955        case 111574433: // usage
2956          this.usage = castToString(value); // StringType
2957          break;
2958        case 1470566394: // publicationDate
2959          this.publicationDate = castToDate(value); // DateType
2960          break;
2961        case -1687512484: // lastReviewDate
2962          this.lastReviewDate = castToDate(value); // DateType
2963          break;
2964        case -403934648: // effectivePeriod
2965          this.effectivePeriod = castToPeriod(value); // Period
2966          break;
2967        case -351767064: // coverage
2968          this.getCoverage().add((ModuleMetadataCoverageComponent) value); // ModuleMetadataCoverageComponent
2969          break;
2970        case 110546223: // topic
2971          this.getTopic().add(castToCodeableConcept(value)); // CodeableConcept
2972          break;
2973        case -1895276325: // contributor
2974          this.getContributor().add((ModuleMetadataContributorComponent) value); // ModuleMetadataContributorComponent
2975          break;
2976        case 1447404028: // publisher
2977          this.publisher = castToString(value); // StringType
2978          break;
2979        case 951526432: // contact
2980          this.getContact().add((ModuleMetadataContactComponent) value); // ModuleMetadataContactComponent
2981          break;
2982        case 1522889671: // copyright
2983          this.copyright = castToString(value); // StringType
2984          break;
2985        case 1554540889: // relatedResource
2986          this.getRelatedResource().add((ModuleMetadataRelatedResourceComponent) value); // ModuleMetadataRelatedResourceComponent
2987          break;
2988        default: super.setProperty(hash, name, value);
2989        }
2990
2991      }
2992
2993      @Override
2994      public void setProperty(String name, Base value) throws FHIRException {
2995        if (name.equals("url"))
2996          this.url = castToUri(value); // UriType
2997        else if (name.equals("identifier"))
2998          this.getIdentifier().add(castToIdentifier(value));
2999        else if (name.equals("version"))
3000          this.version = castToString(value); // StringType
3001        else if (name.equals("name"))
3002          this.name = castToString(value); // StringType
3003        else if (name.equals("title"))
3004          this.title = castToString(value); // StringType
3005        else if (name.equals("type"))
3006          this.type = new ModuleMetadataTypeEnumFactory().fromType(value); // Enumeration<ModuleMetadataType>
3007        else if (name.equals("status"))
3008          this.status = new ModuleMetadataStatusEnumFactory().fromType(value); // Enumeration<ModuleMetadataStatus>
3009        else if (name.equals("experimental"))
3010          this.experimental = castToBoolean(value); // BooleanType
3011        else if (name.equals("description"))
3012          this.description = castToString(value); // StringType
3013        else if (name.equals("purpose"))
3014          this.purpose = castToString(value); // StringType
3015        else if (name.equals("usage"))
3016          this.usage = castToString(value); // StringType
3017        else if (name.equals("publicationDate"))
3018          this.publicationDate = castToDate(value); // DateType
3019        else if (name.equals("lastReviewDate"))
3020          this.lastReviewDate = castToDate(value); // DateType
3021        else if (name.equals("effectivePeriod"))
3022          this.effectivePeriod = castToPeriod(value); // Period
3023        else if (name.equals("coverage"))
3024          this.getCoverage().add((ModuleMetadataCoverageComponent) value);
3025        else if (name.equals("topic"))
3026          this.getTopic().add(castToCodeableConcept(value));
3027        else if (name.equals("contributor"))
3028          this.getContributor().add((ModuleMetadataContributorComponent) value);
3029        else if (name.equals("publisher"))
3030          this.publisher = castToString(value); // StringType
3031        else if (name.equals("contact"))
3032          this.getContact().add((ModuleMetadataContactComponent) value);
3033        else if (name.equals("copyright"))
3034          this.copyright = castToString(value); // StringType
3035        else if (name.equals("relatedResource"))
3036          this.getRelatedResource().add((ModuleMetadataRelatedResourceComponent) value);
3037        else
3038          super.setProperty(name, value);
3039      }
3040
3041      @Override
3042      public Base makeProperty(int hash, String name) throws FHIRException {
3043        switch (hash) {
3044        case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType
3045        case -1618432855:  return addIdentifier(); // Identifier
3046        case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType
3047        case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType
3048        case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType
3049        case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration<ModuleMetadataType>
3050        case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration<ModuleMetadataStatus>
3051        case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType
3052        case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType
3053        case -220463842: throw new FHIRException("Cannot make property purpose as it is not a complex type"); // StringType
3054        case 111574433: throw new FHIRException("Cannot make property usage as it is not a complex type"); // StringType
3055        case 1470566394: throw new FHIRException("Cannot make property publicationDate as it is not a complex type"); // DateType
3056        case -1687512484: throw new FHIRException("Cannot make property lastReviewDate as it is not a complex type"); // DateType
3057        case -403934648:  return getEffectivePeriod(); // Period
3058        case -351767064:  return addCoverage(); // ModuleMetadataCoverageComponent
3059        case 110546223:  return addTopic(); // CodeableConcept
3060        case -1895276325:  return addContributor(); // ModuleMetadataContributorComponent
3061        case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType
3062        case 951526432:  return addContact(); // ModuleMetadataContactComponent
3063        case 1522889671: throw new FHIRException("Cannot make property copyright as it is not a complex type"); // StringType
3064        case 1554540889:  return addRelatedResource(); // ModuleMetadataRelatedResourceComponent
3065        default: return super.makeProperty(hash, name);
3066        }
3067
3068      }
3069
3070      @Override
3071      public Base addChild(String name) throws FHIRException {
3072        if (name.equals("url")) {
3073          throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.url");
3074        }
3075        else if (name.equals("identifier")) {
3076          return addIdentifier();
3077        }
3078        else if (name.equals("version")) {
3079          throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.version");
3080        }
3081        else if (name.equals("name")) {
3082          throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.name");
3083        }
3084        else if (name.equals("title")) {
3085          throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.title");
3086        }
3087        else if (name.equals("type")) {
3088          throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.type");
3089        }
3090        else if (name.equals("status")) {
3091          throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.status");
3092        }
3093        else if (name.equals("experimental")) {
3094          throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.experimental");
3095        }
3096        else if (name.equals("description")) {
3097          throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.description");
3098        }
3099        else if (name.equals("purpose")) {
3100          throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.purpose");
3101        }
3102        else if (name.equals("usage")) {
3103          throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.usage");
3104        }
3105        else if (name.equals("publicationDate")) {
3106          throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.publicationDate");
3107        }
3108        else if (name.equals("lastReviewDate")) {
3109          throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.lastReviewDate");
3110        }
3111        else if (name.equals("effectivePeriod")) {
3112          this.effectivePeriod = new Period();
3113          return this.effectivePeriod;
3114        }
3115        else if (name.equals("coverage")) {
3116          return addCoverage();
3117        }
3118        else if (name.equals("topic")) {
3119          return addTopic();
3120        }
3121        else if (name.equals("contributor")) {
3122          return addContributor();
3123        }
3124        else if (name.equals("publisher")) {
3125          throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.publisher");
3126        }
3127        else if (name.equals("contact")) {
3128          return addContact();
3129        }
3130        else if (name.equals("copyright")) {
3131          throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.copyright");
3132        }
3133        else if (name.equals("relatedResource")) {
3134          return addRelatedResource();
3135        }
3136        else
3137          return super.addChild(name);
3138      }
3139
3140  public String fhirType() {
3141    return "ModuleMetadata";
3142
3143  }
3144
3145      public ModuleMetadata copy() {
3146        ModuleMetadata dst = new ModuleMetadata();
3147        copyValues(dst);
3148        dst.url = url == null ? null : url.copy();
3149        if (identifier != null) {
3150          dst.identifier = new ArrayList<Identifier>();
3151          for (Identifier i : identifier)
3152            dst.identifier.add(i.copy());
3153        };
3154        dst.version = version == null ? null : version.copy();
3155        dst.name = name == null ? null : name.copy();
3156        dst.title = title == null ? null : title.copy();
3157        dst.type = type == null ? null : type.copy();
3158        dst.status = status == null ? null : status.copy();
3159        dst.experimental = experimental == null ? null : experimental.copy();
3160        dst.description = description == null ? null : description.copy();
3161        dst.purpose = purpose == null ? null : purpose.copy();
3162        dst.usage = usage == null ? null : usage.copy();
3163        dst.publicationDate = publicationDate == null ? null : publicationDate.copy();
3164        dst.lastReviewDate = lastReviewDate == null ? null : lastReviewDate.copy();
3165        dst.effectivePeriod = effectivePeriod == null ? null : effectivePeriod.copy();
3166        if (coverage != null) {
3167          dst.coverage = new ArrayList<ModuleMetadataCoverageComponent>();
3168          for (ModuleMetadataCoverageComponent i : coverage)
3169            dst.coverage.add(i.copy());
3170        };
3171        if (topic != null) {
3172          dst.topic = new ArrayList<CodeableConcept>();
3173          for (CodeableConcept i : topic)
3174            dst.topic.add(i.copy());
3175        };
3176        if (contributor != null) {
3177          dst.contributor = new ArrayList<ModuleMetadataContributorComponent>();
3178          for (ModuleMetadataContributorComponent i : contributor)
3179            dst.contributor.add(i.copy());
3180        };
3181        dst.publisher = publisher == null ? null : publisher.copy();
3182        if (contact != null) {
3183          dst.contact = new ArrayList<ModuleMetadataContactComponent>();
3184          for (ModuleMetadataContactComponent i : contact)
3185            dst.contact.add(i.copy());
3186        };
3187        dst.copyright = copyright == null ? null : copyright.copy();
3188        if (relatedResource != null) {
3189          dst.relatedResource = new ArrayList<ModuleMetadataRelatedResourceComponent>();
3190          for (ModuleMetadataRelatedResourceComponent i : relatedResource)
3191            dst.relatedResource.add(i.copy());
3192        };
3193        return dst;
3194      }
3195
3196      protected ModuleMetadata typedCopy() {
3197        return copy();
3198      }
3199
3200      @Override
3201      public boolean equalsDeep(Base other) {
3202        if (!super.equalsDeep(other))
3203          return false;
3204        if (!(other instanceof ModuleMetadata))
3205          return false;
3206        ModuleMetadata o = (ModuleMetadata) other;
3207        return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true)
3208           && compareDeep(name, o.name, true) && compareDeep(title, o.title, true) && compareDeep(type, o.type, true)
3209           && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) && compareDeep(description, o.description, true)
3210           && compareDeep(purpose, o.purpose, true) && compareDeep(usage, o.usage, true) && compareDeep(publicationDate, o.publicationDate, true)
3211           && compareDeep(lastReviewDate, o.lastReviewDate, true) && compareDeep(effectivePeriod, o.effectivePeriod, true)
3212           && compareDeep(coverage, o.coverage, true) && compareDeep(topic, o.topic, true) && compareDeep(contributor, o.contributor, true)
3213           && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(copyright, o.copyright, true)
3214           && compareDeep(relatedResource, o.relatedResource, true);
3215      }
3216
3217      @Override
3218      public boolean equalsShallow(Base other) {
3219        if (!super.equalsShallow(other))
3220          return false;
3221        if (!(other instanceof ModuleMetadata))
3222          return false;
3223        ModuleMetadata o = (ModuleMetadata) other;
3224        return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true)
3225           && compareValues(title, o.title, true) && compareValues(type, o.type, true) && compareValues(status, o.status, true)
3226           && compareValues(experimental, o.experimental, true) && compareValues(description, o.description, true)
3227           && compareValues(purpose, o.purpose, true) && compareValues(usage, o.usage, true) && compareValues(publicationDate, o.publicationDate, true)
3228           && compareValues(lastReviewDate, o.lastReviewDate, true) && compareValues(publisher, o.publisher, true)
3229           && compareValues(copyright, o.copyright, true);
3230      }
3231
3232      public boolean isEmpty() {
3233        return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty())
3234           && (version == null || version.isEmpty()) && (name == null || name.isEmpty()) && (title == null || title.isEmpty())
3235           && (type == null || type.isEmpty()) && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty())
3236           && (description == null || description.isEmpty()) && (purpose == null || purpose.isEmpty())
3237           && (usage == null || usage.isEmpty()) && (publicationDate == null || publicationDate.isEmpty())
3238           && (lastReviewDate == null || lastReviewDate.isEmpty()) && (effectivePeriod == null || effectivePeriod.isEmpty())
3239           && (coverage == null || coverage.isEmpty()) && (topic == null || topic.isEmpty()) && (contributor == null || contributor.isEmpty())
3240           && (publisher == null || publisher.isEmpty()) && (contact == null || contact.isEmpty()) && (copyright == null || copyright.isEmpty())
3241           && (relatedResource == null || relatedResource.isEmpty());
3242      }
3243
3244
3245}