001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Fri, Jul 15, 2022 11:20+1000 for FHIR v5.0.0-snapshot2
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * The Citation Resource enables reference to any knowledge artifact for purposes of identification and attribution. The Citation Resource supports existing reference structures and developing publication practices such as versioning, expressing complex contributorship roles, and referencing computable resources.
052 */
053@ResourceDef(name="Citation", profile="http://hl7.org/fhir/StructureDefinition/Citation")
054public class Citation extends MetadataResource {
055
056    public enum RelatedArtifactTypeExpanded {
057        /**
058         * Additional documentation for the knowledge resource. This would include additional instructions on usage as well as additional information on clinical context or appropriateness
059         */
060        DOCUMENTATION, 
061        /**
062         * The target artifact is a summary of the justification for the knowledge resource including supporting evidence, relevant guidelines, or other clinically important information. This information is intended to provide a way to make the justification for the knowledge resource available to the consumer of interventions or results produced by the knowledge resource.
063         */
064        JUSTIFICATION, 
065        /**
066         * The previous version of the knowledge artifact, used to establish an ordering of versions of an artifact, independent of the status of each version.
067         */
068        PREDECESSOR, 
069        /**
070         * The subsequent version of the knowledge artfact, used to establish an ordering of versions of an artifact, independent of the status of each version.
071         */
072        SUCCESSOR, 
073        /**
074         * This artifact is derived from the target artifact. This is intended to capture the relationship in which a particular knowledge resource is based on the content of another artifact, 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. The artifact may be derived from one or more target artifacts.
075         */
076        DERIVEDFROM, 
077        /**
078         * This artifact depends on the target artifact. There is a requirement to use the target artifact in the implementation or interpretation of this artifact.
079         */
080        DEPENDSON, 
081        /**
082         * This artifact is composed of the target artifact. This artifact is constructed with the target artifact as a component. The target artifact is a part of this artifact. (A dataset is composed of data.)
083         */
084        COMPOSEDOF, 
085        /**
086         * This artifact is a part of the target artifact. The target artifact is composed of this artifact (and possibly other artifacts).
087         */
088        PARTOF, 
089        /**
090         * This artifact amends or changes the target artifact. This artifact adds additional information that is functionally expected to replace information in the target artifact. This artifact replaces a part but not all of the target artifact.
091         */
092        AMENDS, 
093        /**
094         * This artifact is amended with or changed by the target artifact. There is information in this artifact that should be functionally replaced with information in the target artifact.
095         */
096        AMENDEDWITH, 
097        /**
098         * This artifact adds additional information to the target artifact. The additional information does not replace or change information in the target artifact.
099         */
100        APPENDS, 
101        /**
102         * This artifact has additional information in the target artifact.
103         */
104        APPENDEDWITH, 
105        /**
106         * This artifact cites the target artifact. This may be a bibliographic citation for papers, references, or other relevant material for the knowledge resource. This is intended to allow for citation of related material, but that was not necessarily specifically prepared in connection with this knowledge resource.
107         */
108        CITES, 
109        /**
110         * This artifact is cited by the target artifact.
111         */
112        CITEDBY, 
113        /**
114         * This artifact contains comments about the target artifact. 
115         */
116        COMMENTSON, 
117        /**
118         * This artifact has comments about it in the target artifact.  The type of comments may be expressed in the targetClassifier element such as reply, review, editorial, feedback, solicited, unsolicited, structured, unstructured.
119         */
120        COMMENTIN, 
121        /**
122         * This artifact is a container in which the target artifact is contained. A container is a data structure whose instances are collections of other objects. (A database contains the dataset.)
123         */
124        CONTAINS, 
125        /**
126         * This artifact is contained in the target artifact. The target artifact is a data structure whose instances are collections of other objects.
127         */
128        CONTAINEDIN, 
129        /**
130         * This artifact identifies errors and replacement content for the target artifact.
131         */
132        CORRECTS, 
133        /**
134         * This artifact has corrections to it in the target artifact. The target artifact identifies errors and replacement content for this artifact.
135         */
136        CORRECTIONIN, 
137        /**
138         * This artifact replaces or supersedes the target artifact. The target artifact may be considered deprecated.
139         */
140        REPLACES, 
141        /**
142         * This artifact is replaced with or superseded by the target artifact. This artifact may be considered deprecated.
143         */
144        REPLACEDWITH, 
145        /**
146         * This artifact retracts the target artifact. The content that was published in the target artifact should be considered removed from publication and should no longer be considered part of the public record.
147         */
148        RETRACTS, 
149        /**
150         * This artifact is retracted by the target artifact. The content that was published in this artifact should be considered removed from publication and should no longer be considered part of the public record.
151         */
152        RETRACTEDBY, 
153        /**
154         * This artifact is a signature of the target artifact.
155         */
156        SIGNS, 
157        /**
158         * This artifact has characteristics in common with the target artifact. This relationship may be used in systems to ?deduplicate? knowledge artifacts from different sources, or in systems to show ?similar items?.
159         */
160        SIMILARTO, 
161        /**
162         * This artifact provides additional support for the target artifact. The type of support  is not documentation as it does not describe, explain, or instruct regarding the target artifact.
163         */
164        SUPPORTS, 
165        /**
166         * The target artifact contains additional information related to the knowledge artifact but is not documentation as the additional information does not describe, explain, or instruct regarding the knowledge artifact content or application. This could include an associated dataset.
167         */
168        SUPPORTEDWITH, 
169        /**
170         * This artifact was generated by transforming the target artifact (e.g., format or language conversion). This is intended to capture the relationship in which a particular knowledge resource is based on the content of another artifact, but changes are only apparent in form and there is only one target artifact with the ?transforms? relationship type.
171         */
172        TRANSFORMS, 
173        /**
174         * This artifact was transformed into the target artifact (e.g., by format or language conversion).
175         */
176        TRANSFORMEDINTO, 
177        /**
178         * This artifact was generated by transforming a related artifact (e.g., format or language conversion), noted separately with the ?transforms? relationship type. This transformation used the target artifact to inform the transformation. The target artifact may be a conversion script or translation guide.
179         */
180        TRANSFORMEDWITH, 
181        /**
182         * The related artifact is the citation for this artifact.
183         */
184        CITEAS, 
185        /**
186         * This artifact was created with the target artifact. The target artifact is a tool or support material used in the creation of the artifact, and not content that the artifact was derived from.
187         */
188        CREATEDWITH, 
189        /**
190         * This artifact provides additional documentation for the target artifact. This could include additional instructions on usage as well as additional information on clinical context or appropriateness.
191         */
192        DOCUMENTS, 
193        /**
194         * A copy of the artifact in a publication with a different artifact identifier.
195         */
196        REPRINT, 
197        /**
198         * The original version of record for which the current artifact is a copy.
199         */
200        REPRINTOF, 
201        /**
202         * The target artifact is a precise description of a concept in this artifact. This may be used when the RelatedArtifact datatype is used in elements contained in this artifact.
203         */
204        SPECIFICATIONOF, 
205        /**
206         * added to help the parsers with the generic types
207         */
208        NULL;
209        public static RelatedArtifactTypeExpanded fromCode(String codeString) throws FHIRException {
210            if (codeString == null || "".equals(codeString))
211                return null;
212        if ("documentation".equals(codeString))
213          return DOCUMENTATION;
214        if ("justification".equals(codeString))
215          return JUSTIFICATION;
216        if ("predecessor".equals(codeString))
217          return PREDECESSOR;
218        if ("successor".equals(codeString))
219          return SUCCESSOR;
220        if ("derived-from".equals(codeString))
221          return DERIVEDFROM;
222        if ("depends-on".equals(codeString))
223          return DEPENDSON;
224        if ("composed-of".equals(codeString))
225          return COMPOSEDOF;
226        if ("part-of".equals(codeString))
227          return PARTOF;
228        if ("amends".equals(codeString))
229          return AMENDS;
230        if ("amended-with".equals(codeString))
231          return AMENDEDWITH;
232        if ("appends".equals(codeString))
233          return APPENDS;
234        if ("appended-with".equals(codeString))
235          return APPENDEDWITH;
236        if ("cites".equals(codeString))
237          return CITES;
238        if ("cited-by".equals(codeString))
239          return CITEDBY;
240        if ("comments-on".equals(codeString))
241          return COMMENTSON;
242        if ("comment-in".equals(codeString))
243          return COMMENTIN;
244        if ("contains".equals(codeString))
245          return CONTAINS;
246        if ("contained-in".equals(codeString))
247          return CONTAINEDIN;
248        if ("corrects".equals(codeString))
249          return CORRECTS;
250        if ("correction-in".equals(codeString))
251          return CORRECTIONIN;
252        if ("replaces".equals(codeString))
253          return REPLACES;
254        if ("replaced-with".equals(codeString))
255          return REPLACEDWITH;
256        if ("retracts".equals(codeString))
257          return RETRACTS;
258        if ("retracted-by".equals(codeString))
259          return RETRACTEDBY;
260        if ("signs".equals(codeString))
261          return SIGNS;
262        if ("similar-to".equals(codeString))
263          return SIMILARTO;
264        if ("supports".equals(codeString))
265          return SUPPORTS;
266        if ("supported-with".equals(codeString))
267          return SUPPORTEDWITH;
268        if ("transforms".equals(codeString))
269          return TRANSFORMS;
270        if ("transformed-into".equals(codeString))
271          return TRANSFORMEDINTO;
272        if ("transformed-with".equals(codeString))
273          return TRANSFORMEDWITH;
274        if ("cite-as".equals(codeString))
275          return CITEAS;
276        if ("created-with".equals(codeString))
277          return CREATEDWITH;
278        if ("documents".equals(codeString))
279          return DOCUMENTS;
280        if ("reprint".equals(codeString))
281          return REPRINT;
282        if ("reprint-of".equals(codeString))
283          return REPRINTOF;
284        if ("specification-of".equals(codeString))
285          return SPECIFICATIONOF;
286        if (Configuration.isAcceptInvalidEnums())
287          return null;
288        else
289          throw new FHIRException("Unknown RelatedArtifactTypeExpanded code '"+codeString+"'");
290        }
291        public String toCode() {
292          switch (this) {
293            case DOCUMENTATION: return "documentation";
294            case JUSTIFICATION: return "justification";
295            case PREDECESSOR: return "predecessor";
296            case SUCCESSOR: return "successor";
297            case DERIVEDFROM: return "derived-from";
298            case DEPENDSON: return "depends-on";
299            case COMPOSEDOF: return "composed-of";
300            case PARTOF: return "part-of";
301            case AMENDS: return "amends";
302            case AMENDEDWITH: return "amended-with";
303            case APPENDS: return "appends";
304            case APPENDEDWITH: return "appended-with";
305            case CITES: return "cites";
306            case CITEDBY: return "cited-by";
307            case COMMENTSON: return "comments-on";
308            case COMMENTIN: return "comment-in";
309            case CONTAINS: return "contains";
310            case CONTAINEDIN: return "contained-in";
311            case CORRECTS: return "corrects";
312            case CORRECTIONIN: return "correction-in";
313            case REPLACES: return "replaces";
314            case REPLACEDWITH: return "replaced-with";
315            case RETRACTS: return "retracts";
316            case RETRACTEDBY: return "retracted-by";
317            case SIGNS: return "signs";
318            case SIMILARTO: return "similar-to";
319            case SUPPORTS: return "supports";
320            case SUPPORTEDWITH: return "supported-with";
321            case TRANSFORMS: return "transforms";
322            case TRANSFORMEDINTO: return "transformed-into";
323            case TRANSFORMEDWITH: return "transformed-with";
324            case CITEAS: return "cite-as";
325            case CREATEDWITH: return "created-with";
326            case DOCUMENTS: return "documents";
327            case REPRINT: return "reprint";
328            case REPRINTOF: return "reprint-of";
329            case SPECIFICATIONOF: return "specification-of";
330            case NULL: return null;
331            default: return "?";
332          }
333        }
334        public String getSystem() {
335          switch (this) {
336            case DOCUMENTATION: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
337            case JUSTIFICATION: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
338            case PREDECESSOR: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
339            case SUCCESSOR: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
340            case DERIVEDFROM: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
341            case DEPENDSON: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
342            case COMPOSEDOF: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
343            case PARTOF: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
344            case AMENDS: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
345            case AMENDEDWITH: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
346            case APPENDS: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
347            case APPENDEDWITH: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
348            case CITES: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
349            case CITEDBY: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
350            case COMMENTSON: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
351            case COMMENTIN: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
352            case CONTAINS: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
353            case CONTAINEDIN: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
354            case CORRECTS: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
355            case CORRECTIONIN: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
356            case REPLACES: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
357            case REPLACEDWITH: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
358            case RETRACTS: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
359            case RETRACTEDBY: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
360            case SIGNS: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
361            case SIMILARTO: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
362            case SUPPORTS: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
363            case SUPPORTEDWITH: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
364            case TRANSFORMS: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
365            case TRANSFORMEDINTO: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
366            case TRANSFORMEDWITH: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
367            case CITEAS: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
368            case CREATEDWITH: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
369            case DOCUMENTS: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
370            case REPRINT: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
371            case REPRINTOF: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
372            case SPECIFICATIONOF: return "http://terminology.hl7.org/CodeSystem/related-artifact-type-expanded";
373            case NULL: return null;
374            default: return "?";
375          }
376        }
377        public String getDefinition() {
378          switch (this) {
379            case DOCUMENTATION: return "Additional documentation for the knowledge resource. This would include additional instructions on usage as well as additional information on clinical context or appropriateness";
380            case JUSTIFICATION: return "The target artifact is a summary of the justification for the knowledge resource including supporting evidence, relevant guidelines, or other clinically important information. This information is intended to provide a way to make the justification for the knowledge resource available to the consumer of interventions or results produced by the knowledge resource.";
381            case PREDECESSOR: return "The previous version of the knowledge artifact, used to establish an ordering of versions of an artifact, independent of the status of each version.";
382            case SUCCESSOR: return "The subsequent version of the knowledge artfact, used to establish an ordering of versions of an artifact, independent of the status of each version.";
383            case DERIVEDFROM: return "This artifact is derived from the target artifact. This is intended to capture the relationship in which a particular knowledge resource is based on the content of another artifact, 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. The artifact may be derived from one or more target artifacts.";
384            case DEPENDSON: return "This artifact depends on the target artifact. There is a requirement to use the target artifact in the implementation or interpretation of this artifact.";
385            case COMPOSEDOF: return "This artifact is composed of the target artifact. This artifact is constructed with the target artifact as a component. The target artifact is a part of this artifact. (A dataset is composed of data.)";
386            case PARTOF: return "This artifact is a part of the target artifact. The target artifact is composed of this artifact (and possibly other artifacts).";
387            case AMENDS: return "This artifact amends or changes the target artifact. This artifact adds additional information that is functionally expected to replace information in the target artifact. This artifact replaces a part but not all of the target artifact.";
388            case AMENDEDWITH: return "This artifact is amended with or changed by the target artifact. There is information in this artifact that should be functionally replaced with information in the target artifact.";
389            case APPENDS: return "This artifact adds additional information to the target artifact. The additional information does not replace or change information in the target artifact.";
390            case APPENDEDWITH: return "This artifact has additional information in the target artifact.";
391            case CITES: return "This artifact cites the target artifact. This may be a bibliographic citation for papers, references, or other relevant material for the knowledge resource. This is intended to allow for citation of related material, but that was not necessarily specifically prepared in connection with this knowledge resource.";
392            case CITEDBY: return "This artifact is cited by the target artifact.";
393            case COMMENTSON: return "This artifact contains comments about the target artifact. ";
394            case COMMENTIN: return "This artifact has comments about it in the target artifact.  The type of comments may be expressed in the targetClassifier element such as reply, review, editorial, feedback, solicited, unsolicited, structured, unstructured.";
395            case CONTAINS: return "This artifact is a container in which the target artifact is contained. A container is a data structure whose instances are collections of other objects. (A database contains the dataset.)";
396            case CONTAINEDIN: return "This artifact is contained in the target artifact. The target artifact is a data structure whose instances are collections of other objects.";
397            case CORRECTS: return "This artifact identifies errors and replacement content for the target artifact.";
398            case CORRECTIONIN: return "This artifact has corrections to it in the target artifact. The target artifact identifies errors and replacement content for this artifact.";
399            case REPLACES: return "This artifact replaces or supersedes the target artifact. The target artifact may be considered deprecated.";
400            case REPLACEDWITH: return "This artifact is replaced with or superseded by the target artifact. This artifact may be considered deprecated.";
401            case RETRACTS: return "This artifact retracts the target artifact. The content that was published in the target artifact should be considered removed from publication and should no longer be considered part of the public record.";
402            case RETRACTEDBY: return "This artifact is retracted by the target artifact. The content that was published in this artifact should be considered removed from publication and should no longer be considered part of the public record.";
403            case SIGNS: return "This artifact is a signature of the target artifact.";
404            case SIMILARTO: return "This artifact has characteristics in common with the target artifact. This relationship may be used in systems to ?deduplicate? knowledge artifacts from different sources, or in systems to show ?similar items?.";
405            case SUPPORTS: return "This artifact provides additional support for the target artifact. The type of support  is not documentation as it does not describe, explain, or instruct regarding the target artifact.";
406            case SUPPORTEDWITH: return "The target artifact contains additional information related to the knowledge artifact but is not documentation as the additional information does not describe, explain, or instruct regarding the knowledge artifact content or application. This could include an associated dataset.";
407            case TRANSFORMS: return "This artifact was generated by transforming the target artifact (e.g., format or language conversion). This is intended to capture the relationship in which a particular knowledge resource is based on the content of another artifact, but changes are only apparent in form and there is only one target artifact with the ?transforms? relationship type.";
408            case TRANSFORMEDINTO: return "This artifact was transformed into the target artifact (e.g., by format or language conversion).";
409            case TRANSFORMEDWITH: return "This artifact was generated by transforming a related artifact (e.g., format or language conversion), noted separately with the ?transforms? relationship type. This transformation used the target artifact to inform the transformation. The target artifact may be a conversion script or translation guide.";
410            case CITEAS: return "The related artifact is the citation for this artifact.";
411            case CREATEDWITH: return "This artifact was created with the target artifact. The target artifact is a tool or support material used in the creation of the artifact, and not content that the artifact was derived from.";
412            case DOCUMENTS: return "This artifact provides additional documentation for the target artifact. This could include additional instructions on usage as well as additional information on clinical context or appropriateness.";
413            case REPRINT: return "A copy of the artifact in a publication with a different artifact identifier.";
414            case REPRINTOF: return "The original version of record for which the current artifact is a copy.";
415            case SPECIFICATIONOF: return "The target artifact is a precise description of a concept in this artifact. This may be used when the RelatedArtifact datatype is used in elements contained in this artifact.";
416            case NULL: return null;
417            default: return "?";
418          }
419        }
420        public String getDisplay() {
421          switch (this) {
422            case DOCUMENTATION: return "Documentation";
423            case JUSTIFICATION: return "Justification";
424            case PREDECESSOR: return "Predecessor";
425            case SUCCESSOR: return "Successor";
426            case DERIVEDFROM: return "Derived From";
427            case DEPENDSON: return "Depends On";
428            case COMPOSEDOF: return "Composed Of";
429            case PARTOF: return "Part Of";
430            case AMENDS: return "Amends";
431            case AMENDEDWITH: return "Amended With";
432            case APPENDS: return "Appends";
433            case APPENDEDWITH: return "Appended With";
434            case CITES: return "Cites";
435            case CITEDBY: return "Cited By";
436            case COMMENTSON: return "Is Comment On";
437            case COMMENTIN: return "Has Comment In";
438            case CONTAINS: return "Contains";
439            case CONTAINEDIN: return "Contained In";
440            case CORRECTS: return "Corrects";
441            case CORRECTIONIN: return "Correction In";
442            case REPLACES: return "Replaces";
443            case REPLACEDWITH: return "Replaced With";
444            case RETRACTS: return "Retracts";
445            case RETRACTEDBY: return "Retracted By";
446            case SIGNS: return "Signs";
447            case SIMILARTO: return "Similar To";
448            case SUPPORTS: return "Supports";
449            case SUPPORTEDWITH: return "Supported With";
450            case TRANSFORMS: return "Transforms";
451            case TRANSFORMEDINTO: return "Transformed Into";
452            case TRANSFORMEDWITH: return "Transformed With";
453            case CITEAS: return "Citation for";
454            case CREATEDWITH: return "Created With";
455            case DOCUMENTS: return "Documents";
456            case REPRINT: return "Reprint";
457            case REPRINTOF: return "Reprint Of";
458            case SPECIFICATIONOF: return "Specification of";
459            case NULL: return null;
460            default: return "?";
461          }
462        }
463    }
464
465  public static class RelatedArtifactTypeExpandedEnumFactory implements EnumFactory<RelatedArtifactTypeExpanded> {
466    public RelatedArtifactTypeExpanded fromCode(String codeString) throws IllegalArgumentException {
467      if (codeString == null || "".equals(codeString))
468            if (codeString == null || "".equals(codeString))
469                return null;
470        if ("documentation".equals(codeString))
471          return RelatedArtifactTypeExpanded.DOCUMENTATION;
472        if ("justification".equals(codeString))
473          return RelatedArtifactTypeExpanded.JUSTIFICATION;
474        if ("predecessor".equals(codeString))
475          return RelatedArtifactTypeExpanded.PREDECESSOR;
476        if ("successor".equals(codeString))
477          return RelatedArtifactTypeExpanded.SUCCESSOR;
478        if ("derived-from".equals(codeString))
479          return RelatedArtifactTypeExpanded.DERIVEDFROM;
480        if ("depends-on".equals(codeString))
481          return RelatedArtifactTypeExpanded.DEPENDSON;
482        if ("composed-of".equals(codeString))
483          return RelatedArtifactTypeExpanded.COMPOSEDOF;
484        if ("part-of".equals(codeString))
485          return RelatedArtifactTypeExpanded.PARTOF;
486        if ("amends".equals(codeString))
487          return RelatedArtifactTypeExpanded.AMENDS;
488        if ("amended-with".equals(codeString))
489          return RelatedArtifactTypeExpanded.AMENDEDWITH;
490        if ("appends".equals(codeString))
491          return RelatedArtifactTypeExpanded.APPENDS;
492        if ("appended-with".equals(codeString))
493          return RelatedArtifactTypeExpanded.APPENDEDWITH;
494        if ("cites".equals(codeString))
495          return RelatedArtifactTypeExpanded.CITES;
496        if ("cited-by".equals(codeString))
497          return RelatedArtifactTypeExpanded.CITEDBY;
498        if ("comments-on".equals(codeString))
499          return RelatedArtifactTypeExpanded.COMMENTSON;
500        if ("comment-in".equals(codeString))
501          return RelatedArtifactTypeExpanded.COMMENTIN;
502        if ("contains".equals(codeString))
503          return RelatedArtifactTypeExpanded.CONTAINS;
504        if ("contained-in".equals(codeString))
505          return RelatedArtifactTypeExpanded.CONTAINEDIN;
506        if ("corrects".equals(codeString))
507          return RelatedArtifactTypeExpanded.CORRECTS;
508        if ("correction-in".equals(codeString))
509          return RelatedArtifactTypeExpanded.CORRECTIONIN;
510        if ("replaces".equals(codeString))
511          return RelatedArtifactTypeExpanded.REPLACES;
512        if ("replaced-with".equals(codeString))
513          return RelatedArtifactTypeExpanded.REPLACEDWITH;
514        if ("retracts".equals(codeString))
515          return RelatedArtifactTypeExpanded.RETRACTS;
516        if ("retracted-by".equals(codeString))
517          return RelatedArtifactTypeExpanded.RETRACTEDBY;
518        if ("signs".equals(codeString))
519          return RelatedArtifactTypeExpanded.SIGNS;
520        if ("similar-to".equals(codeString))
521          return RelatedArtifactTypeExpanded.SIMILARTO;
522        if ("supports".equals(codeString))
523          return RelatedArtifactTypeExpanded.SUPPORTS;
524        if ("supported-with".equals(codeString))
525          return RelatedArtifactTypeExpanded.SUPPORTEDWITH;
526        if ("transforms".equals(codeString))
527          return RelatedArtifactTypeExpanded.TRANSFORMS;
528        if ("transformed-into".equals(codeString))
529          return RelatedArtifactTypeExpanded.TRANSFORMEDINTO;
530        if ("transformed-with".equals(codeString))
531          return RelatedArtifactTypeExpanded.TRANSFORMEDWITH;
532        if ("cite-as".equals(codeString))
533          return RelatedArtifactTypeExpanded.CITEAS;
534        if ("created-with".equals(codeString))
535          return RelatedArtifactTypeExpanded.CREATEDWITH;
536        if ("documents".equals(codeString))
537          return RelatedArtifactTypeExpanded.DOCUMENTS;
538        if ("reprint".equals(codeString))
539          return RelatedArtifactTypeExpanded.REPRINT;
540        if ("reprint-of".equals(codeString))
541          return RelatedArtifactTypeExpanded.REPRINTOF;
542        if ("specification-of".equals(codeString))
543          return RelatedArtifactTypeExpanded.SPECIFICATIONOF;
544        throw new IllegalArgumentException("Unknown RelatedArtifactTypeExpanded code '"+codeString+"'");
545        }
546        public Enumeration<RelatedArtifactTypeExpanded> fromType(Base code) throws FHIRException {
547          if (code == null)
548            return null;
549          if (code.isEmpty())
550            return new Enumeration<RelatedArtifactTypeExpanded>(this);
551          String codeString = ((PrimitiveType) code).asStringValue();
552          if (codeString == null || "".equals(codeString))
553            return null;
554        if ("documentation".equals(codeString))
555          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.DOCUMENTATION);
556        if ("justification".equals(codeString))
557          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.JUSTIFICATION);
558        if ("predecessor".equals(codeString))
559          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.PREDECESSOR);
560        if ("successor".equals(codeString))
561          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.SUCCESSOR);
562        if ("derived-from".equals(codeString))
563          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.DERIVEDFROM);
564        if ("depends-on".equals(codeString))
565          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.DEPENDSON);
566        if ("composed-of".equals(codeString))
567          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.COMPOSEDOF);
568        if ("part-of".equals(codeString))
569          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.PARTOF);
570        if ("amends".equals(codeString))
571          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.AMENDS);
572        if ("amended-with".equals(codeString))
573          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.AMENDEDWITH);
574        if ("appends".equals(codeString))
575          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.APPENDS);
576        if ("appended-with".equals(codeString))
577          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.APPENDEDWITH);
578        if ("cites".equals(codeString))
579          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.CITES);
580        if ("cited-by".equals(codeString))
581          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.CITEDBY);
582        if ("comments-on".equals(codeString))
583          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.COMMENTSON);
584        if ("comment-in".equals(codeString))
585          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.COMMENTIN);
586        if ("contains".equals(codeString))
587          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.CONTAINS);
588        if ("contained-in".equals(codeString))
589          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.CONTAINEDIN);
590        if ("corrects".equals(codeString))
591          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.CORRECTS);
592        if ("correction-in".equals(codeString))
593          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.CORRECTIONIN);
594        if ("replaces".equals(codeString))
595          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.REPLACES);
596        if ("replaced-with".equals(codeString))
597          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.REPLACEDWITH);
598        if ("retracts".equals(codeString))
599          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.RETRACTS);
600        if ("retracted-by".equals(codeString))
601          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.RETRACTEDBY);
602        if ("signs".equals(codeString))
603          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.SIGNS);
604        if ("similar-to".equals(codeString))
605          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.SIMILARTO);
606        if ("supports".equals(codeString))
607          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.SUPPORTS);
608        if ("supported-with".equals(codeString))
609          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.SUPPORTEDWITH);
610        if ("transforms".equals(codeString))
611          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.TRANSFORMS);
612        if ("transformed-into".equals(codeString))
613          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.TRANSFORMEDINTO);
614        if ("transformed-with".equals(codeString))
615          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.TRANSFORMEDWITH);
616        if ("cite-as".equals(codeString))
617          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.CITEAS);
618        if ("created-with".equals(codeString))
619          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.CREATEDWITH);
620        if ("documents".equals(codeString))
621          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.DOCUMENTS);
622        if ("reprint".equals(codeString))
623          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.REPRINT);
624        if ("reprint-of".equals(codeString))
625          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.REPRINTOF);
626        if ("specification-of".equals(codeString))
627          return new Enumeration<RelatedArtifactTypeExpanded>(this, RelatedArtifactTypeExpanded.SPECIFICATIONOF);
628        throw new FHIRException("Unknown RelatedArtifactTypeExpanded code '"+codeString+"'");
629        }
630    public String toCode(RelatedArtifactTypeExpanded code) {
631      if (code == RelatedArtifactTypeExpanded.DOCUMENTATION)
632        return "documentation";
633      if (code == RelatedArtifactTypeExpanded.JUSTIFICATION)
634        return "justification";
635      if (code == RelatedArtifactTypeExpanded.PREDECESSOR)
636        return "predecessor";
637      if (code == RelatedArtifactTypeExpanded.SUCCESSOR)
638        return "successor";
639      if (code == RelatedArtifactTypeExpanded.DERIVEDFROM)
640        return "derived-from";
641      if (code == RelatedArtifactTypeExpanded.DEPENDSON)
642        return "depends-on";
643      if (code == RelatedArtifactTypeExpanded.COMPOSEDOF)
644        return "composed-of";
645      if (code == RelatedArtifactTypeExpanded.PARTOF)
646        return "part-of";
647      if (code == RelatedArtifactTypeExpanded.AMENDS)
648        return "amends";
649      if (code == RelatedArtifactTypeExpanded.AMENDEDWITH)
650        return "amended-with";
651      if (code == RelatedArtifactTypeExpanded.APPENDS)
652        return "appends";
653      if (code == RelatedArtifactTypeExpanded.APPENDEDWITH)
654        return "appended-with";
655      if (code == RelatedArtifactTypeExpanded.CITES)
656        return "cites";
657      if (code == RelatedArtifactTypeExpanded.CITEDBY)
658        return "cited-by";
659      if (code == RelatedArtifactTypeExpanded.COMMENTSON)
660        return "comments-on";
661      if (code == RelatedArtifactTypeExpanded.COMMENTIN)
662        return "comment-in";
663      if (code == RelatedArtifactTypeExpanded.CONTAINS)
664        return "contains";
665      if (code == RelatedArtifactTypeExpanded.CONTAINEDIN)
666        return "contained-in";
667      if (code == RelatedArtifactTypeExpanded.CORRECTS)
668        return "corrects";
669      if (code == RelatedArtifactTypeExpanded.CORRECTIONIN)
670        return "correction-in";
671      if (code == RelatedArtifactTypeExpanded.REPLACES)
672        return "replaces";
673      if (code == RelatedArtifactTypeExpanded.REPLACEDWITH)
674        return "replaced-with";
675      if (code == RelatedArtifactTypeExpanded.RETRACTS)
676        return "retracts";
677      if (code == RelatedArtifactTypeExpanded.RETRACTEDBY)
678        return "retracted-by";
679      if (code == RelatedArtifactTypeExpanded.SIGNS)
680        return "signs";
681      if (code == RelatedArtifactTypeExpanded.SIMILARTO)
682        return "similar-to";
683      if (code == RelatedArtifactTypeExpanded.SUPPORTS)
684        return "supports";
685      if (code == RelatedArtifactTypeExpanded.SUPPORTEDWITH)
686        return "supported-with";
687      if (code == RelatedArtifactTypeExpanded.TRANSFORMS)
688        return "transforms";
689      if (code == RelatedArtifactTypeExpanded.TRANSFORMEDINTO)
690        return "transformed-into";
691      if (code == RelatedArtifactTypeExpanded.TRANSFORMEDWITH)
692        return "transformed-with";
693      if (code == RelatedArtifactTypeExpanded.CITEAS)
694        return "cite-as";
695      if (code == RelatedArtifactTypeExpanded.CREATEDWITH)
696        return "created-with";
697      if (code == RelatedArtifactTypeExpanded.DOCUMENTS)
698        return "documents";
699      if (code == RelatedArtifactTypeExpanded.REPRINT)
700        return "reprint";
701      if (code == RelatedArtifactTypeExpanded.REPRINTOF)
702        return "reprint-of";
703      if (code == RelatedArtifactTypeExpanded.SPECIFICATIONOF)
704        return "specification-of";
705      return "?";
706      }
707    public String toSystem(RelatedArtifactTypeExpanded code) {
708      return code.getSystem();
709      }
710    }
711
712    @Block()
713    public static class CitationSummaryComponent extends BackboneElement implements IBaseBackboneElement {
714        /**
715         * Format for display of the citation.
716         */
717        @Child(name = "style", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
718        @Description(shortDefinition="Format for display of the citation", formalDefinition="Format for display of the citation." )
719        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/citation-summary-style")
720        protected CodeableConcept style;
721
722        /**
723         * The human-readable display of the citation.
724         */
725        @Child(name = "text", type = {MarkdownType.class}, order=2, min=1, max=1, modifier=false, summary=true)
726        @Description(shortDefinition="The human-readable display of the citation", formalDefinition="The human-readable display of the citation." )
727        protected MarkdownType text;
728
729        private static final long serialVersionUID = 123416446L;
730
731    /**
732     * Constructor
733     */
734      public CitationSummaryComponent() {
735        super();
736      }
737
738    /**
739     * Constructor
740     */
741      public CitationSummaryComponent(String text) {
742        super();
743        this.setText(text);
744      }
745
746        /**
747         * @return {@link #style} (Format for display of the citation.)
748         */
749        public CodeableConcept getStyle() { 
750          if (this.style == null)
751            if (Configuration.errorOnAutoCreate())
752              throw new Error("Attempt to auto-create CitationSummaryComponent.style");
753            else if (Configuration.doAutoCreate())
754              this.style = new CodeableConcept(); // cc
755          return this.style;
756        }
757
758        public boolean hasStyle() { 
759          return this.style != null && !this.style.isEmpty();
760        }
761
762        /**
763         * @param value {@link #style} (Format for display of the citation.)
764         */
765        public CitationSummaryComponent setStyle(CodeableConcept value) { 
766          this.style = value;
767          return this;
768        }
769
770        /**
771         * @return {@link #text} (The human-readable display of the citation.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
772         */
773        public MarkdownType getTextElement() { 
774          if (this.text == null)
775            if (Configuration.errorOnAutoCreate())
776              throw new Error("Attempt to auto-create CitationSummaryComponent.text");
777            else if (Configuration.doAutoCreate())
778              this.text = new MarkdownType(); // bb
779          return this.text;
780        }
781
782        public boolean hasTextElement() { 
783          return this.text != null && !this.text.isEmpty();
784        }
785
786        public boolean hasText() { 
787          return this.text != null && !this.text.isEmpty();
788        }
789
790        /**
791         * @param value {@link #text} (The human-readable display of the citation.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
792         */
793        public CitationSummaryComponent setTextElement(MarkdownType value) { 
794          this.text = value;
795          return this;
796        }
797
798        /**
799         * @return The human-readable display of the citation.
800         */
801        public String getText() { 
802          return this.text == null ? null : this.text.getValue();
803        }
804
805        /**
806         * @param value The human-readable display of the citation.
807         */
808        public CitationSummaryComponent setText(String value) { 
809            if (this.text == null)
810              this.text = new MarkdownType();
811            this.text.setValue(value);
812          return this;
813        }
814
815        protected void listChildren(List<Property> children) {
816          super.listChildren(children);
817          children.add(new Property("style", "CodeableConcept", "Format for display of the citation.", 0, 1, style));
818          children.add(new Property("text", "markdown", "The human-readable display of the citation.", 0, 1, text));
819        }
820
821        @Override
822        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
823          switch (_hash) {
824          case 109780401: /*style*/  return new Property("style", "CodeableConcept", "Format for display of the citation.", 0, 1, style);
825          case 3556653: /*text*/  return new Property("text", "markdown", "The human-readable display of the citation.", 0, 1, text);
826          default: return super.getNamedProperty(_hash, _name, _checkValid);
827          }
828
829        }
830
831      @Override
832      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
833        switch (hash) {
834        case 109780401: /*style*/ return this.style == null ? new Base[0] : new Base[] {this.style}; // CodeableConcept
835        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // MarkdownType
836        default: return super.getProperty(hash, name, checkValid);
837        }
838
839      }
840
841      @Override
842      public Base setProperty(int hash, String name, Base value) throws FHIRException {
843        switch (hash) {
844        case 109780401: // style
845          this.style = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
846          return value;
847        case 3556653: // text
848          this.text = TypeConvertor.castToMarkdown(value); // MarkdownType
849          return value;
850        default: return super.setProperty(hash, name, value);
851        }
852
853      }
854
855      @Override
856      public Base setProperty(String name, Base value) throws FHIRException {
857        if (name.equals("style")) {
858          this.style = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
859        } else if (name.equals("text")) {
860          this.text = TypeConvertor.castToMarkdown(value); // MarkdownType
861        } else
862          return super.setProperty(name, value);
863        return value;
864      }
865
866      @Override
867      public Base makeProperty(int hash, String name) throws FHIRException {
868        switch (hash) {
869        case 109780401:  return getStyle();
870        case 3556653:  return getTextElement();
871        default: return super.makeProperty(hash, name);
872        }
873
874      }
875
876      @Override
877      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
878        switch (hash) {
879        case 109780401: /*style*/ return new String[] {"CodeableConcept"};
880        case 3556653: /*text*/ return new String[] {"markdown"};
881        default: return super.getTypesForProperty(hash, name);
882        }
883
884      }
885
886      @Override
887      public Base addChild(String name) throws FHIRException {
888        if (name.equals("style")) {
889          this.style = new CodeableConcept();
890          return this.style;
891        }
892        else if (name.equals("text")) {
893          throw new FHIRException("Cannot call addChild on a primitive type Citation.summary.text");
894        }
895        else
896          return super.addChild(name);
897      }
898
899      public CitationSummaryComponent copy() {
900        CitationSummaryComponent dst = new CitationSummaryComponent();
901        copyValues(dst);
902        return dst;
903      }
904
905      public void copyValues(CitationSummaryComponent dst) {
906        super.copyValues(dst);
907        dst.style = style == null ? null : style.copy();
908        dst.text = text == null ? null : text.copy();
909      }
910
911      @Override
912      public boolean equalsDeep(Base other_) {
913        if (!super.equalsDeep(other_))
914          return false;
915        if (!(other_ instanceof CitationSummaryComponent))
916          return false;
917        CitationSummaryComponent o = (CitationSummaryComponent) other_;
918        return compareDeep(style, o.style, true) && compareDeep(text, o.text, true);
919      }
920
921      @Override
922      public boolean equalsShallow(Base other_) {
923        if (!super.equalsShallow(other_))
924          return false;
925        if (!(other_ instanceof CitationSummaryComponent))
926          return false;
927        CitationSummaryComponent o = (CitationSummaryComponent) other_;
928        return compareValues(text, o.text, true);
929      }
930
931      public boolean isEmpty() {
932        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(style, text);
933      }
934
935  public String fhirType() {
936    return "Citation.summary";
937
938  }
939
940  }
941
942    @Block()
943    public static class CitationClassificationComponent extends BackboneElement implements IBaseBackboneElement {
944        /**
945         * The kind of classifier (e.g. publication type, keyword).
946         */
947        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
948        @Description(shortDefinition="The kind of classifier (e.g. publication type, keyword)", formalDefinition="The kind of classifier (e.g. publication type, keyword)." )
949        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/citation-classification-type")
950        protected CodeableConcept type;
951
952        /**
953         * The specific classification value.
954         */
955        @Child(name = "classifier", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
956        @Description(shortDefinition="The specific classification value", formalDefinition="The specific classification value." )
957        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/citation-artifact-classifier")
958        protected List<CodeableConcept> classifier;
959
960        private static final long serialVersionUID = -283121869L;
961
962    /**
963     * Constructor
964     */
965      public CitationClassificationComponent() {
966        super();
967      }
968
969        /**
970         * @return {@link #type} (The kind of classifier (e.g. publication type, keyword).)
971         */
972        public CodeableConcept getType() { 
973          if (this.type == null)
974            if (Configuration.errorOnAutoCreate())
975              throw new Error("Attempt to auto-create CitationClassificationComponent.type");
976            else if (Configuration.doAutoCreate())
977              this.type = new CodeableConcept(); // cc
978          return this.type;
979        }
980
981        public boolean hasType() { 
982          return this.type != null && !this.type.isEmpty();
983        }
984
985        /**
986         * @param value {@link #type} (The kind of classifier (e.g. publication type, keyword).)
987         */
988        public CitationClassificationComponent setType(CodeableConcept value) { 
989          this.type = value;
990          return this;
991        }
992
993        /**
994         * @return {@link #classifier} (The specific classification value.)
995         */
996        public List<CodeableConcept> getClassifier() { 
997          if (this.classifier == null)
998            this.classifier = new ArrayList<CodeableConcept>();
999          return this.classifier;
1000        }
1001
1002        /**
1003         * @return Returns a reference to <code>this</code> for easy method chaining
1004         */
1005        public CitationClassificationComponent setClassifier(List<CodeableConcept> theClassifier) { 
1006          this.classifier = theClassifier;
1007          return this;
1008        }
1009
1010        public boolean hasClassifier() { 
1011          if (this.classifier == null)
1012            return false;
1013          for (CodeableConcept item : this.classifier)
1014            if (!item.isEmpty())
1015              return true;
1016          return false;
1017        }
1018
1019        public CodeableConcept addClassifier() { //3
1020          CodeableConcept t = new CodeableConcept();
1021          if (this.classifier == null)
1022            this.classifier = new ArrayList<CodeableConcept>();
1023          this.classifier.add(t);
1024          return t;
1025        }
1026
1027        public CitationClassificationComponent addClassifier(CodeableConcept t) { //3
1028          if (t == null)
1029            return this;
1030          if (this.classifier == null)
1031            this.classifier = new ArrayList<CodeableConcept>();
1032          this.classifier.add(t);
1033          return this;
1034        }
1035
1036        /**
1037         * @return The first repetition of repeating field {@link #classifier}, creating it if it does not already exist {3}
1038         */
1039        public CodeableConcept getClassifierFirstRep() { 
1040          if (getClassifier().isEmpty()) {
1041            addClassifier();
1042          }
1043          return getClassifier().get(0);
1044        }
1045
1046        protected void listChildren(List<Property> children) {
1047          super.listChildren(children);
1048          children.add(new Property("type", "CodeableConcept", "The kind of classifier (e.g. publication type, keyword).", 0, 1, type));
1049          children.add(new Property("classifier", "CodeableConcept", "The specific classification value.", 0, java.lang.Integer.MAX_VALUE, classifier));
1050        }
1051
1052        @Override
1053        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1054          switch (_hash) {
1055          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The kind of classifier (e.g. publication type, keyword).", 0, 1, type);
1056          case -281470431: /*classifier*/  return new Property("classifier", "CodeableConcept", "The specific classification value.", 0, java.lang.Integer.MAX_VALUE, classifier);
1057          default: return super.getNamedProperty(_hash, _name, _checkValid);
1058          }
1059
1060        }
1061
1062      @Override
1063      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1064        switch (hash) {
1065        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1066        case -281470431: /*classifier*/ return this.classifier == null ? new Base[0] : this.classifier.toArray(new Base[this.classifier.size()]); // CodeableConcept
1067        default: return super.getProperty(hash, name, checkValid);
1068        }
1069
1070      }
1071
1072      @Override
1073      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1074        switch (hash) {
1075        case 3575610: // type
1076          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1077          return value;
1078        case -281470431: // classifier
1079          this.getClassifier().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1080          return value;
1081        default: return super.setProperty(hash, name, value);
1082        }
1083
1084      }
1085
1086      @Override
1087      public Base setProperty(String name, Base value) throws FHIRException {
1088        if (name.equals("type")) {
1089          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1090        } else if (name.equals("classifier")) {
1091          this.getClassifier().add(TypeConvertor.castToCodeableConcept(value));
1092        } else
1093          return super.setProperty(name, value);
1094        return value;
1095      }
1096
1097      @Override
1098      public Base makeProperty(int hash, String name) throws FHIRException {
1099        switch (hash) {
1100        case 3575610:  return getType();
1101        case -281470431:  return addClassifier(); 
1102        default: return super.makeProperty(hash, name);
1103        }
1104
1105      }
1106
1107      @Override
1108      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1109        switch (hash) {
1110        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1111        case -281470431: /*classifier*/ return new String[] {"CodeableConcept"};
1112        default: return super.getTypesForProperty(hash, name);
1113        }
1114
1115      }
1116
1117      @Override
1118      public Base addChild(String name) throws FHIRException {
1119        if (name.equals("type")) {
1120          this.type = new CodeableConcept();
1121          return this.type;
1122        }
1123        else if (name.equals("classifier")) {
1124          return addClassifier();
1125        }
1126        else
1127          return super.addChild(name);
1128      }
1129
1130      public CitationClassificationComponent copy() {
1131        CitationClassificationComponent dst = new CitationClassificationComponent();
1132        copyValues(dst);
1133        return dst;
1134      }
1135
1136      public void copyValues(CitationClassificationComponent dst) {
1137        super.copyValues(dst);
1138        dst.type = type == null ? null : type.copy();
1139        if (classifier != null) {
1140          dst.classifier = new ArrayList<CodeableConcept>();
1141          for (CodeableConcept i : classifier)
1142            dst.classifier.add(i.copy());
1143        };
1144      }
1145
1146      @Override
1147      public boolean equalsDeep(Base other_) {
1148        if (!super.equalsDeep(other_))
1149          return false;
1150        if (!(other_ instanceof CitationClassificationComponent))
1151          return false;
1152        CitationClassificationComponent o = (CitationClassificationComponent) other_;
1153        return compareDeep(type, o.type, true) && compareDeep(classifier, o.classifier, true);
1154      }
1155
1156      @Override
1157      public boolean equalsShallow(Base other_) {
1158        if (!super.equalsShallow(other_))
1159          return false;
1160        if (!(other_ instanceof CitationClassificationComponent))
1161          return false;
1162        CitationClassificationComponent o = (CitationClassificationComponent) other_;
1163        return true;
1164      }
1165
1166      public boolean isEmpty() {
1167        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, classifier);
1168      }
1169
1170  public String fhirType() {
1171    return "Citation.classification";
1172
1173  }
1174
1175  }
1176
1177    @Block()
1178    public static class CitationStatusDateComponent extends BackboneElement implements IBaseBackboneElement {
1179        /**
1180         * Classification of the status.
1181         */
1182        @Child(name = "activity", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
1183        @Description(shortDefinition="Classification of the status", formalDefinition="Classification of the status." )
1184        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/citation-status-type")
1185        protected CodeableConcept activity;
1186
1187        /**
1188         * Either occurred or expected.
1189         */
1190        @Child(name = "actual", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1191        @Description(shortDefinition="Either occurred or expected", formalDefinition="Either occurred or expected." )
1192        protected BooleanType actual;
1193
1194        /**
1195         * When the status started and/or ended.
1196         */
1197        @Child(name = "period", type = {Period.class}, order=3, min=1, max=1, modifier=false, summary=false)
1198        @Description(shortDefinition="When the status started and/or ended", formalDefinition="When the status started and/or ended." )
1199        protected Period period;
1200
1201        private static final long serialVersionUID = 1123586924L;
1202
1203    /**
1204     * Constructor
1205     */
1206      public CitationStatusDateComponent() {
1207        super();
1208      }
1209
1210    /**
1211     * Constructor
1212     */
1213      public CitationStatusDateComponent(CodeableConcept activity, Period period) {
1214        super();
1215        this.setActivity(activity);
1216        this.setPeriod(period);
1217      }
1218
1219        /**
1220         * @return {@link #activity} (Classification of the status.)
1221         */
1222        public CodeableConcept getActivity() { 
1223          if (this.activity == null)
1224            if (Configuration.errorOnAutoCreate())
1225              throw new Error("Attempt to auto-create CitationStatusDateComponent.activity");
1226            else if (Configuration.doAutoCreate())
1227              this.activity = new CodeableConcept(); // cc
1228          return this.activity;
1229        }
1230
1231        public boolean hasActivity() { 
1232          return this.activity != null && !this.activity.isEmpty();
1233        }
1234
1235        /**
1236         * @param value {@link #activity} (Classification of the status.)
1237         */
1238        public CitationStatusDateComponent setActivity(CodeableConcept value) { 
1239          this.activity = value;
1240          return this;
1241        }
1242
1243        /**
1244         * @return {@link #actual} (Either occurred or expected.). This is the underlying object with id, value and extensions. The accessor "getActual" gives direct access to the value
1245         */
1246        public BooleanType getActualElement() { 
1247          if (this.actual == null)
1248            if (Configuration.errorOnAutoCreate())
1249              throw new Error("Attempt to auto-create CitationStatusDateComponent.actual");
1250            else if (Configuration.doAutoCreate())
1251              this.actual = new BooleanType(); // bb
1252          return this.actual;
1253        }
1254
1255        public boolean hasActualElement() { 
1256          return this.actual != null && !this.actual.isEmpty();
1257        }
1258
1259        public boolean hasActual() { 
1260          return this.actual != null && !this.actual.isEmpty();
1261        }
1262
1263        /**
1264         * @param value {@link #actual} (Either occurred or expected.). This is the underlying object with id, value and extensions. The accessor "getActual" gives direct access to the value
1265         */
1266        public CitationStatusDateComponent setActualElement(BooleanType value) { 
1267          this.actual = value;
1268          return this;
1269        }
1270
1271        /**
1272         * @return Either occurred or expected.
1273         */
1274        public boolean getActual() { 
1275          return this.actual == null || this.actual.isEmpty() ? false : this.actual.getValue();
1276        }
1277
1278        /**
1279         * @param value Either occurred or expected.
1280         */
1281        public CitationStatusDateComponent setActual(boolean value) { 
1282            if (this.actual == null)
1283              this.actual = new BooleanType();
1284            this.actual.setValue(value);
1285          return this;
1286        }
1287
1288        /**
1289         * @return {@link #period} (When the status started and/or ended.)
1290         */
1291        public Period getPeriod() { 
1292          if (this.period == null)
1293            if (Configuration.errorOnAutoCreate())
1294              throw new Error("Attempt to auto-create CitationStatusDateComponent.period");
1295            else if (Configuration.doAutoCreate())
1296              this.period = new Period(); // cc
1297          return this.period;
1298        }
1299
1300        public boolean hasPeriod() { 
1301          return this.period != null && !this.period.isEmpty();
1302        }
1303
1304        /**
1305         * @param value {@link #period} (When the status started and/or ended.)
1306         */
1307        public CitationStatusDateComponent setPeriod(Period value) { 
1308          this.period = value;
1309          return this;
1310        }
1311
1312        protected void listChildren(List<Property> children) {
1313          super.listChildren(children);
1314          children.add(new Property("activity", "CodeableConcept", "Classification of the status.", 0, 1, activity));
1315          children.add(new Property("actual", "boolean", "Either occurred or expected.", 0, 1, actual));
1316          children.add(new Property("period", "Period", "When the status started and/or ended.", 0, 1, period));
1317        }
1318
1319        @Override
1320        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1321          switch (_hash) {
1322          case -1655966961: /*activity*/  return new Property("activity", "CodeableConcept", "Classification of the status.", 0, 1, activity);
1323          case -1422939762: /*actual*/  return new Property("actual", "boolean", "Either occurred or expected.", 0, 1, actual);
1324          case -991726143: /*period*/  return new Property("period", "Period", "When the status started and/or ended.", 0, 1, period);
1325          default: return super.getNamedProperty(_hash, _name, _checkValid);
1326          }
1327
1328        }
1329
1330      @Override
1331      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1332        switch (hash) {
1333        case -1655966961: /*activity*/ return this.activity == null ? new Base[0] : new Base[] {this.activity}; // CodeableConcept
1334        case -1422939762: /*actual*/ return this.actual == null ? new Base[0] : new Base[] {this.actual}; // BooleanType
1335        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
1336        default: return super.getProperty(hash, name, checkValid);
1337        }
1338
1339      }
1340
1341      @Override
1342      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1343        switch (hash) {
1344        case -1655966961: // activity
1345          this.activity = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1346          return value;
1347        case -1422939762: // actual
1348          this.actual = TypeConvertor.castToBoolean(value); // BooleanType
1349          return value;
1350        case -991726143: // period
1351          this.period = TypeConvertor.castToPeriod(value); // Period
1352          return value;
1353        default: return super.setProperty(hash, name, value);
1354        }
1355
1356      }
1357
1358      @Override
1359      public Base setProperty(String name, Base value) throws FHIRException {
1360        if (name.equals("activity")) {
1361          this.activity = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1362        } else if (name.equals("actual")) {
1363          this.actual = TypeConvertor.castToBoolean(value); // BooleanType
1364        } else if (name.equals("period")) {
1365          this.period = TypeConvertor.castToPeriod(value); // Period
1366        } else
1367          return super.setProperty(name, value);
1368        return value;
1369      }
1370
1371      @Override
1372      public Base makeProperty(int hash, String name) throws FHIRException {
1373        switch (hash) {
1374        case -1655966961:  return getActivity();
1375        case -1422939762:  return getActualElement();
1376        case -991726143:  return getPeriod();
1377        default: return super.makeProperty(hash, name);
1378        }
1379
1380      }
1381
1382      @Override
1383      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1384        switch (hash) {
1385        case -1655966961: /*activity*/ return new String[] {"CodeableConcept"};
1386        case -1422939762: /*actual*/ return new String[] {"boolean"};
1387        case -991726143: /*period*/ return new String[] {"Period"};
1388        default: return super.getTypesForProperty(hash, name);
1389        }
1390
1391      }
1392
1393      @Override
1394      public Base addChild(String name) throws FHIRException {
1395        if (name.equals("activity")) {
1396          this.activity = new CodeableConcept();
1397          return this.activity;
1398        }
1399        else if (name.equals("actual")) {
1400          throw new FHIRException("Cannot call addChild on a primitive type Citation.statusDate.actual");
1401        }
1402        else if (name.equals("period")) {
1403          this.period = new Period();
1404          return this.period;
1405        }
1406        else
1407          return super.addChild(name);
1408      }
1409
1410      public CitationStatusDateComponent copy() {
1411        CitationStatusDateComponent dst = new CitationStatusDateComponent();
1412        copyValues(dst);
1413        return dst;
1414      }
1415
1416      public void copyValues(CitationStatusDateComponent dst) {
1417        super.copyValues(dst);
1418        dst.activity = activity == null ? null : activity.copy();
1419        dst.actual = actual == null ? null : actual.copy();
1420        dst.period = period == null ? null : period.copy();
1421      }
1422
1423      @Override
1424      public boolean equalsDeep(Base other_) {
1425        if (!super.equalsDeep(other_))
1426          return false;
1427        if (!(other_ instanceof CitationStatusDateComponent))
1428          return false;
1429        CitationStatusDateComponent o = (CitationStatusDateComponent) other_;
1430        return compareDeep(activity, o.activity, true) && compareDeep(actual, o.actual, true) && compareDeep(period, o.period, true)
1431          ;
1432      }
1433
1434      @Override
1435      public boolean equalsShallow(Base other_) {
1436        if (!super.equalsShallow(other_))
1437          return false;
1438        if (!(other_ instanceof CitationStatusDateComponent))
1439          return false;
1440        CitationStatusDateComponent o = (CitationStatusDateComponent) other_;
1441        return compareValues(actual, o.actual, true);
1442      }
1443
1444      public boolean isEmpty() {
1445        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(activity, actual, period
1446          );
1447      }
1448
1449  public String fhirType() {
1450    return "Citation.statusDate";
1451
1452  }
1453
1454  }
1455
1456    @Block()
1457    public static class CitationCitedArtifactComponent extends BackboneElement implements IBaseBackboneElement {
1458        /**
1459         * A formal identifier that is used to identify this citation when it is represented in other formats, or referenced in a specification, model, design or an instance.
1460         */
1461        @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1462        @Description(shortDefinition="May include DOI, PMID, PMCID, etc.", formalDefinition="A formal identifier that is used to identify this citation when it is represented in other formats, or referenced in a specification, model, design or an instance." )
1463        protected List<Identifier> identifier;
1464
1465        /**
1466         * A formal identifier that is used to identify things closely related to this citation.
1467         */
1468        @Child(name = "relatedIdentifier", type = {Identifier.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1469        @Description(shortDefinition="May include trial registry identifiers", formalDefinition="A formal identifier that is used to identify things closely related to this citation." )
1470        protected List<Identifier> relatedIdentifier;
1471
1472        /**
1473         * When the cited artifact was accessed.
1474         */
1475        @Child(name = "dateAccessed", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=true)
1476        @Description(shortDefinition="When the cited artifact was accessed", formalDefinition="When the cited artifact was accessed." )
1477        protected DateTimeType dateAccessed;
1478
1479        /**
1480         * The defined version of the cited artifact.
1481         */
1482        @Child(name = "version", type = {}, order=4, min=0, max=1, modifier=false, summary=false)
1483        @Description(shortDefinition="The defined version of the cited artifact", formalDefinition="The defined version of the cited artifact." )
1484        protected CitationCitedArtifactVersionComponent version;
1485
1486        /**
1487         * The status of the cited artifact.
1488         */
1489        @Child(name = "currentState", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1490        @Description(shortDefinition="The status of the cited artifact", formalDefinition="The status of the cited artifact." )
1491        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/cited-artifact-status-type")
1492        protected List<CodeableConcept> currentState;
1493
1494        /**
1495         * An effective date or period for a status of the cited artifact.
1496         */
1497        @Child(name = "statusDate", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1498        @Description(shortDefinition="An effective date or period for a status of the cited artifact", formalDefinition="An effective date or period for a status of the cited artifact." )
1499        protected List<CitationCitedArtifactStatusDateComponent> statusDate;
1500
1501        /**
1502         * The title details of the article or artifact.
1503         */
1504        @Child(name = "title", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1505        @Description(shortDefinition="The title details of the article or artifact", formalDefinition="The title details of the article or artifact." )
1506        protected List<CitationCitedArtifactTitleComponent> title;
1507
1508        /**
1509         * Summary of the article or artifact.
1510         */
1511        @Child(name = "abstract", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1512        @Description(shortDefinition="Summary of the article or artifact", formalDefinition="Summary of the article or artifact." )
1513        protected List<CitationCitedArtifactAbstractComponent> abstract_;
1514
1515        /**
1516         * The component of the article or artifact.
1517         */
1518        @Child(name = "part", type = {}, order=9, min=0, max=1, modifier=false, summary=false)
1519        @Description(shortDefinition="The component of the article or artifact", formalDefinition="The component of the article or artifact." )
1520        protected CitationCitedArtifactPartComponent part;
1521
1522        /**
1523         * The artifact related to the cited artifact.
1524         */
1525        @Child(name = "relatesTo", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1526        @Description(shortDefinition="The artifact related to the cited artifact", formalDefinition="The artifact related to the cited artifact." )
1527        protected List<CitationCitedArtifactRelatesToComponent> relatesTo;
1528
1529        /**
1530         * If multiple, used to represent alternative forms of the article that are not separate citations.
1531         */
1532        @Child(name = "publicationForm", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1533        @Description(shortDefinition="If multiple, used to represent alternative forms of the article that are not separate citations", formalDefinition="If multiple, used to represent alternative forms of the article that are not separate citations." )
1534        protected List<CitationCitedArtifactPublicationFormComponent> publicationForm;
1535
1536        /**
1537         * Used for any URL for the article or artifact cited.
1538         */
1539        @Child(name = "webLocation", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1540        @Description(shortDefinition="Used for any URL for the article or artifact cited", formalDefinition="Used for any URL for the article or artifact cited." )
1541        protected List<CitationCitedArtifactWebLocationComponent> webLocation;
1542
1543        /**
1544         * The assignment to an organizing scheme.
1545         */
1546        @Child(name = "classification", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1547        @Description(shortDefinition="The assignment to an organizing scheme", formalDefinition="The assignment to an organizing scheme." )
1548        protected List<CitationCitedArtifactClassificationComponent> classification;
1549
1550        /**
1551         * This element is used to list authors and other contributors, their contact information, specific contributions, and summary statements.
1552         */
1553        @Child(name = "contributorship", type = {}, order=14, min=0, max=1, modifier=false, summary=false)
1554        @Description(shortDefinition="Attribution of authors and other contributors", formalDefinition="This element is used to list authors and other contributors, their contact information, specific contributions, and summary statements." )
1555        protected CitationCitedArtifactContributorshipComponent contributorship;
1556
1557        /**
1558         * Any additional information or content for the article or artifact.
1559         */
1560        @Child(name = "note", type = {Annotation.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1561        @Description(shortDefinition="Any additional information or content for the article or artifact", formalDefinition="Any additional information or content for the article or artifact." )
1562        protected List<Annotation> note;
1563
1564        private static final long serialVersionUID = -1685890486L;
1565
1566    /**
1567     * Constructor
1568     */
1569      public CitationCitedArtifactComponent() {
1570        super();
1571      }
1572
1573        /**
1574         * @return {@link #identifier} (A formal identifier that is used to identify this citation when it is represented in other formats, or referenced in a specification, model, design or an instance.)
1575         */
1576        public List<Identifier> getIdentifier() { 
1577          if (this.identifier == null)
1578            this.identifier = new ArrayList<Identifier>();
1579          return this.identifier;
1580        }
1581
1582        /**
1583         * @return Returns a reference to <code>this</code> for easy method chaining
1584         */
1585        public CitationCitedArtifactComponent setIdentifier(List<Identifier> theIdentifier) { 
1586          this.identifier = theIdentifier;
1587          return this;
1588        }
1589
1590        public boolean hasIdentifier() { 
1591          if (this.identifier == null)
1592            return false;
1593          for (Identifier item : this.identifier)
1594            if (!item.isEmpty())
1595              return true;
1596          return false;
1597        }
1598
1599        public Identifier addIdentifier() { //3
1600          Identifier t = new Identifier();
1601          if (this.identifier == null)
1602            this.identifier = new ArrayList<Identifier>();
1603          this.identifier.add(t);
1604          return t;
1605        }
1606
1607        public CitationCitedArtifactComponent addIdentifier(Identifier t) { //3
1608          if (t == null)
1609            return this;
1610          if (this.identifier == null)
1611            this.identifier = new ArrayList<Identifier>();
1612          this.identifier.add(t);
1613          return this;
1614        }
1615
1616        /**
1617         * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
1618         */
1619        public Identifier getIdentifierFirstRep() { 
1620          if (getIdentifier().isEmpty()) {
1621            addIdentifier();
1622          }
1623          return getIdentifier().get(0);
1624        }
1625
1626        /**
1627         * @return {@link #relatedIdentifier} (A formal identifier that is used to identify things closely related to this citation.)
1628         */
1629        public List<Identifier> getRelatedIdentifier() { 
1630          if (this.relatedIdentifier == null)
1631            this.relatedIdentifier = new ArrayList<Identifier>();
1632          return this.relatedIdentifier;
1633        }
1634
1635        /**
1636         * @return Returns a reference to <code>this</code> for easy method chaining
1637         */
1638        public CitationCitedArtifactComponent setRelatedIdentifier(List<Identifier> theRelatedIdentifier) { 
1639          this.relatedIdentifier = theRelatedIdentifier;
1640          return this;
1641        }
1642
1643        public boolean hasRelatedIdentifier() { 
1644          if (this.relatedIdentifier == null)
1645            return false;
1646          for (Identifier item : this.relatedIdentifier)
1647            if (!item.isEmpty())
1648              return true;
1649          return false;
1650        }
1651
1652        public Identifier addRelatedIdentifier() { //3
1653          Identifier t = new Identifier();
1654          if (this.relatedIdentifier == null)
1655            this.relatedIdentifier = new ArrayList<Identifier>();
1656          this.relatedIdentifier.add(t);
1657          return t;
1658        }
1659
1660        public CitationCitedArtifactComponent addRelatedIdentifier(Identifier t) { //3
1661          if (t == null)
1662            return this;
1663          if (this.relatedIdentifier == null)
1664            this.relatedIdentifier = new ArrayList<Identifier>();
1665          this.relatedIdentifier.add(t);
1666          return this;
1667        }
1668
1669        /**
1670         * @return The first repetition of repeating field {@link #relatedIdentifier}, creating it if it does not already exist {3}
1671         */
1672        public Identifier getRelatedIdentifierFirstRep() { 
1673          if (getRelatedIdentifier().isEmpty()) {
1674            addRelatedIdentifier();
1675          }
1676          return getRelatedIdentifier().get(0);
1677        }
1678
1679        /**
1680         * @return {@link #dateAccessed} (When the cited artifact was accessed.). This is the underlying object with id, value and extensions. The accessor "getDateAccessed" gives direct access to the value
1681         */
1682        public DateTimeType getDateAccessedElement() { 
1683          if (this.dateAccessed == null)
1684            if (Configuration.errorOnAutoCreate())
1685              throw new Error("Attempt to auto-create CitationCitedArtifactComponent.dateAccessed");
1686            else if (Configuration.doAutoCreate())
1687              this.dateAccessed = new DateTimeType(); // bb
1688          return this.dateAccessed;
1689        }
1690
1691        public boolean hasDateAccessedElement() { 
1692          return this.dateAccessed != null && !this.dateAccessed.isEmpty();
1693        }
1694
1695        public boolean hasDateAccessed() { 
1696          return this.dateAccessed != null && !this.dateAccessed.isEmpty();
1697        }
1698
1699        /**
1700         * @param value {@link #dateAccessed} (When the cited artifact was accessed.). This is the underlying object with id, value and extensions. The accessor "getDateAccessed" gives direct access to the value
1701         */
1702        public CitationCitedArtifactComponent setDateAccessedElement(DateTimeType value) { 
1703          this.dateAccessed = value;
1704          return this;
1705        }
1706
1707        /**
1708         * @return When the cited artifact was accessed.
1709         */
1710        public Date getDateAccessed() { 
1711          return this.dateAccessed == null ? null : this.dateAccessed.getValue();
1712        }
1713
1714        /**
1715         * @param value When the cited artifact was accessed.
1716         */
1717        public CitationCitedArtifactComponent setDateAccessed(Date value) { 
1718          if (value == null)
1719            this.dateAccessed = null;
1720          else {
1721            if (this.dateAccessed == null)
1722              this.dateAccessed = new DateTimeType();
1723            this.dateAccessed.setValue(value);
1724          }
1725          return this;
1726        }
1727
1728        /**
1729         * @return {@link #version} (The defined version of the cited artifact.)
1730         */
1731        public CitationCitedArtifactVersionComponent getVersion() { 
1732          if (this.version == null)
1733            if (Configuration.errorOnAutoCreate())
1734              throw new Error("Attempt to auto-create CitationCitedArtifactComponent.version");
1735            else if (Configuration.doAutoCreate())
1736              this.version = new CitationCitedArtifactVersionComponent(); // cc
1737          return this.version;
1738        }
1739
1740        public boolean hasVersion() { 
1741          return this.version != null && !this.version.isEmpty();
1742        }
1743
1744        /**
1745         * @param value {@link #version} (The defined version of the cited artifact.)
1746         */
1747        public CitationCitedArtifactComponent setVersion(CitationCitedArtifactVersionComponent value) { 
1748          this.version = value;
1749          return this;
1750        }
1751
1752        /**
1753         * @return {@link #currentState} (The status of the cited artifact.)
1754         */
1755        public List<CodeableConcept> getCurrentState() { 
1756          if (this.currentState == null)
1757            this.currentState = new ArrayList<CodeableConcept>();
1758          return this.currentState;
1759        }
1760
1761        /**
1762         * @return Returns a reference to <code>this</code> for easy method chaining
1763         */
1764        public CitationCitedArtifactComponent setCurrentState(List<CodeableConcept> theCurrentState) { 
1765          this.currentState = theCurrentState;
1766          return this;
1767        }
1768
1769        public boolean hasCurrentState() { 
1770          if (this.currentState == null)
1771            return false;
1772          for (CodeableConcept item : this.currentState)
1773            if (!item.isEmpty())
1774              return true;
1775          return false;
1776        }
1777
1778        public CodeableConcept addCurrentState() { //3
1779          CodeableConcept t = new CodeableConcept();
1780          if (this.currentState == null)
1781            this.currentState = new ArrayList<CodeableConcept>();
1782          this.currentState.add(t);
1783          return t;
1784        }
1785
1786        public CitationCitedArtifactComponent addCurrentState(CodeableConcept t) { //3
1787          if (t == null)
1788            return this;
1789          if (this.currentState == null)
1790            this.currentState = new ArrayList<CodeableConcept>();
1791          this.currentState.add(t);
1792          return this;
1793        }
1794
1795        /**
1796         * @return The first repetition of repeating field {@link #currentState}, creating it if it does not already exist {3}
1797         */
1798        public CodeableConcept getCurrentStateFirstRep() { 
1799          if (getCurrentState().isEmpty()) {
1800            addCurrentState();
1801          }
1802          return getCurrentState().get(0);
1803        }
1804
1805        /**
1806         * @return {@link #statusDate} (An effective date or period for a status of the cited artifact.)
1807         */
1808        public List<CitationCitedArtifactStatusDateComponent> getStatusDate() { 
1809          if (this.statusDate == null)
1810            this.statusDate = new ArrayList<CitationCitedArtifactStatusDateComponent>();
1811          return this.statusDate;
1812        }
1813
1814        /**
1815         * @return Returns a reference to <code>this</code> for easy method chaining
1816         */
1817        public CitationCitedArtifactComponent setStatusDate(List<CitationCitedArtifactStatusDateComponent> theStatusDate) { 
1818          this.statusDate = theStatusDate;
1819          return this;
1820        }
1821
1822        public boolean hasStatusDate() { 
1823          if (this.statusDate == null)
1824            return false;
1825          for (CitationCitedArtifactStatusDateComponent item : this.statusDate)
1826            if (!item.isEmpty())
1827              return true;
1828          return false;
1829        }
1830
1831        public CitationCitedArtifactStatusDateComponent addStatusDate() { //3
1832          CitationCitedArtifactStatusDateComponent t = new CitationCitedArtifactStatusDateComponent();
1833          if (this.statusDate == null)
1834            this.statusDate = new ArrayList<CitationCitedArtifactStatusDateComponent>();
1835          this.statusDate.add(t);
1836          return t;
1837        }
1838
1839        public CitationCitedArtifactComponent addStatusDate(CitationCitedArtifactStatusDateComponent t) { //3
1840          if (t == null)
1841            return this;
1842          if (this.statusDate == null)
1843            this.statusDate = new ArrayList<CitationCitedArtifactStatusDateComponent>();
1844          this.statusDate.add(t);
1845          return this;
1846        }
1847
1848        /**
1849         * @return The first repetition of repeating field {@link #statusDate}, creating it if it does not already exist {3}
1850         */
1851        public CitationCitedArtifactStatusDateComponent getStatusDateFirstRep() { 
1852          if (getStatusDate().isEmpty()) {
1853            addStatusDate();
1854          }
1855          return getStatusDate().get(0);
1856        }
1857
1858        /**
1859         * @return {@link #title} (The title details of the article or artifact.)
1860         */
1861        public List<CitationCitedArtifactTitleComponent> getTitle() { 
1862          if (this.title == null)
1863            this.title = new ArrayList<CitationCitedArtifactTitleComponent>();
1864          return this.title;
1865        }
1866
1867        /**
1868         * @return Returns a reference to <code>this</code> for easy method chaining
1869         */
1870        public CitationCitedArtifactComponent setTitle(List<CitationCitedArtifactTitleComponent> theTitle) { 
1871          this.title = theTitle;
1872          return this;
1873        }
1874
1875        public boolean hasTitle() { 
1876          if (this.title == null)
1877            return false;
1878          for (CitationCitedArtifactTitleComponent item : this.title)
1879            if (!item.isEmpty())
1880              return true;
1881          return false;
1882        }
1883
1884        public CitationCitedArtifactTitleComponent addTitle() { //3
1885          CitationCitedArtifactTitleComponent t = new CitationCitedArtifactTitleComponent();
1886          if (this.title == null)
1887            this.title = new ArrayList<CitationCitedArtifactTitleComponent>();
1888          this.title.add(t);
1889          return t;
1890        }
1891
1892        public CitationCitedArtifactComponent addTitle(CitationCitedArtifactTitleComponent t) { //3
1893          if (t == null)
1894            return this;
1895          if (this.title == null)
1896            this.title = new ArrayList<CitationCitedArtifactTitleComponent>();
1897          this.title.add(t);
1898          return this;
1899        }
1900
1901        /**
1902         * @return The first repetition of repeating field {@link #title}, creating it if it does not already exist {3}
1903         */
1904        public CitationCitedArtifactTitleComponent getTitleFirstRep() { 
1905          if (getTitle().isEmpty()) {
1906            addTitle();
1907          }
1908          return getTitle().get(0);
1909        }
1910
1911        /**
1912         * @return {@link #abstract_} (Summary of the article or artifact.)
1913         */
1914        public List<CitationCitedArtifactAbstractComponent> getAbstract() { 
1915          if (this.abstract_ == null)
1916            this.abstract_ = new ArrayList<CitationCitedArtifactAbstractComponent>();
1917          return this.abstract_;
1918        }
1919
1920        /**
1921         * @return Returns a reference to <code>this</code> for easy method chaining
1922         */
1923        public CitationCitedArtifactComponent setAbstract(List<CitationCitedArtifactAbstractComponent> theAbstract) { 
1924          this.abstract_ = theAbstract;
1925          return this;
1926        }
1927
1928        public boolean hasAbstract() { 
1929          if (this.abstract_ == null)
1930            return false;
1931          for (CitationCitedArtifactAbstractComponent item : this.abstract_)
1932            if (!item.isEmpty())
1933              return true;
1934          return false;
1935        }
1936
1937        public CitationCitedArtifactAbstractComponent addAbstract() { //3
1938          CitationCitedArtifactAbstractComponent t = new CitationCitedArtifactAbstractComponent();
1939          if (this.abstract_ == null)
1940            this.abstract_ = new ArrayList<CitationCitedArtifactAbstractComponent>();
1941          this.abstract_.add(t);
1942          return t;
1943        }
1944
1945        public CitationCitedArtifactComponent addAbstract(CitationCitedArtifactAbstractComponent t) { //3
1946          if (t == null)
1947            return this;
1948          if (this.abstract_ == null)
1949            this.abstract_ = new ArrayList<CitationCitedArtifactAbstractComponent>();
1950          this.abstract_.add(t);
1951          return this;
1952        }
1953
1954        /**
1955         * @return The first repetition of repeating field {@link #abstract_}, creating it if it does not already exist {3}
1956         */
1957        public CitationCitedArtifactAbstractComponent getAbstractFirstRep() { 
1958          if (getAbstract().isEmpty()) {
1959            addAbstract();
1960          }
1961          return getAbstract().get(0);
1962        }
1963
1964        /**
1965         * @return {@link #part} (The component of the article or artifact.)
1966         */
1967        public CitationCitedArtifactPartComponent getPart() { 
1968          if (this.part == null)
1969            if (Configuration.errorOnAutoCreate())
1970              throw new Error("Attempt to auto-create CitationCitedArtifactComponent.part");
1971            else if (Configuration.doAutoCreate())
1972              this.part = new CitationCitedArtifactPartComponent(); // cc
1973          return this.part;
1974        }
1975
1976        public boolean hasPart() { 
1977          return this.part != null && !this.part.isEmpty();
1978        }
1979
1980        /**
1981         * @param value {@link #part} (The component of the article or artifact.)
1982         */
1983        public CitationCitedArtifactComponent setPart(CitationCitedArtifactPartComponent value) { 
1984          this.part = value;
1985          return this;
1986        }
1987
1988        /**
1989         * @return {@link #relatesTo} (The artifact related to the cited artifact.)
1990         */
1991        public List<CitationCitedArtifactRelatesToComponent> getRelatesTo() { 
1992          if (this.relatesTo == null)
1993            this.relatesTo = new ArrayList<CitationCitedArtifactRelatesToComponent>();
1994          return this.relatesTo;
1995        }
1996
1997        /**
1998         * @return Returns a reference to <code>this</code> for easy method chaining
1999         */
2000        public CitationCitedArtifactComponent setRelatesTo(List<CitationCitedArtifactRelatesToComponent> theRelatesTo) { 
2001          this.relatesTo = theRelatesTo;
2002          return this;
2003        }
2004
2005        public boolean hasRelatesTo() { 
2006          if (this.relatesTo == null)
2007            return false;
2008          for (CitationCitedArtifactRelatesToComponent item : this.relatesTo)
2009            if (!item.isEmpty())
2010              return true;
2011          return false;
2012        }
2013
2014        public CitationCitedArtifactRelatesToComponent addRelatesTo() { //3
2015          CitationCitedArtifactRelatesToComponent t = new CitationCitedArtifactRelatesToComponent();
2016          if (this.relatesTo == null)
2017            this.relatesTo = new ArrayList<CitationCitedArtifactRelatesToComponent>();
2018          this.relatesTo.add(t);
2019          return t;
2020        }
2021
2022        public CitationCitedArtifactComponent addRelatesTo(CitationCitedArtifactRelatesToComponent t) { //3
2023          if (t == null)
2024            return this;
2025          if (this.relatesTo == null)
2026            this.relatesTo = new ArrayList<CitationCitedArtifactRelatesToComponent>();
2027          this.relatesTo.add(t);
2028          return this;
2029        }
2030
2031        /**
2032         * @return The first repetition of repeating field {@link #relatesTo}, creating it if it does not already exist {3}
2033         */
2034        public CitationCitedArtifactRelatesToComponent getRelatesToFirstRep() { 
2035          if (getRelatesTo().isEmpty()) {
2036            addRelatesTo();
2037          }
2038          return getRelatesTo().get(0);
2039        }
2040
2041        /**
2042         * @return {@link #publicationForm} (If multiple, used to represent alternative forms of the article that are not separate citations.)
2043         */
2044        public List<CitationCitedArtifactPublicationFormComponent> getPublicationForm() { 
2045          if (this.publicationForm == null)
2046            this.publicationForm = new ArrayList<CitationCitedArtifactPublicationFormComponent>();
2047          return this.publicationForm;
2048        }
2049
2050        /**
2051         * @return Returns a reference to <code>this</code> for easy method chaining
2052         */
2053        public CitationCitedArtifactComponent setPublicationForm(List<CitationCitedArtifactPublicationFormComponent> thePublicationForm) { 
2054          this.publicationForm = thePublicationForm;
2055          return this;
2056        }
2057
2058        public boolean hasPublicationForm() { 
2059          if (this.publicationForm == null)
2060            return false;
2061          for (CitationCitedArtifactPublicationFormComponent item : this.publicationForm)
2062            if (!item.isEmpty())
2063              return true;
2064          return false;
2065        }
2066
2067        public CitationCitedArtifactPublicationFormComponent addPublicationForm() { //3
2068          CitationCitedArtifactPublicationFormComponent t = new CitationCitedArtifactPublicationFormComponent();
2069          if (this.publicationForm == null)
2070            this.publicationForm = new ArrayList<CitationCitedArtifactPublicationFormComponent>();
2071          this.publicationForm.add(t);
2072          return t;
2073        }
2074
2075        public CitationCitedArtifactComponent addPublicationForm(CitationCitedArtifactPublicationFormComponent t) { //3
2076          if (t == null)
2077            return this;
2078          if (this.publicationForm == null)
2079            this.publicationForm = new ArrayList<CitationCitedArtifactPublicationFormComponent>();
2080          this.publicationForm.add(t);
2081          return this;
2082        }
2083
2084        /**
2085         * @return The first repetition of repeating field {@link #publicationForm}, creating it if it does not already exist {3}
2086         */
2087        public CitationCitedArtifactPublicationFormComponent getPublicationFormFirstRep() { 
2088          if (getPublicationForm().isEmpty()) {
2089            addPublicationForm();
2090          }
2091          return getPublicationForm().get(0);
2092        }
2093
2094        /**
2095         * @return {@link #webLocation} (Used for any URL for the article or artifact cited.)
2096         */
2097        public List<CitationCitedArtifactWebLocationComponent> getWebLocation() { 
2098          if (this.webLocation == null)
2099            this.webLocation = new ArrayList<CitationCitedArtifactWebLocationComponent>();
2100          return this.webLocation;
2101        }
2102
2103        /**
2104         * @return Returns a reference to <code>this</code> for easy method chaining
2105         */
2106        public CitationCitedArtifactComponent setWebLocation(List<CitationCitedArtifactWebLocationComponent> theWebLocation) { 
2107          this.webLocation = theWebLocation;
2108          return this;
2109        }
2110
2111        public boolean hasWebLocation() { 
2112          if (this.webLocation == null)
2113            return false;
2114          for (CitationCitedArtifactWebLocationComponent item : this.webLocation)
2115            if (!item.isEmpty())
2116              return true;
2117          return false;
2118        }
2119
2120        public CitationCitedArtifactWebLocationComponent addWebLocation() { //3
2121          CitationCitedArtifactWebLocationComponent t = new CitationCitedArtifactWebLocationComponent();
2122          if (this.webLocation == null)
2123            this.webLocation = new ArrayList<CitationCitedArtifactWebLocationComponent>();
2124          this.webLocation.add(t);
2125          return t;
2126        }
2127
2128        public CitationCitedArtifactComponent addWebLocation(CitationCitedArtifactWebLocationComponent t) { //3
2129          if (t == null)
2130            return this;
2131          if (this.webLocation == null)
2132            this.webLocation = new ArrayList<CitationCitedArtifactWebLocationComponent>();
2133          this.webLocation.add(t);
2134          return this;
2135        }
2136
2137        /**
2138         * @return The first repetition of repeating field {@link #webLocation}, creating it if it does not already exist {3}
2139         */
2140        public CitationCitedArtifactWebLocationComponent getWebLocationFirstRep() { 
2141          if (getWebLocation().isEmpty()) {
2142            addWebLocation();
2143          }
2144          return getWebLocation().get(0);
2145        }
2146
2147        /**
2148         * @return {@link #classification} (The assignment to an organizing scheme.)
2149         */
2150        public List<CitationCitedArtifactClassificationComponent> getClassification() { 
2151          if (this.classification == null)
2152            this.classification = new ArrayList<CitationCitedArtifactClassificationComponent>();
2153          return this.classification;
2154        }
2155
2156        /**
2157         * @return Returns a reference to <code>this</code> for easy method chaining
2158         */
2159        public CitationCitedArtifactComponent setClassification(List<CitationCitedArtifactClassificationComponent> theClassification) { 
2160          this.classification = theClassification;
2161          return this;
2162        }
2163
2164        public boolean hasClassification() { 
2165          if (this.classification == null)
2166            return false;
2167          for (CitationCitedArtifactClassificationComponent item : this.classification)
2168            if (!item.isEmpty())
2169              return true;
2170          return false;
2171        }
2172
2173        public CitationCitedArtifactClassificationComponent addClassification() { //3
2174          CitationCitedArtifactClassificationComponent t = new CitationCitedArtifactClassificationComponent();
2175          if (this.classification == null)
2176            this.classification = new ArrayList<CitationCitedArtifactClassificationComponent>();
2177          this.classification.add(t);
2178          return t;
2179        }
2180
2181        public CitationCitedArtifactComponent addClassification(CitationCitedArtifactClassificationComponent t) { //3
2182          if (t == null)
2183            return this;
2184          if (this.classification == null)
2185            this.classification = new ArrayList<CitationCitedArtifactClassificationComponent>();
2186          this.classification.add(t);
2187          return this;
2188        }
2189
2190        /**
2191         * @return The first repetition of repeating field {@link #classification}, creating it if it does not already exist {3}
2192         */
2193        public CitationCitedArtifactClassificationComponent getClassificationFirstRep() { 
2194          if (getClassification().isEmpty()) {
2195            addClassification();
2196          }
2197          return getClassification().get(0);
2198        }
2199
2200        /**
2201         * @return {@link #contributorship} (This element is used to list authors and other contributors, their contact information, specific contributions, and summary statements.)
2202         */
2203        public CitationCitedArtifactContributorshipComponent getContributorship() { 
2204          if (this.contributorship == null)
2205            if (Configuration.errorOnAutoCreate())
2206              throw new Error("Attempt to auto-create CitationCitedArtifactComponent.contributorship");
2207            else if (Configuration.doAutoCreate())
2208              this.contributorship = new CitationCitedArtifactContributorshipComponent(); // cc
2209          return this.contributorship;
2210        }
2211
2212        public boolean hasContributorship() { 
2213          return this.contributorship != null && !this.contributorship.isEmpty();
2214        }
2215
2216        /**
2217         * @param value {@link #contributorship} (This element is used to list authors and other contributors, their contact information, specific contributions, and summary statements.)
2218         */
2219        public CitationCitedArtifactComponent setContributorship(CitationCitedArtifactContributorshipComponent value) { 
2220          this.contributorship = value;
2221          return this;
2222        }
2223
2224        /**
2225         * @return {@link #note} (Any additional information or content for the article or artifact.)
2226         */
2227        public List<Annotation> getNote() { 
2228          if (this.note == null)
2229            this.note = new ArrayList<Annotation>();
2230          return this.note;
2231        }
2232
2233        /**
2234         * @return Returns a reference to <code>this</code> for easy method chaining
2235         */
2236        public CitationCitedArtifactComponent setNote(List<Annotation> theNote) { 
2237          this.note = theNote;
2238          return this;
2239        }
2240
2241        public boolean hasNote() { 
2242          if (this.note == null)
2243            return false;
2244          for (Annotation item : this.note)
2245            if (!item.isEmpty())
2246              return true;
2247          return false;
2248        }
2249
2250        public Annotation addNote() { //3
2251          Annotation t = new Annotation();
2252          if (this.note == null)
2253            this.note = new ArrayList<Annotation>();
2254          this.note.add(t);
2255          return t;
2256        }
2257
2258        public CitationCitedArtifactComponent addNote(Annotation t) { //3
2259          if (t == null)
2260            return this;
2261          if (this.note == null)
2262            this.note = new ArrayList<Annotation>();
2263          this.note.add(t);
2264          return this;
2265        }
2266
2267        /**
2268         * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
2269         */
2270        public Annotation getNoteFirstRep() { 
2271          if (getNote().isEmpty()) {
2272            addNote();
2273          }
2274          return getNote().get(0);
2275        }
2276
2277        protected void listChildren(List<Property> children) {
2278          super.listChildren(children);
2279          children.add(new Property("identifier", "Identifier", "A formal identifier that is used to identify this citation when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier));
2280          children.add(new Property("relatedIdentifier", "Identifier", "A formal identifier that is used to identify things closely related to this citation.", 0, java.lang.Integer.MAX_VALUE, relatedIdentifier));
2281          children.add(new Property("dateAccessed", "dateTime", "When the cited artifact was accessed.", 0, 1, dateAccessed));
2282          children.add(new Property("version", "", "The defined version of the cited artifact.", 0, 1, version));
2283          children.add(new Property("currentState", "CodeableConcept", "The status of the cited artifact.", 0, java.lang.Integer.MAX_VALUE, currentState));
2284          children.add(new Property("statusDate", "", "An effective date or period for a status of the cited artifact.", 0, java.lang.Integer.MAX_VALUE, statusDate));
2285          children.add(new Property("title", "", "The title details of the article or artifact.", 0, java.lang.Integer.MAX_VALUE, title));
2286          children.add(new Property("abstract", "", "Summary of the article or artifact.", 0, java.lang.Integer.MAX_VALUE, abstract_));
2287          children.add(new Property("part", "", "The component of the article or artifact.", 0, 1, part));
2288          children.add(new Property("relatesTo", "", "The artifact related to the cited artifact.", 0, java.lang.Integer.MAX_VALUE, relatesTo));
2289          children.add(new Property("publicationForm", "", "If multiple, used to represent alternative forms of the article that are not separate citations.", 0, java.lang.Integer.MAX_VALUE, publicationForm));
2290          children.add(new Property("webLocation", "", "Used for any URL for the article or artifact cited.", 0, java.lang.Integer.MAX_VALUE, webLocation));
2291          children.add(new Property("classification", "", "The assignment to an organizing scheme.", 0, java.lang.Integer.MAX_VALUE, classification));
2292          children.add(new Property("contributorship", "", "This element is used to list authors and other contributors, their contact information, specific contributions, and summary statements.", 0, 1, contributorship));
2293          children.add(new Property("note", "Annotation", "Any additional information or content for the article or artifact.", 0, java.lang.Integer.MAX_VALUE, note));
2294        }
2295
2296        @Override
2297        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2298          switch (_hash) {
2299          case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A formal identifier that is used to identify this citation when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier);
2300          case -1007604940: /*relatedIdentifier*/  return new Property("relatedIdentifier", "Identifier", "A formal identifier that is used to identify things closely related to this citation.", 0, java.lang.Integer.MAX_VALUE, relatedIdentifier);
2301          case 540917457: /*dateAccessed*/  return new Property("dateAccessed", "dateTime", "When the cited artifact was accessed.", 0, 1, dateAccessed);
2302          case 351608024: /*version*/  return new Property("version", "", "The defined version of the cited artifact.", 0, 1, version);
2303          case 1457822360: /*currentState*/  return new Property("currentState", "CodeableConcept", "The status of the cited artifact.", 0, java.lang.Integer.MAX_VALUE, currentState);
2304          case 247524032: /*statusDate*/  return new Property("statusDate", "", "An effective date or period for a status of the cited artifact.", 0, java.lang.Integer.MAX_VALUE, statusDate);
2305          case 110371416: /*title*/  return new Property("title", "", "The title details of the article or artifact.", 0, java.lang.Integer.MAX_VALUE, title);
2306          case 1732898850: /*abstract*/  return new Property("abstract", "", "Summary of the article or artifact.", 0, java.lang.Integer.MAX_VALUE, abstract_);
2307          case 3433459: /*part*/  return new Property("part", "", "The component of the article or artifact.", 0, 1, part);
2308          case -7765931: /*relatesTo*/  return new Property("relatesTo", "", "The artifact related to the cited artifact.", 0, java.lang.Integer.MAX_VALUE, relatesTo);
2309          case 1470639376: /*publicationForm*/  return new Property("publicationForm", "", "If multiple, used to represent alternative forms of the article that are not separate citations.", 0, java.lang.Integer.MAX_VALUE, publicationForm);
2310          case -828032215: /*webLocation*/  return new Property("webLocation", "", "Used for any URL for the article or artifact cited.", 0, java.lang.Integer.MAX_VALUE, webLocation);
2311          case 382350310: /*classification*/  return new Property("classification", "", "The assignment to an organizing scheme.", 0, java.lang.Integer.MAX_VALUE, classification);
2312          case 538727831: /*contributorship*/  return new Property("contributorship", "", "This element is used to list authors and other contributors, their contact information, specific contributions, and summary statements.", 0, 1, contributorship);
2313          case 3387378: /*note*/  return new Property("note", "Annotation", "Any additional information or content for the article or artifact.", 0, java.lang.Integer.MAX_VALUE, note);
2314          default: return super.getNamedProperty(_hash, _name, _checkValid);
2315          }
2316
2317        }
2318
2319      @Override
2320      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2321        switch (hash) {
2322        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2323        case -1007604940: /*relatedIdentifier*/ return this.relatedIdentifier == null ? new Base[0] : this.relatedIdentifier.toArray(new Base[this.relatedIdentifier.size()]); // Identifier
2324        case 540917457: /*dateAccessed*/ return this.dateAccessed == null ? new Base[0] : new Base[] {this.dateAccessed}; // DateTimeType
2325        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // CitationCitedArtifactVersionComponent
2326        case 1457822360: /*currentState*/ return this.currentState == null ? new Base[0] : this.currentState.toArray(new Base[this.currentState.size()]); // CodeableConcept
2327        case 247524032: /*statusDate*/ return this.statusDate == null ? new Base[0] : this.statusDate.toArray(new Base[this.statusDate.size()]); // CitationCitedArtifactStatusDateComponent
2328        case 110371416: /*title*/ return this.title == null ? new Base[0] : this.title.toArray(new Base[this.title.size()]); // CitationCitedArtifactTitleComponent
2329        case 1732898850: /*abstract*/ return this.abstract_ == null ? new Base[0] : this.abstract_.toArray(new Base[this.abstract_.size()]); // CitationCitedArtifactAbstractComponent
2330        case 3433459: /*part*/ return this.part == null ? new Base[0] : new Base[] {this.part}; // CitationCitedArtifactPartComponent
2331        case -7765931: /*relatesTo*/ return this.relatesTo == null ? new Base[0] : this.relatesTo.toArray(new Base[this.relatesTo.size()]); // CitationCitedArtifactRelatesToComponent
2332        case 1470639376: /*publicationForm*/ return this.publicationForm == null ? new Base[0] : this.publicationForm.toArray(new Base[this.publicationForm.size()]); // CitationCitedArtifactPublicationFormComponent
2333        case -828032215: /*webLocation*/ return this.webLocation == null ? new Base[0] : this.webLocation.toArray(new Base[this.webLocation.size()]); // CitationCitedArtifactWebLocationComponent
2334        case 382350310: /*classification*/ return this.classification == null ? new Base[0] : this.classification.toArray(new Base[this.classification.size()]); // CitationCitedArtifactClassificationComponent
2335        case 538727831: /*contributorship*/ return this.contributorship == null ? new Base[0] : new Base[] {this.contributorship}; // CitationCitedArtifactContributorshipComponent
2336        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
2337        default: return super.getProperty(hash, name, checkValid);
2338        }
2339
2340      }
2341
2342      @Override
2343      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2344        switch (hash) {
2345        case -1618432855: // identifier
2346          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
2347          return value;
2348        case -1007604940: // relatedIdentifier
2349          this.getRelatedIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
2350          return value;
2351        case 540917457: // dateAccessed
2352          this.dateAccessed = TypeConvertor.castToDateTime(value); // DateTimeType
2353          return value;
2354        case 351608024: // version
2355          this.version = (CitationCitedArtifactVersionComponent) value; // CitationCitedArtifactVersionComponent
2356          return value;
2357        case 1457822360: // currentState
2358          this.getCurrentState().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2359          return value;
2360        case 247524032: // statusDate
2361          this.getStatusDate().add((CitationCitedArtifactStatusDateComponent) value); // CitationCitedArtifactStatusDateComponent
2362          return value;
2363        case 110371416: // title
2364          this.getTitle().add((CitationCitedArtifactTitleComponent) value); // CitationCitedArtifactTitleComponent
2365          return value;
2366        case 1732898850: // abstract
2367          this.getAbstract().add((CitationCitedArtifactAbstractComponent) value); // CitationCitedArtifactAbstractComponent
2368          return value;
2369        case 3433459: // part
2370          this.part = (CitationCitedArtifactPartComponent) value; // CitationCitedArtifactPartComponent
2371          return value;
2372        case -7765931: // relatesTo
2373          this.getRelatesTo().add((CitationCitedArtifactRelatesToComponent) value); // CitationCitedArtifactRelatesToComponent
2374          return value;
2375        case 1470639376: // publicationForm
2376          this.getPublicationForm().add((CitationCitedArtifactPublicationFormComponent) value); // CitationCitedArtifactPublicationFormComponent
2377          return value;
2378        case -828032215: // webLocation
2379          this.getWebLocation().add((CitationCitedArtifactWebLocationComponent) value); // CitationCitedArtifactWebLocationComponent
2380          return value;
2381        case 382350310: // classification
2382          this.getClassification().add((CitationCitedArtifactClassificationComponent) value); // CitationCitedArtifactClassificationComponent
2383          return value;
2384        case 538727831: // contributorship
2385          this.contributorship = (CitationCitedArtifactContributorshipComponent) value; // CitationCitedArtifactContributorshipComponent
2386          return value;
2387        case 3387378: // note
2388          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
2389          return value;
2390        default: return super.setProperty(hash, name, value);
2391        }
2392
2393      }
2394
2395      @Override
2396      public Base setProperty(String name, Base value) throws FHIRException {
2397        if (name.equals("identifier")) {
2398          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
2399        } else if (name.equals("relatedIdentifier")) {
2400          this.getRelatedIdentifier().add(TypeConvertor.castToIdentifier(value));
2401        } else if (name.equals("dateAccessed")) {
2402          this.dateAccessed = TypeConvertor.castToDateTime(value); // DateTimeType
2403        } else if (name.equals("version")) {
2404          this.version = (CitationCitedArtifactVersionComponent) value; // CitationCitedArtifactVersionComponent
2405        } else if (name.equals("currentState")) {
2406          this.getCurrentState().add(TypeConvertor.castToCodeableConcept(value));
2407        } else if (name.equals("statusDate")) {
2408          this.getStatusDate().add((CitationCitedArtifactStatusDateComponent) value);
2409        } else if (name.equals("title")) {
2410          this.getTitle().add((CitationCitedArtifactTitleComponent) value);
2411        } else if (name.equals("abstract")) {
2412          this.getAbstract().add((CitationCitedArtifactAbstractComponent) value);
2413        } else if (name.equals("part")) {
2414          this.part = (CitationCitedArtifactPartComponent) value; // CitationCitedArtifactPartComponent
2415        } else if (name.equals("relatesTo")) {
2416          this.getRelatesTo().add((CitationCitedArtifactRelatesToComponent) value);
2417        } else if (name.equals("publicationForm")) {
2418          this.getPublicationForm().add((CitationCitedArtifactPublicationFormComponent) value);
2419        } else if (name.equals("webLocation")) {
2420          this.getWebLocation().add((CitationCitedArtifactWebLocationComponent) value);
2421        } else if (name.equals("classification")) {
2422          this.getClassification().add((CitationCitedArtifactClassificationComponent) value);
2423        } else if (name.equals("contributorship")) {
2424          this.contributorship = (CitationCitedArtifactContributorshipComponent) value; // CitationCitedArtifactContributorshipComponent
2425        } else if (name.equals("note")) {
2426          this.getNote().add(TypeConvertor.castToAnnotation(value));
2427        } else
2428          return super.setProperty(name, value);
2429        return value;
2430      }
2431
2432      @Override
2433      public Base makeProperty(int hash, String name) throws FHIRException {
2434        switch (hash) {
2435        case -1618432855:  return addIdentifier(); 
2436        case -1007604940:  return addRelatedIdentifier(); 
2437        case 540917457:  return getDateAccessedElement();
2438        case 351608024:  return getVersion();
2439        case 1457822360:  return addCurrentState(); 
2440        case 247524032:  return addStatusDate(); 
2441        case 110371416:  return addTitle(); 
2442        case 1732898850:  return addAbstract(); 
2443        case 3433459:  return getPart();
2444        case -7765931:  return addRelatesTo(); 
2445        case 1470639376:  return addPublicationForm(); 
2446        case -828032215:  return addWebLocation(); 
2447        case 382350310:  return addClassification(); 
2448        case 538727831:  return getContributorship();
2449        case 3387378:  return addNote(); 
2450        default: return super.makeProperty(hash, name);
2451        }
2452
2453      }
2454
2455      @Override
2456      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2457        switch (hash) {
2458        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2459        case -1007604940: /*relatedIdentifier*/ return new String[] {"Identifier"};
2460        case 540917457: /*dateAccessed*/ return new String[] {"dateTime"};
2461        case 351608024: /*version*/ return new String[] {};
2462        case 1457822360: /*currentState*/ return new String[] {"CodeableConcept"};
2463        case 247524032: /*statusDate*/ return new String[] {};
2464        case 110371416: /*title*/ return new String[] {};
2465        case 1732898850: /*abstract*/ return new String[] {};
2466        case 3433459: /*part*/ return new String[] {};
2467        case -7765931: /*relatesTo*/ return new String[] {};
2468        case 1470639376: /*publicationForm*/ return new String[] {};
2469        case -828032215: /*webLocation*/ return new String[] {};
2470        case 382350310: /*classification*/ return new String[] {};
2471        case 538727831: /*contributorship*/ return new String[] {};
2472        case 3387378: /*note*/ return new String[] {"Annotation"};
2473        default: return super.getTypesForProperty(hash, name);
2474        }
2475
2476      }
2477
2478      @Override
2479      public Base addChild(String name) throws FHIRException {
2480        if (name.equals("identifier")) {
2481          return addIdentifier();
2482        }
2483        else if (name.equals("relatedIdentifier")) {
2484          return addRelatedIdentifier();
2485        }
2486        else if (name.equals("dateAccessed")) {
2487          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.dateAccessed");
2488        }
2489        else if (name.equals("version")) {
2490          this.version = new CitationCitedArtifactVersionComponent();
2491          return this.version;
2492        }
2493        else if (name.equals("currentState")) {
2494          return addCurrentState();
2495        }
2496        else if (name.equals("statusDate")) {
2497          return addStatusDate();
2498        }
2499        else if (name.equals("title")) {
2500          return addTitle();
2501        }
2502        else if (name.equals("abstract")) {
2503          return addAbstract();
2504        }
2505        else if (name.equals("part")) {
2506          this.part = new CitationCitedArtifactPartComponent();
2507          return this.part;
2508        }
2509        else if (name.equals("relatesTo")) {
2510          return addRelatesTo();
2511        }
2512        else if (name.equals("publicationForm")) {
2513          return addPublicationForm();
2514        }
2515        else if (name.equals("webLocation")) {
2516          return addWebLocation();
2517        }
2518        else if (name.equals("classification")) {
2519          return addClassification();
2520        }
2521        else if (name.equals("contributorship")) {
2522          this.contributorship = new CitationCitedArtifactContributorshipComponent();
2523          return this.contributorship;
2524        }
2525        else if (name.equals("note")) {
2526          return addNote();
2527        }
2528        else
2529          return super.addChild(name);
2530      }
2531
2532      public CitationCitedArtifactComponent copy() {
2533        CitationCitedArtifactComponent dst = new CitationCitedArtifactComponent();
2534        copyValues(dst);
2535        return dst;
2536      }
2537
2538      public void copyValues(CitationCitedArtifactComponent dst) {
2539        super.copyValues(dst);
2540        if (identifier != null) {
2541          dst.identifier = new ArrayList<Identifier>();
2542          for (Identifier i : identifier)
2543            dst.identifier.add(i.copy());
2544        };
2545        if (relatedIdentifier != null) {
2546          dst.relatedIdentifier = new ArrayList<Identifier>();
2547          for (Identifier i : relatedIdentifier)
2548            dst.relatedIdentifier.add(i.copy());
2549        };
2550        dst.dateAccessed = dateAccessed == null ? null : dateAccessed.copy();
2551        dst.version = version == null ? null : version.copy();
2552        if (currentState != null) {
2553          dst.currentState = new ArrayList<CodeableConcept>();
2554          for (CodeableConcept i : currentState)
2555            dst.currentState.add(i.copy());
2556        };
2557        if (statusDate != null) {
2558          dst.statusDate = new ArrayList<CitationCitedArtifactStatusDateComponent>();
2559          for (CitationCitedArtifactStatusDateComponent i : statusDate)
2560            dst.statusDate.add(i.copy());
2561        };
2562        if (title != null) {
2563          dst.title = new ArrayList<CitationCitedArtifactTitleComponent>();
2564          for (CitationCitedArtifactTitleComponent i : title)
2565            dst.title.add(i.copy());
2566        };
2567        if (abstract_ != null) {
2568          dst.abstract_ = new ArrayList<CitationCitedArtifactAbstractComponent>();
2569          for (CitationCitedArtifactAbstractComponent i : abstract_)
2570            dst.abstract_.add(i.copy());
2571        };
2572        dst.part = part == null ? null : part.copy();
2573        if (relatesTo != null) {
2574          dst.relatesTo = new ArrayList<CitationCitedArtifactRelatesToComponent>();
2575          for (CitationCitedArtifactRelatesToComponent i : relatesTo)
2576            dst.relatesTo.add(i.copy());
2577        };
2578        if (publicationForm != null) {
2579          dst.publicationForm = new ArrayList<CitationCitedArtifactPublicationFormComponent>();
2580          for (CitationCitedArtifactPublicationFormComponent i : publicationForm)
2581            dst.publicationForm.add(i.copy());
2582        };
2583        if (webLocation != null) {
2584          dst.webLocation = new ArrayList<CitationCitedArtifactWebLocationComponent>();
2585          for (CitationCitedArtifactWebLocationComponent i : webLocation)
2586            dst.webLocation.add(i.copy());
2587        };
2588        if (classification != null) {
2589          dst.classification = new ArrayList<CitationCitedArtifactClassificationComponent>();
2590          for (CitationCitedArtifactClassificationComponent i : classification)
2591            dst.classification.add(i.copy());
2592        };
2593        dst.contributorship = contributorship == null ? null : contributorship.copy();
2594        if (note != null) {
2595          dst.note = new ArrayList<Annotation>();
2596          for (Annotation i : note)
2597            dst.note.add(i.copy());
2598        };
2599      }
2600
2601      @Override
2602      public boolean equalsDeep(Base other_) {
2603        if (!super.equalsDeep(other_))
2604          return false;
2605        if (!(other_ instanceof CitationCitedArtifactComponent))
2606          return false;
2607        CitationCitedArtifactComponent o = (CitationCitedArtifactComponent) other_;
2608        return compareDeep(identifier, o.identifier, true) && compareDeep(relatedIdentifier, o.relatedIdentifier, true)
2609           && compareDeep(dateAccessed, o.dateAccessed, true) && compareDeep(version, o.version, true) && compareDeep(currentState, o.currentState, true)
2610           && compareDeep(statusDate, o.statusDate, true) && compareDeep(title, o.title, true) && compareDeep(abstract_, o.abstract_, true)
2611           && compareDeep(part, o.part, true) && compareDeep(relatesTo, o.relatesTo, true) && compareDeep(publicationForm, o.publicationForm, true)
2612           && compareDeep(webLocation, o.webLocation, true) && compareDeep(classification, o.classification, true)
2613           && compareDeep(contributorship, o.contributorship, true) && compareDeep(note, o.note, true);
2614      }
2615
2616      @Override
2617      public boolean equalsShallow(Base other_) {
2618        if (!super.equalsShallow(other_))
2619          return false;
2620        if (!(other_ instanceof CitationCitedArtifactComponent))
2621          return false;
2622        CitationCitedArtifactComponent o = (CitationCitedArtifactComponent) other_;
2623        return compareValues(dateAccessed, o.dateAccessed, true);
2624      }
2625
2626      public boolean isEmpty() {
2627        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, relatedIdentifier
2628          , dateAccessed, version, currentState, statusDate, title, abstract_, part, relatesTo
2629          , publicationForm, webLocation, classification, contributorship, note);
2630      }
2631
2632  public String fhirType() {
2633    return "Citation.citedArtifact";
2634
2635  }
2636
2637  }
2638
2639    @Block()
2640    public static class CitationCitedArtifactVersionComponent extends BackboneElement implements IBaseBackboneElement {
2641        /**
2642         * The version number or other version identifier.
2643         */
2644        @Child(name = "value", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
2645        @Description(shortDefinition="The version number or other version identifier", formalDefinition="The version number or other version identifier." )
2646        protected StringType value;
2647
2648        /**
2649         * Citation for the main version of the cited artifact.
2650         */
2651        @Child(name = "baseCitation", type = {Citation.class}, order=2, min=0, max=1, modifier=false, summary=false)
2652        @Description(shortDefinition="Citation for the main version of the cited artifact", formalDefinition="Citation for the main version of the cited artifact." )
2653        protected Reference baseCitation;
2654
2655        private static final long serialVersionUID = 1437090319L;
2656
2657    /**
2658     * Constructor
2659     */
2660      public CitationCitedArtifactVersionComponent() {
2661        super();
2662      }
2663
2664    /**
2665     * Constructor
2666     */
2667      public CitationCitedArtifactVersionComponent(String value) {
2668        super();
2669        this.setValue(value);
2670      }
2671
2672        /**
2673         * @return {@link #value} (The version number or other version identifier.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
2674         */
2675        public StringType getValueElement() { 
2676          if (this.value == null)
2677            if (Configuration.errorOnAutoCreate())
2678              throw new Error("Attempt to auto-create CitationCitedArtifactVersionComponent.value");
2679            else if (Configuration.doAutoCreate())
2680              this.value = new StringType(); // bb
2681          return this.value;
2682        }
2683
2684        public boolean hasValueElement() { 
2685          return this.value != null && !this.value.isEmpty();
2686        }
2687
2688        public boolean hasValue() { 
2689          return this.value != null && !this.value.isEmpty();
2690        }
2691
2692        /**
2693         * @param value {@link #value} (The version number or other version identifier.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
2694         */
2695        public CitationCitedArtifactVersionComponent setValueElement(StringType value) { 
2696          this.value = value;
2697          return this;
2698        }
2699
2700        /**
2701         * @return The version number or other version identifier.
2702         */
2703        public String getValue() { 
2704          return this.value == null ? null : this.value.getValue();
2705        }
2706
2707        /**
2708         * @param value The version number or other version identifier.
2709         */
2710        public CitationCitedArtifactVersionComponent setValue(String value) { 
2711            if (this.value == null)
2712              this.value = new StringType();
2713            this.value.setValue(value);
2714          return this;
2715        }
2716
2717        /**
2718         * @return {@link #baseCitation} (Citation for the main version of the cited artifact.)
2719         */
2720        public Reference getBaseCitation() { 
2721          if (this.baseCitation == null)
2722            if (Configuration.errorOnAutoCreate())
2723              throw new Error("Attempt to auto-create CitationCitedArtifactVersionComponent.baseCitation");
2724            else if (Configuration.doAutoCreate())
2725              this.baseCitation = new Reference(); // cc
2726          return this.baseCitation;
2727        }
2728
2729        public boolean hasBaseCitation() { 
2730          return this.baseCitation != null && !this.baseCitation.isEmpty();
2731        }
2732
2733        /**
2734         * @param value {@link #baseCitation} (Citation for the main version of the cited artifact.)
2735         */
2736        public CitationCitedArtifactVersionComponent setBaseCitation(Reference value) { 
2737          this.baseCitation = value;
2738          return this;
2739        }
2740
2741        protected void listChildren(List<Property> children) {
2742          super.listChildren(children);
2743          children.add(new Property("value", "string", "The version number or other version identifier.", 0, 1, value));
2744          children.add(new Property("baseCitation", "Reference(Citation)", "Citation for the main version of the cited artifact.", 0, 1, baseCitation));
2745        }
2746
2747        @Override
2748        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2749          switch (_hash) {
2750          case 111972721: /*value*/  return new Property("value", "string", "The version number or other version identifier.", 0, 1, value);
2751          case 1182995672: /*baseCitation*/  return new Property("baseCitation", "Reference(Citation)", "Citation for the main version of the cited artifact.", 0, 1, baseCitation);
2752          default: return super.getNamedProperty(_hash, _name, _checkValid);
2753          }
2754
2755        }
2756
2757      @Override
2758      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2759        switch (hash) {
2760        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType
2761        case 1182995672: /*baseCitation*/ return this.baseCitation == null ? new Base[0] : new Base[] {this.baseCitation}; // Reference
2762        default: return super.getProperty(hash, name, checkValid);
2763        }
2764
2765      }
2766
2767      @Override
2768      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2769        switch (hash) {
2770        case 111972721: // value
2771          this.value = TypeConvertor.castToString(value); // StringType
2772          return value;
2773        case 1182995672: // baseCitation
2774          this.baseCitation = TypeConvertor.castToReference(value); // Reference
2775          return value;
2776        default: return super.setProperty(hash, name, value);
2777        }
2778
2779      }
2780
2781      @Override
2782      public Base setProperty(String name, Base value) throws FHIRException {
2783        if (name.equals("value")) {
2784          this.value = TypeConvertor.castToString(value); // StringType
2785        } else if (name.equals("baseCitation")) {
2786          this.baseCitation = TypeConvertor.castToReference(value); // Reference
2787        } else
2788          return super.setProperty(name, value);
2789        return value;
2790      }
2791
2792      @Override
2793      public Base makeProperty(int hash, String name) throws FHIRException {
2794        switch (hash) {
2795        case 111972721:  return getValueElement();
2796        case 1182995672:  return getBaseCitation();
2797        default: return super.makeProperty(hash, name);
2798        }
2799
2800      }
2801
2802      @Override
2803      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2804        switch (hash) {
2805        case 111972721: /*value*/ return new String[] {"string"};
2806        case 1182995672: /*baseCitation*/ return new String[] {"Reference"};
2807        default: return super.getTypesForProperty(hash, name);
2808        }
2809
2810      }
2811
2812      @Override
2813      public Base addChild(String name) throws FHIRException {
2814        if (name.equals("value")) {
2815          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.version.value");
2816        }
2817        else if (name.equals("baseCitation")) {
2818          this.baseCitation = new Reference();
2819          return this.baseCitation;
2820        }
2821        else
2822          return super.addChild(name);
2823      }
2824
2825      public CitationCitedArtifactVersionComponent copy() {
2826        CitationCitedArtifactVersionComponent dst = new CitationCitedArtifactVersionComponent();
2827        copyValues(dst);
2828        return dst;
2829      }
2830
2831      public void copyValues(CitationCitedArtifactVersionComponent dst) {
2832        super.copyValues(dst);
2833        dst.value = value == null ? null : value.copy();
2834        dst.baseCitation = baseCitation == null ? null : baseCitation.copy();
2835      }
2836
2837      @Override
2838      public boolean equalsDeep(Base other_) {
2839        if (!super.equalsDeep(other_))
2840          return false;
2841        if (!(other_ instanceof CitationCitedArtifactVersionComponent))
2842          return false;
2843        CitationCitedArtifactVersionComponent o = (CitationCitedArtifactVersionComponent) other_;
2844        return compareDeep(value, o.value, true) && compareDeep(baseCitation, o.baseCitation, true);
2845      }
2846
2847      @Override
2848      public boolean equalsShallow(Base other_) {
2849        if (!super.equalsShallow(other_))
2850          return false;
2851        if (!(other_ instanceof CitationCitedArtifactVersionComponent))
2852          return false;
2853        CitationCitedArtifactVersionComponent o = (CitationCitedArtifactVersionComponent) other_;
2854        return compareValues(value, o.value, true);
2855      }
2856
2857      public boolean isEmpty() {
2858        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(value, baseCitation);
2859      }
2860
2861  public String fhirType() {
2862    return "Citation.citedArtifact.version";
2863
2864  }
2865
2866  }
2867
2868    @Block()
2869    public static class CitationCitedArtifactStatusDateComponent extends BackboneElement implements IBaseBackboneElement {
2870        /**
2871         * Classification of the status.
2872         */
2873        @Child(name = "activity", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
2874        @Description(shortDefinition="Classification of the status", formalDefinition="Classification of the status." )
2875        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/cited-artifact-status-type")
2876        protected CodeableConcept activity;
2877
2878        /**
2879         * Either occurred or expected.
2880         */
2881        @Child(name = "actual", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false)
2882        @Description(shortDefinition="Either occurred or expected", formalDefinition="Either occurred or expected." )
2883        protected BooleanType actual;
2884
2885        /**
2886         * When the status started and/or ended.
2887         */
2888        @Child(name = "period", type = {Period.class}, order=3, min=1, max=1, modifier=false, summary=false)
2889        @Description(shortDefinition="When the status started and/or ended", formalDefinition="When the status started and/or ended." )
2890        protected Period period;
2891
2892        private static final long serialVersionUID = 1123586924L;
2893
2894    /**
2895     * Constructor
2896     */
2897      public CitationCitedArtifactStatusDateComponent() {
2898        super();
2899      }
2900
2901    /**
2902     * Constructor
2903     */
2904      public CitationCitedArtifactStatusDateComponent(CodeableConcept activity, Period period) {
2905        super();
2906        this.setActivity(activity);
2907        this.setPeriod(period);
2908      }
2909
2910        /**
2911         * @return {@link #activity} (Classification of the status.)
2912         */
2913        public CodeableConcept getActivity() { 
2914          if (this.activity == null)
2915            if (Configuration.errorOnAutoCreate())
2916              throw new Error("Attempt to auto-create CitationCitedArtifactStatusDateComponent.activity");
2917            else if (Configuration.doAutoCreate())
2918              this.activity = new CodeableConcept(); // cc
2919          return this.activity;
2920        }
2921
2922        public boolean hasActivity() { 
2923          return this.activity != null && !this.activity.isEmpty();
2924        }
2925
2926        /**
2927         * @param value {@link #activity} (Classification of the status.)
2928         */
2929        public CitationCitedArtifactStatusDateComponent setActivity(CodeableConcept value) { 
2930          this.activity = value;
2931          return this;
2932        }
2933
2934        /**
2935         * @return {@link #actual} (Either occurred or expected.). This is the underlying object with id, value and extensions. The accessor "getActual" gives direct access to the value
2936         */
2937        public BooleanType getActualElement() { 
2938          if (this.actual == null)
2939            if (Configuration.errorOnAutoCreate())
2940              throw new Error("Attempt to auto-create CitationCitedArtifactStatusDateComponent.actual");
2941            else if (Configuration.doAutoCreate())
2942              this.actual = new BooleanType(); // bb
2943          return this.actual;
2944        }
2945
2946        public boolean hasActualElement() { 
2947          return this.actual != null && !this.actual.isEmpty();
2948        }
2949
2950        public boolean hasActual() { 
2951          return this.actual != null && !this.actual.isEmpty();
2952        }
2953
2954        /**
2955         * @param value {@link #actual} (Either occurred or expected.). This is the underlying object with id, value and extensions. The accessor "getActual" gives direct access to the value
2956         */
2957        public CitationCitedArtifactStatusDateComponent setActualElement(BooleanType value) { 
2958          this.actual = value;
2959          return this;
2960        }
2961
2962        /**
2963         * @return Either occurred or expected.
2964         */
2965        public boolean getActual() { 
2966          return this.actual == null || this.actual.isEmpty() ? false : this.actual.getValue();
2967        }
2968
2969        /**
2970         * @param value Either occurred or expected.
2971         */
2972        public CitationCitedArtifactStatusDateComponent setActual(boolean value) { 
2973            if (this.actual == null)
2974              this.actual = new BooleanType();
2975            this.actual.setValue(value);
2976          return this;
2977        }
2978
2979        /**
2980         * @return {@link #period} (When the status started and/or ended.)
2981         */
2982        public Period getPeriod() { 
2983          if (this.period == null)
2984            if (Configuration.errorOnAutoCreate())
2985              throw new Error("Attempt to auto-create CitationCitedArtifactStatusDateComponent.period");
2986            else if (Configuration.doAutoCreate())
2987              this.period = new Period(); // cc
2988          return this.period;
2989        }
2990
2991        public boolean hasPeriod() { 
2992          return this.period != null && !this.period.isEmpty();
2993        }
2994
2995        /**
2996         * @param value {@link #period} (When the status started and/or ended.)
2997         */
2998        public CitationCitedArtifactStatusDateComponent setPeriod(Period value) { 
2999          this.period = value;
3000          return this;
3001        }
3002
3003        protected void listChildren(List<Property> children) {
3004          super.listChildren(children);
3005          children.add(new Property("activity", "CodeableConcept", "Classification of the status.", 0, 1, activity));
3006          children.add(new Property("actual", "boolean", "Either occurred or expected.", 0, 1, actual));
3007          children.add(new Property("period", "Period", "When the status started and/or ended.", 0, 1, period));
3008        }
3009
3010        @Override
3011        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3012          switch (_hash) {
3013          case -1655966961: /*activity*/  return new Property("activity", "CodeableConcept", "Classification of the status.", 0, 1, activity);
3014          case -1422939762: /*actual*/  return new Property("actual", "boolean", "Either occurred or expected.", 0, 1, actual);
3015          case -991726143: /*period*/  return new Property("period", "Period", "When the status started and/or ended.", 0, 1, period);
3016          default: return super.getNamedProperty(_hash, _name, _checkValid);
3017          }
3018
3019        }
3020
3021      @Override
3022      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3023        switch (hash) {
3024        case -1655966961: /*activity*/ return this.activity == null ? new Base[0] : new Base[] {this.activity}; // CodeableConcept
3025        case -1422939762: /*actual*/ return this.actual == null ? new Base[0] : new Base[] {this.actual}; // BooleanType
3026        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
3027        default: return super.getProperty(hash, name, checkValid);
3028        }
3029
3030      }
3031
3032      @Override
3033      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3034        switch (hash) {
3035        case -1655966961: // activity
3036          this.activity = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3037          return value;
3038        case -1422939762: // actual
3039          this.actual = TypeConvertor.castToBoolean(value); // BooleanType
3040          return value;
3041        case -991726143: // period
3042          this.period = TypeConvertor.castToPeriod(value); // Period
3043          return value;
3044        default: return super.setProperty(hash, name, value);
3045        }
3046
3047      }
3048
3049      @Override
3050      public Base setProperty(String name, Base value) throws FHIRException {
3051        if (name.equals("activity")) {
3052          this.activity = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3053        } else if (name.equals("actual")) {
3054          this.actual = TypeConvertor.castToBoolean(value); // BooleanType
3055        } else if (name.equals("period")) {
3056          this.period = TypeConvertor.castToPeriod(value); // Period
3057        } else
3058          return super.setProperty(name, value);
3059        return value;
3060      }
3061
3062      @Override
3063      public Base makeProperty(int hash, String name) throws FHIRException {
3064        switch (hash) {
3065        case -1655966961:  return getActivity();
3066        case -1422939762:  return getActualElement();
3067        case -991726143:  return getPeriod();
3068        default: return super.makeProperty(hash, name);
3069        }
3070
3071      }
3072
3073      @Override
3074      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3075        switch (hash) {
3076        case -1655966961: /*activity*/ return new String[] {"CodeableConcept"};
3077        case -1422939762: /*actual*/ return new String[] {"boolean"};
3078        case -991726143: /*period*/ return new String[] {"Period"};
3079        default: return super.getTypesForProperty(hash, name);
3080        }
3081
3082      }
3083
3084      @Override
3085      public Base addChild(String name) throws FHIRException {
3086        if (name.equals("activity")) {
3087          this.activity = new CodeableConcept();
3088          return this.activity;
3089        }
3090        else if (name.equals("actual")) {
3091          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.statusDate.actual");
3092        }
3093        else if (name.equals("period")) {
3094          this.period = new Period();
3095          return this.period;
3096        }
3097        else
3098          return super.addChild(name);
3099      }
3100
3101      public CitationCitedArtifactStatusDateComponent copy() {
3102        CitationCitedArtifactStatusDateComponent dst = new CitationCitedArtifactStatusDateComponent();
3103        copyValues(dst);
3104        return dst;
3105      }
3106
3107      public void copyValues(CitationCitedArtifactStatusDateComponent dst) {
3108        super.copyValues(dst);
3109        dst.activity = activity == null ? null : activity.copy();
3110        dst.actual = actual == null ? null : actual.copy();
3111        dst.period = period == null ? null : period.copy();
3112      }
3113
3114      @Override
3115      public boolean equalsDeep(Base other_) {
3116        if (!super.equalsDeep(other_))
3117          return false;
3118        if (!(other_ instanceof CitationCitedArtifactStatusDateComponent))
3119          return false;
3120        CitationCitedArtifactStatusDateComponent o = (CitationCitedArtifactStatusDateComponent) other_;
3121        return compareDeep(activity, o.activity, true) && compareDeep(actual, o.actual, true) && compareDeep(period, o.period, true)
3122          ;
3123      }
3124
3125      @Override
3126      public boolean equalsShallow(Base other_) {
3127        if (!super.equalsShallow(other_))
3128          return false;
3129        if (!(other_ instanceof CitationCitedArtifactStatusDateComponent))
3130          return false;
3131        CitationCitedArtifactStatusDateComponent o = (CitationCitedArtifactStatusDateComponent) other_;
3132        return compareValues(actual, o.actual, true);
3133      }
3134
3135      public boolean isEmpty() {
3136        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(activity, actual, period
3137          );
3138      }
3139
3140  public String fhirType() {
3141    return "Citation.citedArtifact.statusDate";
3142
3143  }
3144
3145  }
3146
3147    @Block()
3148    public static class CitationCitedArtifactTitleComponent extends BackboneElement implements IBaseBackboneElement {
3149        /**
3150         * Used to express the reason or specific aspect for the title.
3151         */
3152        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3153        @Description(shortDefinition="The kind of title", formalDefinition="Used to express the reason or specific aspect for the title." )
3154        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/title-type")
3155        protected List<CodeableConcept> type;
3156
3157        /**
3158         * Used to express the specific language.
3159         */
3160        @Child(name = "language", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
3161        @Description(shortDefinition="Used to express the specific language", formalDefinition="Used to express the specific language." )
3162        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/languages")
3163        protected CodeableConcept language;
3164
3165        /**
3166         * The title of the article or artifact.
3167         */
3168        @Child(name = "text", type = {MarkdownType.class}, order=3, min=1, max=1, modifier=false, summary=false)
3169        @Description(shortDefinition="The title of the article or artifact", formalDefinition="The title of the article or artifact." )
3170        protected MarkdownType text;
3171
3172        private static final long serialVersionUID = 1526221998L;
3173
3174    /**
3175     * Constructor
3176     */
3177      public CitationCitedArtifactTitleComponent() {
3178        super();
3179      }
3180
3181    /**
3182     * Constructor
3183     */
3184      public CitationCitedArtifactTitleComponent(String text) {
3185        super();
3186        this.setText(text);
3187      }
3188
3189        /**
3190         * @return {@link #type} (Used to express the reason or specific aspect for the title.)
3191         */
3192        public List<CodeableConcept> getType() { 
3193          if (this.type == null)
3194            this.type = new ArrayList<CodeableConcept>();
3195          return this.type;
3196        }
3197
3198        /**
3199         * @return Returns a reference to <code>this</code> for easy method chaining
3200         */
3201        public CitationCitedArtifactTitleComponent setType(List<CodeableConcept> theType) { 
3202          this.type = theType;
3203          return this;
3204        }
3205
3206        public boolean hasType() { 
3207          if (this.type == null)
3208            return false;
3209          for (CodeableConcept item : this.type)
3210            if (!item.isEmpty())
3211              return true;
3212          return false;
3213        }
3214
3215        public CodeableConcept addType() { //3
3216          CodeableConcept t = new CodeableConcept();
3217          if (this.type == null)
3218            this.type = new ArrayList<CodeableConcept>();
3219          this.type.add(t);
3220          return t;
3221        }
3222
3223        public CitationCitedArtifactTitleComponent addType(CodeableConcept t) { //3
3224          if (t == null)
3225            return this;
3226          if (this.type == null)
3227            this.type = new ArrayList<CodeableConcept>();
3228          this.type.add(t);
3229          return this;
3230        }
3231
3232        /**
3233         * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist {3}
3234         */
3235        public CodeableConcept getTypeFirstRep() { 
3236          if (getType().isEmpty()) {
3237            addType();
3238          }
3239          return getType().get(0);
3240        }
3241
3242        /**
3243         * @return {@link #language} (Used to express the specific language.)
3244         */
3245        public CodeableConcept getLanguage() { 
3246          if (this.language == null)
3247            if (Configuration.errorOnAutoCreate())
3248              throw new Error("Attempt to auto-create CitationCitedArtifactTitleComponent.language");
3249            else if (Configuration.doAutoCreate())
3250              this.language = new CodeableConcept(); // cc
3251          return this.language;
3252        }
3253
3254        public boolean hasLanguage() { 
3255          return this.language != null && !this.language.isEmpty();
3256        }
3257
3258        /**
3259         * @param value {@link #language} (Used to express the specific language.)
3260         */
3261        public CitationCitedArtifactTitleComponent setLanguage(CodeableConcept value) { 
3262          this.language = value;
3263          return this;
3264        }
3265
3266        /**
3267         * @return {@link #text} (The title of the article or artifact.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
3268         */
3269        public MarkdownType getTextElement() { 
3270          if (this.text == null)
3271            if (Configuration.errorOnAutoCreate())
3272              throw new Error("Attempt to auto-create CitationCitedArtifactTitleComponent.text");
3273            else if (Configuration.doAutoCreate())
3274              this.text = new MarkdownType(); // bb
3275          return this.text;
3276        }
3277
3278        public boolean hasTextElement() { 
3279          return this.text != null && !this.text.isEmpty();
3280        }
3281
3282        public boolean hasText() { 
3283          return this.text != null && !this.text.isEmpty();
3284        }
3285
3286        /**
3287         * @param value {@link #text} (The title of the article or artifact.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
3288         */
3289        public CitationCitedArtifactTitleComponent setTextElement(MarkdownType value) { 
3290          this.text = value;
3291          return this;
3292        }
3293
3294        /**
3295         * @return The title of the article or artifact.
3296         */
3297        public String getText() { 
3298          return this.text == null ? null : this.text.getValue();
3299        }
3300
3301        /**
3302         * @param value The title of the article or artifact.
3303         */
3304        public CitationCitedArtifactTitleComponent setText(String value) { 
3305            if (this.text == null)
3306              this.text = new MarkdownType();
3307            this.text.setValue(value);
3308          return this;
3309        }
3310
3311        protected void listChildren(List<Property> children) {
3312          super.listChildren(children);
3313          children.add(new Property("type", "CodeableConcept", "Used to express the reason or specific aspect for the title.", 0, java.lang.Integer.MAX_VALUE, type));
3314          children.add(new Property("language", "CodeableConcept", "Used to express the specific language.", 0, 1, language));
3315          children.add(new Property("text", "markdown", "The title of the article or artifact.", 0, 1, text));
3316        }
3317
3318        @Override
3319        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3320          switch (_hash) {
3321          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Used to express the reason or specific aspect for the title.", 0, java.lang.Integer.MAX_VALUE, type);
3322          case -1613589672: /*language*/  return new Property("language", "CodeableConcept", "Used to express the specific language.", 0, 1, language);
3323          case 3556653: /*text*/  return new Property("text", "markdown", "The title of the article or artifact.", 0, 1, text);
3324          default: return super.getNamedProperty(_hash, _name, _checkValid);
3325          }
3326
3327        }
3328
3329      @Override
3330      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3331        switch (hash) {
3332        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept
3333        case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeableConcept
3334        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // MarkdownType
3335        default: return super.getProperty(hash, name, checkValid);
3336        }
3337
3338      }
3339
3340      @Override
3341      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3342        switch (hash) {
3343        case 3575610: // type
3344          this.getType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
3345          return value;
3346        case -1613589672: // language
3347          this.language = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3348          return value;
3349        case 3556653: // text
3350          this.text = TypeConvertor.castToMarkdown(value); // MarkdownType
3351          return value;
3352        default: return super.setProperty(hash, name, value);
3353        }
3354
3355      }
3356
3357      @Override
3358      public Base setProperty(String name, Base value) throws FHIRException {
3359        if (name.equals("type")) {
3360          this.getType().add(TypeConvertor.castToCodeableConcept(value));
3361        } else if (name.equals("language")) {
3362          this.language = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3363        } else if (name.equals("text")) {
3364          this.text = TypeConvertor.castToMarkdown(value); // MarkdownType
3365        } else
3366          return super.setProperty(name, value);
3367        return value;
3368      }
3369
3370      @Override
3371      public Base makeProperty(int hash, String name) throws FHIRException {
3372        switch (hash) {
3373        case 3575610:  return addType(); 
3374        case -1613589672:  return getLanguage();
3375        case 3556653:  return getTextElement();
3376        default: return super.makeProperty(hash, name);
3377        }
3378
3379      }
3380
3381      @Override
3382      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3383        switch (hash) {
3384        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
3385        case -1613589672: /*language*/ return new String[] {"CodeableConcept"};
3386        case 3556653: /*text*/ return new String[] {"markdown"};
3387        default: return super.getTypesForProperty(hash, name);
3388        }
3389
3390      }
3391
3392      @Override
3393      public Base addChild(String name) throws FHIRException {
3394        if (name.equals("type")) {
3395          return addType();
3396        }
3397        else if (name.equals("language")) {
3398          this.language = new CodeableConcept();
3399          return this.language;
3400        }
3401        else if (name.equals("text")) {
3402          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.title.text");
3403        }
3404        else
3405          return super.addChild(name);
3406      }
3407
3408      public CitationCitedArtifactTitleComponent copy() {
3409        CitationCitedArtifactTitleComponent dst = new CitationCitedArtifactTitleComponent();
3410        copyValues(dst);
3411        return dst;
3412      }
3413
3414      public void copyValues(CitationCitedArtifactTitleComponent dst) {
3415        super.copyValues(dst);
3416        if (type != null) {
3417          dst.type = new ArrayList<CodeableConcept>();
3418          for (CodeableConcept i : type)
3419            dst.type.add(i.copy());
3420        };
3421        dst.language = language == null ? null : language.copy();
3422        dst.text = text == null ? null : text.copy();
3423      }
3424
3425      @Override
3426      public boolean equalsDeep(Base other_) {
3427        if (!super.equalsDeep(other_))
3428          return false;
3429        if (!(other_ instanceof CitationCitedArtifactTitleComponent))
3430          return false;
3431        CitationCitedArtifactTitleComponent o = (CitationCitedArtifactTitleComponent) other_;
3432        return compareDeep(type, o.type, true) && compareDeep(language, o.language, true) && compareDeep(text, o.text, true)
3433          ;
3434      }
3435
3436      @Override
3437      public boolean equalsShallow(Base other_) {
3438        if (!super.equalsShallow(other_))
3439          return false;
3440        if (!(other_ instanceof CitationCitedArtifactTitleComponent))
3441          return false;
3442        CitationCitedArtifactTitleComponent o = (CitationCitedArtifactTitleComponent) other_;
3443        return compareValues(text, o.text, true);
3444      }
3445
3446      public boolean isEmpty() {
3447        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, language, text);
3448      }
3449
3450  public String fhirType() {
3451    return "Citation.citedArtifact.title";
3452
3453  }
3454
3455  }
3456
3457    @Block()
3458    public static class CitationCitedArtifactAbstractComponent extends BackboneElement implements IBaseBackboneElement {
3459        /**
3460         * Used to express the reason or specific aspect for the abstract.
3461         */
3462        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
3463        @Description(shortDefinition="The kind of abstract", formalDefinition="Used to express the reason or specific aspect for the abstract." )
3464        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/cited-artifact-abstract-type")
3465        protected CodeableConcept type;
3466
3467        /**
3468         * Used to express the specific language.
3469         */
3470        @Child(name = "language", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
3471        @Description(shortDefinition="Used to express the specific language", formalDefinition="Used to express the specific language." )
3472        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/languages")
3473        protected CodeableConcept language;
3474
3475        /**
3476         * Abstract content.
3477         */
3478        @Child(name = "text", type = {MarkdownType.class}, order=3, min=1, max=1, modifier=false, summary=false)
3479        @Description(shortDefinition="Abstract content", formalDefinition="Abstract content." )
3480        protected MarkdownType text;
3481
3482        /**
3483         * Copyright notice for the abstract.
3484         */
3485        @Child(name = "copyright", type = {MarkdownType.class}, order=4, min=0, max=1, modifier=false, summary=false)
3486        @Description(shortDefinition="Copyright notice for the abstract", formalDefinition="Copyright notice for the abstract." )
3487        protected MarkdownType copyright;
3488
3489        private static final long serialVersionUID = -1882363442L;
3490
3491    /**
3492     * Constructor
3493     */
3494      public CitationCitedArtifactAbstractComponent() {
3495        super();
3496      }
3497
3498    /**
3499     * Constructor
3500     */
3501      public CitationCitedArtifactAbstractComponent(String text) {
3502        super();
3503        this.setText(text);
3504      }
3505
3506        /**
3507         * @return {@link #type} (Used to express the reason or specific aspect for the abstract.)
3508         */
3509        public CodeableConcept getType() { 
3510          if (this.type == null)
3511            if (Configuration.errorOnAutoCreate())
3512              throw new Error("Attempt to auto-create CitationCitedArtifactAbstractComponent.type");
3513            else if (Configuration.doAutoCreate())
3514              this.type = new CodeableConcept(); // cc
3515          return this.type;
3516        }
3517
3518        public boolean hasType() { 
3519          return this.type != null && !this.type.isEmpty();
3520        }
3521
3522        /**
3523         * @param value {@link #type} (Used to express the reason or specific aspect for the abstract.)
3524         */
3525        public CitationCitedArtifactAbstractComponent setType(CodeableConcept value) { 
3526          this.type = value;
3527          return this;
3528        }
3529
3530        /**
3531         * @return {@link #language} (Used to express the specific language.)
3532         */
3533        public CodeableConcept getLanguage() { 
3534          if (this.language == null)
3535            if (Configuration.errorOnAutoCreate())
3536              throw new Error("Attempt to auto-create CitationCitedArtifactAbstractComponent.language");
3537            else if (Configuration.doAutoCreate())
3538              this.language = new CodeableConcept(); // cc
3539          return this.language;
3540        }
3541
3542        public boolean hasLanguage() { 
3543          return this.language != null && !this.language.isEmpty();
3544        }
3545
3546        /**
3547         * @param value {@link #language} (Used to express the specific language.)
3548         */
3549        public CitationCitedArtifactAbstractComponent setLanguage(CodeableConcept value) { 
3550          this.language = value;
3551          return this;
3552        }
3553
3554        /**
3555         * @return {@link #text} (Abstract content.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
3556         */
3557        public MarkdownType getTextElement() { 
3558          if (this.text == null)
3559            if (Configuration.errorOnAutoCreate())
3560              throw new Error("Attempt to auto-create CitationCitedArtifactAbstractComponent.text");
3561            else if (Configuration.doAutoCreate())
3562              this.text = new MarkdownType(); // bb
3563          return this.text;
3564        }
3565
3566        public boolean hasTextElement() { 
3567          return this.text != null && !this.text.isEmpty();
3568        }
3569
3570        public boolean hasText() { 
3571          return this.text != null && !this.text.isEmpty();
3572        }
3573
3574        /**
3575         * @param value {@link #text} (Abstract content.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
3576         */
3577        public CitationCitedArtifactAbstractComponent setTextElement(MarkdownType value) { 
3578          this.text = value;
3579          return this;
3580        }
3581
3582        /**
3583         * @return Abstract content.
3584         */
3585        public String getText() { 
3586          return this.text == null ? null : this.text.getValue();
3587        }
3588
3589        /**
3590         * @param value Abstract content.
3591         */
3592        public CitationCitedArtifactAbstractComponent setText(String value) { 
3593            if (this.text == null)
3594              this.text = new MarkdownType();
3595            this.text.setValue(value);
3596          return this;
3597        }
3598
3599        /**
3600         * @return {@link #copyright} (Copyright notice for the abstract.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
3601         */
3602        public MarkdownType getCopyrightElement() { 
3603          if (this.copyright == null)
3604            if (Configuration.errorOnAutoCreate())
3605              throw new Error("Attempt to auto-create CitationCitedArtifactAbstractComponent.copyright");
3606            else if (Configuration.doAutoCreate())
3607              this.copyright = new MarkdownType(); // bb
3608          return this.copyright;
3609        }
3610
3611        public boolean hasCopyrightElement() { 
3612          return this.copyright != null && !this.copyright.isEmpty();
3613        }
3614
3615        public boolean hasCopyright() { 
3616          return this.copyright != null && !this.copyright.isEmpty();
3617        }
3618
3619        /**
3620         * @param value {@link #copyright} (Copyright notice for the abstract.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
3621         */
3622        public CitationCitedArtifactAbstractComponent setCopyrightElement(MarkdownType value) { 
3623          this.copyright = value;
3624          return this;
3625        }
3626
3627        /**
3628         * @return Copyright notice for the abstract.
3629         */
3630        public String getCopyright() { 
3631          return this.copyright == null ? null : this.copyright.getValue();
3632        }
3633
3634        /**
3635         * @param value Copyright notice for the abstract.
3636         */
3637        public CitationCitedArtifactAbstractComponent setCopyright(String value) { 
3638          if (value == null)
3639            this.copyright = null;
3640          else {
3641            if (this.copyright == null)
3642              this.copyright = new MarkdownType();
3643            this.copyright.setValue(value);
3644          }
3645          return this;
3646        }
3647
3648        protected void listChildren(List<Property> children) {
3649          super.listChildren(children);
3650          children.add(new Property("type", "CodeableConcept", "Used to express the reason or specific aspect for the abstract.", 0, 1, type));
3651          children.add(new Property("language", "CodeableConcept", "Used to express the specific language.", 0, 1, language));
3652          children.add(new Property("text", "markdown", "Abstract content.", 0, 1, text));
3653          children.add(new Property("copyright", "markdown", "Copyright notice for the abstract.", 0, 1, copyright));
3654        }
3655
3656        @Override
3657        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3658          switch (_hash) {
3659          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Used to express the reason or specific aspect for the abstract.", 0, 1, type);
3660          case -1613589672: /*language*/  return new Property("language", "CodeableConcept", "Used to express the specific language.", 0, 1, language);
3661          case 3556653: /*text*/  return new Property("text", "markdown", "Abstract content.", 0, 1, text);
3662          case 1522889671: /*copyright*/  return new Property("copyright", "markdown", "Copyright notice for the abstract.", 0, 1, copyright);
3663          default: return super.getNamedProperty(_hash, _name, _checkValid);
3664          }
3665
3666        }
3667
3668      @Override
3669      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3670        switch (hash) {
3671        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
3672        case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeableConcept
3673        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // MarkdownType
3674        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
3675        default: return super.getProperty(hash, name, checkValid);
3676        }
3677
3678      }
3679
3680      @Override
3681      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3682        switch (hash) {
3683        case 3575610: // type
3684          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3685          return value;
3686        case -1613589672: // language
3687          this.language = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3688          return value;
3689        case 3556653: // text
3690          this.text = TypeConvertor.castToMarkdown(value); // MarkdownType
3691          return value;
3692        case 1522889671: // copyright
3693          this.copyright = TypeConvertor.castToMarkdown(value); // MarkdownType
3694          return value;
3695        default: return super.setProperty(hash, name, value);
3696        }
3697
3698      }
3699
3700      @Override
3701      public Base setProperty(String name, Base value) throws FHIRException {
3702        if (name.equals("type")) {
3703          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3704        } else if (name.equals("language")) {
3705          this.language = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3706        } else if (name.equals("text")) {
3707          this.text = TypeConvertor.castToMarkdown(value); // MarkdownType
3708        } else if (name.equals("copyright")) {
3709          this.copyright = TypeConvertor.castToMarkdown(value); // MarkdownType
3710        } else
3711          return super.setProperty(name, value);
3712        return value;
3713      }
3714
3715      @Override
3716      public Base makeProperty(int hash, String name) throws FHIRException {
3717        switch (hash) {
3718        case 3575610:  return getType();
3719        case -1613589672:  return getLanguage();
3720        case 3556653:  return getTextElement();
3721        case 1522889671:  return getCopyrightElement();
3722        default: return super.makeProperty(hash, name);
3723        }
3724
3725      }
3726
3727      @Override
3728      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3729        switch (hash) {
3730        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
3731        case -1613589672: /*language*/ return new String[] {"CodeableConcept"};
3732        case 3556653: /*text*/ return new String[] {"markdown"};
3733        case 1522889671: /*copyright*/ return new String[] {"markdown"};
3734        default: return super.getTypesForProperty(hash, name);
3735        }
3736
3737      }
3738
3739      @Override
3740      public Base addChild(String name) throws FHIRException {
3741        if (name.equals("type")) {
3742          this.type = new CodeableConcept();
3743          return this.type;
3744        }
3745        else if (name.equals("language")) {
3746          this.language = new CodeableConcept();
3747          return this.language;
3748        }
3749        else if (name.equals("text")) {
3750          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.abstract.text");
3751        }
3752        else if (name.equals("copyright")) {
3753          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.abstract.copyright");
3754        }
3755        else
3756          return super.addChild(name);
3757      }
3758
3759      public CitationCitedArtifactAbstractComponent copy() {
3760        CitationCitedArtifactAbstractComponent dst = new CitationCitedArtifactAbstractComponent();
3761        copyValues(dst);
3762        return dst;
3763      }
3764
3765      public void copyValues(CitationCitedArtifactAbstractComponent dst) {
3766        super.copyValues(dst);
3767        dst.type = type == null ? null : type.copy();
3768        dst.language = language == null ? null : language.copy();
3769        dst.text = text == null ? null : text.copy();
3770        dst.copyright = copyright == null ? null : copyright.copy();
3771      }
3772
3773      @Override
3774      public boolean equalsDeep(Base other_) {
3775        if (!super.equalsDeep(other_))
3776          return false;
3777        if (!(other_ instanceof CitationCitedArtifactAbstractComponent))
3778          return false;
3779        CitationCitedArtifactAbstractComponent o = (CitationCitedArtifactAbstractComponent) other_;
3780        return compareDeep(type, o.type, true) && compareDeep(language, o.language, true) && compareDeep(text, o.text, true)
3781           && compareDeep(copyright, o.copyright, true);
3782      }
3783
3784      @Override
3785      public boolean equalsShallow(Base other_) {
3786        if (!super.equalsShallow(other_))
3787          return false;
3788        if (!(other_ instanceof CitationCitedArtifactAbstractComponent))
3789          return false;
3790        CitationCitedArtifactAbstractComponent o = (CitationCitedArtifactAbstractComponent) other_;
3791        return compareValues(text, o.text, true) && compareValues(copyright, o.copyright, true);
3792      }
3793
3794      public boolean isEmpty() {
3795        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, language, text, copyright
3796          );
3797      }
3798
3799  public String fhirType() {
3800    return "Citation.citedArtifact.abstract";
3801
3802  }
3803
3804  }
3805
3806    @Block()
3807    public static class CitationCitedArtifactPartComponent extends BackboneElement implements IBaseBackboneElement {
3808        /**
3809         * The kind of component.
3810         */
3811        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
3812        @Description(shortDefinition="The kind of component", formalDefinition="The kind of component." )
3813        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/cited-artifact-part-type")
3814        protected CodeableConcept type;
3815
3816        /**
3817         * The specification of the component.
3818         */
3819        @Child(name = "value", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
3820        @Description(shortDefinition="The specification of the component", formalDefinition="The specification of the component." )
3821        protected StringType value;
3822
3823        /**
3824         * The citation for the full article or artifact.
3825         */
3826        @Child(name = "baseCitation", type = {Citation.class}, order=3, min=0, max=1, modifier=false, summary=false)
3827        @Description(shortDefinition="The citation for the full article or artifact", formalDefinition="The citation for the full article or artifact." )
3828        protected Reference baseCitation;
3829
3830        private static final long serialVersionUID = -765350500L;
3831
3832    /**
3833     * Constructor
3834     */
3835      public CitationCitedArtifactPartComponent() {
3836        super();
3837      }
3838
3839        /**
3840         * @return {@link #type} (The kind of component.)
3841         */
3842        public CodeableConcept getType() { 
3843          if (this.type == null)
3844            if (Configuration.errorOnAutoCreate())
3845              throw new Error("Attempt to auto-create CitationCitedArtifactPartComponent.type");
3846            else if (Configuration.doAutoCreate())
3847              this.type = new CodeableConcept(); // cc
3848          return this.type;
3849        }
3850
3851        public boolean hasType() { 
3852          return this.type != null && !this.type.isEmpty();
3853        }
3854
3855        /**
3856         * @param value {@link #type} (The kind of component.)
3857         */
3858        public CitationCitedArtifactPartComponent setType(CodeableConcept value) { 
3859          this.type = value;
3860          return this;
3861        }
3862
3863        /**
3864         * @return {@link #value} (The specification of the component.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
3865         */
3866        public StringType getValueElement() { 
3867          if (this.value == null)
3868            if (Configuration.errorOnAutoCreate())
3869              throw new Error("Attempt to auto-create CitationCitedArtifactPartComponent.value");
3870            else if (Configuration.doAutoCreate())
3871              this.value = new StringType(); // bb
3872          return this.value;
3873        }
3874
3875        public boolean hasValueElement() { 
3876          return this.value != null && !this.value.isEmpty();
3877        }
3878
3879        public boolean hasValue() { 
3880          return this.value != null && !this.value.isEmpty();
3881        }
3882
3883        /**
3884         * @param value {@link #value} (The specification of the component.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
3885         */
3886        public CitationCitedArtifactPartComponent setValueElement(StringType value) { 
3887          this.value = value;
3888          return this;
3889        }
3890
3891        /**
3892         * @return The specification of the component.
3893         */
3894        public String getValue() { 
3895          return this.value == null ? null : this.value.getValue();
3896        }
3897
3898        /**
3899         * @param value The specification of the component.
3900         */
3901        public CitationCitedArtifactPartComponent setValue(String value) { 
3902          if (Utilities.noString(value))
3903            this.value = null;
3904          else {
3905            if (this.value == null)
3906              this.value = new StringType();
3907            this.value.setValue(value);
3908          }
3909          return this;
3910        }
3911
3912        /**
3913         * @return {@link #baseCitation} (The citation for the full article or artifact.)
3914         */
3915        public Reference getBaseCitation() { 
3916          if (this.baseCitation == null)
3917            if (Configuration.errorOnAutoCreate())
3918              throw new Error("Attempt to auto-create CitationCitedArtifactPartComponent.baseCitation");
3919            else if (Configuration.doAutoCreate())
3920              this.baseCitation = new Reference(); // cc
3921          return this.baseCitation;
3922        }
3923
3924        public boolean hasBaseCitation() { 
3925          return this.baseCitation != null && !this.baseCitation.isEmpty();
3926        }
3927
3928        /**
3929         * @param value {@link #baseCitation} (The citation for the full article or artifact.)
3930         */
3931        public CitationCitedArtifactPartComponent setBaseCitation(Reference value) { 
3932          this.baseCitation = value;
3933          return this;
3934        }
3935
3936        protected void listChildren(List<Property> children) {
3937          super.listChildren(children);
3938          children.add(new Property("type", "CodeableConcept", "The kind of component.", 0, 1, type));
3939          children.add(new Property("value", "string", "The specification of the component.", 0, 1, value));
3940          children.add(new Property("baseCitation", "Reference(Citation)", "The citation for the full article or artifact.", 0, 1, baseCitation));
3941        }
3942
3943        @Override
3944        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3945          switch (_hash) {
3946          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The kind of component.", 0, 1, type);
3947          case 111972721: /*value*/  return new Property("value", "string", "The specification of the component.", 0, 1, value);
3948          case 1182995672: /*baseCitation*/  return new Property("baseCitation", "Reference(Citation)", "The citation for the full article or artifact.", 0, 1, baseCitation);
3949          default: return super.getNamedProperty(_hash, _name, _checkValid);
3950          }
3951
3952        }
3953
3954      @Override
3955      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3956        switch (hash) {
3957        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
3958        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType
3959        case 1182995672: /*baseCitation*/ return this.baseCitation == null ? new Base[0] : new Base[] {this.baseCitation}; // Reference
3960        default: return super.getProperty(hash, name, checkValid);
3961        }
3962
3963      }
3964
3965      @Override
3966      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3967        switch (hash) {
3968        case 3575610: // type
3969          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3970          return value;
3971        case 111972721: // value
3972          this.value = TypeConvertor.castToString(value); // StringType
3973          return value;
3974        case 1182995672: // baseCitation
3975          this.baseCitation = TypeConvertor.castToReference(value); // Reference
3976          return value;
3977        default: return super.setProperty(hash, name, value);
3978        }
3979
3980      }
3981
3982      @Override
3983      public Base setProperty(String name, Base value) throws FHIRException {
3984        if (name.equals("type")) {
3985          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3986        } else if (name.equals("value")) {
3987          this.value = TypeConvertor.castToString(value); // StringType
3988        } else if (name.equals("baseCitation")) {
3989          this.baseCitation = TypeConvertor.castToReference(value); // Reference
3990        } else
3991          return super.setProperty(name, value);
3992        return value;
3993      }
3994
3995      @Override
3996      public Base makeProperty(int hash, String name) throws FHIRException {
3997        switch (hash) {
3998        case 3575610:  return getType();
3999        case 111972721:  return getValueElement();
4000        case 1182995672:  return getBaseCitation();
4001        default: return super.makeProperty(hash, name);
4002        }
4003
4004      }
4005
4006      @Override
4007      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4008        switch (hash) {
4009        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
4010        case 111972721: /*value*/ return new String[] {"string"};
4011        case 1182995672: /*baseCitation*/ return new String[] {"Reference"};
4012        default: return super.getTypesForProperty(hash, name);
4013        }
4014
4015      }
4016
4017      @Override
4018      public Base addChild(String name) throws FHIRException {
4019        if (name.equals("type")) {
4020          this.type = new CodeableConcept();
4021          return this.type;
4022        }
4023        else if (name.equals("value")) {
4024          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.part.value");
4025        }
4026        else if (name.equals("baseCitation")) {
4027          this.baseCitation = new Reference();
4028          return this.baseCitation;
4029        }
4030        else
4031          return super.addChild(name);
4032      }
4033
4034      public CitationCitedArtifactPartComponent copy() {
4035        CitationCitedArtifactPartComponent dst = new CitationCitedArtifactPartComponent();
4036        copyValues(dst);
4037        return dst;
4038      }
4039
4040      public void copyValues(CitationCitedArtifactPartComponent dst) {
4041        super.copyValues(dst);
4042        dst.type = type == null ? null : type.copy();
4043        dst.value = value == null ? null : value.copy();
4044        dst.baseCitation = baseCitation == null ? null : baseCitation.copy();
4045      }
4046
4047      @Override
4048      public boolean equalsDeep(Base other_) {
4049        if (!super.equalsDeep(other_))
4050          return false;
4051        if (!(other_ instanceof CitationCitedArtifactPartComponent))
4052          return false;
4053        CitationCitedArtifactPartComponent o = (CitationCitedArtifactPartComponent) other_;
4054        return compareDeep(type, o.type, true) && compareDeep(value, o.value, true) && compareDeep(baseCitation, o.baseCitation, true)
4055          ;
4056      }
4057
4058      @Override
4059      public boolean equalsShallow(Base other_) {
4060        if (!super.equalsShallow(other_))
4061          return false;
4062        if (!(other_ instanceof CitationCitedArtifactPartComponent))
4063          return false;
4064        CitationCitedArtifactPartComponent o = (CitationCitedArtifactPartComponent) other_;
4065        return compareValues(value, o.value, true);
4066      }
4067
4068      public boolean isEmpty() {
4069        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, value, baseCitation
4070          );
4071      }
4072
4073  public String fhirType() {
4074    return "Citation.citedArtifact.part";
4075
4076  }
4077
4078  }
4079
4080    @Block()
4081    public static class CitationCitedArtifactRelatesToComponent extends BackboneElement implements IBaseBackboneElement {
4082        /**
4083         * The type of relationship to the related artifact.
4084         */
4085        @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
4086        @Description(shortDefinition="documentation | justification | predecessor | successor | derived-from | depends-on | composed-of | part-of | amends | amended-with | appends | appended-with | cites | cited-by | comments-on | comment-in | contains | contained-in | corrects | correction-in | replaces | replaced-with | retracts | retracted-by | signs | similar-to | supports | supported-with | transforms | transformed-into | transformed-with | cite-as | created-with | documents | reprint | reprint-of | specification-of", formalDefinition="The type of relationship to the related artifact." )
4087        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/related-artifact-type-expanded")
4088        protected Enumeration<RelatedArtifactTypeExpanded> type;
4089
4090        /**
4091         * Provides additional classifiers of the related artifact.
4092         */
4093        @Child(name = "classifier", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4094        @Description(shortDefinition="Additional classifiers", formalDefinition="Provides additional classifiers of the related artifact." )
4095        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/citation-artifact-classifier")
4096        protected List<CodeableConcept> classifier;
4097
4098        /**
4099         * A short label that can be used to reference the citation from elsewhere in the containing artifact, such as a footnote index.
4100         */
4101        @Child(name = "label", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
4102        @Description(shortDefinition="Short label", formalDefinition="A short label that can be used to reference the citation from elsewhere in the containing artifact, such as a footnote index." )
4103        protected StringType label;
4104
4105        /**
4106         * A brief description of the document or knowledge resource being referenced, suitable for display to a consumer.
4107         */
4108        @Child(name = "display", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
4109        @Description(shortDefinition="Brief description of the related artifact", formalDefinition="A brief description of the document or knowledge resource being referenced, suitable for display to a consumer." )
4110        protected StringType display;
4111
4112        /**
4113         * A bibliographic citation for the related artifact. This text SHOULD be formatted according to an accepted citation format.
4114         */
4115        @Child(name = "citation", type = {MarkdownType.class}, order=5, min=0, max=1, modifier=false, summary=false)
4116        @Description(shortDefinition="Bibliographic citation for the artifact", formalDefinition="A bibliographic citation for the related artifact. This text SHOULD be formatted according to an accepted citation format." )
4117        protected MarkdownType citation;
4118
4119        /**
4120         * The document being referenced, represented as an attachment. This is exclusive with the resource element.
4121         */
4122        @Child(name = "document", type = {Attachment.class}, order=6, min=0, max=1, modifier=false, summary=false)
4123        @Description(shortDefinition="What document is being referenced", formalDefinition="The document being referenced, represented as an attachment. This is exclusive with the resource element." )
4124        protected Attachment document;
4125
4126        /**
4127         * The related artifact, such as a library, value set, profile, or other knowledge resource.
4128         */
4129        @Child(name = "resource", type = {CanonicalType.class}, order=7, min=0, max=1, modifier=false, summary=false)
4130        @Description(shortDefinition="What artifact is being referenced", formalDefinition="The related artifact, such as a library, value set, profile, or other knowledge resource." )
4131        protected CanonicalType resource;
4132
4133        /**
4134         * The related artifact, if the artifact is not a canonical resource, or a resource reference to a canonical resource.
4135         */
4136        @Child(name = "resourceReference", type = {Reference.class}, order=8, min=0, max=1, modifier=false, summary=false)
4137        @Description(shortDefinition="What artifact, if not a conformance resource", formalDefinition="The related artifact, if the artifact is not a canonical resource, or a resource reference to a canonical resource." )
4138        protected Reference resourceReference;
4139
4140        private static final long serialVersionUID = 1537406923L;
4141
4142    /**
4143     * Constructor
4144     */
4145      public CitationCitedArtifactRelatesToComponent() {
4146        super();
4147      }
4148
4149    /**
4150     * Constructor
4151     */
4152      public CitationCitedArtifactRelatesToComponent(RelatedArtifactTypeExpanded type) {
4153        super();
4154        this.setType(type);
4155      }
4156
4157        /**
4158         * @return {@link #type} (The type of relationship to the related artifact.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
4159         */
4160        public Enumeration<RelatedArtifactTypeExpanded> getTypeElement() { 
4161          if (this.type == null)
4162            if (Configuration.errorOnAutoCreate())
4163              throw new Error("Attempt to auto-create CitationCitedArtifactRelatesToComponent.type");
4164            else if (Configuration.doAutoCreate())
4165              this.type = new Enumeration<RelatedArtifactTypeExpanded>(new RelatedArtifactTypeExpandedEnumFactory()); // bb
4166          return this.type;
4167        }
4168
4169        public boolean hasTypeElement() { 
4170          return this.type != null && !this.type.isEmpty();
4171        }
4172
4173        public boolean hasType() { 
4174          return this.type != null && !this.type.isEmpty();
4175        }
4176
4177        /**
4178         * @param value {@link #type} (The type of relationship to the related artifact.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
4179         */
4180        public CitationCitedArtifactRelatesToComponent setTypeElement(Enumeration<RelatedArtifactTypeExpanded> value) { 
4181          this.type = value;
4182          return this;
4183        }
4184
4185        /**
4186         * @return The type of relationship to the related artifact.
4187         */
4188        public RelatedArtifactTypeExpanded getType() { 
4189          return this.type == null ? null : this.type.getValue();
4190        }
4191
4192        /**
4193         * @param value The type of relationship to the related artifact.
4194         */
4195        public CitationCitedArtifactRelatesToComponent setType(RelatedArtifactTypeExpanded value) { 
4196            if (this.type == null)
4197              this.type = new Enumeration<RelatedArtifactTypeExpanded>(new RelatedArtifactTypeExpandedEnumFactory());
4198            this.type.setValue(value);
4199          return this;
4200        }
4201
4202        /**
4203         * @return {@link #classifier} (Provides additional classifiers of the related artifact.)
4204         */
4205        public List<CodeableConcept> getClassifier() { 
4206          if (this.classifier == null)
4207            this.classifier = new ArrayList<CodeableConcept>();
4208          return this.classifier;
4209        }
4210
4211        /**
4212         * @return Returns a reference to <code>this</code> for easy method chaining
4213         */
4214        public CitationCitedArtifactRelatesToComponent setClassifier(List<CodeableConcept> theClassifier) { 
4215          this.classifier = theClassifier;
4216          return this;
4217        }
4218
4219        public boolean hasClassifier() { 
4220          if (this.classifier == null)
4221            return false;
4222          for (CodeableConcept item : this.classifier)
4223            if (!item.isEmpty())
4224              return true;
4225          return false;
4226        }
4227
4228        public CodeableConcept addClassifier() { //3
4229          CodeableConcept t = new CodeableConcept();
4230          if (this.classifier == null)
4231            this.classifier = new ArrayList<CodeableConcept>();
4232          this.classifier.add(t);
4233          return t;
4234        }
4235
4236        public CitationCitedArtifactRelatesToComponent addClassifier(CodeableConcept t) { //3
4237          if (t == null)
4238            return this;
4239          if (this.classifier == null)
4240            this.classifier = new ArrayList<CodeableConcept>();
4241          this.classifier.add(t);
4242          return this;
4243        }
4244
4245        /**
4246         * @return The first repetition of repeating field {@link #classifier}, creating it if it does not already exist {3}
4247         */
4248        public CodeableConcept getClassifierFirstRep() { 
4249          if (getClassifier().isEmpty()) {
4250            addClassifier();
4251          }
4252          return getClassifier().get(0);
4253        }
4254
4255        /**
4256         * @return {@link #label} (A short label that can be used to reference the citation from elsewhere in the containing artifact, such as a footnote index.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value
4257         */
4258        public StringType getLabelElement() { 
4259          if (this.label == null)
4260            if (Configuration.errorOnAutoCreate())
4261              throw new Error("Attempt to auto-create CitationCitedArtifactRelatesToComponent.label");
4262            else if (Configuration.doAutoCreate())
4263              this.label = new StringType(); // bb
4264          return this.label;
4265        }
4266
4267        public boolean hasLabelElement() { 
4268          return this.label != null && !this.label.isEmpty();
4269        }
4270
4271        public boolean hasLabel() { 
4272          return this.label != null && !this.label.isEmpty();
4273        }
4274
4275        /**
4276         * @param value {@link #label} (A short label that can be used to reference the citation from elsewhere in the containing artifact, such as a footnote index.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value
4277         */
4278        public CitationCitedArtifactRelatesToComponent setLabelElement(StringType value) { 
4279          this.label = value;
4280          return this;
4281        }
4282
4283        /**
4284         * @return A short label that can be used to reference the citation from elsewhere in the containing artifact, such as a footnote index.
4285         */
4286        public String getLabel() { 
4287          return this.label == null ? null : this.label.getValue();
4288        }
4289
4290        /**
4291         * @param value A short label that can be used to reference the citation from elsewhere in the containing artifact, such as a footnote index.
4292         */
4293        public CitationCitedArtifactRelatesToComponent setLabel(String value) { 
4294          if (Utilities.noString(value))
4295            this.label = null;
4296          else {
4297            if (this.label == null)
4298              this.label = new StringType();
4299            this.label.setValue(value);
4300          }
4301          return this;
4302        }
4303
4304        /**
4305         * @return {@link #display} (A brief description of the document or knowledge resource being referenced, suitable for display to a consumer.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value
4306         */
4307        public StringType getDisplayElement() { 
4308          if (this.display == null)
4309            if (Configuration.errorOnAutoCreate())
4310              throw new Error("Attempt to auto-create CitationCitedArtifactRelatesToComponent.display");
4311            else if (Configuration.doAutoCreate())
4312              this.display = new StringType(); // bb
4313          return this.display;
4314        }
4315
4316        public boolean hasDisplayElement() { 
4317          return this.display != null && !this.display.isEmpty();
4318        }
4319
4320        public boolean hasDisplay() { 
4321          return this.display != null && !this.display.isEmpty();
4322        }
4323
4324        /**
4325         * @param value {@link #display} (A brief description of the document or knowledge resource being referenced, suitable for display to a consumer.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value
4326         */
4327        public CitationCitedArtifactRelatesToComponent setDisplayElement(StringType value) { 
4328          this.display = value;
4329          return this;
4330        }
4331
4332        /**
4333         * @return A brief description of the document or knowledge resource being referenced, suitable for display to a consumer.
4334         */
4335        public String getDisplay() { 
4336          return this.display == null ? null : this.display.getValue();
4337        }
4338
4339        /**
4340         * @param value A brief description of the document or knowledge resource being referenced, suitable for display to a consumer.
4341         */
4342        public CitationCitedArtifactRelatesToComponent setDisplay(String value) { 
4343          if (Utilities.noString(value))
4344            this.display = null;
4345          else {
4346            if (this.display == null)
4347              this.display = new StringType();
4348            this.display.setValue(value);
4349          }
4350          return this;
4351        }
4352
4353        /**
4354         * @return {@link #citation} (A bibliographic citation for the related artifact. This text SHOULD be formatted according to an accepted citation format.). This is the underlying object with id, value and extensions. The accessor "getCitation" gives direct access to the value
4355         */
4356        public MarkdownType getCitationElement() { 
4357          if (this.citation == null)
4358            if (Configuration.errorOnAutoCreate())
4359              throw new Error("Attempt to auto-create CitationCitedArtifactRelatesToComponent.citation");
4360            else if (Configuration.doAutoCreate())
4361              this.citation = new MarkdownType(); // bb
4362          return this.citation;
4363        }
4364
4365        public boolean hasCitationElement() { 
4366          return this.citation != null && !this.citation.isEmpty();
4367        }
4368
4369        public boolean hasCitation() { 
4370          return this.citation != null && !this.citation.isEmpty();
4371        }
4372
4373        /**
4374         * @param value {@link #citation} (A bibliographic citation for the related artifact. This text SHOULD be formatted according to an accepted citation format.). This is the underlying object with id, value and extensions. The accessor "getCitation" gives direct access to the value
4375         */
4376        public CitationCitedArtifactRelatesToComponent setCitationElement(MarkdownType value) { 
4377          this.citation = value;
4378          return this;
4379        }
4380
4381        /**
4382         * @return A bibliographic citation for the related artifact. This text SHOULD be formatted according to an accepted citation format.
4383         */
4384        public String getCitation() { 
4385          return this.citation == null ? null : this.citation.getValue();
4386        }
4387
4388        /**
4389         * @param value A bibliographic citation for the related artifact. This text SHOULD be formatted according to an accepted citation format.
4390         */
4391        public CitationCitedArtifactRelatesToComponent setCitation(String value) { 
4392          if (value == null)
4393            this.citation = null;
4394          else {
4395            if (this.citation == null)
4396              this.citation = new MarkdownType();
4397            this.citation.setValue(value);
4398          }
4399          return this;
4400        }
4401
4402        /**
4403         * @return {@link #document} (The document being referenced, represented as an attachment. This is exclusive with the resource element.)
4404         */
4405        public Attachment getDocument() { 
4406          if (this.document == null)
4407            if (Configuration.errorOnAutoCreate())
4408              throw new Error("Attempt to auto-create CitationCitedArtifactRelatesToComponent.document");
4409            else if (Configuration.doAutoCreate())
4410              this.document = new Attachment(); // cc
4411          return this.document;
4412        }
4413
4414        public boolean hasDocument() { 
4415          return this.document != null && !this.document.isEmpty();
4416        }
4417
4418        /**
4419         * @param value {@link #document} (The document being referenced, represented as an attachment. This is exclusive with the resource element.)
4420         */
4421        public CitationCitedArtifactRelatesToComponent setDocument(Attachment value) { 
4422          this.document = value;
4423          return this;
4424        }
4425
4426        /**
4427         * @return {@link #resource} (The related artifact, such as a library, value set, profile, or other knowledge resource.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value
4428         */
4429        public CanonicalType getResourceElement() { 
4430          if (this.resource == null)
4431            if (Configuration.errorOnAutoCreate())
4432              throw new Error("Attempt to auto-create CitationCitedArtifactRelatesToComponent.resource");
4433            else if (Configuration.doAutoCreate())
4434              this.resource = new CanonicalType(); // bb
4435          return this.resource;
4436        }
4437
4438        public boolean hasResourceElement() { 
4439          return this.resource != null && !this.resource.isEmpty();
4440        }
4441
4442        public boolean hasResource() { 
4443          return this.resource != null && !this.resource.isEmpty();
4444        }
4445
4446        /**
4447         * @param value {@link #resource} (The related artifact, such as a library, value set, profile, or other knowledge resource.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value
4448         */
4449        public CitationCitedArtifactRelatesToComponent setResourceElement(CanonicalType value) { 
4450          this.resource = value;
4451          return this;
4452        }
4453
4454        /**
4455         * @return The related artifact, such as a library, value set, profile, or other knowledge resource.
4456         */
4457        public String getResource() { 
4458          return this.resource == null ? null : this.resource.getValue();
4459        }
4460
4461        /**
4462         * @param value The related artifact, such as a library, value set, profile, or other knowledge resource.
4463         */
4464        public CitationCitedArtifactRelatesToComponent setResource(String value) { 
4465          if (Utilities.noString(value))
4466            this.resource = null;
4467          else {
4468            if (this.resource == null)
4469              this.resource = new CanonicalType();
4470            this.resource.setValue(value);
4471          }
4472          return this;
4473        }
4474
4475        /**
4476         * @return {@link #resourceReference} (The related artifact, if the artifact is not a canonical resource, or a resource reference to a canonical resource.)
4477         */
4478        public Reference getResourceReference() { 
4479          if (this.resourceReference == null)
4480            if (Configuration.errorOnAutoCreate())
4481              throw new Error("Attempt to auto-create CitationCitedArtifactRelatesToComponent.resourceReference");
4482            else if (Configuration.doAutoCreate())
4483              this.resourceReference = new Reference(); // cc
4484          return this.resourceReference;
4485        }
4486
4487        public boolean hasResourceReference() { 
4488          return this.resourceReference != null && !this.resourceReference.isEmpty();
4489        }
4490
4491        /**
4492         * @param value {@link #resourceReference} (The related artifact, if the artifact is not a canonical resource, or a resource reference to a canonical resource.)
4493         */
4494        public CitationCitedArtifactRelatesToComponent setResourceReference(Reference value) { 
4495          this.resourceReference = value;
4496          return this;
4497        }
4498
4499        protected void listChildren(List<Property> children) {
4500          super.listChildren(children);
4501          children.add(new Property("type", "code", "The type of relationship to the related artifact.", 0, 1, type));
4502          children.add(new Property("classifier", "CodeableConcept", "Provides additional classifiers of the related artifact.", 0, java.lang.Integer.MAX_VALUE, classifier));
4503          children.add(new Property("label", "string", "A short label that can be used to reference the citation from elsewhere in the containing artifact, such as a footnote index.", 0, 1, label));
4504          children.add(new Property("display", "string", "A brief description of the document or knowledge resource being referenced, suitable for display to a consumer.", 0, 1, display));
4505          children.add(new Property("citation", "markdown", "A bibliographic citation for the related artifact. This text SHOULD be formatted according to an accepted citation format.", 0, 1, citation));
4506          children.add(new Property("document", "Attachment", "The document being referenced, represented as an attachment. This is exclusive with the resource element.", 0, 1, document));
4507          children.add(new Property("resource", "canonical", "The related artifact, such as a library, value set, profile, or other knowledge resource.", 0, 1, resource));
4508          children.add(new Property("resourceReference", "Reference", "The related artifact, if the artifact is not a canonical resource, or a resource reference to a canonical resource.", 0, 1, resourceReference));
4509        }
4510
4511        @Override
4512        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4513          switch (_hash) {
4514          case 3575610: /*type*/  return new Property("type", "code", "The type of relationship to the related artifact.", 0, 1, type);
4515          case -281470431: /*classifier*/  return new Property("classifier", "CodeableConcept", "Provides additional classifiers of the related artifact.", 0, java.lang.Integer.MAX_VALUE, classifier);
4516          case 102727412: /*label*/  return new Property("label", "string", "A short label that can be used to reference the citation from elsewhere in the containing artifact, such as a footnote index.", 0, 1, label);
4517          case 1671764162: /*display*/  return new Property("display", "string", "A brief description of the document or knowledge resource being referenced, suitable for display to a consumer.", 0, 1, display);
4518          case -1442706713: /*citation*/  return new Property("citation", "markdown", "A bibliographic citation for the related artifact. This text SHOULD be formatted according to an accepted citation format.", 0, 1, citation);
4519          case 861720859: /*document*/  return new Property("document", "Attachment", "The document being referenced, represented as an attachment. This is exclusive with the resource element.", 0, 1, document);
4520          case -341064690: /*resource*/  return new Property("resource", "canonical", "The related artifact, such as a library, value set, profile, or other knowledge resource.", 0, 1, resource);
4521          case -610120995: /*resourceReference*/  return new Property("resourceReference", "Reference", "The related artifact, if the artifact is not a canonical resource, or a resource reference to a canonical resource.", 0, 1, resourceReference);
4522          default: return super.getNamedProperty(_hash, _name, _checkValid);
4523          }
4524
4525        }
4526
4527      @Override
4528      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4529        switch (hash) {
4530        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<RelatedArtifactTypeExpanded>
4531        case -281470431: /*classifier*/ return this.classifier == null ? new Base[0] : this.classifier.toArray(new Base[this.classifier.size()]); // CodeableConcept
4532        case 102727412: /*label*/ return this.label == null ? new Base[0] : new Base[] {this.label}; // StringType
4533        case 1671764162: /*display*/ return this.display == null ? new Base[0] : new Base[] {this.display}; // StringType
4534        case -1442706713: /*citation*/ return this.citation == null ? new Base[0] : new Base[] {this.citation}; // MarkdownType
4535        case 861720859: /*document*/ return this.document == null ? new Base[0] : new Base[] {this.document}; // Attachment
4536        case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // CanonicalType
4537        case -610120995: /*resourceReference*/ return this.resourceReference == null ? new Base[0] : new Base[] {this.resourceReference}; // Reference
4538        default: return super.getProperty(hash, name, checkValid);
4539        }
4540
4541      }
4542
4543      @Override
4544      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4545        switch (hash) {
4546        case 3575610: // type
4547          value = new RelatedArtifactTypeExpandedEnumFactory().fromType(TypeConvertor.castToCode(value));
4548          this.type = (Enumeration) value; // Enumeration<RelatedArtifactTypeExpanded>
4549          return value;
4550        case -281470431: // classifier
4551          this.getClassifier().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
4552          return value;
4553        case 102727412: // label
4554          this.label = TypeConvertor.castToString(value); // StringType
4555          return value;
4556        case 1671764162: // display
4557          this.display = TypeConvertor.castToString(value); // StringType
4558          return value;
4559        case -1442706713: // citation
4560          this.citation = TypeConvertor.castToMarkdown(value); // MarkdownType
4561          return value;
4562        case 861720859: // document
4563          this.document = TypeConvertor.castToAttachment(value); // Attachment
4564          return value;
4565        case -341064690: // resource
4566          this.resource = TypeConvertor.castToCanonical(value); // CanonicalType
4567          return value;
4568        case -610120995: // resourceReference
4569          this.resourceReference = TypeConvertor.castToReference(value); // Reference
4570          return value;
4571        default: return super.setProperty(hash, name, value);
4572        }
4573
4574      }
4575
4576      @Override
4577      public Base setProperty(String name, Base value) throws FHIRException {
4578        if (name.equals("type")) {
4579          value = new RelatedArtifactTypeExpandedEnumFactory().fromType(TypeConvertor.castToCode(value));
4580          this.type = (Enumeration) value; // Enumeration<RelatedArtifactTypeExpanded>
4581        } else if (name.equals("classifier")) {
4582          this.getClassifier().add(TypeConvertor.castToCodeableConcept(value));
4583        } else if (name.equals("label")) {
4584          this.label = TypeConvertor.castToString(value); // StringType
4585        } else if (name.equals("display")) {
4586          this.display = TypeConvertor.castToString(value); // StringType
4587        } else if (name.equals("citation")) {
4588          this.citation = TypeConvertor.castToMarkdown(value); // MarkdownType
4589        } else if (name.equals("document")) {
4590          this.document = TypeConvertor.castToAttachment(value); // Attachment
4591        } else if (name.equals("resource")) {
4592          this.resource = TypeConvertor.castToCanonical(value); // CanonicalType
4593        } else if (name.equals("resourceReference")) {
4594          this.resourceReference = TypeConvertor.castToReference(value); // Reference
4595        } else
4596          return super.setProperty(name, value);
4597        return value;
4598      }
4599
4600      @Override
4601      public Base makeProperty(int hash, String name) throws FHIRException {
4602        switch (hash) {
4603        case 3575610:  return getTypeElement();
4604        case -281470431:  return addClassifier(); 
4605        case 102727412:  return getLabelElement();
4606        case 1671764162:  return getDisplayElement();
4607        case -1442706713:  return getCitationElement();
4608        case 861720859:  return getDocument();
4609        case -341064690:  return getResourceElement();
4610        case -610120995:  return getResourceReference();
4611        default: return super.makeProperty(hash, name);
4612        }
4613
4614      }
4615
4616      @Override
4617      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4618        switch (hash) {
4619        case 3575610: /*type*/ return new String[] {"code"};
4620        case -281470431: /*classifier*/ return new String[] {"CodeableConcept"};
4621        case 102727412: /*label*/ return new String[] {"string"};
4622        case 1671764162: /*display*/ return new String[] {"string"};
4623        case -1442706713: /*citation*/ return new String[] {"markdown"};
4624        case 861720859: /*document*/ return new String[] {"Attachment"};
4625        case -341064690: /*resource*/ return new String[] {"canonical"};
4626        case -610120995: /*resourceReference*/ return new String[] {"Reference"};
4627        default: return super.getTypesForProperty(hash, name);
4628        }
4629
4630      }
4631
4632      @Override
4633      public Base addChild(String name) throws FHIRException {
4634        if (name.equals("type")) {
4635          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.relatesTo.type");
4636        }
4637        else if (name.equals("classifier")) {
4638          return addClassifier();
4639        }
4640        else if (name.equals("label")) {
4641          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.relatesTo.label");
4642        }
4643        else if (name.equals("display")) {
4644          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.relatesTo.display");
4645        }
4646        else if (name.equals("citation")) {
4647          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.relatesTo.citation");
4648        }
4649        else if (name.equals("document")) {
4650          this.document = new Attachment();
4651          return this.document;
4652        }
4653        else if (name.equals("resource")) {
4654          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.relatesTo.resource");
4655        }
4656        else if (name.equals("resourceReference")) {
4657          this.resourceReference = new Reference();
4658          return this.resourceReference;
4659        }
4660        else
4661          return super.addChild(name);
4662      }
4663
4664      public CitationCitedArtifactRelatesToComponent copy() {
4665        CitationCitedArtifactRelatesToComponent dst = new CitationCitedArtifactRelatesToComponent();
4666        copyValues(dst);
4667        return dst;
4668      }
4669
4670      public void copyValues(CitationCitedArtifactRelatesToComponent dst) {
4671        super.copyValues(dst);
4672        dst.type = type == null ? null : type.copy();
4673        if (classifier != null) {
4674          dst.classifier = new ArrayList<CodeableConcept>();
4675          for (CodeableConcept i : classifier)
4676            dst.classifier.add(i.copy());
4677        };
4678        dst.label = label == null ? null : label.copy();
4679        dst.display = display == null ? null : display.copy();
4680        dst.citation = citation == null ? null : citation.copy();
4681        dst.document = document == null ? null : document.copy();
4682        dst.resource = resource == null ? null : resource.copy();
4683        dst.resourceReference = resourceReference == null ? null : resourceReference.copy();
4684      }
4685
4686      @Override
4687      public boolean equalsDeep(Base other_) {
4688        if (!super.equalsDeep(other_))
4689          return false;
4690        if (!(other_ instanceof CitationCitedArtifactRelatesToComponent))
4691          return false;
4692        CitationCitedArtifactRelatesToComponent o = (CitationCitedArtifactRelatesToComponent) other_;
4693        return compareDeep(type, o.type, true) && compareDeep(classifier, o.classifier, true) && compareDeep(label, o.label, true)
4694           && compareDeep(display, o.display, true) && compareDeep(citation, o.citation, true) && compareDeep(document, o.document, true)
4695           && compareDeep(resource, o.resource, true) && compareDeep(resourceReference, o.resourceReference, true)
4696          ;
4697      }
4698
4699      @Override
4700      public boolean equalsShallow(Base other_) {
4701        if (!super.equalsShallow(other_))
4702          return false;
4703        if (!(other_ instanceof CitationCitedArtifactRelatesToComponent))
4704          return false;
4705        CitationCitedArtifactRelatesToComponent o = (CitationCitedArtifactRelatesToComponent) other_;
4706        return compareValues(type, o.type, true) && compareValues(label, o.label, true) && compareValues(display, o.display, true)
4707           && compareValues(citation, o.citation, true) && compareValues(resource, o.resource, true);
4708      }
4709
4710      public boolean isEmpty() {
4711        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, classifier, label
4712          , display, citation, document, resource, resourceReference);
4713      }
4714
4715  public String fhirType() {
4716    return "Citation.citedArtifact.relatesTo";
4717
4718  }
4719
4720  }
4721
4722    @Block()
4723    public static class CitationCitedArtifactPublicationFormComponent extends BackboneElement implements IBaseBackboneElement {
4724        /**
4725         * The collection the cited article or artifact is published in.
4726         */
4727        @Child(name = "publishedIn", type = {}, order=1, min=0, max=1, modifier=false, summary=false)
4728        @Description(shortDefinition="The collection the cited article or artifact is published in", formalDefinition="The collection the cited article or artifact is published in." )
4729        protected CitationCitedArtifactPublicationFormPublishedInComponent publishedIn;
4730
4731        /**
4732         * The specific issue in which the cited article resides.
4733         */
4734        @Child(name = "periodicRelease", type = {}, order=2, min=0, max=1, modifier=false, summary=false)
4735        @Description(shortDefinition="The specific issue in which the cited article resides", formalDefinition="The specific issue in which the cited article resides." )
4736        protected CitationCitedArtifactPublicationFormPeriodicReleaseComponent periodicRelease;
4737
4738        /**
4739         * The date the article was added to the database, or the date the article was released (which may differ from the journal issue publication date).
4740         */
4741        @Child(name = "articleDate", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=false)
4742        @Description(shortDefinition="The date the article was added to the database, or the date the article was released", formalDefinition="The date the article was added to the database, or the date the article was released (which may differ from the journal issue publication date)." )
4743        protected DateTimeType articleDate;
4744
4745        /**
4746         * The date the article was last revised or updated in the database.
4747         */
4748        @Child(name = "lastRevisionDate", type = {DateTimeType.class}, order=4, min=0, max=1, modifier=false, summary=false)
4749        @Description(shortDefinition="The date the article was last revised or updated in the database", formalDefinition="The date the article was last revised or updated in the database." )
4750        protected DateTimeType lastRevisionDate;
4751
4752        /**
4753         * Language in which this form of the article is published.
4754         */
4755        @Child(name = "language", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4756        @Description(shortDefinition="Language in which this form of the article is published", formalDefinition="Language in which this form of the article is published." )
4757        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/languages")
4758        protected List<CodeableConcept> language;
4759
4760        /**
4761         * Entry number or identifier for inclusion in a database.
4762         */
4763        @Child(name = "accessionNumber", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false)
4764        @Description(shortDefinition="Entry number or identifier for inclusion in a database", formalDefinition="Entry number or identifier for inclusion in a database." )
4765        protected StringType accessionNumber;
4766
4767        /**
4768         * Used for full display of pagination.
4769         */
4770        @Child(name = "pageString", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=false)
4771        @Description(shortDefinition="Used for full display of pagination", formalDefinition="Used for full display of pagination." )
4772        protected StringType pageString;
4773
4774        /**
4775         * Used for isolated representation of first page.
4776         */
4777        @Child(name = "firstPage", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false)
4778        @Description(shortDefinition="Used for isolated representation of first page", formalDefinition="Used for isolated representation of first page." )
4779        protected StringType firstPage;
4780
4781        /**
4782         * Used for isolated representation of last page.
4783         */
4784        @Child(name = "lastPage", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=false)
4785        @Description(shortDefinition="Used for isolated representation of last page", formalDefinition="Used for isolated representation of last page." )
4786        protected StringType lastPage;
4787
4788        /**
4789         * Actual or approximate number of pages or screens.
4790         */
4791        @Child(name = "pageCount", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false)
4792        @Description(shortDefinition="Number of pages or screens", formalDefinition="Actual or approximate number of pages or screens." )
4793        protected StringType pageCount;
4794
4795        /**
4796         * Copyright notice for the full article or artifact.
4797         */
4798        @Child(name = "copyright", type = {MarkdownType.class}, order=11, min=0, max=1, modifier=false, summary=false)
4799        @Description(shortDefinition="Copyright notice for the full article or artifact", formalDefinition="Copyright notice for the full article or artifact." )
4800        protected MarkdownType copyright;
4801
4802        private static final long serialVersionUID = -191740896L;
4803
4804    /**
4805     * Constructor
4806     */
4807      public CitationCitedArtifactPublicationFormComponent() {
4808        super();
4809      }
4810
4811        /**
4812         * @return {@link #publishedIn} (The collection the cited article or artifact is published in.)
4813         */
4814        public CitationCitedArtifactPublicationFormPublishedInComponent getPublishedIn() { 
4815          if (this.publishedIn == null)
4816            if (Configuration.errorOnAutoCreate())
4817              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.publishedIn");
4818            else if (Configuration.doAutoCreate())
4819              this.publishedIn = new CitationCitedArtifactPublicationFormPublishedInComponent(); // cc
4820          return this.publishedIn;
4821        }
4822
4823        public boolean hasPublishedIn() { 
4824          return this.publishedIn != null && !this.publishedIn.isEmpty();
4825        }
4826
4827        /**
4828         * @param value {@link #publishedIn} (The collection the cited article or artifact is published in.)
4829         */
4830        public CitationCitedArtifactPublicationFormComponent setPublishedIn(CitationCitedArtifactPublicationFormPublishedInComponent value) { 
4831          this.publishedIn = value;
4832          return this;
4833        }
4834
4835        /**
4836         * @return {@link #periodicRelease} (The specific issue in which the cited article resides.)
4837         */
4838        public CitationCitedArtifactPublicationFormPeriodicReleaseComponent getPeriodicRelease() { 
4839          if (this.periodicRelease == null)
4840            if (Configuration.errorOnAutoCreate())
4841              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.periodicRelease");
4842            else if (Configuration.doAutoCreate())
4843              this.periodicRelease = new CitationCitedArtifactPublicationFormPeriodicReleaseComponent(); // cc
4844          return this.periodicRelease;
4845        }
4846
4847        public boolean hasPeriodicRelease() { 
4848          return this.periodicRelease != null && !this.periodicRelease.isEmpty();
4849        }
4850
4851        /**
4852         * @param value {@link #periodicRelease} (The specific issue in which the cited article resides.)
4853         */
4854        public CitationCitedArtifactPublicationFormComponent setPeriodicRelease(CitationCitedArtifactPublicationFormPeriodicReleaseComponent value) { 
4855          this.periodicRelease = value;
4856          return this;
4857        }
4858
4859        /**
4860         * @return {@link #articleDate} (The date the article was added to the database, or the date the article was released (which may differ from the journal issue publication date).). This is the underlying object with id, value and extensions. The accessor "getArticleDate" gives direct access to the value
4861         */
4862        public DateTimeType getArticleDateElement() { 
4863          if (this.articleDate == null)
4864            if (Configuration.errorOnAutoCreate())
4865              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.articleDate");
4866            else if (Configuration.doAutoCreate())
4867              this.articleDate = new DateTimeType(); // bb
4868          return this.articleDate;
4869        }
4870
4871        public boolean hasArticleDateElement() { 
4872          return this.articleDate != null && !this.articleDate.isEmpty();
4873        }
4874
4875        public boolean hasArticleDate() { 
4876          return this.articleDate != null && !this.articleDate.isEmpty();
4877        }
4878
4879        /**
4880         * @param value {@link #articleDate} (The date the article was added to the database, or the date the article was released (which may differ from the journal issue publication date).). This is the underlying object with id, value and extensions. The accessor "getArticleDate" gives direct access to the value
4881         */
4882        public CitationCitedArtifactPublicationFormComponent setArticleDateElement(DateTimeType value) { 
4883          this.articleDate = value;
4884          return this;
4885        }
4886
4887        /**
4888         * @return The date the article was added to the database, or the date the article was released (which may differ from the journal issue publication date).
4889         */
4890        public Date getArticleDate() { 
4891          return this.articleDate == null ? null : this.articleDate.getValue();
4892        }
4893
4894        /**
4895         * @param value The date the article was added to the database, or the date the article was released (which may differ from the journal issue publication date).
4896         */
4897        public CitationCitedArtifactPublicationFormComponent setArticleDate(Date value) { 
4898          if (value == null)
4899            this.articleDate = null;
4900          else {
4901            if (this.articleDate == null)
4902              this.articleDate = new DateTimeType();
4903            this.articleDate.setValue(value);
4904          }
4905          return this;
4906        }
4907
4908        /**
4909         * @return {@link #lastRevisionDate} (The date the article was last revised or updated in the database.). This is the underlying object with id, value and extensions. The accessor "getLastRevisionDate" gives direct access to the value
4910         */
4911        public DateTimeType getLastRevisionDateElement() { 
4912          if (this.lastRevisionDate == null)
4913            if (Configuration.errorOnAutoCreate())
4914              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.lastRevisionDate");
4915            else if (Configuration.doAutoCreate())
4916              this.lastRevisionDate = new DateTimeType(); // bb
4917          return this.lastRevisionDate;
4918        }
4919
4920        public boolean hasLastRevisionDateElement() { 
4921          return this.lastRevisionDate != null && !this.lastRevisionDate.isEmpty();
4922        }
4923
4924        public boolean hasLastRevisionDate() { 
4925          return this.lastRevisionDate != null && !this.lastRevisionDate.isEmpty();
4926        }
4927
4928        /**
4929         * @param value {@link #lastRevisionDate} (The date the article was last revised or updated in the database.). This is the underlying object with id, value and extensions. The accessor "getLastRevisionDate" gives direct access to the value
4930         */
4931        public CitationCitedArtifactPublicationFormComponent setLastRevisionDateElement(DateTimeType value) { 
4932          this.lastRevisionDate = value;
4933          return this;
4934        }
4935
4936        /**
4937         * @return The date the article was last revised or updated in the database.
4938         */
4939        public Date getLastRevisionDate() { 
4940          return this.lastRevisionDate == null ? null : this.lastRevisionDate.getValue();
4941        }
4942
4943        /**
4944         * @param value The date the article was last revised or updated in the database.
4945         */
4946        public CitationCitedArtifactPublicationFormComponent setLastRevisionDate(Date value) { 
4947          if (value == null)
4948            this.lastRevisionDate = null;
4949          else {
4950            if (this.lastRevisionDate == null)
4951              this.lastRevisionDate = new DateTimeType();
4952            this.lastRevisionDate.setValue(value);
4953          }
4954          return this;
4955        }
4956
4957        /**
4958         * @return {@link #language} (Language in which this form of the article is published.)
4959         */
4960        public List<CodeableConcept> getLanguage() { 
4961          if (this.language == null)
4962            this.language = new ArrayList<CodeableConcept>();
4963          return this.language;
4964        }
4965
4966        /**
4967         * @return Returns a reference to <code>this</code> for easy method chaining
4968         */
4969        public CitationCitedArtifactPublicationFormComponent setLanguage(List<CodeableConcept> theLanguage) { 
4970          this.language = theLanguage;
4971          return this;
4972        }
4973
4974        public boolean hasLanguage() { 
4975          if (this.language == null)
4976            return false;
4977          for (CodeableConcept item : this.language)
4978            if (!item.isEmpty())
4979              return true;
4980          return false;
4981        }
4982
4983        public CodeableConcept addLanguage() { //3
4984          CodeableConcept t = new CodeableConcept();
4985          if (this.language == null)
4986            this.language = new ArrayList<CodeableConcept>();
4987          this.language.add(t);
4988          return t;
4989        }
4990
4991        public CitationCitedArtifactPublicationFormComponent addLanguage(CodeableConcept t) { //3
4992          if (t == null)
4993            return this;
4994          if (this.language == null)
4995            this.language = new ArrayList<CodeableConcept>();
4996          this.language.add(t);
4997          return this;
4998        }
4999
5000        /**
5001         * @return The first repetition of repeating field {@link #language}, creating it if it does not already exist {3}
5002         */
5003        public CodeableConcept getLanguageFirstRep() { 
5004          if (getLanguage().isEmpty()) {
5005            addLanguage();
5006          }
5007          return getLanguage().get(0);
5008        }
5009
5010        /**
5011         * @return {@link #accessionNumber} (Entry number or identifier for inclusion in a database.). This is the underlying object with id, value and extensions. The accessor "getAccessionNumber" gives direct access to the value
5012         */
5013        public StringType getAccessionNumberElement() { 
5014          if (this.accessionNumber == null)
5015            if (Configuration.errorOnAutoCreate())
5016              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.accessionNumber");
5017            else if (Configuration.doAutoCreate())
5018              this.accessionNumber = new StringType(); // bb
5019          return this.accessionNumber;
5020        }
5021
5022        public boolean hasAccessionNumberElement() { 
5023          return this.accessionNumber != null && !this.accessionNumber.isEmpty();
5024        }
5025
5026        public boolean hasAccessionNumber() { 
5027          return this.accessionNumber != null && !this.accessionNumber.isEmpty();
5028        }
5029
5030        /**
5031         * @param value {@link #accessionNumber} (Entry number or identifier for inclusion in a database.). This is the underlying object with id, value and extensions. The accessor "getAccessionNumber" gives direct access to the value
5032         */
5033        public CitationCitedArtifactPublicationFormComponent setAccessionNumberElement(StringType value) { 
5034          this.accessionNumber = value;
5035          return this;
5036        }
5037
5038        /**
5039         * @return Entry number or identifier for inclusion in a database.
5040         */
5041        public String getAccessionNumber() { 
5042          return this.accessionNumber == null ? null : this.accessionNumber.getValue();
5043        }
5044
5045        /**
5046         * @param value Entry number or identifier for inclusion in a database.
5047         */
5048        public CitationCitedArtifactPublicationFormComponent setAccessionNumber(String value) { 
5049          if (Utilities.noString(value))
5050            this.accessionNumber = null;
5051          else {
5052            if (this.accessionNumber == null)
5053              this.accessionNumber = new StringType();
5054            this.accessionNumber.setValue(value);
5055          }
5056          return this;
5057        }
5058
5059        /**
5060         * @return {@link #pageString} (Used for full display of pagination.). This is the underlying object with id, value and extensions. The accessor "getPageString" gives direct access to the value
5061         */
5062        public StringType getPageStringElement() { 
5063          if (this.pageString == null)
5064            if (Configuration.errorOnAutoCreate())
5065              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.pageString");
5066            else if (Configuration.doAutoCreate())
5067              this.pageString = new StringType(); // bb
5068          return this.pageString;
5069        }
5070
5071        public boolean hasPageStringElement() { 
5072          return this.pageString != null && !this.pageString.isEmpty();
5073        }
5074
5075        public boolean hasPageString() { 
5076          return this.pageString != null && !this.pageString.isEmpty();
5077        }
5078
5079        /**
5080         * @param value {@link #pageString} (Used for full display of pagination.). This is the underlying object with id, value and extensions. The accessor "getPageString" gives direct access to the value
5081         */
5082        public CitationCitedArtifactPublicationFormComponent setPageStringElement(StringType value) { 
5083          this.pageString = value;
5084          return this;
5085        }
5086
5087        /**
5088         * @return Used for full display of pagination.
5089         */
5090        public String getPageString() { 
5091          return this.pageString == null ? null : this.pageString.getValue();
5092        }
5093
5094        /**
5095         * @param value Used for full display of pagination.
5096         */
5097        public CitationCitedArtifactPublicationFormComponent setPageString(String value) { 
5098          if (Utilities.noString(value))
5099            this.pageString = null;
5100          else {
5101            if (this.pageString == null)
5102              this.pageString = new StringType();
5103            this.pageString.setValue(value);
5104          }
5105          return this;
5106        }
5107
5108        /**
5109         * @return {@link #firstPage} (Used for isolated representation of first page.). This is the underlying object with id, value and extensions. The accessor "getFirstPage" gives direct access to the value
5110         */
5111        public StringType getFirstPageElement() { 
5112          if (this.firstPage == null)
5113            if (Configuration.errorOnAutoCreate())
5114              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.firstPage");
5115            else if (Configuration.doAutoCreate())
5116              this.firstPage = new StringType(); // bb
5117          return this.firstPage;
5118        }
5119
5120        public boolean hasFirstPageElement() { 
5121          return this.firstPage != null && !this.firstPage.isEmpty();
5122        }
5123
5124        public boolean hasFirstPage() { 
5125          return this.firstPage != null && !this.firstPage.isEmpty();
5126        }
5127
5128        /**
5129         * @param value {@link #firstPage} (Used for isolated representation of first page.). This is the underlying object with id, value and extensions. The accessor "getFirstPage" gives direct access to the value
5130         */
5131        public CitationCitedArtifactPublicationFormComponent setFirstPageElement(StringType value) { 
5132          this.firstPage = value;
5133          return this;
5134        }
5135
5136        /**
5137         * @return Used for isolated representation of first page.
5138         */
5139        public String getFirstPage() { 
5140          return this.firstPage == null ? null : this.firstPage.getValue();
5141        }
5142
5143        /**
5144         * @param value Used for isolated representation of first page.
5145         */
5146        public CitationCitedArtifactPublicationFormComponent setFirstPage(String value) { 
5147          if (Utilities.noString(value))
5148            this.firstPage = null;
5149          else {
5150            if (this.firstPage == null)
5151              this.firstPage = new StringType();
5152            this.firstPage.setValue(value);
5153          }
5154          return this;
5155        }
5156
5157        /**
5158         * @return {@link #lastPage} (Used for isolated representation of last page.). This is the underlying object with id, value and extensions. The accessor "getLastPage" gives direct access to the value
5159         */
5160        public StringType getLastPageElement() { 
5161          if (this.lastPage == null)
5162            if (Configuration.errorOnAutoCreate())
5163              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.lastPage");
5164            else if (Configuration.doAutoCreate())
5165              this.lastPage = new StringType(); // bb
5166          return this.lastPage;
5167        }
5168
5169        public boolean hasLastPageElement() { 
5170          return this.lastPage != null && !this.lastPage.isEmpty();
5171        }
5172
5173        public boolean hasLastPage() { 
5174          return this.lastPage != null && !this.lastPage.isEmpty();
5175        }
5176
5177        /**
5178         * @param value {@link #lastPage} (Used for isolated representation of last page.). This is the underlying object with id, value and extensions. The accessor "getLastPage" gives direct access to the value
5179         */
5180        public CitationCitedArtifactPublicationFormComponent setLastPageElement(StringType value) { 
5181          this.lastPage = value;
5182          return this;
5183        }
5184
5185        /**
5186         * @return Used for isolated representation of last page.
5187         */
5188        public String getLastPage() { 
5189          return this.lastPage == null ? null : this.lastPage.getValue();
5190        }
5191
5192        /**
5193         * @param value Used for isolated representation of last page.
5194         */
5195        public CitationCitedArtifactPublicationFormComponent setLastPage(String value) { 
5196          if (Utilities.noString(value))
5197            this.lastPage = null;
5198          else {
5199            if (this.lastPage == null)
5200              this.lastPage = new StringType();
5201            this.lastPage.setValue(value);
5202          }
5203          return this;
5204        }
5205
5206        /**
5207         * @return {@link #pageCount} (Actual or approximate number of pages or screens.). This is the underlying object with id, value and extensions. The accessor "getPageCount" gives direct access to the value
5208         */
5209        public StringType getPageCountElement() { 
5210          if (this.pageCount == null)
5211            if (Configuration.errorOnAutoCreate())
5212              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.pageCount");
5213            else if (Configuration.doAutoCreate())
5214              this.pageCount = new StringType(); // bb
5215          return this.pageCount;
5216        }
5217
5218        public boolean hasPageCountElement() { 
5219          return this.pageCount != null && !this.pageCount.isEmpty();
5220        }
5221
5222        public boolean hasPageCount() { 
5223          return this.pageCount != null && !this.pageCount.isEmpty();
5224        }
5225
5226        /**
5227         * @param value {@link #pageCount} (Actual or approximate number of pages or screens.). This is the underlying object with id, value and extensions. The accessor "getPageCount" gives direct access to the value
5228         */
5229        public CitationCitedArtifactPublicationFormComponent setPageCountElement(StringType value) { 
5230          this.pageCount = value;
5231          return this;
5232        }
5233
5234        /**
5235         * @return Actual or approximate number of pages or screens.
5236         */
5237        public String getPageCount() { 
5238          return this.pageCount == null ? null : this.pageCount.getValue();
5239        }
5240
5241        /**
5242         * @param value Actual or approximate number of pages or screens.
5243         */
5244        public CitationCitedArtifactPublicationFormComponent setPageCount(String value) { 
5245          if (Utilities.noString(value))
5246            this.pageCount = null;
5247          else {
5248            if (this.pageCount == null)
5249              this.pageCount = new StringType();
5250            this.pageCount.setValue(value);
5251          }
5252          return this;
5253        }
5254
5255        /**
5256         * @return {@link #copyright} (Copyright notice for the full article or artifact.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
5257         */
5258        public MarkdownType getCopyrightElement() { 
5259          if (this.copyright == null)
5260            if (Configuration.errorOnAutoCreate())
5261              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.copyright");
5262            else if (Configuration.doAutoCreate())
5263              this.copyright = new MarkdownType(); // bb
5264          return this.copyright;
5265        }
5266
5267        public boolean hasCopyrightElement() { 
5268          return this.copyright != null && !this.copyright.isEmpty();
5269        }
5270
5271        public boolean hasCopyright() { 
5272          return this.copyright != null && !this.copyright.isEmpty();
5273        }
5274
5275        /**
5276         * @param value {@link #copyright} (Copyright notice for the full article or artifact.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
5277         */
5278        public CitationCitedArtifactPublicationFormComponent setCopyrightElement(MarkdownType value) { 
5279          this.copyright = value;
5280          return this;
5281        }
5282
5283        /**
5284         * @return Copyright notice for the full article or artifact.
5285         */
5286        public String getCopyright() { 
5287          return this.copyright == null ? null : this.copyright.getValue();
5288        }
5289
5290        /**
5291         * @param value Copyright notice for the full article or artifact.
5292         */
5293        public CitationCitedArtifactPublicationFormComponent setCopyright(String value) { 
5294          if (value == null)
5295            this.copyright = null;
5296          else {
5297            if (this.copyright == null)
5298              this.copyright = new MarkdownType();
5299            this.copyright.setValue(value);
5300          }
5301          return this;
5302        }
5303
5304        protected void listChildren(List<Property> children) {
5305          super.listChildren(children);
5306          children.add(new Property("publishedIn", "", "The collection the cited article or artifact is published in.", 0, 1, publishedIn));
5307          children.add(new Property("periodicRelease", "", "The specific issue in which the cited article resides.", 0, 1, periodicRelease));
5308          children.add(new Property("articleDate", "dateTime", "The date the article was added to the database, or the date the article was released (which may differ from the journal issue publication date).", 0, 1, articleDate));
5309          children.add(new Property("lastRevisionDate", "dateTime", "The date the article was last revised or updated in the database.", 0, 1, lastRevisionDate));
5310          children.add(new Property("language", "CodeableConcept", "Language in which this form of the article is published.", 0, java.lang.Integer.MAX_VALUE, language));
5311          children.add(new Property("accessionNumber", "string", "Entry number or identifier for inclusion in a database.", 0, 1, accessionNumber));
5312          children.add(new Property("pageString", "string", "Used for full display of pagination.", 0, 1, pageString));
5313          children.add(new Property("firstPage", "string", "Used for isolated representation of first page.", 0, 1, firstPage));
5314          children.add(new Property("lastPage", "string", "Used for isolated representation of last page.", 0, 1, lastPage));
5315          children.add(new Property("pageCount", "string", "Actual or approximate number of pages or screens.", 0, 1, pageCount));
5316          children.add(new Property("copyright", "markdown", "Copyright notice for the full article or artifact.", 0, 1, copyright));
5317        }
5318
5319        @Override
5320        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5321          switch (_hash) {
5322          case -614144077: /*publishedIn*/  return new Property("publishedIn", "", "The collection the cited article or artifact is published in.", 0, 1, publishedIn);
5323          case 1726878956: /*periodicRelease*/  return new Property("periodicRelease", "", "The specific issue in which the cited article resides.", 0, 1, periodicRelease);
5324          case 817743300: /*articleDate*/  return new Property("articleDate", "dateTime", "The date the article was added to the database, or the date the article was released (which may differ from the journal issue publication date).", 0, 1, articleDate);
5325          case 2129161183: /*lastRevisionDate*/  return new Property("lastRevisionDate", "dateTime", "The date the article was last revised or updated in the database.", 0, 1, lastRevisionDate);
5326          case -1613589672: /*language*/  return new Property("language", "CodeableConcept", "Language in which this form of the article is published.", 0, java.lang.Integer.MAX_VALUE, language);
5327          case 1807963277: /*accessionNumber*/  return new Property("accessionNumber", "string", "Entry number or identifier for inclusion in a database.", 0, 1, accessionNumber);
5328          case 1287145344: /*pageString*/  return new Property("pageString", "string", "Used for full display of pagination.", 0, 1, pageString);
5329          case 132895071: /*firstPage*/  return new Property("firstPage", "string", "Used for isolated representation of first page.", 0, 1, firstPage);
5330          case -1459540411: /*lastPage*/  return new Property("lastPage", "string", "Used for isolated representation of last page.", 0, 1, lastPage);
5331          case 857882560: /*pageCount*/  return new Property("pageCount", "string", "Actual or approximate number of pages or screens.", 0, 1, pageCount);
5332          case 1522889671: /*copyright*/  return new Property("copyright", "markdown", "Copyright notice for the full article or artifact.", 0, 1, copyright);
5333          default: return super.getNamedProperty(_hash, _name, _checkValid);
5334          }
5335
5336        }
5337
5338      @Override
5339      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5340        switch (hash) {
5341        case -614144077: /*publishedIn*/ return this.publishedIn == null ? new Base[0] : new Base[] {this.publishedIn}; // CitationCitedArtifactPublicationFormPublishedInComponent
5342        case 1726878956: /*periodicRelease*/ return this.periodicRelease == null ? new Base[0] : new Base[] {this.periodicRelease}; // CitationCitedArtifactPublicationFormPeriodicReleaseComponent
5343        case 817743300: /*articleDate*/ return this.articleDate == null ? new Base[0] : new Base[] {this.articleDate}; // DateTimeType
5344        case 2129161183: /*lastRevisionDate*/ return this.lastRevisionDate == null ? new Base[0] : new Base[] {this.lastRevisionDate}; // DateTimeType
5345        case -1613589672: /*language*/ return this.language == null ? new Base[0] : this.language.toArray(new Base[this.language.size()]); // CodeableConcept
5346        case 1807963277: /*accessionNumber*/ return this.accessionNumber == null ? new Base[0] : new Base[] {this.accessionNumber}; // StringType
5347        case 1287145344: /*pageString*/ return this.pageString == null ? new Base[0] : new Base[] {this.pageString}; // StringType
5348        case 132895071: /*firstPage*/ return this.firstPage == null ? new Base[0] : new Base[] {this.firstPage}; // StringType
5349        case -1459540411: /*lastPage*/ return this.lastPage == null ? new Base[0] : new Base[] {this.lastPage}; // StringType
5350        case 857882560: /*pageCount*/ return this.pageCount == null ? new Base[0] : new Base[] {this.pageCount}; // StringType
5351        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
5352        default: return super.getProperty(hash, name, checkValid);
5353        }
5354
5355      }
5356
5357      @Override
5358      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5359        switch (hash) {
5360        case -614144077: // publishedIn
5361          this.publishedIn = (CitationCitedArtifactPublicationFormPublishedInComponent) value; // CitationCitedArtifactPublicationFormPublishedInComponent
5362          return value;
5363        case 1726878956: // periodicRelease
5364          this.periodicRelease = (CitationCitedArtifactPublicationFormPeriodicReleaseComponent) value; // CitationCitedArtifactPublicationFormPeriodicReleaseComponent
5365          return value;
5366        case 817743300: // articleDate
5367          this.articleDate = TypeConvertor.castToDateTime(value); // DateTimeType
5368          return value;
5369        case 2129161183: // lastRevisionDate
5370          this.lastRevisionDate = TypeConvertor.castToDateTime(value); // DateTimeType
5371          return value;
5372        case -1613589672: // language
5373          this.getLanguage().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
5374          return value;
5375        case 1807963277: // accessionNumber
5376          this.accessionNumber = TypeConvertor.castToString(value); // StringType
5377          return value;
5378        case 1287145344: // pageString
5379          this.pageString = TypeConvertor.castToString(value); // StringType
5380          return value;
5381        case 132895071: // firstPage
5382          this.firstPage = TypeConvertor.castToString(value); // StringType
5383          return value;
5384        case -1459540411: // lastPage
5385          this.lastPage = TypeConvertor.castToString(value); // StringType
5386          return value;
5387        case 857882560: // pageCount
5388          this.pageCount = TypeConvertor.castToString(value); // StringType
5389          return value;
5390        case 1522889671: // copyright
5391          this.copyright = TypeConvertor.castToMarkdown(value); // MarkdownType
5392          return value;
5393        default: return super.setProperty(hash, name, value);
5394        }
5395
5396      }
5397
5398      @Override
5399      public Base setProperty(String name, Base value) throws FHIRException {
5400        if (name.equals("publishedIn")) {
5401          this.publishedIn = (CitationCitedArtifactPublicationFormPublishedInComponent) value; // CitationCitedArtifactPublicationFormPublishedInComponent
5402        } else if (name.equals("periodicRelease")) {
5403          this.periodicRelease = (CitationCitedArtifactPublicationFormPeriodicReleaseComponent) value; // CitationCitedArtifactPublicationFormPeriodicReleaseComponent
5404        } else if (name.equals("articleDate")) {
5405          this.articleDate = TypeConvertor.castToDateTime(value); // DateTimeType
5406        } else if (name.equals("lastRevisionDate")) {
5407          this.lastRevisionDate = TypeConvertor.castToDateTime(value); // DateTimeType
5408        } else if (name.equals("language")) {
5409          this.getLanguage().add(TypeConvertor.castToCodeableConcept(value));
5410        } else if (name.equals("accessionNumber")) {
5411          this.accessionNumber = TypeConvertor.castToString(value); // StringType
5412        } else if (name.equals("pageString")) {
5413          this.pageString = TypeConvertor.castToString(value); // StringType
5414        } else if (name.equals("firstPage")) {
5415          this.firstPage = TypeConvertor.castToString(value); // StringType
5416        } else if (name.equals("lastPage")) {
5417          this.lastPage = TypeConvertor.castToString(value); // StringType
5418        } else if (name.equals("pageCount")) {
5419          this.pageCount = TypeConvertor.castToString(value); // StringType
5420        } else if (name.equals("copyright")) {
5421          this.copyright = TypeConvertor.castToMarkdown(value); // MarkdownType
5422        } else
5423          return super.setProperty(name, value);
5424        return value;
5425      }
5426
5427      @Override
5428      public Base makeProperty(int hash, String name) throws FHIRException {
5429        switch (hash) {
5430        case -614144077:  return getPublishedIn();
5431        case 1726878956:  return getPeriodicRelease();
5432        case 817743300:  return getArticleDateElement();
5433        case 2129161183:  return getLastRevisionDateElement();
5434        case -1613589672:  return addLanguage(); 
5435        case 1807963277:  return getAccessionNumberElement();
5436        case 1287145344:  return getPageStringElement();
5437        case 132895071:  return getFirstPageElement();
5438        case -1459540411:  return getLastPageElement();
5439        case 857882560:  return getPageCountElement();
5440        case 1522889671:  return getCopyrightElement();
5441        default: return super.makeProperty(hash, name);
5442        }
5443
5444      }
5445
5446      @Override
5447      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5448        switch (hash) {
5449        case -614144077: /*publishedIn*/ return new String[] {};
5450        case 1726878956: /*periodicRelease*/ return new String[] {};
5451        case 817743300: /*articleDate*/ return new String[] {"dateTime"};
5452        case 2129161183: /*lastRevisionDate*/ return new String[] {"dateTime"};
5453        case -1613589672: /*language*/ return new String[] {"CodeableConcept"};
5454        case 1807963277: /*accessionNumber*/ return new String[] {"string"};
5455        case 1287145344: /*pageString*/ return new String[] {"string"};
5456        case 132895071: /*firstPage*/ return new String[] {"string"};
5457        case -1459540411: /*lastPage*/ return new String[] {"string"};
5458        case 857882560: /*pageCount*/ return new String[] {"string"};
5459        case 1522889671: /*copyright*/ return new String[] {"markdown"};
5460        default: return super.getTypesForProperty(hash, name);
5461        }
5462
5463      }
5464
5465      @Override
5466      public Base addChild(String name) throws FHIRException {
5467        if (name.equals("publishedIn")) {
5468          this.publishedIn = new CitationCitedArtifactPublicationFormPublishedInComponent();
5469          return this.publishedIn;
5470        }
5471        else if (name.equals("periodicRelease")) {
5472          this.periodicRelease = new CitationCitedArtifactPublicationFormPeriodicReleaseComponent();
5473          return this.periodicRelease;
5474        }
5475        else if (name.equals("articleDate")) {
5476          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.articleDate");
5477        }
5478        else if (name.equals("lastRevisionDate")) {
5479          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.lastRevisionDate");
5480        }
5481        else if (name.equals("language")) {
5482          return addLanguage();
5483        }
5484        else if (name.equals("accessionNumber")) {
5485          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.accessionNumber");
5486        }
5487        else if (name.equals("pageString")) {
5488          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.pageString");
5489        }
5490        else if (name.equals("firstPage")) {
5491          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.firstPage");
5492        }
5493        else if (name.equals("lastPage")) {
5494          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.lastPage");
5495        }
5496        else if (name.equals("pageCount")) {
5497          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.pageCount");
5498        }
5499        else if (name.equals("copyright")) {
5500          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.copyright");
5501        }
5502        else
5503          return super.addChild(name);
5504      }
5505
5506      public CitationCitedArtifactPublicationFormComponent copy() {
5507        CitationCitedArtifactPublicationFormComponent dst = new CitationCitedArtifactPublicationFormComponent();
5508        copyValues(dst);
5509        return dst;
5510      }
5511
5512      public void copyValues(CitationCitedArtifactPublicationFormComponent dst) {
5513        super.copyValues(dst);
5514        dst.publishedIn = publishedIn == null ? null : publishedIn.copy();
5515        dst.periodicRelease = periodicRelease == null ? null : periodicRelease.copy();
5516        dst.articleDate = articleDate == null ? null : articleDate.copy();
5517        dst.lastRevisionDate = lastRevisionDate == null ? null : lastRevisionDate.copy();
5518        if (language != null) {
5519          dst.language = new ArrayList<CodeableConcept>();
5520          for (CodeableConcept i : language)
5521            dst.language.add(i.copy());
5522        };
5523        dst.accessionNumber = accessionNumber == null ? null : accessionNumber.copy();
5524        dst.pageString = pageString == null ? null : pageString.copy();
5525        dst.firstPage = firstPage == null ? null : firstPage.copy();
5526        dst.lastPage = lastPage == null ? null : lastPage.copy();
5527        dst.pageCount = pageCount == null ? null : pageCount.copy();
5528        dst.copyright = copyright == null ? null : copyright.copy();
5529      }
5530
5531      @Override
5532      public boolean equalsDeep(Base other_) {
5533        if (!super.equalsDeep(other_))
5534          return false;
5535        if (!(other_ instanceof CitationCitedArtifactPublicationFormComponent))
5536          return false;
5537        CitationCitedArtifactPublicationFormComponent o = (CitationCitedArtifactPublicationFormComponent) other_;
5538        return compareDeep(publishedIn, o.publishedIn, true) && compareDeep(periodicRelease, o.periodicRelease, true)
5539           && compareDeep(articleDate, o.articleDate, true) && compareDeep(lastRevisionDate, o.lastRevisionDate, true)
5540           && compareDeep(language, o.language, true) && compareDeep(accessionNumber, o.accessionNumber, true)
5541           && compareDeep(pageString, o.pageString, true) && compareDeep(firstPage, o.firstPage, true) && compareDeep(lastPage, o.lastPage, true)
5542           && compareDeep(pageCount, o.pageCount, true) && compareDeep(copyright, o.copyright, true);
5543      }
5544
5545      @Override
5546      public boolean equalsShallow(Base other_) {
5547        if (!super.equalsShallow(other_))
5548          return false;
5549        if (!(other_ instanceof CitationCitedArtifactPublicationFormComponent))
5550          return false;
5551        CitationCitedArtifactPublicationFormComponent o = (CitationCitedArtifactPublicationFormComponent) other_;
5552        return compareValues(articleDate, o.articleDate, true) && compareValues(lastRevisionDate, o.lastRevisionDate, true)
5553           && compareValues(accessionNumber, o.accessionNumber, true) && compareValues(pageString, o.pageString, true)
5554           && compareValues(firstPage, o.firstPage, true) && compareValues(lastPage, o.lastPage, true) && compareValues(pageCount, o.pageCount, true)
5555           && compareValues(copyright, o.copyright, true);
5556      }
5557
5558      public boolean isEmpty() {
5559        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(publishedIn, periodicRelease
5560          , articleDate, lastRevisionDate, language, accessionNumber, pageString, firstPage
5561          , lastPage, pageCount, copyright);
5562      }
5563
5564  public String fhirType() {
5565    return "Citation.citedArtifact.publicationForm";
5566
5567  }
5568
5569  }
5570
5571    @Block()
5572    public static class CitationCitedArtifactPublicationFormPublishedInComponent extends BackboneElement implements IBaseBackboneElement {
5573        /**
5574         * Kind of container (e.g. Periodical, database, or book).
5575         */
5576        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
5577        @Description(shortDefinition="Kind of container (e.g. Periodical, database, or book)", formalDefinition="Kind of container (e.g. Periodical, database, or book)." )
5578        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/published-in-type")
5579        protected CodeableConcept type;
5580
5581        /**
5582         * Journal identifiers include ISSN, ISO Abbreviation and NLMuniqueID; Book identifiers include ISBN.
5583         */
5584        @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5585        @Description(shortDefinition="Journal identifiers include ISSN, ISO Abbreviation and NLMuniqueID; Book identifiers include ISBN", formalDefinition="Journal identifiers include ISSN, ISO Abbreviation and NLMuniqueID; Book identifiers include ISBN." )
5586        protected List<Identifier> identifier;
5587
5588        /**
5589         * Name of the database or title of the book or journal.
5590         */
5591        @Child(name = "title", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
5592        @Description(shortDefinition="Name of the database or title of the book or journal", formalDefinition="Name of the database or title of the book or journal." )
5593        protected StringType title;
5594
5595        /**
5596         * Name of the publisher.
5597         */
5598        @Child(name = "publisher", type = {Organization.class}, order=4, min=0, max=1, modifier=false, summary=false)
5599        @Description(shortDefinition="Name of the publisher", formalDefinition="Name of the publisher." )
5600        protected Reference publisher;
5601
5602        /**
5603         * Geographic location of the publisher.
5604         */
5605        @Child(name = "publisherLocation", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false)
5606        @Description(shortDefinition="Geographic location of the publisher", formalDefinition="Geographic location of the publisher." )
5607        protected StringType publisherLocation;
5608
5609        private static final long serialVersionUID = 1440066953L;
5610
5611    /**
5612     * Constructor
5613     */
5614      public CitationCitedArtifactPublicationFormPublishedInComponent() {
5615        super();
5616      }
5617
5618        /**
5619         * @return {@link #type} (Kind of container (e.g. Periodical, database, or book).)
5620         */
5621        public CodeableConcept getType() { 
5622          if (this.type == null)
5623            if (Configuration.errorOnAutoCreate())
5624              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPublishedInComponent.type");
5625            else if (Configuration.doAutoCreate())
5626              this.type = new CodeableConcept(); // cc
5627          return this.type;
5628        }
5629
5630        public boolean hasType() { 
5631          return this.type != null && !this.type.isEmpty();
5632        }
5633
5634        /**
5635         * @param value {@link #type} (Kind of container (e.g. Periodical, database, or book).)
5636         */
5637        public CitationCitedArtifactPublicationFormPublishedInComponent setType(CodeableConcept value) { 
5638          this.type = value;
5639          return this;
5640        }
5641
5642        /**
5643         * @return {@link #identifier} (Journal identifiers include ISSN, ISO Abbreviation and NLMuniqueID; Book identifiers include ISBN.)
5644         */
5645        public List<Identifier> getIdentifier() { 
5646          if (this.identifier == null)
5647            this.identifier = new ArrayList<Identifier>();
5648          return this.identifier;
5649        }
5650
5651        /**
5652         * @return Returns a reference to <code>this</code> for easy method chaining
5653         */
5654        public CitationCitedArtifactPublicationFormPublishedInComponent setIdentifier(List<Identifier> theIdentifier) { 
5655          this.identifier = theIdentifier;
5656          return this;
5657        }
5658
5659        public boolean hasIdentifier() { 
5660          if (this.identifier == null)
5661            return false;
5662          for (Identifier item : this.identifier)
5663            if (!item.isEmpty())
5664              return true;
5665          return false;
5666        }
5667
5668        public Identifier addIdentifier() { //3
5669          Identifier t = new Identifier();
5670          if (this.identifier == null)
5671            this.identifier = new ArrayList<Identifier>();
5672          this.identifier.add(t);
5673          return t;
5674        }
5675
5676        public CitationCitedArtifactPublicationFormPublishedInComponent addIdentifier(Identifier t) { //3
5677          if (t == null)
5678            return this;
5679          if (this.identifier == null)
5680            this.identifier = new ArrayList<Identifier>();
5681          this.identifier.add(t);
5682          return this;
5683        }
5684
5685        /**
5686         * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
5687         */
5688        public Identifier getIdentifierFirstRep() { 
5689          if (getIdentifier().isEmpty()) {
5690            addIdentifier();
5691          }
5692          return getIdentifier().get(0);
5693        }
5694
5695        /**
5696         * @return {@link #title} (Name of the database or title of the book or journal.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
5697         */
5698        public StringType getTitleElement() { 
5699          if (this.title == null)
5700            if (Configuration.errorOnAutoCreate())
5701              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPublishedInComponent.title");
5702            else if (Configuration.doAutoCreate())
5703              this.title = new StringType(); // bb
5704          return this.title;
5705        }
5706
5707        public boolean hasTitleElement() { 
5708          return this.title != null && !this.title.isEmpty();
5709        }
5710
5711        public boolean hasTitle() { 
5712          return this.title != null && !this.title.isEmpty();
5713        }
5714
5715        /**
5716         * @param value {@link #title} (Name of the database or title of the book or journal.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
5717         */
5718        public CitationCitedArtifactPublicationFormPublishedInComponent setTitleElement(StringType value) { 
5719          this.title = value;
5720          return this;
5721        }
5722
5723        /**
5724         * @return Name of the database or title of the book or journal.
5725         */
5726        public String getTitle() { 
5727          return this.title == null ? null : this.title.getValue();
5728        }
5729
5730        /**
5731         * @param value Name of the database or title of the book or journal.
5732         */
5733        public CitationCitedArtifactPublicationFormPublishedInComponent setTitle(String value) { 
5734          if (Utilities.noString(value))
5735            this.title = null;
5736          else {
5737            if (this.title == null)
5738              this.title = new StringType();
5739            this.title.setValue(value);
5740          }
5741          return this;
5742        }
5743
5744        /**
5745         * @return {@link #publisher} (Name of the publisher.)
5746         */
5747        public Reference getPublisher() { 
5748          if (this.publisher == null)
5749            if (Configuration.errorOnAutoCreate())
5750              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPublishedInComponent.publisher");
5751            else if (Configuration.doAutoCreate())
5752              this.publisher = new Reference(); // cc
5753          return this.publisher;
5754        }
5755
5756        public boolean hasPublisher() { 
5757          return this.publisher != null && !this.publisher.isEmpty();
5758        }
5759
5760        /**
5761         * @param value {@link #publisher} (Name of the publisher.)
5762         */
5763        public CitationCitedArtifactPublicationFormPublishedInComponent setPublisher(Reference value) { 
5764          this.publisher = value;
5765          return this;
5766        }
5767
5768        /**
5769         * @return {@link #publisherLocation} (Geographic location of the publisher.). This is the underlying object with id, value and extensions. The accessor "getPublisherLocation" gives direct access to the value
5770         */
5771        public StringType getPublisherLocationElement() { 
5772          if (this.publisherLocation == null)
5773            if (Configuration.errorOnAutoCreate())
5774              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPublishedInComponent.publisherLocation");
5775            else if (Configuration.doAutoCreate())
5776              this.publisherLocation = new StringType(); // bb
5777          return this.publisherLocation;
5778        }
5779
5780        public boolean hasPublisherLocationElement() { 
5781          return this.publisherLocation != null && !this.publisherLocation.isEmpty();
5782        }
5783
5784        public boolean hasPublisherLocation() { 
5785          return this.publisherLocation != null && !this.publisherLocation.isEmpty();
5786        }
5787
5788        /**
5789         * @param value {@link #publisherLocation} (Geographic location of the publisher.). This is the underlying object with id, value and extensions. The accessor "getPublisherLocation" gives direct access to the value
5790         */
5791        public CitationCitedArtifactPublicationFormPublishedInComponent setPublisherLocationElement(StringType value) { 
5792          this.publisherLocation = value;
5793          return this;
5794        }
5795
5796        /**
5797         * @return Geographic location of the publisher.
5798         */
5799        public String getPublisherLocation() { 
5800          return this.publisherLocation == null ? null : this.publisherLocation.getValue();
5801        }
5802
5803        /**
5804         * @param value Geographic location of the publisher.
5805         */
5806        public CitationCitedArtifactPublicationFormPublishedInComponent setPublisherLocation(String value) { 
5807          if (Utilities.noString(value))
5808            this.publisherLocation = null;
5809          else {
5810            if (this.publisherLocation == null)
5811              this.publisherLocation = new StringType();
5812            this.publisherLocation.setValue(value);
5813          }
5814          return this;
5815        }
5816
5817        protected void listChildren(List<Property> children) {
5818          super.listChildren(children);
5819          children.add(new Property("type", "CodeableConcept", "Kind of container (e.g. Periodical, database, or book).", 0, 1, type));
5820          children.add(new Property("identifier", "Identifier", "Journal identifiers include ISSN, ISO Abbreviation and NLMuniqueID; Book identifiers include ISBN.", 0, java.lang.Integer.MAX_VALUE, identifier));
5821          children.add(new Property("title", "string", "Name of the database or title of the book or journal.", 0, 1, title));
5822          children.add(new Property("publisher", "Reference(Organization)", "Name of the publisher.", 0, 1, publisher));
5823          children.add(new Property("publisherLocation", "string", "Geographic location of the publisher.", 0, 1, publisherLocation));
5824        }
5825
5826        @Override
5827        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5828          switch (_hash) {
5829          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Kind of container (e.g. Periodical, database, or book).", 0, 1, type);
5830          case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Journal identifiers include ISSN, ISO Abbreviation and NLMuniqueID; Book identifiers include ISBN.", 0, java.lang.Integer.MAX_VALUE, identifier);
5831          case 110371416: /*title*/  return new Property("title", "string", "Name of the database or title of the book or journal.", 0, 1, title);
5832          case 1447404028: /*publisher*/  return new Property("publisher", "Reference(Organization)", "Name of the publisher.", 0, 1, publisher);
5833          case -1281627695: /*publisherLocation*/  return new Property("publisherLocation", "string", "Geographic location of the publisher.", 0, 1, publisherLocation);
5834          default: return super.getNamedProperty(_hash, _name, _checkValid);
5835          }
5836
5837        }
5838
5839      @Override
5840      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5841        switch (hash) {
5842        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
5843        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
5844        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
5845        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // Reference
5846        case -1281627695: /*publisherLocation*/ return this.publisherLocation == null ? new Base[0] : new Base[] {this.publisherLocation}; // StringType
5847        default: return super.getProperty(hash, name, checkValid);
5848        }
5849
5850      }
5851
5852      @Override
5853      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5854        switch (hash) {
5855        case 3575610: // type
5856          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
5857          return value;
5858        case -1618432855: // identifier
5859          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
5860          return value;
5861        case 110371416: // title
5862          this.title = TypeConvertor.castToString(value); // StringType
5863          return value;
5864        case 1447404028: // publisher
5865          this.publisher = TypeConvertor.castToReference(value); // Reference
5866          return value;
5867        case -1281627695: // publisherLocation
5868          this.publisherLocation = TypeConvertor.castToString(value); // StringType
5869          return value;
5870        default: return super.setProperty(hash, name, value);
5871        }
5872
5873      }
5874
5875      @Override
5876      public Base setProperty(String name, Base value) throws FHIRException {
5877        if (name.equals("type")) {
5878          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
5879        } else if (name.equals("identifier")) {
5880          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
5881        } else if (name.equals("title")) {
5882          this.title = TypeConvertor.castToString(value); // StringType
5883        } else if (name.equals("publisher")) {
5884          this.publisher = TypeConvertor.castToReference(value); // Reference
5885        } else if (name.equals("publisherLocation")) {
5886          this.publisherLocation = TypeConvertor.castToString(value); // StringType
5887        } else
5888          return super.setProperty(name, value);
5889        return value;
5890      }
5891
5892      @Override
5893      public Base makeProperty(int hash, String name) throws FHIRException {
5894        switch (hash) {
5895        case 3575610:  return getType();
5896        case -1618432855:  return addIdentifier(); 
5897        case 110371416:  return getTitleElement();
5898        case 1447404028:  return getPublisher();
5899        case -1281627695:  return getPublisherLocationElement();
5900        default: return super.makeProperty(hash, name);
5901        }
5902
5903      }
5904
5905      @Override
5906      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5907        switch (hash) {
5908        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
5909        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
5910        case 110371416: /*title*/ return new String[] {"string"};
5911        case 1447404028: /*publisher*/ return new String[] {"Reference"};
5912        case -1281627695: /*publisherLocation*/ return new String[] {"string"};
5913        default: return super.getTypesForProperty(hash, name);
5914        }
5915
5916      }
5917
5918      @Override
5919      public Base addChild(String name) throws FHIRException {
5920        if (name.equals("type")) {
5921          this.type = new CodeableConcept();
5922          return this.type;
5923        }
5924        else if (name.equals("identifier")) {
5925          return addIdentifier();
5926        }
5927        else if (name.equals("title")) {
5928          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.publishedIn.title");
5929        }
5930        else if (name.equals("publisher")) {
5931          this.publisher = new Reference();
5932          return this.publisher;
5933        }
5934        else if (name.equals("publisherLocation")) {
5935          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.publishedIn.publisherLocation");
5936        }
5937        else
5938          return super.addChild(name);
5939      }
5940
5941      public CitationCitedArtifactPublicationFormPublishedInComponent copy() {
5942        CitationCitedArtifactPublicationFormPublishedInComponent dst = new CitationCitedArtifactPublicationFormPublishedInComponent();
5943        copyValues(dst);
5944        return dst;
5945      }
5946
5947      public void copyValues(CitationCitedArtifactPublicationFormPublishedInComponent dst) {
5948        super.copyValues(dst);
5949        dst.type = type == null ? null : type.copy();
5950        if (identifier != null) {
5951          dst.identifier = new ArrayList<Identifier>();
5952          for (Identifier i : identifier)
5953            dst.identifier.add(i.copy());
5954        };
5955        dst.title = title == null ? null : title.copy();
5956        dst.publisher = publisher == null ? null : publisher.copy();
5957        dst.publisherLocation = publisherLocation == null ? null : publisherLocation.copy();
5958      }
5959
5960      @Override
5961      public boolean equalsDeep(Base other_) {
5962        if (!super.equalsDeep(other_))
5963          return false;
5964        if (!(other_ instanceof CitationCitedArtifactPublicationFormPublishedInComponent))
5965          return false;
5966        CitationCitedArtifactPublicationFormPublishedInComponent o = (CitationCitedArtifactPublicationFormPublishedInComponent) other_;
5967        return compareDeep(type, o.type, true) && compareDeep(identifier, o.identifier, true) && compareDeep(title, o.title, true)
5968           && compareDeep(publisher, o.publisher, true) && compareDeep(publisherLocation, o.publisherLocation, true)
5969          ;
5970      }
5971
5972      @Override
5973      public boolean equalsShallow(Base other_) {
5974        if (!super.equalsShallow(other_))
5975          return false;
5976        if (!(other_ instanceof CitationCitedArtifactPublicationFormPublishedInComponent))
5977          return false;
5978        CitationCitedArtifactPublicationFormPublishedInComponent o = (CitationCitedArtifactPublicationFormPublishedInComponent) other_;
5979        return compareValues(title, o.title, true) && compareValues(publisherLocation, o.publisherLocation, true)
5980          ;
5981      }
5982
5983      public boolean isEmpty() {
5984        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, identifier, title
5985          , publisher, publisherLocation);
5986      }
5987
5988  public String fhirType() {
5989    return "Citation.citedArtifact.publicationForm.publishedIn";
5990
5991  }
5992
5993  }
5994
5995    @Block()
5996    public static class CitationCitedArtifactPublicationFormPeriodicReleaseComponent extends BackboneElement implements IBaseBackboneElement {
5997        /**
5998         * Describes the form of the medium cited. Common codes are "Internet" or "Print".
5999         */
6000        @Child(name = "citedMedium", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
6001        @Description(shortDefinition="Internet or Print", formalDefinition="Describes the form of the medium cited. Common codes are \"Internet\" or \"Print\"." )
6002        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/cited-medium")
6003        protected CodeableConcept citedMedium;
6004
6005        /**
6006         * Volume number of journal in which the article is published.
6007         */
6008        @Child(name = "volume", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
6009        @Description(shortDefinition="Volume number of journal in which the article is published", formalDefinition="Volume number of journal in which the article is published." )
6010        protected StringType volume;
6011
6012        /**
6013         * Issue, part or supplement of journal in which the article is published.
6014         */
6015        @Child(name = "issue", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
6016        @Description(shortDefinition="Issue, part or supplement of journal in which the article is published", formalDefinition="Issue, part or supplement of journal in which the article is published." )
6017        protected StringType issue;
6018
6019        /**
6020         * Defining the date on which the issue of the journal was published.
6021         */
6022        @Child(name = "dateOfPublication", type = {}, order=4, min=0, max=1, modifier=false, summary=false)
6023        @Description(shortDefinition="Defining the date on which the issue of the journal was published", formalDefinition="Defining the date on which the issue of the journal was published." )
6024        protected CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent dateOfPublication;
6025
6026        private static final long serialVersionUID = -474554951L;
6027
6028    /**
6029     * Constructor
6030     */
6031      public CitationCitedArtifactPublicationFormPeriodicReleaseComponent() {
6032        super();
6033      }
6034
6035        /**
6036         * @return {@link #citedMedium} (Describes the form of the medium cited. Common codes are "Internet" or "Print".)
6037         */
6038        public CodeableConcept getCitedMedium() { 
6039          if (this.citedMedium == null)
6040            if (Configuration.errorOnAutoCreate())
6041              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseComponent.citedMedium");
6042            else if (Configuration.doAutoCreate())
6043              this.citedMedium = new CodeableConcept(); // cc
6044          return this.citedMedium;
6045        }
6046
6047        public boolean hasCitedMedium() { 
6048          return this.citedMedium != null && !this.citedMedium.isEmpty();
6049        }
6050
6051        /**
6052         * @param value {@link #citedMedium} (Describes the form of the medium cited. Common codes are "Internet" or "Print".)
6053         */
6054        public CitationCitedArtifactPublicationFormPeriodicReleaseComponent setCitedMedium(CodeableConcept value) { 
6055          this.citedMedium = value;
6056          return this;
6057        }
6058
6059        /**
6060         * @return {@link #volume} (Volume number of journal in which the article is published.). This is the underlying object with id, value and extensions. The accessor "getVolume" gives direct access to the value
6061         */
6062        public StringType getVolumeElement() { 
6063          if (this.volume == null)
6064            if (Configuration.errorOnAutoCreate())
6065              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseComponent.volume");
6066            else if (Configuration.doAutoCreate())
6067              this.volume = new StringType(); // bb
6068          return this.volume;
6069        }
6070
6071        public boolean hasVolumeElement() { 
6072          return this.volume != null && !this.volume.isEmpty();
6073        }
6074
6075        public boolean hasVolume() { 
6076          return this.volume != null && !this.volume.isEmpty();
6077        }
6078
6079        /**
6080         * @param value {@link #volume} (Volume number of journal in which the article is published.). This is the underlying object with id, value and extensions. The accessor "getVolume" gives direct access to the value
6081         */
6082        public CitationCitedArtifactPublicationFormPeriodicReleaseComponent setVolumeElement(StringType value) { 
6083          this.volume = value;
6084          return this;
6085        }
6086
6087        /**
6088         * @return Volume number of journal in which the article is published.
6089         */
6090        public String getVolume() { 
6091          return this.volume == null ? null : this.volume.getValue();
6092        }
6093
6094        /**
6095         * @param value Volume number of journal in which the article is published.
6096         */
6097        public CitationCitedArtifactPublicationFormPeriodicReleaseComponent setVolume(String value) { 
6098          if (Utilities.noString(value))
6099            this.volume = null;
6100          else {
6101            if (this.volume == null)
6102              this.volume = new StringType();
6103            this.volume.setValue(value);
6104          }
6105          return this;
6106        }
6107
6108        /**
6109         * @return {@link #issue} (Issue, part or supplement of journal in which the article is published.). This is the underlying object with id, value and extensions. The accessor "getIssue" gives direct access to the value
6110         */
6111        public StringType getIssueElement() { 
6112          if (this.issue == null)
6113            if (Configuration.errorOnAutoCreate())
6114              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseComponent.issue");
6115            else if (Configuration.doAutoCreate())
6116              this.issue = new StringType(); // bb
6117          return this.issue;
6118        }
6119
6120        public boolean hasIssueElement() { 
6121          return this.issue != null && !this.issue.isEmpty();
6122        }
6123
6124        public boolean hasIssue() { 
6125          return this.issue != null && !this.issue.isEmpty();
6126        }
6127
6128        /**
6129         * @param value {@link #issue} (Issue, part or supplement of journal in which the article is published.). This is the underlying object with id, value and extensions. The accessor "getIssue" gives direct access to the value
6130         */
6131        public CitationCitedArtifactPublicationFormPeriodicReleaseComponent setIssueElement(StringType value) { 
6132          this.issue = value;
6133          return this;
6134        }
6135
6136        /**
6137         * @return Issue, part or supplement of journal in which the article is published.
6138         */
6139        public String getIssue() { 
6140          return this.issue == null ? null : this.issue.getValue();
6141        }
6142
6143        /**
6144         * @param value Issue, part or supplement of journal in which the article is published.
6145         */
6146        public CitationCitedArtifactPublicationFormPeriodicReleaseComponent setIssue(String value) { 
6147          if (Utilities.noString(value))
6148            this.issue = null;
6149          else {
6150            if (this.issue == null)
6151              this.issue = new StringType();
6152            this.issue.setValue(value);
6153          }
6154          return this;
6155        }
6156
6157        /**
6158         * @return {@link #dateOfPublication} (Defining the date on which the issue of the journal was published.)
6159         */
6160        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent getDateOfPublication() { 
6161          if (this.dateOfPublication == null)
6162            if (Configuration.errorOnAutoCreate())
6163              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseComponent.dateOfPublication");
6164            else if (Configuration.doAutoCreate())
6165              this.dateOfPublication = new CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent(); // cc
6166          return this.dateOfPublication;
6167        }
6168
6169        public boolean hasDateOfPublication() { 
6170          return this.dateOfPublication != null && !this.dateOfPublication.isEmpty();
6171        }
6172
6173        /**
6174         * @param value {@link #dateOfPublication} (Defining the date on which the issue of the journal was published.)
6175         */
6176        public CitationCitedArtifactPublicationFormPeriodicReleaseComponent setDateOfPublication(CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent value) { 
6177          this.dateOfPublication = value;
6178          return this;
6179        }
6180
6181        protected void listChildren(List<Property> children) {
6182          super.listChildren(children);
6183          children.add(new Property("citedMedium", "CodeableConcept", "Describes the form of the medium cited. Common codes are \"Internet\" or \"Print\".", 0, 1, citedMedium));
6184          children.add(new Property("volume", "string", "Volume number of journal in which the article is published.", 0, 1, volume));
6185          children.add(new Property("issue", "string", "Issue, part or supplement of journal in which the article is published.", 0, 1, issue));
6186          children.add(new Property("dateOfPublication", "", "Defining the date on which the issue of the journal was published.", 0, 1, dateOfPublication));
6187        }
6188
6189        @Override
6190        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6191          switch (_hash) {
6192          case 612116418: /*citedMedium*/  return new Property("citedMedium", "CodeableConcept", "Describes the form of the medium cited. Common codes are \"Internet\" or \"Print\".", 0, 1, citedMedium);
6193          case -810883302: /*volume*/  return new Property("volume", "string", "Volume number of journal in which the article is published.", 0, 1, volume);
6194          case 100509913: /*issue*/  return new Property("issue", "string", "Issue, part or supplement of journal in which the article is published.", 0, 1, issue);
6195          case -1662473529: /*dateOfPublication*/  return new Property("dateOfPublication", "", "Defining the date on which the issue of the journal was published.", 0, 1, dateOfPublication);
6196          default: return super.getNamedProperty(_hash, _name, _checkValid);
6197          }
6198
6199        }
6200
6201      @Override
6202      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6203        switch (hash) {
6204        case 612116418: /*citedMedium*/ return this.citedMedium == null ? new Base[0] : new Base[] {this.citedMedium}; // CodeableConcept
6205        case -810883302: /*volume*/ return this.volume == null ? new Base[0] : new Base[] {this.volume}; // StringType
6206        case 100509913: /*issue*/ return this.issue == null ? new Base[0] : new Base[] {this.issue}; // StringType
6207        case -1662473529: /*dateOfPublication*/ return this.dateOfPublication == null ? new Base[0] : new Base[] {this.dateOfPublication}; // CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent
6208        default: return super.getProperty(hash, name, checkValid);
6209        }
6210
6211      }
6212
6213      @Override
6214      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6215        switch (hash) {
6216        case 612116418: // citedMedium
6217          this.citedMedium = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
6218          return value;
6219        case -810883302: // volume
6220          this.volume = TypeConvertor.castToString(value); // StringType
6221          return value;
6222        case 100509913: // issue
6223          this.issue = TypeConvertor.castToString(value); // StringType
6224          return value;
6225        case -1662473529: // dateOfPublication
6226          this.dateOfPublication = (CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent) value; // CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent
6227          return value;
6228        default: return super.setProperty(hash, name, value);
6229        }
6230
6231      }
6232
6233      @Override
6234      public Base setProperty(String name, Base value) throws FHIRException {
6235        if (name.equals("citedMedium")) {
6236          this.citedMedium = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
6237        } else if (name.equals("volume")) {
6238          this.volume = TypeConvertor.castToString(value); // StringType
6239        } else if (name.equals("issue")) {
6240          this.issue = TypeConvertor.castToString(value); // StringType
6241        } else if (name.equals("dateOfPublication")) {
6242          this.dateOfPublication = (CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent) value; // CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent
6243        } else
6244          return super.setProperty(name, value);
6245        return value;
6246      }
6247
6248      @Override
6249      public Base makeProperty(int hash, String name) throws FHIRException {
6250        switch (hash) {
6251        case 612116418:  return getCitedMedium();
6252        case -810883302:  return getVolumeElement();
6253        case 100509913:  return getIssueElement();
6254        case -1662473529:  return getDateOfPublication();
6255        default: return super.makeProperty(hash, name);
6256        }
6257
6258      }
6259
6260      @Override
6261      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6262        switch (hash) {
6263        case 612116418: /*citedMedium*/ return new String[] {"CodeableConcept"};
6264        case -810883302: /*volume*/ return new String[] {"string"};
6265        case 100509913: /*issue*/ return new String[] {"string"};
6266        case -1662473529: /*dateOfPublication*/ return new String[] {};
6267        default: return super.getTypesForProperty(hash, name);
6268        }
6269
6270      }
6271
6272      @Override
6273      public Base addChild(String name) throws FHIRException {
6274        if (name.equals("citedMedium")) {
6275          this.citedMedium = new CodeableConcept();
6276          return this.citedMedium;
6277        }
6278        else if (name.equals("volume")) {
6279          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.periodicRelease.volume");
6280        }
6281        else if (name.equals("issue")) {
6282          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.periodicRelease.issue");
6283        }
6284        else if (name.equals("dateOfPublication")) {
6285          this.dateOfPublication = new CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent();
6286          return this.dateOfPublication;
6287        }
6288        else
6289          return super.addChild(name);
6290      }
6291
6292      public CitationCitedArtifactPublicationFormPeriodicReleaseComponent copy() {
6293        CitationCitedArtifactPublicationFormPeriodicReleaseComponent dst = new CitationCitedArtifactPublicationFormPeriodicReleaseComponent();
6294        copyValues(dst);
6295        return dst;
6296      }
6297
6298      public void copyValues(CitationCitedArtifactPublicationFormPeriodicReleaseComponent dst) {
6299        super.copyValues(dst);
6300        dst.citedMedium = citedMedium == null ? null : citedMedium.copy();
6301        dst.volume = volume == null ? null : volume.copy();
6302        dst.issue = issue == null ? null : issue.copy();
6303        dst.dateOfPublication = dateOfPublication == null ? null : dateOfPublication.copy();
6304      }
6305
6306      @Override
6307      public boolean equalsDeep(Base other_) {
6308        if (!super.equalsDeep(other_))
6309          return false;
6310        if (!(other_ instanceof CitationCitedArtifactPublicationFormPeriodicReleaseComponent))
6311          return false;
6312        CitationCitedArtifactPublicationFormPeriodicReleaseComponent o = (CitationCitedArtifactPublicationFormPeriodicReleaseComponent) other_;
6313        return compareDeep(citedMedium, o.citedMedium, true) && compareDeep(volume, o.volume, true) && compareDeep(issue, o.issue, true)
6314           && compareDeep(dateOfPublication, o.dateOfPublication, true);
6315      }
6316
6317      @Override
6318      public boolean equalsShallow(Base other_) {
6319        if (!super.equalsShallow(other_))
6320          return false;
6321        if (!(other_ instanceof CitationCitedArtifactPublicationFormPeriodicReleaseComponent))
6322          return false;
6323        CitationCitedArtifactPublicationFormPeriodicReleaseComponent o = (CitationCitedArtifactPublicationFormPeriodicReleaseComponent) other_;
6324        return compareValues(volume, o.volume, true) && compareValues(issue, o.issue, true);
6325      }
6326
6327      public boolean isEmpty() {
6328        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(citedMedium, volume, issue
6329          , dateOfPublication);
6330      }
6331
6332  public String fhirType() {
6333    return "Citation.citedArtifact.publicationForm.periodicRelease";
6334
6335  }
6336
6337  }
6338
6339    @Block()
6340    public static class CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent extends BackboneElement implements IBaseBackboneElement {
6341        /**
6342         * Date on which the issue of the journal was published.
6343         */
6344        @Child(name = "date", type = {DateType.class}, order=1, min=0, max=1, modifier=false, summary=false)
6345        @Description(shortDefinition="Date on which the issue of the journal was published", formalDefinition="Date on which the issue of the journal was published." )
6346        protected DateType date;
6347
6348        /**
6349         * Year on which the issue of the journal was published.
6350         */
6351        @Child(name = "year", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
6352        @Description(shortDefinition="Year on which the issue of the journal was published", formalDefinition="Year on which the issue of the journal was published." )
6353        protected StringType year;
6354
6355        /**
6356         * Month on which the issue of the journal was published.
6357         */
6358        @Child(name = "month", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
6359        @Description(shortDefinition="Month on which the issue of the journal was published", formalDefinition="Month on which the issue of the journal was published." )
6360        protected StringType month;
6361
6362        /**
6363         * Day on which the issue of the journal was published.
6364         */
6365        @Child(name = "day", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
6366        @Description(shortDefinition="Day on which the issue of the journal was published", formalDefinition="Day on which the issue of the journal was published." )
6367        protected StringType day;
6368
6369        /**
6370         * Spring, Summer, Fall/Autumn, Winter.
6371         */
6372        @Child(name = "season", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false)
6373        @Description(shortDefinition="Season on which the issue of the journal was published", formalDefinition="Spring, Summer, Fall/Autumn, Winter." )
6374        protected StringType season;
6375
6376        /**
6377         * Text representation of the date of which the issue of the journal was published.
6378         */
6379        @Child(name = "text", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false)
6380        @Description(shortDefinition="Text representation of the date of which the issue of the journal was published", formalDefinition="Text representation of the date of which the issue of the journal was published." )
6381        protected StringType text;
6382
6383        private static final long serialVersionUID = 1585589146L;
6384
6385    /**
6386     * Constructor
6387     */
6388      public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent() {
6389        super();
6390      }
6391
6392        /**
6393         * @return {@link #date} (Date on which the issue of the journal was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
6394         */
6395        public DateType getDateElement() { 
6396          if (this.date == null)
6397            if (Configuration.errorOnAutoCreate())
6398              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent.date");
6399            else if (Configuration.doAutoCreate())
6400              this.date = new DateType(); // bb
6401          return this.date;
6402        }
6403
6404        public boolean hasDateElement() { 
6405          return this.date != null && !this.date.isEmpty();
6406        }
6407
6408        public boolean hasDate() { 
6409          return this.date != null && !this.date.isEmpty();
6410        }
6411
6412        /**
6413         * @param value {@link #date} (Date on which the issue of the journal was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
6414         */
6415        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setDateElement(DateType value) { 
6416          this.date = value;
6417          return this;
6418        }
6419
6420        /**
6421         * @return Date on which the issue of the journal was published.
6422         */
6423        public Date getDate() { 
6424          return this.date == null ? null : this.date.getValue();
6425        }
6426
6427        /**
6428         * @param value Date on which the issue of the journal was published.
6429         */
6430        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setDate(Date value) { 
6431          if (value == null)
6432            this.date = null;
6433          else {
6434            if (this.date == null)
6435              this.date = new DateType();
6436            this.date.setValue(value);
6437          }
6438          return this;
6439        }
6440
6441        /**
6442         * @return {@link #year} (Year on which the issue of the journal was published.). This is the underlying object with id, value and extensions. The accessor "getYear" gives direct access to the value
6443         */
6444        public StringType getYearElement() { 
6445          if (this.year == null)
6446            if (Configuration.errorOnAutoCreate())
6447              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent.year");
6448            else if (Configuration.doAutoCreate())
6449              this.year = new StringType(); // bb
6450          return this.year;
6451        }
6452
6453        public boolean hasYearElement() { 
6454          return this.year != null && !this.year.isEmpty();
6455        }
6456
6457        public boolean hasYear() { 
6458          return this.year != null && !this.year.isEmpty();
6459        }
6460
6461        /**
6462         * @param value {@link #year} (Year on which the issue of the journal was published.). This is the underlying object with id, value and extensions. The accessor "getYear" gives direct access to the value
6463         */
6464        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setYearElement(StringType value) { 
6465          this.year = value;
6466          return this;
6467        }
6468
6469        /**
6470         * @return Year on which the issue of the journal was published.
6471         */
6472        public String getYear() { 
6473          return this.year == null ? null : this.year.getValue();
6474        }
6475
6476        /**
6477         * @param value Year on which the issue of the journal was published.
6478         */
6479        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setYear(String value) { 
6480          if (Utilities.noString(value))
6481            this.year = null;
6482          else {
6483            if (this.year == null)
6484              this.year = new StringType();
6485            this.year.setValue(value);
6486          }
6487          return this;
6488        }
6489
6490        /**
6491         * @return {@link #month} (Month on which the issue of the journal was published.). This is the underlying object with id, value and extensions. The accessor "getMonth" gives direct access to the value
6492         */
6493        public StringType getMonthElement() { 
6494          if (this.month == null)
6495            if (Configuration.errorOnAutoCreate())
6496              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent.month");
6497            else if (Configuration.doAutoCreate())
6498              this.month = new StringType(); // bb
6499          return this.month;
6500        }
6501
6502        public boolean hasMonthElement() { 
6503          return this.month != null && !this.month.isEmpty();
6504        }
6505
6506        public boolean hasMonth() { 
6507          return this.month != null && !this.month.isEmpty();
6508        }
6509
6510        /**
6511         * @param value {@link #month} (Month on which the issue of the journal was published.). This is the underlying object with id, value and extensions. The accessor "getMonth" gives direct access to the value
6512         */
6513        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setMonthElement(StringType value) { 
6514          this.month = value;
6515          return this;
6516        }
6517
6518        /**
6519         * @return Month on which the issue of the journal was published.
6520         */
6521        public String getMonth() { 
6522          return this.month == null ? null : this.month.getValue();
6523        }
6524
6525        /**
6526         * @param value Month on which the issue of the journal was published.
6527         */
6528        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setMonth(String value) { 
6529          if (Utilities.noString(value))
6530            this.month = null;
6531          else {
6532            if (this.month == null)
6533              this.month = new StringType();
6534            this.month.setValue(value);
6535          }
6536          return this;
6537        }
6538
6539        /**
6540         * @return {@link #day} (Day on which the issue of the journal was published.). This is the underlying object with id, value and extensions. The accessor "getDay" gives direct access to the value
6541         */
6542        public StringType getDayElement() { 
6543          if (this.day == null)
6544            if (Configuration.errorOnAutoCreate())
6545              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent.day");
6546            else if (Configuration.doAutoCreate())
6547              this.day = new StringType(); // bb
6548          return this.day;
6549        }
6550
6551        public boolean hasDayElement() { 
6552          return this.day != null && !this.day.isEmpty();
6553        }
6554
6555        public boolean hasDay() { 
6556          return this.day != null && !this.day.isEmpty();
6557        }
6558
6559        /**
6560         * @param value {@link #day} (Day on which the issue of the journal was published.). This is the underlying object with id, value and extensions. The accessor "getDay" gives direct access to the value
6561         */
6562        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setDayElement(StringType value) { 
6563          this.day = value;
6564          return this;
6565        }
6566
6567        /**
6568         * @return Day on which the issue of the journal was published.
6569         */
6570        public String getDay() { 
6571          return this.day == null ? null : this.day.getValue();
6572        }
6573
6574        /**
6575         * @param value Day on which the issue of the journal was published.
6576         */
6577        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setDay(String value) { 
6578          if (Utilities.noString(value))
6579            this.day = null;
6580          else {
6581            if (this.day == null)
6582              this.day = new StringType();
6583            this.day.setValue(value);
6584          }
6585          return this;
6586        }
6587
6588        /**
6589         * @return {@link #season} (Spring, Summer, Fall/Autumn, Winter.). This is the underlying object with id, value and extensions. The accessor "getSeason" gives direct access to the value
6590         */
6591        public StringType getSeasonElement() { 
6592          if (this.season == null)
6593            if (Configuration.errorOnAutoCreate())
6594              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent.season");
6595            else if (Configuration.doAutoCreate())
6596              this.season = new StringType(); // bb
6597          return this.season;
6598        }
6599
6600        public boolean hasSeasonElement() { 
6601          return this.season != null && !this.season.isEmpty();
6602        }
6603
6604        public boolean hasSeason() { 
6605          return this.season != null && !this.season.isEmpty();
6606        }
6607
6608        /**
6609         * @param value {@link #season} (Spring, Summer, Fall/Autumn, Winter.). This is the underlying object with id, value and extensions. The accessor "getSeason" gives direct access to the value
6610         */
6611        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setSeasonElement(StringType value) { 
6612          this.season = value;
6613          return this;
6614        }
6615
6616        /**
6617         * @return Spring, Summer, Fall/Autumn, Winter.
6618         */
6619        public String getSeason() { 
6620          return this.season == null ? null : this.season.getValue();
6621        }
6622
6623        /**
6624         * @param value Spring, Summer, Fall/Autumn, Winter.
6625         */
6626        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setSeason(String value) { 
6627          if (Utilities.noString(value))
6628            this.season = null;
6629          else {
6630            if (this.season == null)
6631              this.season = new StringType();
6632            this.season.setValue(value);
6633          }
6634          return this;
6635        }
6636
6637        /**
6638         * @return {@link #text} (Text representation of the date of which the issue of the journal was published.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
6639         */
6640        public StringType getTextElement() { 
6641          if (this.text == null)
6642            if (Configuration.errorOnAutoCreate())
6643              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent.text");
6644            else if (Configuration.doAutoCreate())
6645              this.text = new StringType(); // bb
6646          return this.text;
6647        }
6648
6649        public boolean hasTextElement() { 
6650          return this.text != null && !this.text.isEmpty();
6651        }
6652
6653        public boolean hasText() { 
6654          return this.text != null && !this.text.isEmpty();
6655        }
6656
6657        /**
6658         * @param value {@link #text} (Text representation of the date of which the issue of the journal was published.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
6659         */
6660        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setTextElement(StringType value) { 
6661          this.text = value;
6662          return this;
6663        }
6664
6665        /**
6666         * @return Text representation of the date of which the issue of the journal was published.
6667         */
6668        public String getText() { 
6669          return this.text == null ? null : this.text.getValue();
6670        }
6671
6672        /**
6673         * @param value Text representation of the date of which the issue of the journal was published.
6674         */
6675        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setText(String value) { 
6676          if (Utilities.noString(value))
6677            this.text = null;
6678          else {
6679            if (this.text == null)
6680              this.text = new StringType();
6681            this.text.setValue(value);
6682          }
6683          return this;
6684        }
6685
6686        protected void listChildren(List<Property> children) {
6687          super.listChildren(children);
6688          children.add(new Property("date", "date", "Date on which the issue of the journal was published.", 0, 1, date));
6689          children.add(new Property("year", "string", "Year on which the issue of the journal was published.", 0, 1, year));
6690          children.add(new Property("month", "string", "Month on which the issue of the journal was published.", 0, 1, month));
6691          children.add(new Property("day", "string", "Day on which the issue of the journal was published.", 0, 1, day));
6692          children.add(new Property("season", "string", "Spring, Summer, Fall/Autumn, Winter.", 0, 1, season));
6693          children.add(new Property("text", "string", "Text representation of the date of which the issue of the journal was published.", 0, 1, text));
6694        }
6695
6696        @Override
6697        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6698          switch (_hash) {
6699          case 3076014: /*date*/  return new Property("date", "date", "Date on which the issue of the journal was published.", 0, 1, date);
6700          case 3704893: /*year*/  return new Property("year", "string", "Year on which the issue of the journal was published.", 0, 1, year);
6701          case 104080000: /*month*/  return new Property("month", "string", "Month on which the issue of the journal was published.", 0, 1, month);
6702          case 99228: /*day*/  return new Property("day", "string", "Day on which the issue of the journal was published.", 0, 1, day);
6703          case -906335517: /*season*/  return new Property("season", "string", "Spring, Summer, Fall/Autumn, Winter.", 0, 1, season);
6704          case 3556653: /*text*/  return new Property("text", "string", "Text representation of the date of which the issue of the journal was published.", 0, 1, text);
6705          default: return super.getNamedProperty(_hash, _name, _checkValid);
6706          }
6707
6708        }
6709
6710      @Override
6711      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6712        switch (hash) {
6713        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateType
6714        case 3704893: /*year*/ return this.year == null ? new Base[0] : new Base[] {this.year}; // StringType
6715        case 104080000: /*month*/ return this.month == null ? new Base[0] : new Base[] {this.month}; // StringType
6716        case 99228: /*day*/ return this.day == null ? new Base[0] : new Base[] {this.day}; // StringType
6717        case -906335517: /*season*/ return this.season == null ? new Base[0] : new Base[] {this.season}; // StringType
6718        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType
6719        default: return super.getProperty(hash, name, checkValid);
6720        }
6721
6722      }
6723
6724      @Override
6725      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6726        switch (hash) {
6727        case 3076014: // date
6728          this.date = TypeConvertor.castToDate(value); // DateType
6729          return value;
6730        case 3704893: // year
6731          this.year = TypeConvertor.castToString(value); // StringType
6732          return value;
6733        case 104080000: // month
6734          this.month = TypeConvertor.castToString(value); // StringType
6735          return value;
6736        case 99228: // day
6737          this.day = TypeConvertor.castToString(value); // StringType
6738          return value;
6739        case -906335517: // season
6740          this.season = TypeConvertor.castToString(value); // StringType
6741          return value;
6742        case 3556653: // text
6743          this.text = TypeConvertor.castToString(value); // StringType
6744          return value;
6745        default: return super.setProperty(hash, name, value);
6746        }
6747
6748      }
6749
6750      @Override
6751      public Base setProperty(String name, Base value) throws FHIRException {
6752        if (name.equals("date")) {
6753          this.date = TypeConvertor.castToDate(value); // DateType
6754        } else if (name.equals("year")) {
6755          this.year = TypeConvertor.castToString(value); // StringType
6756        } else if (name.equals("month")) {
6757          this.month = TypeConvertor.castToString(value); // StringType
6758        } else if (name.equals("day")) {
6759          this.day = TypeConvertor.castToString(value); // StringType
6760        } else if (name.equals("season")) {
6761          this.season = TypeConvertor.castToString(value); // StringType
6762        } else if (name.equals("text")) {
6763          this.text = TypeConvertor.castToString(value); // StringType
6764        } else
6765          return super.setProperty(name, value);
6766        return value;
6767      }
6768
6769      @Override
6770      public Base makeProperty(int hash, String name) throws FHIRException {
6771        switch (hash) {
6772        case 3076014:  return getDateElement();
6773        case 3704893:  return getYearElement();
6774        case 104080000:  return getMonthElement();
6775        case 99228:  return getDayElement();
6776        case -906335517:  return getSeasonElement();
6777        case 3556653:  return getTextElement();
6778        default: return super.makeProperty(hash, name);
6779        }
6780
6781      }
6782
6783      @Override
6784      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6785        switch (hash) {
6786        case 3076014: /*date*/ return new String[] {"date"};
6787        case 3704893: /*year*/ return new String[] {"string"};
6788        case 104080000: /*month*/ return new String[] {"string"};
6789        case 99228: /*day*/ return new String[] {"string"};
6790        case -906335517: /*season*/ return new String[] {"string"};
6791        case 3556653: /*text*/ return new String[] {"string"};
6792        default: return super.getTypesForProperty(hash, name);
6793        }
6794
6795      }
6796
6797      @Override
6798      public Base addChild(String name) throws FHIRException {
6799        if (name.equals("date")) {
6800          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.periodicRelease.dateOfPublication.date");
6801        }
6802        else if (name.equals("year")) {
6803          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.periodicRelease.dateOfPublication.year");
6804        }
6805        else if (name.equals("month")) {
6806          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.periodicRelease.dateOfPublication.month");
6807        }
6808        else if (name.equals("day")) {
6809          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.periodicRelease.dateOfPublication.day");
6810        }
6811        else if (name.equals("season")) {
6812          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.periodicRelease.dateOfPublication.season");
6813        }
6814        else if (name.equals("text")) {
6815          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.periodicRelease.dateOfPublication.text");
6816        }
6817        else
6818          return super.addChild(name);
6819      }
6820
6821      public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent copy() {
6822        CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent dst = new CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent();
6823        copyValues(dst);
6824        return dst;
6825      }
6826
6827      public void copyValues(CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent dst) {
6828        super.copyValues(dst);
6829        dst.date = date == null ? null : date.copy();
6830        dst.year = year == null ? null : year.copy();
6831        dst.month = month == null ? null : month.copy();
6832        dst.day = day == null ? null : day.copy();
6833        dst.season = season == null ? null : season.copy();
6834        dst.text = text == null ? null : text.copy();
6835      }
6836
6837      @Override
6838      public boolean equalsDeep(Base other_) {
6839        if (!super.equalsDeep(other_))
6840          return false;
6841        if (!(other_ instanceof CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent))
6842          return false;
6843        CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent o = (CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent) other_;
6844        return compareDeep(date, o.date, true) && compareDeep(year, o.year, true) && compareDeep(month, o.month, true)
6845           && compareDeep(day, o.day, true) && compareDeep(season, o.season, true) && compareDeep(text, o.text, true)
6846          ;
6847      }
6848
6849      @Override
6850      public boolean equalsShallow(Base other_) {
6851        if (!super.equalsShallow(other_))
6852          return false;
6853        if (!(other_ instanceof CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent))
6854          return false;
6855        CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent o = (CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent) other_;
6856        return compareValues(date, o.date, true) && compareValues(year, o.year, true) && compareValues(month, o.month, true)
6857           && compareValues(day, o.day, true) && compareValues(season, o.season, true) && compareValues(text, o.text, true)
6858          ;
6859      }
6860
6861      public boolean isEmpty() {
6862        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(date, year, month, day
6863          , season, text);
6864      }
6865
6866  public String fhirType() {
6867    return "Citation.citedArtifact.publicationForm.periodicRelease.dateOfPublication";
6868
6869  }
6870
6871  }
6872
6873    @Block()
6874    public static class CitationCitedArtifactWebLocationComponent extends BackboneElement implements IBaseBackboneElement {
6875        /**
6876         * Code the reason for different URLs, e.g. abstract and full-text.
6877         */
6878        @Child(name = "classifier", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6879        @Description(shortDefinition="Code the reason for different URLs, e.g. abstract and full-text", formalDefinition="Code the reason for different URLs, e.g. abstract and full-text." )
6880        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/artifact-url-classifier")
6881        protected List<CodeableConcept> classifier;
6882
6883        /**
6884         * The specific URL.
6885         */
6886        @Child(name = "url", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=false)
6887        @Description(shortDefinition="The specific URL", formalDefinition="The specific URL." )
6888        protected UriType url;
6889
6890        private static final long serialVersionUID = -1300703403L;
6891
6892    /**
6893     * Constructor
6894     */
6895      public CitationCitedArtifactWebLocationComponent() {
6896        super();
6897      }
6898
6899        /**
6900         * @return {@link #classifier} (Code the reason for different URLs, e.g. abstract and full-text.)
6901         */
6902        public List<CodeableConcept> getClassifier() { 
6903          if (this.classifier == null)
6904            this.classifier = new ArrayList<CodeableConcept>();
6905          return this.classifier;
6906        }
6907
6908        /**
6909         * @return Returns a reference to <code>this</code> for easy method chaining
6910         */
6911        public CitationCitedArtifactWebLocationComponent setClassifier(List<CodeableConcept> theClassifier) { 
6912          this.classifier = theClassifier;
6913          return this;
6914        }
6915
6916        public boolean hasClassifier() { 
6917          if (this.classifier == null)
6918            return false;
6919          for (CodeableConcept item : this.classifier)
6920            if (!item.isEmpty())
6921              return true;
6922          return false;
6923        }
6924
6925        public CodeableConcept addClassifier() { //3
6926          CodeableConcept t = new CodeableConcept();
6927          if (this.classifier == null)
6928            this.classifier = new ArrayList<CodeableConcept>();
6929          this.classifier.add(t);
6930          return t;
6931        }
6932
6933        public CitationCitedArtifactWebLocationComponent addClassifier(CodeableConcept t) { //3
6934          if (t == null)
6935            return this;
6936          if (this.classifier == null)
6937            this.classifier = new ArrayList<CodeableConcept>();
6938          this.classifier.add(t);
6939          return this;
6940        }
6941
6942        /**
6943         * @return The first repetition of repeating field {@link #classifier}, creating it if it does not already exist {3}
6944         */
6945        public CodeableConcept getClassifierFirstRep() { 
6946          if (getClassifier().isEmpty()) {
6947            addClassifier();
6948          }
6949          return getClassifier().get(0);
6950        }
6951
6952        /**
6953         * @return {@link #url} (The specific URL.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
6954         */
6955        public UriType getUrlElement() { 
6956          if (this.url == null)
6957            if (Configuration.errorOnAutoCreate())
6958              throw new Error("Attempt to auto-create CitationCitedArtifactWebLocationComponent.url");
6959            else if (Configuration.doAutoCreate())
6960              this.url = new UriType(); // bb
6961          return this.url;
6962        }
6963
6964        public boolean hasUrlElement() { 
6965          return this.url != null && !this.url.isEmpty();
6966        }
6967
6968        public boolean hasUrl() { 
6969          return this.url != null && !this.url.isEmpty();
6970        }
6971
6972        /**
6973         * @param value {@link #url} (The specific URL.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
6974         */
6975        public CitationCitedArtifactWebLocationComponent setUrlElement(UriType value) { 
6976          this.url = value;
6977          return this;
6978        }
6979
6980        /**
6981         * @return The specific URL.
6982         */
6983        public String getUrl() { 
6984          return this.url == null ? null : this.url.getValue();
6985        }
6986
6987        /**
6988         * @param value The specific URL.
6989         */
6990        public CitationCitedArtifactWebLocationComponent setUrl(String value) { 
6991          if (Utilities.noString(value))
6992            this.url = null;
6993          else {
6994            if (this.url == null)
6995              this.url = new UriType();
6996            this.url.setValue(value);
6997          }
6998          return this;
6999        }
7000
7001        protected void listChildren(List<Property> children) {
7002          super.listChildren(children);
7003          children.add(new Property("classifier", "CodeableConcept", "Code the reason for different URLs, e.g. abstract and full-text.", 0, java.lang.Integer.MAX_VALUE, classifier));
7004          children.add(new Property("url", "uri", "The specific URL.", 0, 1, url));
7005        }
7006
7007        @Override
7008        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
7009          switch (_hash) {
7010          case -281470431: /*classifier*/  return new Property("classifier", "CodeableConcept", "Code the reason for different URLs, e.g. abstract and full-text.", 0, java.lang.Integer.MAX_VALUE, classifier);
7011          case 116079: /*url*/  return new Property("url", "uri", "The specific URL.", 0, 1, url);
7012          default: return super.getNamedProperty(_hash, _name, _checkValid);
7013          }
7014
7015        }
7016
7017      @Override
7018      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
7019        switch (hash) {
7020        case -281470431: /*classifier*/ return this.classifier == null ? new Base[0] : this.classifier.toArray(new Base[this.classifier.size()]); // CodeableConcept
7021        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
7022        default: return super.getProperty(hash, name, checkValid);
7023        }
7024
7025      }
7026
7027      @Override
7028      public Base setProperty(int hash, String name, Base value) throws FHIRException {
7029        switch (hash) {
7030        case -281470431: // classifier
7031          this.getClassifier().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
7032          return value;
7033        case 116079: // url
7034          this.url = TypeConvertor.castToUri(value); // UriType
7035          return value;
7036        default: return super.setProperty(hash, name, value);
7037        }
7038
7039      }
7040
7041      @Override
7042      public Base setProperty(String name, Base value) throws FHIRException {
7043        if (name.equals("classifier")) {
7044          this.getClassifier().add(TypeConvertor.castToCodeableConcept(value));
7045        } else if (name.equals("url")) {
7046          this.url = TypeConvertor.castToUri(value); // UriType
7047        } else
7048          return super.setProperty(name, value);
7049        return value;
7050      }
7051
7052      @Override
7053      public Base makeProperty(int hash, String name) throws FHIRException {
7054        switch (hash) {
7055        case -281470431:  return addClassifier(); 
7056        case 116079:  return getUrlElement();
7057        default: return super.makeProperty(hash, name);
7058        }
7059
7060      }
7061
7062      @Override
7063      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
7064        switch (hash) {
7065        case -281470431: /*classifier*/ return new String[] {"CodeableConcept"};
7066        case 116079: /*url*/ return new String[] {"uri"};
7067        default: return super.getTypesForProperty(hash, name);
7068        }
7069
7070      }
7071
7072      @Override
7073      public Base addChild(String name) throws FHIRException {
7074        if (name.equals("classifier")) {
7075          return addClassifier();
7076        }
7077        else if (name.equals("url")) {
7078          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.webLocation.url");
7079        }
7080        else
7081          return super.addChild(name);
7082      }
7083
7084      public CitationCitedArtifactWebLocationComponent copy() {
7085        CitationCitedArtifactWebLocationComponent dst = new CitationCitedArtifactWebLocationComponent();
7086        copyValues(dst);
7087        return dst;
7088      }
7089
7090      public void copyValues(CitationCitedArtifactWebLocationComponent dst) {
7091        super.copyValues(dst);
7092        if (classifier != null) {
7093          dst.classifier = new ArrayList<CodeableConcept>();
7094          for (CodeableConcept i : classifier)
7095            dst.classifier.add(i.copy());
7096        };
7097        dst.url = url == null ? null : url.copy();
7098      }
7099
7100      @Override
7101      public boolean equalsDeep(Base other_) {
7102        if (!super.equalsDeep(other_))
7103          return false;
7104        if (!(other_ instanceof CitationCitedArtifactWebLocationComponent))
7105          return false;
7106        CitationCitedArtifactWebLocationComponent o = (CitationCitedArtifactWebLocationComponent) other_;
7107        return compareDeep(classifier, o.classifier, true) && compareDeep(url, o.url, true);
7108      }
7109
7110      @Override
7111      public boolean equalsShallow(Base other_) {
7112        if (!super.equalsShallow(other_))
7113          return false;
7114        if (!(other_ instanceof CitationCitedArtifactWebLocationComponent))
7115          return false;
7116        CitationCitedArtifactWebLocationComponent o = (CitationCitedArtifactWebLocationComponent) other_;
7117        return compareValues(url, o.url, true);
7118      }
7119
7120      public boolean isEmpty() {
7121        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(classifier, url);
7122      }
7123
7124  public String fhirType() {
7125    return "Citation.citedArtifact.webLocation";
7126
7127  }
7128
7129  }
7130
7131    @Block()
7132    public static class CitationCitedArtifactClassificationComponent extends BackboneElement implements IBaseBackboneElement {
7133        /**
7134         * The kind of classifier (e.g. publication type, keyword).
7135         */
7136        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
7137        @Description(shortDefinition="The kind of classifier (e.g. publication type, keyword)", formalDefinition="The kind of classifier (e.g. publication type, keyword)." )
7138        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/cited-artifact-classification-type")
7139        protected CodeableConcept type;
7140
7141        /**
7142         * The specific classification value.
7143         */
7144        @Child(name = "classifier", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
7145        @Description(shortDefinition="The specific classification value", formalDefinition="The specific classification value." )
7146        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/citation-artifact-classifier")
7147        protected List<CodeableConcept> classifier;
7148
7149        /**
7150         * Complex or externally created classification.
7151         */
7152        @Child(name = "artifactAssessment", type = {ArtifactAssessment.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
7153        @Description(shortDefinition="Complex or externally created classification\n", formalDefinition="Complex or externally created classification." )
7154        protected List<Reference> artifactAssessment;
7155
7156        private static final long serialVersionUID = 394554928L;
7157
7158    /**
7159     * Constructor
7160     */
7161      public CitationCitedArtifactClassificationComponent() {
7162        super();
7163      }
7164
7165        /**
7166         * @return {@link #type} (The kind of classifier (e.g. publication type, keyword).)
7167         */
7168        public CodeableConcept getType() { 
7169          if (this.type == null)
7170            if (Configuration.errorOnAutoCreate())
7171              throw new Error("Attempt to auto-create CitationCitedArtifactClassificationComponent.type");
7172            else if (Configuration.doAutoCreate())
7173              this.type = new CodeableConcept(); // cc
7174          return this.type;
7175        }
7176
7177        public boolean hasType() { 
7178          return this.type != null && !this.type.isEmpty();
7179        }
7180
7181        /**
7182         * @param value {@link #type} (The kind of classifier (e.g. publication type, keyword).)
7183         */
7184        public CitationCitedArtifactClassificationComponent setType(CodeableConcept value) { 
7185          this.type = value;
7186          return this;
7187        }
7188
7189        /**
7190         * @return {@link #classifier} (The specific classification value.)
7191         */
7192        public List<CodeableConcept> getClassifier() { 
7193          if (this.classifier == null)
7194            this.classifier = new ArrayList<CodeableConcept>();
7195          return this.classifier;
7196        }
7197
7198        /**
7199         * @return Returns a reference to <code>this</code> for easy method chaining
7200         */
7201        public CitationCitedArtifactClassificationComponent setClassifier(List<CodeableConcept> theClassifier) { 
7202          this.classifier = theClassifier;
7203          return this;
7204        }
7205
7206        public boolean hasClassifier() { 
7207          if (this.classifier == null)
7208            return false;
7209          for (CodeableConcept item : this.classifier)
7210            if (!item.isEmpty())
7211              return true;
7212          return false;
7213        }
7214
7215        public CodeableConcept addClassifier() { //3
7216          CodeableConcept t = new CodeableConcept();
7217          if (this.classifier == null)
7218            this.classifier = new ArrayList<CodeableConcept>();
7219          this.classifier.add(t);
7220          return t;
7221        }
7222
7223        public CitationCitedArtifactClassificationComponent addClassifier(CodeableConcept t) { //3
7224          if (t == null)
7225            return this;
7226          if (this.classifier == null)
7227            this.classifier = new ArrayList<CodeableConcept>();
7228          this.classifier.add(t);
7229          return this;
7230        }
7231
7232        /**
7233         * @return The first repetition of repeating field {@link #classifier}, creating it if it does not already exist {3}
7234         */
7235        public CodeableConcept getClassifierFirstRep() { 
7236          if (getClassifier().isEmpty()) {
7237            addClassifier();
7238          }
7239          return getClassifier().get(0);
7240        }
7241
7242        /**
7243         * @return {@link #artifactAssessment} (Complex or externally created classification.)
7244         */
7245        public List<Reference> getArtifactAssessment() { 
7246          if (this.artifactAssessment == null)
7247            this.artifactAssessment = new ArrayList<Reference>();
7248          return this.artifactAssessment;
7249        }
7250
7251        /**
7252         * @return Returns a reference to <code>this</code> for easy method chaining
7253         */
7254        public CitationCitedArtifactClassificationComponent setArtifactAssessment(List<Reference> theArtifactAssessment) { 
7255          this.artifactAssessment = theArtifactAssessment;
7256          return this;
7257        }
7258
7259        public boolean hasArtifactAssessment() { 
7260          if (this.artifactAssessment == null)
7261            return false;
7262          for (Reference item : this.artifactAssessment)
7263            if (!item.isEmpty())
7264              return true;
7265          return false;
7266        }
7267
7268        public Reference addArtifactAssessment() { //3
7269          Reference t = new Reference();
7270          if (this.artifactAssessment == null)
7271            this.artifactAssessment = new ArrayList<Reference>();
7272          this.artifactAssessment.add(t);
7273          return t;
7274        }
7275
7276        public CitationCitedArtifactClassificationComponent addArtifactAssessment(Reference t) { //3
7277          if (t == null)
7278            return this;
7279          if (this.artifactAssessment == null)
7280            this.artifactAssessment = new ArrayList<Reference>();
7281          this.artifactAssessment.add(t);
7282          return this;
7283        }
7284
7285        /**
7286         * @return The first repetition of repeating field {@link #artifactAssessment}, creating it if it does not already exist {3}
7287         */
7288        public Reference getArtifactAssessmentFirstRep() { 
7289          if (getArtifactAssessment().isEmpty()) {
7290            addArtifactAssessment();
7291          }
7292          return getArtifactAssessment().get(0);
7293        }
7294
7295        protected void listChildren(List<Property> children) {
7296          super.listChildren(children);
7297          children.add(new Property("type", "CodeableConcept", "The kind of classifier (e.g. publication type, keyword).", 0, 1, type));
7298          children.add(new Property("classifier", "CodeableConcept", "The specific classification value.", 0, java.lang.Integer.MAX_VALUE, classifier));
7299          children.add(new Property("artifactAssessment", "Reference(ArtifactAssessment)", "Complex or externally created classification.", 0, java.lang.Integer.MAX_VALUE, artifactAssessment));
7300        }
7301
7302        @Override
7303        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
7304          switch (_hash) {
7305          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The kind of classifier (e.g. publication type, keyword).", 0, 1, type);
7306          case -281470431: /*classifier*/  return new Property("classifier", "CodeableConcept", "The specific classification value.", 0, java.lang.Integer.MAX_VALUE, classifier);
7307          case 1014987316: /*artifactAssessment*/  return new Property("artifactAssessment", "Reference(ArtifactAssessment)", "Complex or externally created classification.", 0, java.lang.Integer.MAX_VALUE, artifactAssessment);
7308          default: return super.getNamedProperty(_hash, _name, _checkValid);
7309          }
7310
7311        }
7312
7313      @Override
7314      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
7315        switch (hash) {
7316        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
7317        case -281470431: /*classifier*/ return this.classifier == null ? new Base[0] : this.classifier.toArray(new Base[this.classifier.size()]); // CodeableConcept
7318        case 1014987316: /*artifactAssessment*/ return this.artifactAssessment == null ? new Base[0] : this.artifactAssessment.toArray(new Base[this.artifactAssessment.size()]); // Reference
7319        default: return super.getProperty(hash, name, checkValid);
7320        }
7321
7322      }
7323
7324      @Override
7325      public Base setProperty(int hash, String name, Base value) throws FHIRException {
7326        switch (hash) {
7327        case 3575610: // type
7328          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
7329          return value;
7330        case -281470431: // classifier
7331          this.getClassifier().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
7332          return value;
7333        case 1014987316: // artifactAssessment
7334          this.getArtifactAssessment().add(TypeConvertor.castToReference(value)); // Reference
7335          return value;
7336        default: return super.setProperty(hash, name, value);
7337        }
7338
7339      }
7340
7341      @Override
7342      public Base setProperty(String name, Base value) throws FHIRException {
7343        if (name.equals("type")) {
7344          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
7345        } else if (name.equals("classifier")) {
7346          this.getClassifier().add(TypeConvertor.castToCodeableConcept(value));
7347        } else if (name.equals("artifactAssessment")) {
7348          this.getArtifactAssessment().add(TypeConvertor.castToReference(value));
7349        } else
7350          return super.setProperty(name, value);
7351        return value;
7352      }
7353
7354      @Override
7355      public Base makeProperty(int hash, String name) throws FHIRException {
7356        switch (hash) {
7357        case 3575610:  return getType();
7358        case -281470431:  return addClassifier(); 
7359        case 1014987316:  return addArtifactAssessment(); 
7360        default: return super.makeProperty(hash, name);
7361        }
7362
7363      }
7364
7365      @Override
7366      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
7367        switch (hash) {
7368        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
7369        case -281470431: /*classifier*/ return new String[] {"CodeableConcept"};
7370        case 1014987316: /*artifactAssessment*/ return new String[] {"Reference"};
7371        default: return super.getTypesForProperty(hash, name);
7372        }
7373
7374      }
7375
7376      @Override
7377      public Base addChild(String name) throws FHIRException {
7378        if (name.equals("type")) {
7379          this.type = new CodeableConcept();
7380          return this.type;
7381        }
7382        else if (name.equals("classifier")) {
7383          return addClassifier();
7384        }
7385        else if (name.equals("artifactAssessment")) {
7386          return addArtifactAssessment();
7387        }
7388        else
7389          return super.addChild(name);
7390      }
7391
7392      public CitationCitedArtifactClassificationComponent copy() {
7393        CitationCitedArtifactClassificationComponent dst = new CitationCitedArtifactClassificationComponent();
7394        copyValues(dst);
7395        return dst;
7396      }
7397
7398      public void copyValues(CitationCitedArtifactClassificationComponent dst) {
7399        super.copyValues(dst);
7400        dst.type = type == null ? null : type.copy();
7401        if (classifier != null) {
7402          dst.classifier = new ArrayList<CodeableConcept>();
7403          for (CodeableConcept i : classifier)
7404            dst.classifier.add(i.copy());
7405        };
7406        if (artifactAssessment != null) {
7407          dst.artifactAssessment = new ArrayList<Reference>();
7408          for (Reference i : artifactAssessment)
7409            dst.artifactAssessment.add(i.copy());
7410        };
7411      }
7412
7413      @Override
7414      public boolean equalsDeep(Base other_) {
7415        if (!super.equalsDeep(other_))
7416          return false;
7417        if (!(other_ instanceof CitationCitedArtifactClassificationComponent))
7418          return false;
7419        CitationCitedArtifactClassificationComponent o = (CitationCitedArtifactClassificationComponent) other_;
7420        return compareDeep(type, o.type, true) && compareDeep(classifier, o.classifier, true) && compareDeep(artifactAssessment, o.artifactAssessment, true)
7421          ;
7422      }
7423
7424      @Override
7425      public boolean equalsShallow(Base other_) {
7426        if (!super.equalsShallow(other_))
7427          return false;
7428        if (!(other_ instanceof CitationCitedArtifactClassificationComponent))
7429          return false;
7430        CitationCitedArtifactClassificationComponent o = (CitationCitedArtifactClassificationComponent) other_;
7431        return true;
7432      }
7433
7434      public boolean isEmpty() {
7435        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, classifier, artifactAssessment
7436          );
7437      }
7438
7439  public String fhirType() {
7440    return "Citation.citedArtifact.classification";
7441
7442  }
7443
7444  }
7445
7446    @Block()
7447    public static class CitationCitedArtifactContributorshipComponent extends BackboneElement implements IBaseBackboneElement {
7448        /**
7449         * Indicates if the list includes all authors and/or contributors.
7450         */
7451        @Child(name = "complete", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=false)
7452        @Description(shortDefinition="Indicates if the list includes all authors and/or contributors", formalDefinition="Indicates if the list includes all authors and/or contributors." )
7453        protected BooleanType complete;
7454
7455        /**
7456         * An individual entity named in the author list or contributor list.
7457         */
7458        @Child(name = "entry", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
7459        @Description(shortDefinition="An individual entity named in the list", formalDefinition="An individual entity named in the author list or contributor list." )
7460        protected List<CitationCitedArtifactContributorshipEntryComponent> entry;
7461
7462        /**
7463         * Used to record a display of the author/contributor list without separate coding for each list member.
7464         */
7465        @Child(name = "summary", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
7466        @Description(shortDefinition="Used to record a display of the author/contributor list without separate coding for each list member", formalDefinition="Used to record a display of the author/contributor list without separate coding for each list member." )
7467        protected List<ContributorshipSummaryComponent> summary;
7468
7469        private static final long serialVersionUID = 662810405L;
7470
7471    /**
7472     * Constructor
7473     */
7474      public CitationCitedArtifactContributorshipComponent() {
7475        super();
7476      }
7477
7478        /**
7479         * @return {@link #complete} (Indicates if the list includes all authors and/or contributors.). This is the underlying object with id, value and extensions. The accessor "getComplete" gives direct access to the value
7480         */
7481        public BooleanType getCompleteElement() { 
7482          if (this.complete == null)
7483            if (Configuration.errorOnAutoCreate())
7484              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipComponent.complete");
7485            else if (Configuration.doAutoCreate())
7486              this.complete = new BooleanType(); // bb
7487          return this.complete;
7488        }
7489
7490        public boolean hasCompleteElement() { 
7491          return this.complete != null && !this.complete.isEmpty();
7492        }
7493
7494        public boolean hasComplete() { 
7495          return this.complete != null && !this.complete.isEmpty();
7496        }
7497
7498        /**
7499         * @param value {@link #complete} (Indicates if the list includes all authors and/or contributors.). This is the underlying object with id, value and extensions. The accessor "getComplete" gives direct access to the value
7500         */
7501        public CitationCitedArtifactContributorshipComponent setCompleteElement(BooleanType value) { 
7502          this.complete = value;
7503          return this;
7504        }
7505
7506        /**
7507         * @return Indicates if the list includes all authors and/or contributors.
7508         */
7509        public boolean getComplete() { 
7510          return this.complete == null || this.complete.isEmpty() ? false : this.complete.getValue();
7511        }
7512
7513        /**
7514         * @param value Indicates if the list includes all authors and/or contributors.
7515         */
7516        public CitationCitedArtifactContributorshipComponent setComplete(boolean value) { 
7517            if (this.complete == null)
7518              this.complete = new BooleanType();
7519            this.complete.setValue(value);
7520          return this;
7521        }
7522
7523        /**
7524         * @return {@link #entry} (An individual entity named in the author list or contributor list.)
7525         */
7526        public List<CitationCitedArtifactContributorshipEntryComponent> getEntry() { 
7527          if (this.entry == null)
7528            this.entry = new ArrayList<CitationCitedArtifactContributorshipEntryComponent>();
7529          return this.entry;
7530        }
7531
7532        /**
7533         * @return Returns a reference to <code>this</code> for easy method chaining
7534         */
7535        public CitationCitedArtifactContributorshipComponent setEntry(List<CitationCitedArtifactContributorshipEntryComponent> theEntry) { 
7536          this.entry = theEntry;
7537          return this;
7538        }
7539
7540        public boolean hasEntry() { 
7541          if (this.entry == null)
7542            return false;
7543          for (CitationCitedArtifactContributorshipEntryComponent item : this.entry)
7544            if (!item.isEmpty())
7545              return true;
7546          return false;
7547        }
7548
7549        public CitationCitedArtifactContributorshipEntryComponent addEntry() { //3
7550          CitationCitedArtifactContributorshipEntryComponent t = new CitationCitedArtifactContributorshipEntryComponent();
7551          if (this.entry == null)
7552            this.entry = new ArrayList<CitationCitedArtifactContributorshipEntryComponent>();
7553          this.entry.add(t);
7554          return t;
7555        }
7556
7557        public CitationCitedArtifactContributorshipComponent addEntry(CitationCitedArtifactContributorshipEntryComponent t) { //3
7558          if (t == null)
7559            return this;
7560          if (this.entry == null)
7561            this.entry = new ArrayList<CitationCitedArtifactContributorshipEntryComponent>();
7562          this.entry.add(t);
7563          return this;
7564        }
7565
7566        /**
7567         * @return The first repetition of repeating field {@link #entry}, creating it if it does not already exist {3}
7568         */
7569        public CitationCitedArtifactContributorshipEntryComponent getEntryFirstRep() { 
7570          if (getEntry().isEmpty()) {
7571            addEntry();
7572          }
7573          return getEntry().get(0);
7574        }
7575
7576        /**
7577         * @return {@link #summary} (Used to record a display of the author/contributor list without separate coding for each list member.)
7578         */
7579        public List<ContributorshipSummaryComponent> getSummary() { 
7580          if (this.summary == null)
7581            this.summary = new ArrayList<ContributorshipSummaryComponent>();
7582          return this.summary;
7583        }
7584
7585        /**
7586         * @return Returns a reference to <code>this</code> for easy method chaining
7587         */
7588        public CitationCitedArtifactContributorshipComponent setSummary(List<ContributorshipSummaryComponent> theSummary) { 
7589          this.summary = theSummary;
7590          return this;
7591        }
7592
7593        public boolean hasSummary() { 
7594          if (this.summary == null)
7595            return false;
7596          for (ContributorshipSummaryComponent item : this.summary)
7597            if (!item.isEmpty())
7598              return true;
7599          return false;
7600        }
7601
7602        public ContributorshipSummaryComponent addSummary() { //3
7603          ContributorshipSummaryComponent t = new ContributorshipSummaryComponent();
7604          if (this.summary == null)
7605            this.summary = new ArrayList<ContributorshipSummaryComponent>();
7606          this.summary.add(t);
7607          return t;
7608        }
7609
7610        public CitationCitedArtifactContributorshipComponent addSummary(ContributorshipSummaryComponent t) { //3
7611          if (t == null)
7612            return this;
7613          if (this.summary == null)
7614            this.summary = new ArrayList<ContributorshipSummaryComponent>();
7615          this.summary.add(t);
7616          return this;
7617        }
7618
7619        /**
7620         * @return The first repetition of repeating field {@link #summary}, creating it if it does not already exist {3}
7621         */
7622        public ContributorshipSummaryComponent getSummaryFirstRep() { 
7623          if (getSummary().isEmpty()) {
7624            addSummary();
7625          }
7626          return getSummary().get(0);
7627        }
7628
7629        protected void listChildren(List<Property> children) {
7630          super.listChildren(children);
7631          children.add(new Property("complete", "boolean", "Indicates if the list includes all authors and/or contributors.", 0, 1, complete));
7632          children.add(new Property("entry", "", "An individual entity named in the author list or contributor list.", 0, java.lang.Integer.MAX_VALUE, entry));
7633          children.add(new Property("summary", "", "Used to record a display of the author/contributor list without separate coding for each list member.", 0, java.lang.Integer.MAX_VALUE, summary));
7634        }
7635
7636        @Override
7637        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
7638          switch (_hash) {
7639          case -599445191: /*complete*/  return new Property("complete", "boolean", "Indicates if the list includes all authors and/or contributors.", 0, 1, complete);
7640          case 96667762: /*entry*/  return new Property("entry", "", "An individual entity named in the author list or contributor list.", 0, java.lang.Integer.MAX_VALUE, entry);
7641          case -1857640538: /*summary*/  return new Property("summary", "", "Used to record a display of the author/contributor list without separate coding for each list member.", 0, java.lang.Integer.MAX_VALUE, summary);
7642          default: return super.getNamedProperty(_hash, _name, _checkValid);
7643          }
7644
7645        }
7646
7647      @Override
7648      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
7649        switch (hash) {
7650        case -599445191: /*complete*/ return this.complete == null ? new Base[0] : new Base[] {this.complete}; // BooleanType
7651        case 96667762: /*entry*/ return this.entry == null ? new Base[0] : this.entry.toArray(new Base[this.entry.size()]); // CitationCitedArtifactContributorshipEntryComponent
7652        case -1857640538: /*summary*/ return this.summary == null ? new Base[0] : this.summary.toArray(new Base[this.summary.size()]); // ContributorshipSummaryComponent
7653        default: return super.getProperty(hash, name, checkValid);
7654        }
7655
7656      }
7657
7658      @Override
7659      public Base setProperty(int hash, String name, Base value) throws FHIRException {
7660        switch (hash) {
7661        case -599445191: // complete
7662          this.complete = TypeConvertor.castToBoolean(value); // BooleanType
7663          return value;
7664        case 96667762: // entry
7665          this.getEntry().add((CitationCitedArtifactContributorshipEntryComponent) value); // CitationCitedArtifactContributorshipEntryComponent
7666          return value;
7667        case -1857640538: // summary
7668          this.getSummary().add((ContributorshipSummaryComponent) value); // ContributorshipSummaryComponent
7669          return value;
7670        default: return super.setProperty(hash, name, value);
7671        }
7672
7673      }
7674
7675      @Override
7676      public Base setProperty(String name, Base value) throws FHIRException {
7677        if (name.equals("complete")) {
7678          this.complete = TypeConvertor.castToBoolean(value); // BooleanType
7679        } else if (name.equals("entry")) {
7680          this.getEntry().add((CitationCitedArtifactContributorshipEntryComponent) value);
7681        } else if (name.equals("summary")) {
7682          this.getSummary().add((ContributorshipSummaryComponent) value);
7683        } else
7684          return super.setProperty(name, value);
7685        return value;
7686      }
7687
7688      @Override
7689      public Base makeProperty(int hash, String name) throws FHIRException {
7690        switch (hash) {
7691        case -599445191:  return getCompleteElement();
7692        case 96667762:  return addEntry(); 
7693        case -1857640538:  return addSummary(); 
7694        default: return super.makeProperty(hash, name);
7695        }
7696
7697      }
7698
7699      @Override
7700      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
7701        switch (hash) {
7702        case -599445191: /*complete*/ return new String[] {"boolean"};
7703        case 96667762: /*entry*/ return new String[] {};
7704        case -1857640538: /*summary*/ return new String[] {};
7705        default: return super.getTypesForProperty(hash, name);
7706        }
7707
7708      }
7709
7710      @Override
7711      public Base addChild(String name) throws FHIRException {
7712        if (name.equals("complete")) {
7713          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.contributorship.complete");
7714        }
7715        else if (name.equals("entry")) {
7716          return addEntry();
7717        }
7718        else if (name.equals("summary")) {
7719          return addSummary();
7720        }
7721        else
7722          return super.addChild(name);
7723      }
7724
7725      public CitationCitedArtifactContributorshipComponent copy() {
7726        CitationCitedArtifactContributorshipComponent dst = new CitationCitedArtifactContributorshipComponent();
7727        copyValues(dst);
7728        return dst;
7729      }
7730
7731      public void copyValues(CitationCitedArtifactContributorshipComponent dst) {
7732        super.copyValues(dst);
7733        dst.complete = complete == null ? null : complete.copy();
7734        if (entry != null) {
7735          dst.entry = new ArrayList<CitationCitedArtifactContributorshipEntryComponent>();
7736          for (CitationCitedArtifactContributorshipEntryComponent i : entry)
7737            dst.entry.add(i.copy());
7738        };
7739        if (summary != null) {
7740          dst.summary = new ArrayList<ContributorshipSummaryComponent>();
7741          for (ContributorshipSummaryComponent i : summary)
7742            dst.summary.add(i.copy());
7743        };
7744      }
7745
7746      @Override
7747      public boolean equalsDeep(Base other_) {
7748        if (!super.equalsDeep(other_))
7749          return false;
7750        if (!(other_ instanceof CitationCitedArtifactContributorshipComponent))
7751          return false;
7752        CitationCitedArtifactContributorshipComponent o = (CitationCitedArtifactContributorshipComponent) other_;
7753        return compareDeep(complete, o.complete, true) && compareDeep(entry, o.entry, true) && compareDeep(summary, o.summary, true)
7754          ;
7755      }
7756
7757      @Override
7758      public boolean equalsShallow(Base other_) {
7759        if (!super.equalsShallow(other_))
7760          return false;
7761        if (!(other_ instanceof CitationCitedArtifactContributorshipComponent))
7762          return false;
7763        CitationCitedArtifactContributorshipComponent o = (CitationCitedArtifactContributorshipComponent) other_;
7764        return compareValues(complete, o.complete, true);
7765      }
7766
7767      public boolean isEmpty() {
7768        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(complete, entry, summary
7769          );
7770      }
7771
7772  public String fhirType() {
7773    return "Citation.citedArtifact.contributorship";
7774
7775  }
7776
7777  }
7778
7779    @Block()
7780    public static class CitationCitedArtifactContributorshipEntryComponent extends BackboneElement implements IBaseBackboneElement {
7781        /**
7782         * The identity of the individual entity.
7783         */
7784        @Child(name = "contributor", type = {Practitioner.class, Organization.class}, order=1, min=1, max=1, modifier=false, summary=false)
7785        @Description(shortDefinition="The identity of the individual entity", formalDefinition="The identity of the individual entity." )
7786        protected Reference contributor;
7787
7788        /**
7789         * Initials for forename.
7790         */
7791        @Child(name = "forenameInitials", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
7792        @Description(shortDefinition="Initials for forename", formalDefinition="Initials for forename." )
7793        protected StringType forenameInitials;
7794
7795        /**
7796         * Organization affiliated with the entity.
7797         */
7798        @Child(name = "affiliation", type = {Organization.class, PractitionerRole.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
7799        @Description(shortDefinition="Organizational affiliation", formalDefinition="Organization affiliated with the entity." )
7800        protected List<Reference> affiliation;
7801
7802        /**
7803         * This element identifies the specific nature of an individual?s contribution with respect to the cited work.
7804         */
7805        @Child(name = "contributionType", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
7806        @Description(shortDefinition="The specific contribution", formalDefinition="This element identifies the specific nature of an individual?s contribution with respect to the cited work." )
7807        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/artifact-contribution-type")
7808        protected List<CodeableConcept> contributionType;
7809
7810        /**
7811         * The role of the contributor (e.g. author, editor, reviewer).
7812         */
7813        @Child(name = "role", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false)
7814        @Description(shortDefinition="The role of the contributor (e.g. author, editor, reviewer)", formalDefinition="The role of the contributor (e.g. author, editor, reviewer)." )
7815        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contributor-role")
7816        protected CodeableConcept role;
7817
7818        /**
7819         * Contributions with accounting for time or number.
7820         */
7821        @Child(name = "contributionInstance", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
7822        @Description(shortDefinition="Contributions with accounting for time or number", formalDefinition="Contributions with accounting for time or number." )
7823        protected List<CitationCitedArtifactContributorshipEntryContributionInstanceComponent> contributionInstance;
7824
7825        /**
7826         * Indication of which contributor is the corresponding contributor for the role.
7827         */
7828        @Child(name = "correspondingContact", type = {BooleanType.class}, order=7, min=0, max=1, modifier=false, summary=false)
7829        @Description(shortDefinition="Indication of which contributor is the corresponding contributor for the role", formalDefinition="Indication of which contributor is the corresponding contributor for the role." )
7830        protected BooleanType correspondingContact;
7831
7832        /**
7833         * Provides a numerical ranking to represent the degree of contributorship relative to other contributors, such as 1 for first author and 2 for second author.
7834         */
7835        @Child(name = "rankingOrder", type = {PositiveIntType.class}, order=8, min=0, max=1, modifier=false, summary=false)
7836        @Description(shortDefinition="Ranked order of contribution", formalDefinition="Provides a numerical ranking to represent the degree of contributorship relative to other contributors, such as 1 for first author and 2 for second author." )
7837        protected PositiveIntType rankingOrder;
7838
7839        private static final long serialVersionUID = 1654594857L;
7840
7841    /**
7842     * Constructor
7843     */
7844      public CitationCitedArtifactContributorshipEntryComponent() {
7845        super();
7846      }
7847
7848    /**
7849     * Constructor
7850     */
7851      public CitationCitedArtifactContributorshipEntryComponent(Reference contributor) {
7852        super();
7853        this.setContributor(contributor);
7854      }
7855
7856        /**
7857         * @return {@link #contributor} (The identity of the individual entity.)
7858         */
7859        public Reference getContributor() { 
7860          if (this.contributor == null)
7861            if (Configuration.errorOnAutoCreate())
7862              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryComponent.contributor");
7863            else if (Configuration.doAutoCreate())
7864              this.contributor = new Reference(); // cc
7865          return this.contributor;
7866        }
7867
7868        public boolean hasContributor() { 
7869          return this.contributor != null && !this.contributor.isEmpty();
7870        }
7871
7872        /**
7873         * @param value {@link #contributor} (The identity of the individual entity.)
7874         */
7875        public CitationCitedArtifactContributorshipEntryComponent setContributor(Reference value) { 
7876          this.contributor = value;
7877          return this;
7878        }
7879
7880        /**
7881         * @return {@link #forenameInitials} (Initials for forename.). This is the underlying object with id, value and extensions. The accessor "getForenameInitials" gives direct access to the value
7882         */
7883        public StringType getForenameInitialsElement() { 
7884          if (this.forenameInitials == null)
7885            if (Configuration.errorOnAutoCreate())
7886              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryComponent.forenameInitials");
7887            else if (Configuration.doAutoCreate())
7888              this.forenameInitials = new StringType(); // bb
7889          return this.forenameInitials;
7890        }
7891
7892        public boolean hasForenameInitialsElement() { 
7893          return this.forenameInitials != null && !this.forenameInitials.isEmpty();
7894        }
7895
7896        public boolean hasForenameInitials() { 
7897          return this.forenameInitials != null && !this.forenameInitials.isEmpty();
7898        }
7899
7900        /**
7901         * @param value {@link #forenameInitials} (Initials for forename.). This is the underlying object with id, value and extensions. The accessor "getForenameInitials" gives direct access to the value
7902         */
7903        public CitationCitedArtifactContributorshipEntryComponent setForenameInitialsElement(StringType value) { 
7904          this.forenameInitials = value;
7905          return this;
7906        }
7907
7908        /**
7909         * @return Initials for forename.
7910         */
7911        public String getForenameInitials() { 
7912          return this.forenameInitials == null ? null : this.forenameInitials.getValue();
7913        }
7914
7915        /**
7916         * @param value Initials for forename.
7917         */
7918        public CitationCitedArtifactContributorshipEntryComponent setForenameInitials(String value) { 
7919          if (Utilities.noString(value))
7920            this.forenameInitials = null;
7921          else {
7922            if (this.forenameInitials == null)
7923              this.forenameInitials = new StringType();
7924            this.forenameInitials.setValue(value);
7925          }
7926          return this;
7927        }
7928
7929        /**
7930         * @return {@link #affiliation} (Organization affiliated with the entity.)
7931         */
7932        public List<Reference> getAffiliation() { 
7933          if (this.affiliation == null)
7934            this.affiliation = new ArrayList<Reference>();
7935          return this.affiliation;
7936        }
7937
7938        /**
7939         * @return Returns a reference to <code>this</code> for easy method chaining
7940         */
7941        public CitationCitedArtifactContributorshipEntryComponent setAffiliation(List<Reference> theAffiliation) { 
7942          this.affiliation = theAffiliation;
7943          return this;
7944        }
7945
7946        public boolean hasAffiliation() { 
7947          if (this.affiliation == null)
7948            return false;
7949          for (Reference item : this.affiliation)
7950            if (!item.isEmpty())
7951              return true;
7952          return false;
7953        }
7954
7955        public Reference addAffiliation() { //3
7956          Reference t = new Reference();
7957          if (this.affiliation == null)
7958            this.affiliation = new ArrayList<Reference>();
7959          this.affiliation.add(t);
7960          return t;
7961        }
7962
7963        public CitationCitedArtifactContributorshipEntryComponent addAffiliation(Reference t) { //3
7964          if (t == null)
7965            return this;
7966          if (this.affiliation == null)
7967            this.affiliation = new ArrayList<Reference>();
7968          this.affiliation.add(t);
7969          return this;
7970        }
7971
7972        /**
7973         * @return The first repetition of repeating field {@link #affiliation}, creating it if it does not already exist {3}
7974         */
7975        public Reference getAffiliationFirstRep() { 
7976          if (getAffiliation().isEmpty()) {
7977            addAffiliation();
7978          }
7979          return getAffiliation().get(0);
7980        }
7981
7982        /**
7983         * @return {@link #contributionType} (This element identifies the specific nature of an individual?s contribution with respect to the cited work.)
7984         */
7985        public List<CodeableConcept> getContributionType() { 
7986          if (this.contributionType == null)
7987            this.contributionType = new ArrayList<CodeableConcept>();
7988          return this.contributionType;
7989        }
7990
7991        /**
7992         * @return Returns a reference to <code>this</code> for easy method chaining
7993         */
7994        public CitationCitedArtifactContributorshipEntryComponent setContributionType(List<CodeableConcept> theContributionType) { 
7995          this.contributionType = theContributionType;
7996          return this;
7997        }
7998
7999        public boolean hasContributionType() { 
8000          if (this.contributionType == null)
8001            return false;
8002          for (CodeableConcept item : this.contributionType)
8003            if (!item.isEmpty())
8004              return true;
8005          return false;
8006        }
8007
8008        public CodeableConcept addContributionType() { //3
8009          CodeableConcept t = new CodeableConcept();
8010          if (this.contributionType == null)
8011            this.contributionType = new ArrayList<CodeableConcept>();
8012          this.contributionType.add(t);
8013          return t;
8014        }
8015
8016        public CitationCitedArtifactContributorshipEntryComponent addContributionType(CodeableConcept t) { //3
8017          if (t == null)
8018            return this;
8019          if (this.contributionType == null)
8020            this.contributionType = new ArrayList<CodeableConcept>();
8021          this.contributionType.add(t);
8022          return this;
8023        }
8024
8025        /**
8026         * @return The first repetition of repeating field {@link #contributionType}, creating it if it does not already exist {3}
8027         */
8028        public CodeableConcept getContributionTypeFirstRep() { 
8029          if (getContributionType().isEmpty()) {
8030            addContributionType();
8031          }
8032          return getContributionType().get(0);
8033        }
8034
8035        /**
8036         * @return {@link #role} (The role of the contributor (e.g. author, editor, reviewer).)
8037         */
8038        public CodeableConcept getRole() { 
8039          if (this.role == null)
8040            if (Configuration.errorOnAutoCreate())
8041              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryComponent.role");
8042            else if (Configuration.doAutoCreate())
8043              this.role = new CodeableConcept(); // cc
8044          return this.role;
8045        }
8046
8047        public boolean hasRole() { 
8048          return this.role != null && !this.role.isEmpty();
8049        }
8050
8051        /**
8052         * @param value {@link #role} (The role of the contributor (e.g. author, editor, reviewer).)
8053         */
8054        public CitationCitedArtifactContributorshipEntryComponent setRole(CodeableConcept value) { 
8055          this.role = value;
8056          return this;
8057        }
8058
8059        /**
8060         * @return {@link #contributionInstance} (Contributions with accounting for time or number.)
8061         */
8062        public List<CitationCitedArtifactContributorshipEntryContributionInstanceComponent> getContributionInstance() { 
8063          if (this.contributionInstance == null)
8064            this.contributionInstance = new ArrayList<CitationCitedArtifactContributorshipEntryContributionInstanceComponent>();
8065          return this.contributionInstance;
8066        }
8067
8068        /**
8069         * @return Returns a reference to <code>this</code> for easy method chaining
8070         */
8071        public CitationCitedArtifactContributorshipEntryComponent setContributionInstance(List<CitationCitedArtifactContributorshipEntryContributionInstanceComponent> theContributionInstance) { 
8072          this.contributionInstance = theContributionInstance;
8073          return this;
8074        }
8075
8076        public boolean hasContributionInstance() { 
8077          if (this.contributionInstance == null)
8078            return false;
8079          for (CitationCitedArtifactContributorshipEntryContributionInstanceComponent item : this.contributionInstance)
8080            if (!item.isEmpty())
8081              return true;
8082          return false;
8083        }
8084
8085        public CitationCitedArtifactContributorshipEntryContributionInstanceComponent addContributionInstance() { //3
8086          CitationCitedArtifactContributorshipEntryContributionInstanceComponent t = new CitationCitedArtifactContributorshipEntryContributionInstanceComponent();
8087          if (this.contributionInstance == null)
8088            this.contributionInstance = new ArrayList<CitationCitedArtifactContributorshipEntryContributionInstanceComponent>();
8089          this.contributionInstance.add(t);
8090          return t;
8091        }
8092
8093        public CitationCitedArtifactContributorshipEntryComponent addContributionInstance(CitationCitedArtifactContributorshipEntryContributionInstanceComponent t) { //3
8094          if (t == null)
8095            return this;
8096          if (this.contributionInstance == null)
8097            this.contributionInstance = new ArrayList<CitationCitedArtifactContributorshipEntryContributionInstanceComponent>();
8098          this.contributionInstance.add(t);
8099          return this;
8100        }
8101
8102        /**
8103         * @return The first repetition of repeating field {@link #contributionInstance}, creating it if it does not already exist {3}
8104         */
8105        public CitationCitedArtifactContributorshipEntryContributionInstanceComponent getContributionInstanceFirstRep() { 
8106          if (getContributionInstance().isEmpty()) {
8107            addContributionInstance();
8108          }
8109          return getContributionInstance().get(0);
8110        }
8111
8112        /**
8113         * @return {@link #correspondingContact} (Indication of which contributor is the corresponding contributor for the role.). This is the underlying object with id, value and extensions. The accessor "getCorrespondingContact" gives direct access to the value
8114         */
8115        public BooleanType getCorrespondingContactElement() { 
8116          if (this.correspondingContact == null)
8117            if (Configuration.errorOnAutoCreate())
8118              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryComponent.correspondingContact");
8119            else if (Configuration.doAutoCreate())
8120              this.correspondingContact = new BooleanType(); // bb
8121          return this.correspondingContact;
8122        }
8123
8124        public boolean hasCorrespondingContactElement() { 
8125          return this.correspondingContact != null && !this.correspondingContact.isEmpty();
8126        }
8127
8128        public boolean hasCorrespondingContact() { 
8129          return this.correspondingContact != null && !this.correspondingContact.isEmpty();
8130        }
8131
8132        /**
8133         * @param value {@link #correspondingContact} (Indication of which contributor is the corresponding contributor for the role.). This is the underlying object with id, value and extensions. The accessor "getCorrespondingContact" gives direct access to the value
8134         */
8135        public CitationCitedArtifactContributorshipEntryComponent setCorrespondingContactElement(BooleanType value) { 
8136          this.correspondingContact = value;
8137          return this;
8138        }
8139
8140        /**
8141         * @return Indication of which contributor is the corresponding contributor for the role.
8142         */
8143        public boolean getCorrespondingContact() { 
8144          return this.correspondingContact == null || this.correspondingContact.isEmpty() ? false : this.correspondingContact.getValue();
8145        }
8146
8147        /**
8148         * @param value Indication of which contributor is the corresponding contributor for the role.
8149         */
8150        public CitationCitedArtifactContributorshipEntryComponent setCorrespondingContact(boolean value) { 
8151            if (this.correspondingContact == null)
8152              this.correspondingContact = new BooleanType();
8153            this.correspondingContact.setValue(value);
8154          return this;
8155        }
8156
8157        /**
8158         * @return {@link #rankingOrder} (Provides a numerical ranking to represent the degree of contributorship relative to other contributors, such as 1 for first author and 2 for second author.). This is the underlying object with id, value and extensions. The accessor "getRankingOrder" gives direct access to the value
8159         */
8160        public PositiveIntType getRankingOrderElement() { 
8161          if (this.rankingOrder == null)
8162            if (Configuration.errorOnAutoCreate())
8163              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryComponent.rankingOrder");
8164            else if (Configuration.doAutoCreate())
8165              this.rankingOrder = new PositiveIntType(); // bb
8166          return this.rankingOrder;
8167        }
8168
8169        public boolean hasRankingOrderElement() { 
8170          return this.rankingOrder != null && !this.rankingOrder.isEmpty();
8171        }
8172
8173        public boolean hasRankingOrder() { 
8174          return this.rankingOrder != null && !this.rankingOrder.isEmpty();
8175        }
8176
8177        /**
8178         * @param value {@link #rankingOrder} (Provides a numerical ranking to represent the degree of contributorship relative to other contributors, such as 1 for first author and 2 for second author.). This is the underlying object with id, value and extensions. The accessor "getRankingOrder" gives direct access to the value
8179         */
8180        public CitationCitedArtifactContributorshipEntryComponent setRankingOrderElement(PositiveIntType value) { 
8181          this.rankingOrder = value;
8182          return this;
8183        }
8184
8185        /**
8186         * @return Provides a numerical ranking to represent the degree of contributorship relative to other contributors, such as 1 for first author and 2 for second author.
8187         */
8188        public int getRankingOrder() { 
8189          return this.rankingOrder == null || this.rankingOrder.isEmpty() ? 0 : this.rankingOrder.getValue();
8190        }
8191
8192        /**
8193         * @param value Provides a numerical ranking to represent the degree of contributorship relative to other contributors, such as 1 for first author and 2 for second author.
8194         */
8195        public CitationCitedArtifactContributorshipEntryComponent setRankingOrder(int value) { 
8196            if (this.rankingOrder == null)
8197              this.rankingOrder = new PositiveIntType();
8198            this.rankingOrder.setValue(value);
8199          return this;
8200        }
8201
8202        protected void listChildren(List<Property> children) {
8203          super.listChildren(children);
8204          children.add(new Property("contributor", "Reference(Practitioner|Organization)", "The identity of the individual entity.", 0, 1, contributor));
8205          children.add(new Property("forenameInitials", "string", "Initials for forename.", 0, 1, forenameInitials));
8206          children.add(new Property("affiliation", "Reference(Organization|PractitionerRole)", "Organization affiliated with the entity.", 0, java.lang.Integer.MAX_VALUE, affiliation));
8207          children.add(new Property("contributionType", "CodeableConcept", "This element identifies the specific nature of an individual?s contribution with respect to the cited work.", 0, java.lang.Integer.MAX_VALUE, contributionType));
8208          children.add(new Property("role", "CodeableConcept", "The role of the contributor (e.g. author, editor, reviewer).", 0, 1, role));
8209          children.add(new Property("contributionInstance", "", "Contributions with accounting for time or number.", 0, java.lang.Integer.MAX_VALUE, contributionInstance));
8210          children.add(new Property("correspondingContact", "boolean", "Indication of which contributor is the corresponding contributor for the role.", 0, 1, correspondingContact));
8211          children.add(new Property("rankingOrder", "positiveInt", "Provides a numerical ranking to represent the degree of contributorship relative to other contributors, such as 1 for first author and 2 for second author.", 0, 1, rankingOrder));
8212        }
8213
8214        @Override
8215        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
8216          switch (_hash) {
8217          case -1895276325: /*contributor*/  return new Property("contributor", "Reference(Practitioner|Organization)", "The identity of the individual entity.", 0, 1, contributor);
8218          case -740521962: /*forenameInitials*/  return new Property("forenameInitials", "string", "Initials for forename.", 0, 1, forenameInitials);
8219          case 2019918576: /*affiliation*/  return new Property("affiliation", "Reference(Organization|PractitionerRole)", "Organization affiliated with the entity.", 0, java.lang.Integer.MAX_VALUE, affiliation);
8220          case -1600446614: /*contributionType*/  return new Property("contributionType", "CodeableConcept", "This element identifies the specific nature of an individual?s contribution with respect to the cited work.", 0, java.lang.Integer.MAX_VALUE, contributionType);
8221          case 3506294: /*role*/  return new Property("role", "CodeableConcept", "The role of the contributor (e.g. author, editor, reviewer).", 0, 1, role);
8222          case -547910459: /*contributionInstance*/  return new Property("contributionInstance", "", "Contributions with accounting for time or number.", 0, java.lang.Integer.MAX_VALUE, contributionInstance);
8223          case -1816008851: /*correspondingContact*/  return new Property("correspondingContact", "boolean", "Indication of which contributor is the corresponding contributor for the role.", 0, 1, correspondingContact);
8224          case -762905416: /*rankingOrder*/  return new Property("rankingOrder", "positiveInt", "Provides a numerical ranking to represent the degree of contributorship relative to other contributors, such as 1 for first author and 2 for second author.", 0, 1, rankingOrder);
8225          default: return super.getNamedProperty(_hash, _name, _checkValid);
8226          }
8227
8228        }
8229
8230      @Override
8231      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
8232        switch (hash) {
8233        case -1895276325: /*contributor*/ return this.contributor == null ? new Base[0] : new Base[] {this.contributor}; // Reference
8234        case -740521962: /*forenameInitials*/ return this.forenameInitials == null ? new Base[0] : new Base[] {this.forenameInitials}; // StringType
8235        case 2019918576: /*affiliation*/ return this.affiliation == null ? new Base[0] : this.affiliation.toArray(new Base[this.affiliation.size()]); // Reference
8236        case -1600446614: /*contributionType*/ return this.contributionType == null ? new Base[0] : this.contributionType.toArray(new Base[this.contributionType.size()]); // CodeableConcept
8237        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept
8238        case -547910459: /*contributionInstance*/ return this.contributionInstance == null ? new Base[0] : this.contributionInstance.toArray(new Base[this.contributionInstance.size()]); // CitationCitedArtifactContributorshipEntryContributionInstanceComponent
8239        case -1816008851: /*correspondingContact*/ return this.correspondingContact == null ? new Base[0] : new Base[] {this.correspondingContact}; // BooleanType
8240        case -762905416: /*rankingOrder*/ return this.rankingOrder == null ? new Base[0] : new Base[] {this.rankingOrder}; // PositiveIntType
8241        default: return super.getProperty(hash, name, checkValid);
8242        }
8243
8244      }
8245
8246      @Override
8247      public Base setProperty(int hash, String name, Base value) throws FHIRException {
8248        switch (hash) {
8249        case -1895276325: // contributor
8250          this.contributor = TypeConvertor.castToReference(value); // Reference
8251          return value;
8252        case -740521962: // forenameInitials
8253          this.forenameInitials = TypeConvertor.castToString(value); // StringType
8254          return value;
8255        case 2019918576: // affiliation
8256          this.getAffiliation().add(TypeConvertor.castToReference(value)); // Reference
8257          return value;
8258        case -1600446614: // contributionType
8259          this.getContributionType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
8260          return value;
8261        case 3506294: // role
8262          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8263          return value;
8264        case -547910459: // contributionInstance
8265          this.getContributionInstance().add((CitationCitedArtifactContributorshipEntryContributionInstanceComponent) value); // CitationCitedArtifactContributorshipEntryContributionInstanceComponent
8266          return value;
8267        case -1816008851: // correspondingContact
8268          this.correspondingContact = TypeConvertor.castToBoolean(value); // BooleanType
8269          return value;
8270        case -762905416: // rankingOrder
8271          this.rankingOrder = TypeConvertor.castToPositiveInt(value); // PositiveIntType
8272          return value;
8273        default: return super.setProperty(hash, name, value);
8274        }
8275
8276      }
8277
8278      @Override
8279      public Base setProperty(String name, Base value) throws FHIRException {
8280        if (name.equals("contributor")) {
8281          this.contributor = TypeConvertor.castToReference(value); // Reference
8282        } else if (name.equals("forenameInitials")) {
8283          this.forenameInitials = TypeConvertor.castToString(value); // StringType
8284        } else if (name.equals("affiliation")) {
8285          this.getAffiliation().add(TypeConvertor.castToReference(value));
8286        } else if (name.equals("contributionType")) {
8287          this.getContributionType().add(TypeConvertor.castToCodeableConcept(value));
8288        } else if (name.equals("role")) {
8289          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8290        } else if (name.equals("contributionInstance")) {
8291          this.getContributionInstance().add((CitationCitedArtifactContributorshipEntryContributionInstanceComponent) value);
8292        } else if (name.equals("correspondingContact")) {
8293          this.correspondingContact = TypeConvertor.castToBoolean(value); // BooleanType
8294        } else if (name.equals("rankingOrder")) {
8295          this.rankingOrder = TypeConvertor.castToPositiveInt(value); // PositiveIntType
8296        } else
8297          return super.setProperty(name, value);
8298        return value;
8299      }
8300
8301      @Override
8302      public Base makeProperty(int hash, String name) throws FHIRException {
8303        switch (hash) {
8304        case -1895276325:  return getContributor();
8305        case -740521962:  return getForenameInitialsElement();
8306        case 2019918576:  return addAffiliation(); 
8307        case -1600446614:  return addContributionType(); 
8308        case 3506294:  return getRole();
8309        case -547910459:  return addContributionInstance(); 
8310        case -1816008851:  return getCorrespondingContactElement();
8311        case -762905416:  return getRankingOrderElement();
8312        default: return super.makeProperty(hash, name);
8313        }
8314
8315      }
8316
8317      @Override
8318      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
8319        switch (hash) {
8320        case -1895276325: /*contributor*/ return new String[] {"Reference"};
8321        case -740521962: /*forenameInitials*/ return new String[] {"string"};
8322        case 2019918576: /*affiliation*/ return new String[] {"Reference"};
8323        case -1600446614: /*contributionType*/ return new String[] {"CodeableConcept"};
8324        case 3506294: /*role*/ return new String[] {"CodeableConcept"};
8325        case -547910459: /*contributionInstance*/ return new String[] {};
8326        case -1816008851: /*correspondingContact*/ return new String[] {"boolean"};
8327        case -762905416: /*rankingOrder*/ return new String[] {"positiveInt"};
8328        default: return super.getTypesForProperty(hash, name);
8329        }
8330
8331      }
8332
8333      @Override
8334      public Base addChild(String name) throws FHIRException {
8335        if (name.equals("contributor")) {
8336          this.contributor = new Reference();
8337          return this.contributor;
8338        }
8339        else if (name.equals("forenameInitials")) {
8340          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.contributorship.entry.forenameInitials");
8341        }
8342        else if (name.equals("affiliation")) {
8343          return addAffiliation();
8344        }
8345        else if (name.equals("contributionType")) {
8346          return addContributionType();
8347        }
8348        else if (name.equals("role")) {
8349          this.role = new CodeableConcept();
8350          return this.role;
8351        }
8352        else if (name.equals("contributionInstance")) {
8353          return addContributionInstance();
8354        }
8355        else if (name.equals("correspondingContact")) {
8356          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.contributorship.entry.correspondingContact");
8357        }
8358        else if (name.equals("rankingOrder")) {
8359          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.contributorship.entry.rankingOrder");
8360        }
8361        else
8362          return super.addChild(name);
8363      }
8364
8365      public CitationCitedArtifactContributorshipEntryComponent copy() {
8366        CitationCitedArtifactContributorshipEntryComponent dst = new CitationCitedArtifactContributorshipEntryComponent();
8367        copyValues(dst);
8368        return dst;
8369      }
8370
8371      public void copyValues(CitationCitedArtifactContributorshipEntryComponent dst) {
8372        super.copyValues(dst);
8373        dst.contributor = contributor == null ? null : contributor.copy();
8374        dst.forenameInitials = forenameInitials == null ? null : forenameInitials.copy();
8375        if (affiliation != null) {
8376          dst.affiliation = new ArrayList<Reference>();
8377          for (Reference i : affiliation)
8378            dst.affiliation.add(i.copy());
8379        };
8380        if (contributionType != null) {
8381          dst.contributionType = new ArrayList<CodeableConcept>();
8382          for (CodeableConcept i : contributionType)
8383            dst.contributionType.add(i.copy());
8384        };
8385        dst.role = role == null ? null : role.copy();
8386        if (contributionInstance != null) {
8387          dst.contributionInstance = new ArrayList<CitationCitedArtifactContributorshipEntryContributionInstanceComponent>();
8388          for (CitationCitedArtifactContributorshipEntryContributionInstanceComponent i : contributionInstance)
8389            dst.contributionInstance.add(i.copy());
8390        };
8391        dst.correspondingContact = correspondingContact == null ? null : correspondingContact.copy();
8392        dst.rankingOrder = rankingOrder == null ? null : rankingOrder.copy();
8393      }
8394
8395      @Override
8396      public boolean equalsDeep(Base other_) {
8397        if (!super.equalsDeep(other_))
8398          return false;
8399        if (!(other_ instanceof CitationCitedArtifactContributorshipEntryComponent))
8400          return false;
8401        CitationCitedArtifactContributorshipEntryComponent o = (CitationCitedArtifactContributorshipEntryComponent) other_;
8402        return compareDeep(contributor, o.contributor, true) && compareDeep(forenameInitials, o.forenameInitials, true)
8403           && compareDeep(affiliation, o.affiliation, true) && compareDeep(contributionType, o.contributionType, true)
8404           && compareDeep(role, o.role, true) && compareDeep(contributionInstance, o.contributionInstance, true)
8405           && compareDeep(correspondingContact, o.correspondingContact, true) && compareDeep(rankingOrder, o.rankingOrder, true)
8406          ;
8407      }
8408
8409      @Override
8410      public boolean equalsShallow(Base other_) {
8411        if (!super.equalsShallow(other_))
8412          return false;
8413        if (!(other_ instanceof CitationCitedArtifactContributorshipEntryComponent))
8414          return false;
8415        CitationCitedArtifactContributorshipEntryComponent o = (CitationCitedArtifactContributorshipEntryComponent) other_;
8416        return compareValues(forenameInitials, o.forenameInitials, true) && compareValues(correspondingContact, o.correspondingContact, true)
8417           && compareValues(rankingOrder, o.rankingOrder, true);
8418      }
8419
8420      public boolean isEmpty() {
8421        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(contributor, forenameInitials
8422          , affiliation, contributionType, role, contributionInstance, correspondingContact
8423          , rankingOrder);
8424      }
8425
8426  public String fhirType() {
8427    return "Citation.citedArtifact.contributorship.entry";
8428
8429  }
8430
8431  }
8432
8433    @Block()
8434    public static class CitationCitedArtifactContributorshipEntryContributionInstanceComponent extends BackboneElement implements IBaseBackboneElement {
8435        /**
8436         * The specific contribution.
8437         */
8438        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
8439        @Description(shortDefinition="The specific contribution", formalDefinition="The specific contribution." )
8440        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/artifact-contribution-instance-type")
8441        protected CodeableConcept type;
8442
8443        /**
8444         * The time that the contribution was made.
8445         */
8446        @Child(name = "time", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=false)
8447        @Description(shortDefinition="The time that the contribution was made", formalDefinition="The time that the contribution was made." )
8448        protected DateTimeType time;
8449
8450        private static final long serialVersionUID = -196837729L;
8451
8452    /**
8453     * Constructor
8454     */
8455      public CitationCitedArtifactContributorshipEntryContributionInstanceComponent() {
8456        super();
8457      }
8458
8459    /**
8460     * Constructor
8461     */
8462      public CitationCitedArtifactContributorshipEntryContributionInstanceComponent(CodeableConcept type) {
8463        super();
8464        this.setType(type);
8465      }
8466
8467        /**
8468         * @return {@link #type} (The specific contribution.)
8469         */
8470        public CodeableConcept getType() { 
8471          if (this.type == null)
8472            if (Configuration.errorOnAutoCreate())
8473              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryContributionInstanceComponent.type");
8474            else if (Configuration.doAutoCreate())
8475              this.type = new CodeableConcept(); // cc
8476          return this.type;
8477        }
8478
8479        public boolean hasType() { 
8480          return this.type != null && !this.type.isEmpty();
8481        }
8482
8483        /**
8484         * @param value {@link #type} (The specific contribution.)
8485         */
8486        public CitationCitedArtifactContributorshipEntryContributionInstanceComponent setType(CodeableConcept value) { 
8487          this.type = value;
8488          return this;
8489        }
8490
8491        /**
8492         * @return {@link #time} (The time that the contribution was made.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value
8493         */
8494        public DateTimeType getTimeElement() { 
8495          if (this.time == null)
8496            if (Configuration.errorOnAutoCreate())
8497              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryContributionInstanceComponent.time");
8498            else if (Configuration.doAutoCreate())
8499              this.time = new DateTimeType(); // bb
8500          return this.time;
8501        }
8502
8503        public boolean hasTimeElement() { 
8504          return this.time != null && !this.time.isEmpty();
8505        }
8506
8507        public boolean hasTime() { 
8508          return this.time != null && !this.time.isEmpty();
8509        }
8510
8511        /**
8512         * @param value {@link #time} (The time that the contribution was made.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value
8513         */
8514        public CitationCitedArtifactContributorshipEntryContributionInstanceComponent setTimeElement(DateTimeType value) { 
8515          this.time = value;
8516          return this;
8517        }
8518
8519        /**
8520         * @return The time that the contribution was made.
8521         */
8522        public Date getTime() { 
8523          return this.time == null ? null : this.time.getValue();
8524        }
8525
8526        /**
8527         * @param value The time that the contribution was made.
8528         */
8529        public CitationCitedArtifactContributorshipEntryContributionInstanceComponent setTime(Date value) { 
8530          if (value == null)
8531            this.time = null;
8532          else {
8533            if (this.time == null)
8534              this.time = new DateTimeType();
8535            this.time.setValue(value);
8536          }
8537          return this;
8538        }
8539
8540        protected void listChildren(List<Property> children) {
8541          super.listChildren(children);
8542          children.add(new Property("type", "CodeableConcept", "The specific contribution.", 0, 1, type));
8543          children.add(new Property("time", "dateTime", "The time that the contribution was made.", 0, 1, time));
8544        }
8545
8546        @Override
8547        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
8548          switch (_hash) {
8549          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The specific contribution.", 0, 1, type);
8550          case 3560141: /*time*/  return new Property("time", "dateTime", "The time that the contribution was made.", 0, 1, time);
8551          default: return super.getNamedProperty(_hash, _name, _checkValid);
8552          }
8553
8554        }
8555
8556      @Override
8557      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
8558        switch (hash) {
8559        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
8560        case 3560141: /*time*/ return this.time == null ? new Base[0] : new Base[] {this.time}; // DateTimeType
8561        default: return super.getProperty(hash, name, checkValid);
8562        }
8563
8564      }
8565
8566      @Override
8567      public Base setProperty(int hash, String name, Base value) throws FHIRException {
8568        switch (hash) {
8569        case 3575610: // type
8570          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8571          return value;
8572        case 3560141: // time
8573          this.time = TypeConvertor.castToDateTime(value); // DateTimeType
8574          return value;
8575        default: return super.setProperty(hash, name, value);
8576        }
8577
8578      }
8579
8580      @Override
8581      public Base setProperty(String name, Base value) throws FHIRException {
8582        if (name.equals("type")) {
8583          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8584        } else if (name.equals("time")) {
8585          this.time = TypeConvertor.castToDateTime(value); // DateTimeType
8586        } else
8587          return super.setProperty(name, value);
8588        return value;
8589      }
8590
8591      @Override
8592      public Base makeProperty(int hash, String name) throws FHIRException {
8593        switch (hash) {
8594        case 3575610:  return getType();
8595        case 3560141:  return getTimeElement();
8596        default: return super.makeProperty(hash, name);
8597        }
8598
8599      }
8600
8601      @Override
8602      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
8603        switch (hash) {
8604        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
8605        case 3560141: /*time*/ return new String[] {"dateTime"};
8606        default: return super.getTypesForProperty(hash, name);
8607        }
8608
8609      }
8610
8611      @Override
8612      public Base addChild(String name) throws FHIRException {
8613        if (name.equals("type")) {
8614          this.type = new CodeableConcept();
8615          return this.type;
8616        }
8617        else if (name.equals("time")) {
8618          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.contributorship.entry.contributionInstance.time");
8619        }
8620        else
8621          return super.addChild(name);
8622      }
8623
8624      public CitationCitedArtifactContributorshipEntryContributionInstanceComponent copy() {
8625        CitationCitedArtifactContributorshipEntryContributionInstanceComponent dst = new CitationCitedArtifactContributorshipEntryContributionInstanceComponent();
8626        copyValues(dst);
8627        return dst;
8628      }
8629
8630      public void copyValues(CitationCitedArtifactContributorshipEntryContributionInstanceComponent dst) {
8631        super.copyValues(dst);
8632        dst.type = type == null ? null : type.copy();
8633        dst.time = time == null ? null : time.copy();
8634      }
8635
8636      @Override
8637      public boolean equalsDeep(Base other_) {
8638        if (!super.equalsDeep(other_))
8639          return false;
8640        if (!(other_ instanceof CitationCitedArtifactContributorshipEntryContributionInstanceComponent))
8641          return false;
8642        CitationCitedArtifactContributorshipEntryContributionInstanceComponent o = (CitationCitedArtifactContributorshipEntryContributionInstanceComponent) other_;
8643        return compareDeep(type, o.type, true) && compareDeep(time, o.time, true);
8644      }
8645
8646      @Override
8647      public boolean equalsShallow(Base other_) {
8648        if (!super.equalsShallow(other_))
8649          return false;
8650        if (!(other_ instanceof CitationCitedArtifactContributorshipEntryContributionInstanceComponent))
8651          return false;
8652        CitationCitedArtifactContributorshipEntryContributionInstanceComponent o = (CitationCitedArtifactContributorshipEntryContributionInstanceComponent) other_;
8653        return compareValues(time, o.time, true);
8654      }
8655
8656      public boolean isEmpty() {
8657        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, time);
8658      }
8659
8660  public String fhirType() {
8661    return "Citation.citedArtifact.contributorship.entry.contributionInstance";
8662
8663  }
8664
8665  }
8666
8667    @Block()
8668    public static class ContributorshipSummaryComponent extends BackboneElement implements IBaseBackboneElement {
8669        /**
8670         * Used most commonly to express an author list or a contributorship statement.
8671         */
8672        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
8673        @Description(shortDefinition="Either authorList or contributorshipStatement", formalDefinition="Used most commonly to express an author list or a contributorship statement." )
8674        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contributor-summary-type")
8675        protected CodeableConcept type;
8676
8677        /**
8678         * The format for the display string.
8679         */
8680        @Child(name = "style", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
8681        @Description(shortDefinition="The format for the display string", formalDefinition="The format for the display string." )
8682        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contributor-summary-style")
8683        protected CodeableConcept style;
8684
8685        /**
8686         * Used to code the producer or rule for creating the display string.
8687         */
8688        @Child(name = "source", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
8689        @Description(shortDefinition="Used to code the producer or rule for creating the display string", formalDefinition="Used to code the producer or rule for creating the display string." )
8690        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contributor-summary-source")
8691        protected CodeableConcept source;
8692
8693        /**
8694         * The display string for the author list, contributor list, or contributorship statement.
8695         */
8696        @Child(name = "value", type = {MarkdownType.class}, order=4, min=1, max=1, modifier=false, summary=false)
8697        @Description(shortDefinition="The display string for the author list, contributor list, or contributorship statement", formalDefinition="The display string for the author list, contributor list, or contributorship statement." )
8698        protected MarkdownType value;
8699
8700        private static final long serialVersionUID = 1353383781L;
8701
8702    /**
8703     * Constructor
8704     */
8705      public ContributorshipSummaryComponent() {
8706        super();
8707      }
8708
8709    /**
8710     * Constructor
8711     */
8712      public ContributorshipSummaryComponent(String value) {
8713        super();
8714        this.setValue(value);
8715      }
8716
8717        /**
8718         * @return {@link #type} (Used most commonly to express an author list or a contributorship statement.)
8719         */
8720        public CodeableConcept getType() { 
8721          if (this.type == null)
8722            if (Configuration.errorOnAutoCreate())
8723              throw new Error("Attempt to auto-create ContributorshipSummaryComponent.type");
8724            else if (Configuration.doAutoCreate())
8725              this.type = new CodeableConcept(); // cc
8726          return this.type;
8727        }
8728
8729        public boolean hasType() { 
8730          return this.type != null && !this.type.isEmpty();
8731        }
8732
8733        /**
8734         * @param value {@link #type} (Used most commonly to express an author list or a contributorship statement.)
8735         */
8736        public ContributorshipSummaryComponent setType(CodeableConcept value) { 
8737          this.type = value;
8738          return this;
8739        }
8740
8741        /**
8742         * @return {@link #style} (The format for the display string.)
8743         */
8744        public CodeableConcept getStyle() { 
8745          if (this.style == null)
8746            if (Configuration.errorOnAutoCreate())
8747              throw new Error("Attempt to auto-create ContributorshipSummaryComponent.style");
8748            else if (Configuration.doAutoCreate())
8749              this.style = new CodeableConcept(); // cc
8750          return this.style;
8751        }
8752
8753        public boolean hasStyle() { 
8754          return this.style != null && !this.style.isEmpty();
8755        }
8756
8757        /**
8758         * @param value {@link #style} (The format for the display string.)
8759         */
8760        public ContributorshipSummaryComponent setStyle(CodeableConcept value) { 
8761          this.style = value;
8762          return this;
8763        }
8764
8765        /**
8766         * @return {@link #source} (Used to code the producer or rule for creating the display string.)
8767         */
8768        public CodeableConcept getSource() { 
8769          if (this.source == null)
8770            if (Configuration.errorOnAutoCreate())
8771              throw new Error("Attempt to auto-create ContributorshipSummaryComponent.source");
8772            else if (Configuration.doAutoCreate())
8773              this.source = new CodeableConcept(); // cc
8774          return this.source;
8775        }
8776
8777        public boolean hasSource() { 
8778          return this.source != null && !this.source.isEmpty();
8779        }
8780
8781        /**
8782         * @param value {@link #source} (Used to code the producer or rule for creating the display string.)
8783         */
8784        public ContributorshipSummaryComponent setSource(CodeableConcept value) { 
8785          this.source = value;
8786          return this;
8787        }
8788
8789        /**
8790         * @return {@link #value} (The display string for the author list, contributor list, or contributorship statement.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
8791         */
8792        public MarkdownType getValueElement() { 
8793          if (this.value == null)
8794            if (Configuration.errorOnAutoCreate())
8795              throw new Error("Attempt to auto-create ContributorshipSummaryComponent.value");
8796            else if (Configuration.doAutoCreate())
8797              this.value = new MarkdownType(); // bb
8798          return this.value;
8799        }
8800
8801        public boolean hasValueElement() { 
8802          return this.value != null && !this.value.isEmpty();
8803        }
8804
8805        public boolean hasValue() { 
8806          return this.value != null && !this.value.isEmpty();
8807        }
8808
8809        /**
8810         * @param value {@link #value} (The display string for the author list, contributor list, or contributorship statement.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
8811         */
8812        public ContributorshipSummaryComponent setValueElement(MarkdownType value) { 
8813          this.value = value;
8814          return this;
8815        }
8816
8817        /**
8818         * @return The display string for the author list, contributor list, or contributorship statement.
8819         */
8820        public String getValue() { 
8821          return this.value == null ? null : this.value.getValue();
8822        }
8823
8824        /**
8825         * @param value The display string for the author list, contributor list, or contributorship statement.
8826         */
8827        public ContributorshipSummaryComponent setValue(String value) { 
8828            if (this.value == null)
8829              this.value = new MarkdownType();
8830            this.value.setValue(value);
8831          return this;
8832        }
8833
8834        protected void listChildren(List<Property> children) {
8835          super.listChildren(children);
8836          children.add(new Property("type", "CodeableConcept", "Used most commonly to express an author list or a contributorship statement.", 0, 1, type));
8837          children.add(new Property("style", "CodeableConcept", "The format for the display string.", 0, 1, style));
8838          children.add(new Property("source", "CodeableConcept", "Used to code the producer or rule for creating the display string.", 0, 1, source));
8839          children.add(new Property("value", "markdown", "The display string for the author list, contributor list, or contributorship statement.", 0, 1, value));
8840        }
8841
8842        @Override
8843        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
8844          switch (_hash) {
8845          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Used most commonly to express an author list or a contributorship statement.", 0, 1, type);
8846          case 109780401: /*style*/  return new Property("style", "CodeableConcept", "The format for the display string.", 0, 1, style);
8847          case -896505829: /*source*/  return new Property("source", "CodeableConcept", "Used to code the producer or rule for creating the display string.", 0, 1, source);
8848          case 111972721: /*value*/  return new Property("value", "markdown", "The display string for the author list, contributor list, or contributorship statement.", 0, 1, value);
8849          default: return super.getNamedProperty(_hash, _name, _checkValid);
8850          }
8851
8852        }
8853
8854      @Override
8855      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
8856        switch (hash) {
8857        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
8858        case 109780401: /*style*/ return this.style == null ? new Base[0] : new Base[] {this.style}; // CodeableConcept
8859        case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // CodeableConcept
8860        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // MarkdownType
8861        default: return super.getProperty(hash, name, checkValid);
8862        }
8863
8864      }
8865
8866      @Override
8867      public Base setProperty(int hash, String name, Base value) throws FHIRException {
8868        switch (hash) {
8869        case 3575610: // type
8870          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8871          return value;
8872        case 109780401: // style
8873          this.style = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8874          return value;
8875        case -896505829: // source
8876          this.source = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8877          return value;
8878        case 111972721: // value
8879          this.value = TypeConvertor.castToMarkdown(value); // MarkdownType
8880          return value;
8881        default: return super.setProperty(hash, name, value);
8882        }
8883
8884      }
8885
8886      @Override
8887      public Base setProperty(String name, Base value) throws FHIRException {
8888        if (name.equals("type")) {
8889          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8890        } else if (name.equals("style")) {
8891          this.style = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8892        } else if (name.equals("source")) {
8893          this.source = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8894        } else if (name.equals("value")) {
8895          this.value = TypeConvertor.castToMarkdown(value); // MarkdownType
8896        } else
8897          return super.setProperty(name, value);
8898        return value;
8899      }
8900
8901      @Override
8902      public Base makeProperty(int hash, String name) throws FHIRException {
8903        switch (hash) {
8904        case 3575610:  return getType();
8905        case 109780401:  return getStyle();
8906        case -896505829:  return getSource();
8907        case 111972721:  return getValueElement();
8908        default: return super.makeProperty(hash, name);
8909        }
8910
8911      }
8912
8913      @Override
8914      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
8915        switch (hash) {
8916        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
8917        case 109780401: /*style*/ return new String[] {"CodeableConcept"};
8918        case -896505829: /*source*/ return new String[] {"CodeableConcept"};
8919        case 111972721: /*value*/ return new String[] {"markdown"};
8920        default: return super.getTypesForProperty(hash, name);
8921        }
8922
8923      }
8924
8925      @Override
8926      public Base addChild(String name) throws FHIRException {
8927        if (name.equals("type")) {
8928          this.type = new CodeableConcept();
8929          return this.type;
8930        }
8931        else if (name.equals("style")) {
8932          this.style = new CodeableConcept();
8933          return this.style;
8934        }
8935        else if (name.equals("source")) {
8936          this.source = new CodeableConcept();
8937          return this.source;
8938        }
8939        else if (name.equals("value")) {
8940          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.contributorship.summary.value");
8941        }
8942        else
8943          return super.addChild(name);
8944      }
8945
8946      public ContributorshipSummaryComponent copy() {
8947        ContributorshipSummaryComponent dst = new ContributorshipSummaryComponent();
8948        copyValues(dst);
8949        return dst;
8950      }
8951
8952      public void copyValues(ContributorshipSummaryComponent dst) {
8953        super.copyValues(dst);
8954        dst.type = type == null ? null : type.copy();
8955        dst.style = style == null ? null : style.copy();
8956        dst.source = source == null ? null : source.copy();
8957        dst.value = value == null ? null : value.copy();
8958      }
8959
8960      @Override
8961      public boolean equalsDeep(Base other_) {
8962        if (!super.equalsDeep(other_))
8963          return false;
8964        if (!(other_ instanceof ContributorshipSummaryComponent))
8965          return false;
8966        ContributorshipSummaryComponent o = (ContributorshipSummaryComponent) other_;
8967        return compareDeep(type, o.type, true) && compareDeep(style, o.style, true) && compareDeep(source, o.source, true)
8968           && compareDeep(value, o.value, true);
8969      }
8970
8971      @Override
8972      public boolean equalsShallow(Base other_) {
8973        if (!super.equalsShallow(other_))
8974          return false;
8975        if (!(other_ instanceof ContributorshipSummaryComponent))
8976          return false;
8977        ContributorshipSummaryComponent o = (ContributorshipSummaryComponent) other_;
8978        return compareValues(value, o.value, true);
8979      }
8980
8981      public boolean isEmpty() {
8982        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, style, source, value
8983          );
8984      }
8985
8986  public String fhirType() {
8987    return "Citation.citedArtifact.contributorship.summary";
8988
8989  }
8990
8991  }
8992
8993    /**
8994     * An absolute URI that is used to identify this citation when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this summary is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the summary is stored on different servers.
8995     */
8996    @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true)
8997    @Description(shortDefinition="Canonical identifier for this citation, represented as a globally unique URI", formalDefinition="An absolute URI that is used to identify this citation when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this summary is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the summary is stored on different servers." )
8998    protected UriType url;
8999
9000    /**
9001     * A formal identifier that is used to identify this citation when it is represented in other formats, or referenced in a specification, model, design or an instance.
9002     */
9003    @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
9004    @Description(shortDefinition="Identifier for the Citation resource itself", formalDefinition="A formal identifier that is used to identify this citation when it is represented in other formats, or referenced in a specification, model, design or an instance." )
9005    protected List<Identifier> identifier;
9006
9007    /**
9008     * The identifier that is used to identify this version of the citation when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the citation author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.
9009     */
9010    @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
9011    @Description(shortDefinition="Business version of the citation", formalDefinition="The identifier that is used to identify this version of the citation when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the citation author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence." )
9012    protected StringType version;
9013
9014    /**
9015     * A natural language name identifying the citation. This name should be usable as an identifier for the module by machine processing applications such as code generation.
9016     */
9017    @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
9018    @Description(shortDefinition="Name for this citation (computer friendly)", formalDefinition="A natural language name identifying the citation. This name should be usable as an identifier for the module by machine processing applications such as code generation." )
9019    protected StringType name;
9020
9021    /**
9022     * A short, descriptive, user-friendly title for the citation.
9023     */
9024    @Child(name = "title", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
9025    @Description(shortDefinition="Name for this citation (human friendly)", formalDefinition="A short, descriptive, user-friendly title for the citation." )
9026    protected StringType title;
9027
9028    /**
9029     * The status of this summary. Enables tracking the life-cycle of the content.
9030     */
9031    @Child(name = "status", type = {CodeType.class}, order=5, min=1, max=1, modifier=true, summary=true)
9032    @Description(shortDefinition="draft | active | retired | unknown", formalDefinition="The status of this summary. Enables tracking the life-cycle of the content." )
9033    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/publication-status")
9034    protected Enumeration<PublicationStatus> status;
9035
9036    /**
9037     * A Boolean value to indicate that this citation is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.
9038     */
9039    @Child(name = "experimental", type = {BooleanType.class}, order=6, min=0, max=1, modifier=false, summary=true)
9040    @Description(shortDefinition="For testing purposes, not real usage", formalDefinition="A Boolean value to indicate that this citation is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage." )
9041    protected BooleanType experimental;
9042
9043    /**
9044     * The date  (and optionally time) when the citation was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the citation changes.
9045     */
9046    @Child(name = "date", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=true)
9047    @Description(shortDefinition="Date last changed", formalDefinition="The date  (and optionally time) when the citation was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the citation changes." )
9048    protected DateTimeType date;
9049
9050    /**
9051     * The name of the organization or individual that published the citation.
9052     */
9053    @Child(name = "publisher", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=true)
9054    @Description(shortDefinition="The publisher of the Citation, not the publisher of the article or artifact being cited", formalDefinition="The name of the organization or individual that published the citation." )
9055    protected StringType publisher;
9056
9057    /**
9058     * Contact details to assist a user in finding and communicating with the publisher.
9059     */
9060    @Child(name = "contact", type = {ContactDetail.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
9061    @Description(shortDefinition="Contact details for the publisher of the Citation Resource", formalDefinition="Contact details to assist a user in finding and communicating with the publisher." )
9062    protected List<ContactDetail> contact;
9063
9064    /**
9065     * A free text natural language description of the citation from a consumer's perspective.
9066     */
9067    @Child(name = "description", type = {MarkdownType.class}, order=10, min=0, max=1, modifier=false, summary=false)
9068    @Description(shortDefinition="Natural language description of the citation", formalDefinition="A free text natural language description of the citation from a consumer's perspective." )
9069    protected MarkdownType description;
9070
9071    /**
9072     * The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate citation instances.
9073     */
9074    @Child(name = "useContext", type = {UsageContext.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
9075    @Description(shortDefinition="The context that the Citation Resource content is intended to support", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate citation instances." )
9076    protected List<UsageContext> useContext;
9077
9078    /**
9079     * A legal or geographic region in which the citation is intended to be used.
9080     */
9081    @Child(name = "jurisdiction", type = {CodeableConcept.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
9082    @Description(shortDefinition="Intended jurisdiction for citation (if applicable)", formalDefinition="A legal or geographic region in which the citation is intended to be used." )
9083    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/jurisdiction")
9084    protected List<CodeableConcept> jurisdiction;
9085
9086    /**
9087     * Explanation of why this citation is needed and why it has been designed as it has.
9088     */
9089    @Child(name = "purpose", type = {MarkdownType.class}, order=13, min=0, max=1, modifier=false, summary=false)
9090    @Description(shortDefinition="Why this citation is defined", formalDefinition="Explanation of why this citation is needed and why it has been designed as it has." )
9091    protected MarkdownType purpose;
9092
9093    /**
9094     * Use and/or publishing restrictions for the Citation, not for the cited artifact.
9095     */
9096    @Child(name = "copyright", type = {MarkdownType.class}, order=14, min=0, max=1, modifier=false, summary=false)
9097    @Description(shortDefinition="Use and/or publishing restrictions for the Citation, not for the cited artifact", formalDefinition="Use and/or publishing restrictions for the Citation, not for the cited artifact." )
9098    protected MarkdownType copyright;
9099
9100    /**
9101     * The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.
9102     */
9103    @Child(name = "approvalDate", type = {DateType.class}, order=15, min=0, max=1, modifier=false, summary=false)
9104    @Description(shortDefinition="When the citation was approved by publisher", formalDefinition="The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage." )
9105    protected DateType approvalDate;
9106
9107    /**
9108     * The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.
9109     */
9110    @Child(name = "lastReviewDate", type = {DateType.class}, order=16, min=0, max=1, modifier=false, summary=false)