001package org.hl7.fhir.dstu3.model;
002
003
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034// Generated on Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.x
035import java.util.ArrayList;
036import java.util.Date;
037import java.util.List;
038
039import org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus;
040import org.hl7.fhir.dstu3.model.Enumerations.PublicationStatusEnumFactory;
041import org.hl7.fhir.exceptions.FHIRException;
042import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
043import org.hl7.fhir.utilities.Utilities;
044
045import ca.uhn.fhir.model.api.annotation.Block;
046import ca.uhn.fhir.model.api.annotation.Child;
047import ca.uhn.fhir.model.api.annotation.ChildOrder;
048import ca.uhn.fhir.model.api.annotation.Description;
049import ca.uhn.fhir.model.api.annotation.ResourceDef;
050import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
051/**
052 * The formal description of a single piece of information that can be gathered and reported.
053 */
054@ResourceDef(name="DataElement", profile="http://hl7.org/fhir/Profile/DataElement")
055@ChildOrder(names={"url", "identifier", "version", "status", "experimental", "date", "publisher", "name", "title", "contact", "useContext", "jurisdiction", "copyright", "stringency", "mapping", "element"})
056public class DataElement extends MetadataResource {
057
058    public enum DataElementStringency {
059        /**
060         * The data element is sufficiently well-constrained that multiple pieces of data captured according to the constraints of the data element will be comparable (though in some cases, a degree of automated conversion/normalization may be required).
061         */
062        COMPARABLE, 
063        /**
064         * The data element is fully specified down to a single value set, single unit of measure, single data type, etc.  Multiple pieces of data associated with this data element are fully comparable.
065         */
066        FULLYSPECIFIED, 
067        /**
068         * The data element allows multiple units of measure having equivalent meaning; e.g. "cc" (cubic centimeter) and "mL" (milliliter).
069         */
070        EQUIVALENT, 
071        /**
072         * The data element allows multiple units of measure that are convertable between each other (e.g. inches and centimeters) and/or allows data to be captured in multiple value sets for which a known mapping exists allowing conversion of meaning.
073         */
074        CONVERTABLE, 
075        /**
076         * A convertable data element where unit conversions are different only by a power of 10; e.g. g, mg, kg.
077         */
078        SCALEABLE, 
079        /**
080         * The data element is unconstrained in units, choice of data types and/or choice of vocabulary such that automated comparison of data captured using the data element is not possible.
081         */
082        FLEXIBLE, 
083        /**
084         * added to help the parsers with the generic types
085         */
086        NULL;
087        public static DataElementStringency fromCode(String codeString) throws FHIRException {
088            if (codeString == null || "".equals(codeString))
089                return null;
090        if ("comparable".equals(codeString))
091          return COMPARABLE;
092        if ("fully-specified".equals(codeString))
093          return FULLYSPECIFIED;
094        if ("equivalent".equals(codeString))
095          return EQUIVALENT;
096        if ("convertable".equals(codeString))
097          return CONVERTABLE;
098        if ("scaleable".equals(codeString))
099          return SCALEABLE;
100        if ("flexible".equals(codeString))
101          return FLEXIBLE;
102        if (Configuration.isAcceptInvalidEnums())
103          return null;
104        else
105          throw new FHIRException("Unknown DataElementStringency code '"+codeString+"'");
106        }
107        public String toCode() {
108          switch (this) {
109            case COMPARABLE: return "comparable";
110            case FULLYSPECIFIED: return "fully-specified";
111            case EQUIVALENT: return "equivalent";
112            case CONVERTABLE: return "convertable";
113            case SCALEABLE: return "scaleable";
114            case FLEXIBLE: return "flexible";
115            case NULL: return null;
116            default: return "?";
117          }
118        }
119        public String getSystem() {
120          switch (this) {
121            case COMPARABLE: return "http://hl7.org/fhir/dataelement-stringency";
122            case FULLYSPECIFIED: return "http://hl7.org/fhir/dataelement-stringency";
123            case EQUIVALENT: return "http://hl7.org/fhir/dataelement-stringency";
124            case CONVERTABLE: return "http://hl7.org/fhir/dataelement-stringency";
125            case SCALEABLE: return "http://hl7.org/fhir/dataelement-stringency";
126            case FLEXIBLE: return "http://hl7.org/fhir/dataelement-stringency";
127            case NULL: return null;
128            default: return "?";
129          }
130        }
131        public String getDefinition() {
132          switch (this) {
133            case COMPARABLE: return "The data element is sufficiently well-constrained that multiple pieces of data captured according to the constraints of the data element will be comparable (though in some cases, a degree of automated conversion/normalization may be required).";
134            case FULLYSPECIFIED: return "The data element is fully specified down to a single value set, single unit of measure, single data type, etc.  Multiple pieces of data associated with this data element are fully comparable.";
135            case EQUIVALENT: return "The data element allows multiple units of measure having equivalent meaning; e.g. \"cc\" (cubic centimeter) and \"mL\" (milliliter).";
136            case CONVERTABLE: return "The data element allows multiple units of measure that are convertable between each other (e.g. inches and centimeters) and/or allows data to be captured in multiple value sets for which a known mapping exists allowing conversion of meaning.";
137            case SCALEABLE: return "A convertable data element where unit conversions are different only by a power of 10; e.g. g, mg, kg.";
138            case FLEXIBLE: return "The data element is unconstrained in units, choice of data types and/or choice of vocabulary such that automated comparison of data captured using the data element is not possible.";
139            case NULL: return null;
140            default: return "?";
141          }
142        }
143        public String getDisplay() {
144          switch (this) {
145            case COMPARABLE: return "Comparable";
146            case FULLYSPECIFIED: return "Fully Specified";
147            case EQUIVALENT: return "Equivalent";
148            case CONVERTABLE: return "Convertable";
149            case SCALEABLE: return "Scaleable";
150            case FLEXIBLE: return "Flexible";
151            case NULL: return null;
152            default: return "?";
153          }
154        }
155    }
156
157  public static class DataElementStringencyEnumFactory implements EnumFactory<DataElementStringency> {
158    public DataElementStringency fromCode(String codeString) throws IllegalArgumentException {
159      if (codeString == null || "".equals(codeString))
160            if (codeString == null || "".equals(codeString))
161                return null;
162        if ("comparable".equals(codeString))
163          return DataElementStringency.COMPARABLE;
164        if ("fully-specified".equals(codeString))
165          return DataElementStringency.FULLYSPECIFIED;
166        if ("equivalent".equals(codeString))
167          return DataElementStringency.EQUIVALENT;
168        if ("convertable".equals(codeString))
169          return DataElementStringency.CONVERTABLE;
170        if ("scaleable".equals(codeString))
171          return DataElementStringency.SCALEABLE;
172        if ("flexible".equals(codeString))
173          return DataElementStringency.FLEXIBLE;
174        throw new IllegalArgumentException("Unknown DataElementStringency code '"+codeString+"'");
175        }
176        public Enumeration<DataElementStringency> fromType(PrimitiveType<?> code) throws FHIRException {
177          if (code == null)
178            return null;
179          if (code.isEmpty())
180            return new Enumeration<DataElementStringency>(this);
181          String codeString = code.asStringValue();
182          if (codeString == null || "".equals(codeString))
183            return null;
184        if ("comparable".equals(codeString))
185          return new Enumeration<DataElementStringency>(this, DataElementStringency.COMPARABLE);
186        if ("fully-specified".equals(codeString))
187          return new Enumeration<DataElementStringency>(this, DataElementStringency.FULLYSPECIFIED);
188        if ("equivalent".equals(codeString))
189          return new Enumeration<DataElementStringency>(this, DataElementStringency.EQUIVALENT);
190        if ("convertable".equals(codeString))
191          return new Enumeration<DataElementStringency>(this, DataElementStringency.CONVERTABLE);
192        if ("scaleable".equals(codeString))
193          return new Enumeration<DataElementStringency>(this, DataElementStringency.SCALEABLE);
194        if ("flexible".equals(codeString))
195          return new Enumeration<DataElementStringency>(this, DataElementStringency.FLEXIBLE);
196        throw new FHIRException("Unknown DataElementStringency code '"+codeString+"'");
197        }
198    public String toCode(DataElementStringency code) {
199      if (code == DataElementStringency.COMPARABLE)
200        return "comparable";
201      if (code == DataElementStringency.FULLYSPECIFIED)
202        return "fully-specified";
203      if (code == DataElementStringency.EQUIVALENT)
204        return "equivalent";
205      if (code == DataElementStringency.CONVERTABLE)
206        return "convertable";
207      if (code == DataElementStringency.SCALEABLE)
208        return "scaleable";
209      if (code == DataElementStringency.FLEXIBLE)
210        return "flexible";
211      return "?";
212      }
213    public String toSystem(DataElementStringency code) {
214      return code.getSystem();
215      }
216    }
217
218    @Block()
219    public static class DataElementMappingComponent extends BackboneElement implements IBaseBackboneElement {
220        /**
221         * An internal id that is used to identify this mapping set when specific mappings are made on a per-element basis.
222         */
223        @Child(name = "identity", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=false)
224        @Description(shortDefinition="Internal id when this mapping is used", formalDefinition="An internal id that is used to identify this mapping set when specific mappings are made on a per-element basis." )
225        protected IdType identity;
226
227        /**
228         * An absolute URI that identifies the specification that this mapping is expressed to.
229         */
230        @Child(name = "uri", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=false)
231        @Description(shortDefinition="Identifies what this mapping refers to", formalDefinition="An absolute URI that identifies the specification that this mapping is expressed to." )
232        protected UriType uri;
233
234        /**
235         * A name for the specification that is being mapped to.
236         */
237        @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
238        @Description(shortDefinition="Names what this mapping refers to", formalDefinition="A name for the specification that is being mapped to." )
239        protected StringType name;
240
241        /**
242         * Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.
243         */
244        @Child(name = "comment", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
245        @Description(shortDefinition="Versions, issues, scope limitations, etc.", formalDefinition="Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage." )
246        protected StringType comment;
247
248        private static final long serialVersionUID = 9610265L;
249
250    /**
251     * Constructor
252     */
253      public DataElementMappingComponent() {
254        super();
255      }
256
257    /**
258     * Constructor
259     */
260      public DataElementMappingComponent(IdType identity) {
261        super();
262        this.identity = identity;
263      }
264
265        /**
266         * @return {@link #identity} (An internal id that is used to identify this mapping set when specific mappings are made on a per-element basis.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value
267         */
268        public IdType getIdentityElement() { 
269          if (this.identity == null)
270            if (Configuration.errorOnAutoCreate())
271              throw new Error("Attempt to auto-create DataElementMappingComponent.identity");
272            else if (Configuration.doAutoCreate())
273              this.identity = new IdType(); // bb
274          return this.identity;
275        }
276
277        public boolean hasIdentityElement() { 
278          return this.identity != null && !this.identity.isEmpty();
279        }
280
281        public boolean hasIdentity() { 
282          return this.identity != null && !this.identity.isEmpty();
283        }
284
285        /**
286         * @param value {@link #identity} (An internal id that is used to identify this mapping set when specific mappings are made on a per-element basis.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value
287         */
288        public DataElementMappingComponent setIdentityElement(IdType value) { 
289          this.identity = value;
290          return this;
291        }
292
293        /**
294         * @return An internal id that is used to identify this mapping set when specific mappings are made on a per-element basis.
295         */
296        public String getIdentity() { 
297          return this.identity == null ? null : this.identity.getValue();
298        }
299
300        /**
301         * @param value An internal id that is used to identify this mapping set when specific mappings are made on a per-element basis.
302         */
303        public DataElementMappingComponent setIdentity(String value) { 
304            if (this.identity == null)
305              this.identity = new IdType();
306            this.identity.setValue(value);
307          return this;
308        }
309
310        /**
311         * @return {@link #uri} (An absolute URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value
312         */
313        public UriType getUriElement() { 
314          if (this.uri == null)
315            if (Configuration.errorOnAutoCreate())
316              throw new Error("Attempt to auto-create DataElementMappingComponent.uri");
317            else if (Configuration.doAutoCreate())
318              this.uri = new UriType(); // bb
319          return this.uri;
320        }
321
322        public boolean hasUriElement() { 
323          return this.uri != null && !this.uri.isEmpty();
324        }
325
326        public boolean hasUri() { 
327          return this.uri != null && !this.uri.isEmpty();
328        }
329
330        /**
331         * @param value {@link #uri} (An absolute URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value
332         */
333        public DataElementMappingComponent setUriElement(UriType value) { 
334          this.uri = value;
335          return this;
336        }
337
338        /**
339         * @return An absolute URI that identifies the specification that this mapping is expressed to.
340         */
341        public String getUri() { 
342          return this.uri == null ? null : this.uri.getValue();
343        }
344
345        /**
346         * @param value An absolute URI that identifies the specification that this mapping is expressed to.
347         */
348        public DataElementMappingComponent setUri(String value) { 
349          if (Utilities.noString(value))
350            this.uri = null;
351          else {
352            if (this.uri == null)
353              this.uri = new UriType();
354            this.uri.setValue(value);
355          }
356          return this;
357        }
358
359        /**
360         * @return {@link #name} (A name for the specification that is being mapped to.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
361         */
362        public StringType getNameElement() { 
363          if (this.name == null)
364            if (Configuration.errorOnAutoCreate())
365              throw new Error("Attempt to auto-create DataElementMappingComponent.name");
366            else if (Configuration.doAutoCreate())
367              this.name = new StringType(); // bb
368          return this.name;
369        }
370
371        public boolean hasNameElement() { 
372          return this.name != null && !this.name.isEmpty();
373        }
374
375        public boolean hasName() { 
376          return this.name != null && !this.name.isEmpty();
377        }
378
379        /**
380         * @param value {@link #name} (A name for the specification that is being mapped to.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
381         */
382        public DataElementMappingComponent setNameElement(StringType value) { 
383          this.name = value;
384          return this;
385        }
386
387        /**
388         * @return A name for the specification that is being mapped to.
389         */
390        public String getName() { 
391          return this.name == null ? null : this.name.getValue();
392        }
393
394        /**
395         * @param value A name for the specification that is being mapped to.
396         */
397        public DataElementMappingComponent setName(String value) { 
398          if (Utilities.noString(value))
399            this.name = null;
400          else {
401            if (this.name == null)
402              this.name = new StringType();
403            this.name.setValue(value);
404          }
405          return this;
406        }
407
408        /**
409         * @return {@link #comment} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value
410         */
411        public StringType getCommentElement() { 
412          if (this.comment == null)
413            if (Configuration.errorOnAutoCreate())
414              throw new Error("Attempt to auto-create DataElementMappingComponent.comment");
415            else if (Configuration.doAutoCreate())
416              this.comment = new StringType(); // bb
417          return this.comment;
418        }
419
420        public boolean hasCommentElement() { 
421          return this.comment != null && !this.comment.isEmpty();
422        }
423
424        public boolean hasComment() { 
425          return this.comment != null && !this.comment.isEmpty();
426        }
427
428        /**
429         * @param value {@link #comment} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value
430         */
431        public DataElementMappingComponent setCommentElement(StringType value) { 
432          this.comment = value;
433          return this;
434        }
435
436        /**
437         * @return Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.
438         */
439        public String getComment() { 
440          return this.comment == null ? null : this.comment.getValue();
441        }
442
443        /**
444         * @param value Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.
445         */
446        public DataElementMappingComponent setComment(String value) { 
447          if (Utilities.noString(value))
448            this.comment = null;
449          else {
450            if (this.comment == null)
451              this.comment = new StringType();
452            this.comment.setValue(value);
453          }
454          return this;
455        }
456
457        protected void listChildren(List<Property> children) {
458          super.listChildren(children);
459          children.add(new Property("identity", "id", "An internal id that is used to identify this mapping set when specific mappings are made on a per-element basis.", 0, 1, identity));
460          children.add(new Property("uri", "uri", "An absolute URI that identifies the specification that this mapping is expressed to.", 0, 1, uri));
461          children.add(new Property("name", "string", "A name for the specification that is being mapped to.", 0, 1, name));
462          children.add(new Property("comment", "string", "Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.", 0, 1, comment));
463        }
464
465        @Override
466        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
467          switch (_hash) {
468          case -135761730: /*identity*/  return new Property("identity", "id", "An internal id that is used to identify this mapping set when specific mappings are made on a per-element basis.", 0, 1, identity);
469          case 116076: /*uri*/  return new Property("uri", "uri", "An absolute URI that identifies the specification that this mapping is expressed to.", 0, 1, uri);
470          case 3373707: /*name*/  return new Property("name", "string", "A name for the specification that is being mapped to.", 0, 1, name);
471          case 950398559: /*comment*/  return new Property("comment", "string", "Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.", 0, 1, comment);
472          default: return super.getNamedProperty(_hash, _name, _checkValid);
473          }
474
475        }
476
477      @Override
478      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
479        switch (hash) {
480        case -135761730: /*identity*/ return this.identity == null ? new Base[0] : new Base[] {this.identity}; // IdType
481        case 116076: /*uri*/ return this.uri == null ? new Base[0] : new Base[] {this.uri}; // UriType
482        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
483        case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType
484        default: return super.getProperty(hash, name, checkValid);
485        }
486
487      }
488
489      @Override
490      public Base setProperty(int hash, String name, Base value) throws FHIRException {
491        switch (hash) {
492        case -135761730: // identity
493          this.identity = castToId(value); // IdType
494          return value;
495        case 116076: // uri
496          this.uri = castToUri(value); // UriType
497          return value;
498        case 3373707: // name
499          this.name = castToString(value); // StringType
500          return value;
501        case 950398559: // comment
502          this.comment = castToString(value); // StringType
503          return value;
504        default: return super.setProperty(hash, name, value);
505        }
506
507      }
508
509      @Override
510      public Base setProperty(String name, Base value) throws FHIRException {
511        if (name.equals("identity")) {
512          this.identity = castToId(value); // IdType
513        } else if (name.equals("uri")) {
514          this.uri = castToUri(value); // UriType
515        } else if (name.equals("name")) {
516          this.name = castToString(value); // StringType
517        } else if (name.equals("comment")) {
518          this.comment = castToString(value); // StringType
519        } else
520          return super.setProperty(name, value);
521        return value;
522      }
523
524      @Override
525      public Base makeProperty(int hash, String name) throws FHIRException {
526        switch (hash) {
527        case -135761730:  return getIdentityElement();
528        case 116076:  return getUriElement();
529        case 3373707:  return getNameElement();
530        case 950398559:  return getCommentElement();
531        default: return super.makeProperty(hash, name);
532        }
533
534      }
535
536      @Override
537      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
538        switch (hash) {
539        case -135761730: /*identity*/ return new String[] {"id"};
540        case 116076: /*uri*/ return new String[] {"uri"};
541        case 3373707: /*name*/ return new String[] {"string"};
542        case 950398559: /*comment*/ return new String[] {"string"};
543        default: return super.getTypesForProperty(hash, name);
544        }
545
546      }
547
548      @Override
549      public Base addChild(String name) throws FHIRException {
550        if (name.equals("identity")) {
551          throw new FHIRException("Cannot call addChild on a singleton property DataElement.identity");
552        }
553        else if (name.equals("uri")) {
554          throw new FHIRException("Cannot call addChild on a singleton property DataElement.uri");
555        }
556        else if (name.equals("name")) {
557          throw new FHIRException("Cannot call addChild on a singleton property DataElement.name");
558        }
559        else if (name.equals("comment")) {
560          throw new FHIRException("Cannot call addChild on a singleton property DataElement.comment");
561        }
562        else
563          return super.addChild(name);
564      }
565
566      public DataElementMappingComponent copy() {
567        DataElementMappingComponent dst = new DataElementMappingComponent();
568        copyValues(dst);
569        dst.identity = identity == null ? null : identity.copy();
570        dst.uri = uri == null ? null : uri.copy();
571        dst.name = name == null ? null : name.copy();
572        dst.comment = comment == null ? null : comment.copy();
573        return dst;
574      }
575
576      @Override
577      public boolean equalsDeep(Base other_) {
578        if (!super.equalsDeep(other_))
579          return false;
580        if (!(other_ instanceof DataElementMappingComponent))
581          return false;
582        DataElementMappingComponent o = (DataElementMappingComponent) other_;
583        return compareDeep(identity, o.identity, true) && compareDeep(uri, o.uri, true) && compareDeep(name, o.name, true)
584           && compareDeep(comment, o.comment, true);
585      }
586
587      @Override
588      public boolean equalsShallow(Base other_) {
589        if (!super.equalsShallow(other_))
590          return false;
591        if (!(other_ instanceof DataElementMappingComponent))
592          return false;
593        DataElementMappingComponent o = (DataElementMappingComponent) other_;
594        return compareValues(identity, o.identity, true) && compareValues(uri, o.uri, true) && compareValues(name, o.name, true)
595           && compareValues(comment, o.comment, true);
596      }
597
598      public boolean isEmpty() {
599        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identity, uri, name, comment
600          );
601      }
602
603  public String fhirType() {
604    return "DataElement.mapping";
605
606  }
607
608  }
609
610    /**
611     * A formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance.
612     */
613    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
614    @Description(shortDefinition="Additional identifier for the data element", formalDefinition="A formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance." )
615    protected List<Identifier> identifier;
616
617    /**
618     * A copyright statement relating to the data element and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the data element.
619     */
620    @Child(name = "copyright", type = {MarkdownType.class}, order=1, min=0, max=1, modifier=false, summary=false)
621    @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the data element and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the data element." )
622    protected MarkdownType copyright;
623
624    /**
625     * Identifies how precise the data element is in its definition.
626     */
627    @Child(name = "stringency", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true)
628    @Description(shortDefinition="comparable | fully-specified | equivalent | convertable | scaleable | flexible", formalDefinition="Identifies how precise the data element is in its definition." )
629    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/dataelement-stringency")
630    protected Enumeration<DataElementStringency> stringency;
631
632    /**
633     * Identifies a specification (other than a terminology) that the elements which make up the DataElement have some correspondence with.
634     */
635    @Child(name = "mapping", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
636    @Description(shortDefinition="External specification mapped to", formalDefinition="Identifies a specification (other than a terminology) that the elements which make up the DataElement have some correspondence with." )
637    protected List<DataElementMappingComponent> mapping;
638
639    /**
640     * Defines the structure, type, allowed values and other constraining characteristics of the data element.
641     */
642    @Child(name = "element", type = {ElementDefinition.class}, order=4, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
643    @Description(shortDefinition="Definition of element", formalDefinition="Defines the structure, type, allowed values and other constraining characteristics of the data element." )
644    protected List<ElementDefinition> element;
645
646    private static final long serialVersionUID = 634422795L;
647
648  /**
649   * Constructor
650   */
651    public DataElement() {
652      super();
653    }
654
655  /**
656   * Constructor
657   */
658    public DataElement(Enumeration<PublicationStatus> status) {
659      super();
660      this.status = status;
661    }
662
663    /**
664     * @return {@link #url} (An absolute URI that is used to identify this data element when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this data element is (or will be) published. The URL SHOULD include the major version of the data element. For more information see [Technical and Business Versions](resource.html#versions).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
665     */
666    public UriType getUrlElement() { 
667      if (this.url == null)
668        if (Configuration.errorOnAutoCreate())
669          throw new Error("Attempt to auto-create DataElement.url");
670        else if (Configuration.doAutoCreate())
671          this.url = new UriType(); // bb
672      return this.url;
673    }
674
675    public boolean hasUrlElement() { 
676      return this.url != null && !this.url.isEmpty();
677    }
678
679    public boolean hasUrl() { 
680      return this.url != null && !this.url.isEmpty();
681    }
682
683    /**
684     * @param value {@link #url} (An absolute URI that is used to identify this data element when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this data element is (or will be) published. The URL SHOULD include the major version of the data element. For more information see [Technical and Business Versions](resource.html#versions).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
685     */
686    public DataElement setUrlElement(UriType value) { 
687      this.url = value;
688      return this;
689    }
690
691    /**
692     * @return An absolute URI that is used to identify this data element when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this data element is (or will be) published. The URL SHOULD include the major version of the data element. For more information see [Technical and Business Versions](resource.html#versions).
693     */
694    public String getUrl() { 
695      return this.url == null ? null : this.url.getValue();
696    }
697
698    /**
699     * @param value An absolute URI that is used to identify this data element when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this data element is (or will be) published. The URL SHOULD include the major version of the data element. For more information see [Technical and Business Versions](resource.html#versions).
700     */
701    public DataElement setUrl(String value) { 
702      if (Utilities.noString(value))
703        this.url = null;
704      else {
705        if (this.url == null)
706          this.url = new UriType();
707        this.url.setValue(value);
708      }
709      return this;
710    }
711
712    /**
713     * @return {@link #identifier} (A formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance.)
714     */
715    public List<Identifier> getIdentifier() { 
716      if (this.identifier == null)
717        this.identifier = new ArrayList<Identifier>();
718      return this.identifier;
719    }
720
721    /**
722     * @return Returns a reference to <code>this</code> for easy method chaining
723     */
724    public DataElement setIdentifier(List<Identifier> theIdentifier) { 
725      this.identifier = theIdentifier;
726      return this;
727    }
728
729    public boolean hasIdentifier() { 
730      if (this.identifier == null)
731        return false;
732      for (Identifier item : this.identifier)
733        if (!item.isEmpty())
734          return true;
735      return false;
736    }
737
738    public Identifier addIdentifier() { //3
739      Identifier t = new Identifier();
740      if (this.identifier == null)
741        this.identifier = new ArrayList<Identifier>();
742      this.identifier.add(t);
743      return t;
744    }
745
746    public DataElement addIdentifier(Identifier t) { //3
747      if (t == null)
748        return this;
749      if (this.identifier == null)
750        this.identifier = new ArrayList<Identifier>();
751      this.identifier.add(t);
752      return this;
753    }
754
755    /**
756     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
757     */
758    public Identifier getIdentifierFirstRep() { 
759      if (getIdentifier().isEmpty()) {
760        addIdentifier();
761      }
762      return getIdentifier().get(0);
763    }
764
765    /**
766     * @return {@link #version} (The identifier that is used to identify this version of the data element when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the data element author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
767     */
768    public StringType getVersionElement() { 
769      if (this.version == null)
770        if (Configuration.errorOnAutoCreate())
771          throw new Error("Attempt to auto-create DataElement.version");
772        else if (Configuration.doAutoCreate())
773          this.version = new StringType(); // bb
774      return this.version;
775    }
776
777    public boolean hasVersionElement() { 
778      return this.version != null && !this.version.isEmpty();
779    }
780
781    public boolean hasVersion() { 
782      return this.version != null && !this.version.isEmpty();
783    }
784
785    /**
786     * @param value {@link #version} (The identifier that is used to identify this version of the data element when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the data element author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
787     */
788    public DataElement setVersionElement(StringType value) { 
789      this.version = value;
790      return this;
791    }
792
793    /**
794     * @return The identifier that is used to identify this version of the data element when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the data element 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.
795     */
796    public String getVersion() { 
797      return this.version == null ? null : this.version.getValue();
798    }
799
800    /**
801     * @param value The identifier that is used to identify this version of the data element when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the data element 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.
802     */
803    public DataElement setVersion(String value) { 
804      if (Utilities.noString(value))
805        this.version = null;
806      else {
807        if (this.version == null)
808          this.version = new StringType();
809        this.version.setValue(value);
810      }
811      return this;
812    }
813
814    /**
815     * @return {@link #status} (The status of this data element. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
816     */
817    public Enumeration<PublicationStatus> getStatusElement() { 
818      if (this.status == null)
819        if (Configuration.errorOnAutoCreate())
820          throw new Error("Attempt to auto-create DataElement.status");
821        else if (Configuration.doAutoCreate())
822          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
823      return this.status;
824    }
825
826    public boolean hasStatusElement() { 
827      return this.status != null && !this.status.isEmpty();
828    }
829
830    public boolean hasStatus() { 
831      return this.status != null && !this.status.isEmpty();
832    }
833
834    /**
835     * @param value {@link #status} (The status of this data element. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
836     */
837    public DataElement setStatusElement(Enumeration<PublicationStatus> value) { 
838      this.status = value;
839      return this;
840    }
841
842    /**
843     * @return The status of this data element. Enables tracking the life-cycle of the content.
844     */
845    public PublicationStatus getStatus() { 
846      return this.status == null ? null : this.status.getValue();
847    }
848
849    /**
850     * @param value The status of this data element. Enables tracking the life-cycle of the content.
851     */
852    public DataElement setStatus(PublicationStatus value) { 
853        if (this.status == null)
854          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
855        this.status.setValue(value);
856      return this;
857    }
858
859    /**
860     * @return {@link #experimental} (A boolean value to indicate that this data element is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
861     */
862    public BooleanType getExperimentalElement() { 
863      if (this.experimental == null)
864        if (Configuration.errorOnAutoCreate())
865          throw new Error("Attempt to auto-create DataElement.experimental");
866        else if (Configuration.doAutoCreate())
867          this.experimental = new BooleanType(); // bb
868      return this.experimental;
869    }
870
871    public boolean hasExperimentalElement() { 
872      return this.experimental != null && !this.experimental.isEmpty();
873    }
874
875    public boolean hasExperimental() { 
876      return this.experimental != null && !this.experimental.isEmpty();
877    }
878
879    /**
880     * @param value {@link #experimental} (A boolean value to indicate that this data element is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
881     */
882    public DataElement setExperimentalElement(BooleanType value) { 
883      this.experimental = value;
884      return this;
885    }
886
887    /**
888     * @return A boolean value to indicate that this data element is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
889     */
890    public boolean getExperimental() { 
891      return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
892    }
893
894    /**
895     * @param value A boolean value to indicate that this data element is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
896     */
897    public DataElement setExperimental(boolean value) { 
898        if (this.experimental == null)
899          this.experimental = new BooleanType();
900        this.experimental.setValue(value);
901      return this;
902    }
903
904    /**
905     * @return {@link #date} (The date  (and optionally time) when the data element was published. The date must change if and 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 data element changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
906     */
907    public DateTimeType getDateElement() { 
908      if (this.date == null)
909        if (Configuration.errorOnAutoCreate())
910          throw new Error("Attempt to auto-create DataElement.date");
911        else if (Configuration.doAutoCreate())
912          this.date = new DateTimeType(); // bb
913      return this.date;
914    }
915
916    public boolean hasDateElement() { 
917      return this.date != null && !this.date.isEmpty();
918    }
919
920    public boolean hasDate() { 
921      return this.date != null && !this.date.isEmpty();
922    }
923
924    /**
925     * @param value {@link #date} (The date  (and optionally time) when the data element was published. The date must change if and 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 data element changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
926     */
927    public DataElement setDateElement(DateTimeType value) { 
928      this.date = value;
929      return this;
930    }
931
932    /**
933     * @return The date  (and optionally time) when the data element was published. The date must change if and 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 data element changes.
934     */
935    public Date getDate() { 
936      return this.date == null ? null : this.date.getValue();
937    }
938
939    /**
940     * @param value The date  (and optionally time) when the data element was published. The date must change if and 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 data element changes.
941     */
942    public DataElement setDate(Date value) { 
943      if (value == null)
944        this.date = null;
945      else {
946        if (this.date == null)
947          this.date = new DateTimeType();
948        this.date.setValue(value);
949      }
950      return this;
951    }
952
953    /**
954     * @return {@link #publisher} (The name of the individual or organization that published the data element.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
955     */
956    public StringType getPublisherElement() { 
957      if (this.publisher == null)
958        if (Configuration.errorOnAutoCreate())
959          throw new Error("Attempt to auto-create DataElement.publisher");
960        else if (Configuration.doAutoCreate())
961          this.publisher = new StringType(); // bb
962      return this.publisher;
963    }
964
965    public boolean hasPublisherElement() { 
966      return this.publisher != null && !this.publisher.isEmpty();
967    }
968
969    public boolean hasPublisher() { 
970      return this.publisher != null && !this.publisher.isEmpty();
971    }
972
973    /**
974     * @param value {@link #publisher} (The name of the individual or organization that published the data element.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
975     */
976    public DataElement setPublisherElement(StringType value) { 
977      this.publisher = value;
978      return this;
979    }
980
981    /**
982     * @return The name of the individual or organization that published the data element.
983     */
984    public String getPublisher() { 
985      return this.publisher == null ? null : this.publisher.getValue();
986    }
987
988    /**
989     * @param value The name of the individual or organization that published the data element.
990     */
991    public DataElement setPublisher(String value) { 
992      if (Utilities.noString(value))
993        this.publisher = null;
994      else {
995        if (this.publisher == null)
996          this.publisher = new StringType();
997        this.publisher.setValue(value);
998      }
999      return this;
1000    }
1001
1002    /**
1003     * @return {@link #name} (A natural language name identifying the data element. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1004     */
1005    public StringType getNameElement() { 
1006      if (this.name == null)
1007        if (Configuration.errorOnAutoCreate())
1008          throw new Error("Attempt to auto-create DataElement.name");
1009        else if (Configuration.doAutoCreate())
1010          this.name = new StringType(); // bb
1011      return this.name;
1012    }
1013
1014    public boolean hasNameElement() { 
1015      return this.name != null && !this.name.isEmpty();
1016    }
1017
1018    public boolean hasName() { 
1019      return this.name != null && !this.name.isEmpty();
1020    }
1021
1022    /**
1023     * @param value {@link #name} (A natural language name identifying the data element. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1024     */
1025    public DataElement setNameElement(StringType value) { 
1026      this.name = value;
1027      return this;
1028    }
1029
1030    /**
1031     * @return A natural language name identifying the data element. This name should be usable as an identifier for the module by machine processing applications such as code generation.
1032     */
1033    public String getName() { 
1034      return this.name == null ? null : this.name.getValue();
1035    }
1036
1037    /**
1038     * @param value A natural language name identifying the data element. This name should be usable as an identifier for the module by machine processing applications such as code generation.
1039     */
1040    public DataElement setName(String value) { 
1041      if (Utilities.noString(value))
1042        this.name = null;
1043      else {
1044        if (this.name == null)
1045          this.name = new StringType();
1046        this.name.setValue(value);
1047      }
1048      return this;
1049    }
1050
1051    /**
1052     * @return {@link #title} (A short, descriptive, user-friendly title for the data element.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
1053     */
1054    public StringType getTitleElement() { 
1055      if (this.title == null)
1056        if (Configuration.errorOnAutoCreate())
1057          throw new Error("Attempt to auto-create DataElement.title");
1058        else if (Configuration.doAutoCreate())
1059          this.title = new StringType(); // bb
1060      return this.title;
1061    }
1062
1063    public boolean hasTitleElement() { 
1064      return this.title != null && !this.title.isEmpty();
1065    }
1066
1067    public boolean hasTitle() { 
1068      return this.title != null && !this.title.isEmpty();
1069    }
1070
1071    /**
1072     * @param value {@link #title} (A short, descriptive, user-friendly title for the data element.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
1073     */
1074    public DataElement setTitleElement(StringType value) { 
1075      this.title = value;
1076      return this;
1077    }
1078
1079    /**
1080     * @return A short, descriptive, user-friendly title for the data element.
1081     */
1082    public String getTitle() { 
1083      return this.title == null ? null : this.title.getValue();
1084    }
1085
1086    /**
1087     * @param value A short, descriptive, user-friendly title for the data element.
1088     */
1089    public DataElement setTitle(String value) { 
1090      if (Utilities.noString(value))
1091        this.title = null;
1092      else {
1093        if (this.title == null)
1094          this.title = new StringType();
1095        this.title.setValue(value);
1096      }
1097      return this;
1098    }
1099
1100    /**
1101     * @return {@link #contact} (Contact details to assist a user in finding and communicating with the publisher.)
1102     */
1103    public List<ContactDetail> getContact() { 
1104      if (this.contact == null)
1105        this.contact = new ArrayList<ContactDetail>();
1106      return this.contact;
1107    }
1108
1109    /**
1110     * @return Returns a reference to <code>this</code> for easy method chaining
1111     */
1112    public DataElement setContact(List<ContactDetail> theContact) { 
1113      this.contact = theContact;
1114      return this;
1115    }
1116
1117    public boolean hasContact() { 
1118      if (this.contact == null)
1119        return false;
1120      for (ContactDetail item : this.contact)
1121        if (!item.isEmpty())
1122          return true;
1123      return false;
1124    }
1125
1126    public ContactDetail addContact() { //3
1127      ContactDetail t = new ContactDetail();
1128      if (this.contact == null)
1129        this.contact = new ArrayList<ContactDetail>();
1130      this.contact.add(t);
1131      return t;
1132    }
1133
1134    public DataElement addContact(ContactDetail t) { //3
1135      if (t == null)
1136        return this;
1137      if (this.contact == null)
1138        this.contact = new ArrayList<ContactDetail>();
1139      this.contact.add(t);
1140      return this;
1141    }
1142
1143    /**
1144     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist
1145     */
1146    public ContactDetail getContactFirstRep() { 
1147      if (getContact().isEmpty()) {
1148        addContact();
1149      }
1150      return getContact().get(0);
1151    }
1152
1153    /**
1154     * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate data element instances.)
1155     */
1156    public List<UsageContext> getUseContext() { 
1157      if (this.useContext == null)
1158        this.useContext = new ArrayList<UsageContext>();
1159      return this.useContext;
1160    }
1161
1162    /**
1163     * @return Returns a reference to <code>this</code> for easy method chaining
1164     */
1165    public DataElement setUseContext(List<UsageContext> theUseContext) { 
1166      this.useContext = theUseContext;
1167      return this;
1168    }
1169
1170    public boolean hasUseContext() { 
1171      if (this.useContext == null)
1172        return false;
1173      for (UsageContext item : this.useContext)
1174        if (!item.isEmpty())
1175          return true;
1176      return false;
1177    }
1178
1179    public UsageContext addUseContext() { //3
1180      UsageContext t = new UsageContext();
1181      if (this.useContext == null)
1182        this.useContext = new ArrayList<UsageContext>();
1183      this.useContext.add(t);
1184      return t;
1185    }
1186
1187    public DataElement addUseContext(UsageContext t) { //3
1188      if (t == null)
1189        return this;
1190      if (this.useContext == null)
1191        this.useContext = new ArrayList<UsageContext>();
1192      this.useContext.add(t);
1193      return this;
1194    }
1195
1196    /**
1197     * @return The first repetition of repeating field {@link #useContext}, creating it if it does not already exist
1198     */
1199    public UsageContext getUseContextFirstRep() { 
1200      if (getUseContext().isEmpty()) {
1201        addUseContext();
1202      }
1203      return getUseContext().get(0);
1204    }
1205
1206    /**
1207     * @return {@link #jurisdiction} (A legal or geographic region in which the data element is intended to be used.)
1208     */
1209    public List<CodeableConcept> getJurisdiction() { 
1210      if (this.jurisdiction == null)
1211        this.jurisdiction = new ArrayList<CodeableConcept>();
1212      return this.jurisdiction;
1213    }
1214
1215    /**
1216     * @return Returns a reference to <code>this</code> for easy method chaining
1217     */
1218    public DataElement setJurisdiction(List<CodeableConcept> theJurisdiction) { 
1219      this.jurisdiction = theJurisdiction;
1220      return this;
1221    }
1222
1223    public boolean hasJurisdiction() { 
1224      if (this.jurisdiction == null)
1225        return false;
1226      for (CodeableConcept item : this.jurisdiction)
1227        if (!item.isEmpty())
1228          return true;
1229      return false;
1230    }
1231
1232    public CodeableConcept addJurisdiction() { //3
1233      CodeableConcept t = new CodeableConcept();
1234      if (this.jurisdiction == null)
1235        this.jurisdiction = new ArrayList<CodeableConcept>();
1236      this.jurisdiction.add(t);
1237      return t;
1238    }
1239
1240    public DataElement addJurisdiction(CodeableConcept t) { //3
1241      if (t == null)
1242        return this;
1243      if (this.jurisdiction == null)
1244        this.jurisdiction = new ArrayList<CodeableConcept>();
1245      this.jurisdiction.add(t);
1246      return this;
1247    }
1248
1249    /**
1250     * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist
1251     */
1252    public CodeableConcept getJurisdictionFirstRep() { 
1253      if (getJurisdiction().isEmpty()) {
1254        addJurisdiction();
1255      }
1256      return getJurisdiction().get(0);
1257    }
1258
1259    /**
1260     * @return {@link #copyright} (A copyright statement relating to the data element and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the data element.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
1261     */
1262    public MarkdownType getCopyrightElement() { 
1263      if (this.copyright == null)
1264        if (Configuration.errorOnAutoCreate())
1265          throw new Error("Attempt to auto-create DataElement.copyright");
1266        else if (Configuration.doAutoCreate())
1267          this.copyright = new MarkdownType(); // bb
1268      return this.copyright;
1269    }
1270
1271    public boolean hasCopyrightElement() { 
1272      return this.copyright != null && !this.copyright.isEmpty();
1273    }
1274
1275    public boolean hasCopyright() { 
1276      return this.copyright != null && !this.copyright.isEmpty();
1277    }
1278
1279    /**
1280     * @param value {@link #copyright} (A copyright statement relating to the data element and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the data element.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
1281     */
1282    public DataElement setCopyrightElement(MarkdownType value) { 
1283      this.copyright = value;
1284      return this;
1285    }
1286
1287    /**
1288     * @return A copyright statement relating to the data element and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the data element.
1289     */
1290    public String getCopyright() { 
1291      return this.copyright == null ? null : this.copyright.getValue();
1292    }
1293
1294    /**
1295     * @param value A copyright statement relating to the data element and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the data element.
1296     */
1297    public DataElement setCopyright(String value) { 
1298      if (value == null)
1299        this.copyright = null;
1300      else {
1301        if (this.copyright == null)
1302          this.copyright = new MarkdownType();
1303        this.copyright.setValue(value);
1304      }
1305      return this;
1306    }
1307
1308    /**
1309     * @return {@link #stringency} (Identifies how precise the data element is in its definition.). This is the underlying object with id, value and extensions. The accessor "getStringency" gives direct access to the value
1310     */
1311    public Enumeration<DataElementStringency> getStringencyElement() { 
1312      if (this.stringency == null)
1313        if (Configuration.errorOnAutoCreate())
1314          throw new Error("Attempt to auto-create DataElement.stringency");
1315        else if (Configuration.doAutoCreate())
1316          this.stringency = new Enumeration<DataElementStringency>(new DataElementStringencyEnumFactory()); // bb
1317      return this.stringency;
1318    }
1319
1320    public boolean hasStringencyElement() { 
1321      return this.stringency != null && !this.stringency.isEmpty();
1322    }
1323
1324    public boolean hasStringency() { 
1325      return this.stringency != null && !this.stringency.isEmpty();
1326    }
1327
1328    /**
1329     * @param value {@link #stringency} (Identifies how precise the data element is in its definition.). This is the underlying object with id, value and extensions. The accessor "getStringency" gives direct access to the value
1330     */
1331    public DataElement setStringencyElement(Enumeration<DataElementStringency> value) { 
1332      this.stringency = value;
1333      return this;
1334    }
1335
1336    /**
1337     * @return Identifies how precise the data element is in its definition.
1338     */
1339    public DataElementStringency getStringency() { 
1340      return this.stringency == null ? null : this.stringency.getValue();
1341    }
1342
1343    /**
1344     * @param value Identifies how precise the data element is in its definition.
1345     */
1346    public DataElement setStringency(DataElementStringency value) { 
1347      if (value == null)
1348        this.stringency = null;
1349      else {
1350        if (this.stringency == null)
1351          this.stringency = new Enumeration<DataElementStringency>(new DataElementStringencyEnumFactory());
1352        this.stringency.setValue(value);
1353      }
1354      return this;
1355    }
1356
1357    /**
1358     * @return {@link #mapping} (Identifies a specification (other than a terminology) that the elements which make up the DataElement have some correspondence with.)
1359     */
1360    public List<DataElementMappingComponent> getMapping() { 
1361      if (this.mapping == null)
1362        this.mapping = new ArrayList<DataElementMappingComponent>();
1363      return this.mapping;
1364    }
1365
1366    /**
1367     * @return Returns a reference to <code>this</code> for easy method chaining
1368     */
1369    public DataElement setMapping(List<DataElementMappingComponent> theMapping) { 
1370      this.mapping = theMapping;
1371      return this;
1372    }
1373
1374    public boolean hasMapping() { 
1375      if (this.mapping == null)
1376        return false;
1377      for (DataElementMappingComponent item : this.mapping)
1378        if (!item.isEmpty())
1379          return true;
1380      return false;
1381    }
1382
1383    public DataElementMappingComponent addMapping() { //3
1384      DataElementMappingComponent t = new DataElementMappingComponent();
1385      if (this.mapping == null)
1386        this.mapping = new ArrayList<DataElementMappingComponent>();
1387      this.mapping.add(t);
1388      return t;
1389    }
1390
1391    public DataElement addMapping(DataElementMappingComponent t) { //3
1392      if (t == null)
1393        return this;
1394      if (this.mapping == null)
1395        this.mapping = new ArrayList<DataElementMappingComponent>();
1396      this.mapping.add(t);
1397      return this;
1398    }
1399
1400    /**
1401     * @return The first repetition of repeating field {@link #mapping}, creating it if it does not already exist
1402     */
1403    public DataElementMappingComponent getMappingFirstRep() { 
1404      if (getMapping().isEmpty()) {
1405        addMapping();
1406      }
1407      return getMapping().get(0);
1408    }
1409
1410    /**
1411     * @return {@link #element} (Defines the structure, type, allowed values and other constraining characteristics of the data element.)
1412     */
1413    public List<ElementDefinition> getElement() { 
1414      if (this.element == null)
1415        this.element = new ArrayList<ElementDefinition>();
1416      return this.element;
1417    }
1418
1419    /**
1420     * @return Returns a reference to <code>this</code> for easy method chaining
1421     */
1422    public DataElement setElement(List<ElementDefinition> theElement) { 
1423      this.element = theElement;
1424      return this;
1425    }
1426
1427    public boolean hasElement() { 
1428      if (this.element == null)
1429        return false;
1430      for (ElementDefinition item : this.element)
1431        if (!item.isEmpty())
1432          return true;
1433      return false;
1434    }
1435
1436    public ElementDefinition addElement() { //3
1437      ElementDefinition t = new ElementDefinition();
1438      if (this.element == null)
1439        this.element = new ArrayList<ElementDefinition>();
1440      this.element.add(t);
1441      return t;
1442    }
1443
1444    public DataElement addElement(ElementDefinition t) { //3
1445      if (t == null)
1446        return this;
1447      if (this.element == null)
1448        this.element = new ArrayList<ElementDefinition>();
1449      this.element.add(t);
1450      return this;
1451    }
1452
1453    /**
1454     * @return The first repetition of repeating field {@link #element}, creating it if it does not already exist
1455     */
1456    public ElementDefinition getElementFirstRep() { 
1457      if (getElement().isEmpty()) {
1458        addElement();
1459      }
1460      return getElement().get(0);
1461    }
1462
1463      protected void listChildren(List<Property> children) {
1464        super.listChildren(children);
1465        children.add(new Property("url", "uri", "An absolute URI that is used to identify this data element when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this data element is (or will be) published. The URL SHOULD include the major version of the data element. For more information see [Technical and Business Versions](resource.html#versions).", 0, 1, url));
1466        children.add(new Property("identifier", "Identifier", "A formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier));
1467        children.add(new Property("version", "string", "The identifier that is used to identify this version of the data element when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the data element author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.", 0, 1, version));
1468        children.add(new Property("status", "code", "The status of this data element. Enables tracking the life-cycle of the content.", 0, 1, status));
1469        children.add(new Property("experimental", "boolean", "A boolean value to indicate that this data element is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, 1, experimental));
1470        children.add(new Property("date", "dateTime", "The date  (and optionally time) when the data element was published. The date must change if and 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 data element changes.", 0, 1, date));
1471        children.add(new Property("publisher", "string", "The name of the individual or organization that published the data element.", 0, 1, publisher));
1472        children.add(new Property("name", "string", "A natural language name identifying the data element. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name));
1473        children.add(new Property("title", "string", "A short, descriptive, user-friendly title for the data element.", 0, 1, title));
1474        children.add(new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact));
1475        children.add(new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate data element instances.", 0, java.lang.Integer.MAX_VALUE, useContext));
1476        children.add(new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the data element is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction));
1477        children.add(new Property("copyright", "markdown", "A copyright statement relating to the data element and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the data element.", 0, 1, copyright));
1478        children.add(new Property("stringency", "code", "Identifies how precise the data element is in its definition.", 0, 1, stringency));
1479        children.add(new Property("mapping", "", "Identifies a specification (other than a terminology) that the elements which make up the DataElement have some correspondence with.", 0, java.lang.Integer.MAX_VALUE, mapping));
1480        children.add(new Property("element", "ElementDefinition", "Defines the structure, type, allowed values and other constraining characteristics of the data element.", 0, java.lang.Integer.MAX_VALUE, element));
1481      }
1482
1483      @Override
1484      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1485        switch (_hash) {
1486        case 116079: /*url*/  return new Property("url", "uri", "An absolute URI that is used to identify this data element when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this data element is (or will be) published. The URL SHOULD include the major version of the data element. For more information see [Technical and Business Versions](resource.html#versions).", 0, 1, url);
1487        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier);
1488        case 351608024: /*version*/  return new Property("version", "string", "The identifier that is used to identify this version of the data element when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the data element author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.", 0, 1, version);
1489        case -892481550: /*status*/  return new Property("status", "code", "The status of this data element. Enables tracking the life-cycle of the content.", 0, 1, status);
1490        case -404562712: /*experimental*/  return new Property("experimental", "boolean", "A boolean value to indicate that this data element is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, 1, experimental);
1491        case 3076014: /*date*/  return new Property("date", "dateTime", "The date  (and optionally time) when the data element was published. The date must change if and 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 data element changes.", 0, 1, date);
1492        case 1447404028: /*publisher*/  return new Property("publisher", "string", "The name of the individual or organization that published the data element.", 0, 1, publisher);
1493        case 3373707: /*name*/  return new Property("name", "string", "A natural language name identifying the data element. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name);
1494        case 110371416: /*title*/  return new Property("title", "string", "A short, descriptive, user-friendly title for the data element.", 0, 1, title);
1495        case 951526432: /*contact*/  return new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact);
1496        case -669707736: /*useContext*/  return new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate data element instances.", 0, java.lang.Integer.MAX_VALUE, useContext);
1497        case -507075711: /*jurisdiction*/  return new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the data element is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction);
1498        case 1522889671: /*copyright*/  return new Property("copyright", "markdown", "A copyright statement relating to the data element and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the data element.", 0, 1, copyright);
1499        case -1572568464: /*stringency*/  return new Property("stringency", "code", "Identifies how precise the data element is in its definition.", 0, 1, stringency);
1500        case 837556430: /*mapping*/  return new Property("mapping", "", "Identifies a specification (other than a terminology) that the elements which make up the DataElement have some correspondence with.", 0, java.lang.Integer.MAX_VALUE, mapping);
1501        case -1662836996: /*element*/  return new Property("element", "ElementDefinition", "Defines the structure, type, allowed values and other constraining characteristics of the data element.", 0, java.lang.Integer.MAX_VALUE, element);
1502        default: return super.getNamedProperty(_hash, _name, _checkValid);
1503        }
1504
1505      }
1506
1507      @Override
1508      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1509        switch (hash) {
1510        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
1511        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1512        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
1513        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
1514        case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType
1515        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
1516        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType
1517        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
1518        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
1519        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
1520        case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
1521        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept
1522        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
1523        case -1572568464: /*stringency*/ return this.stringency == null ? new Base[0] : new Base[] {this.stringency}; // Enumeration<DataElementStringency>
1524        case 837556430: /*mapping*/ return this.mapping == null ? new Base[0] : this.mapping.toArray(new Base[this.mapping.size()]); // DataElementMappingComponent
1525        case -1662836996: /*element*/ return this.element == null ? new Base[0] : this.element.toArray(new Base[this.element.size()]); // ElementDefinition
1526        default: return super.getProperty(hash, name, checkValid);
1527        }
1528
1529      }
1530
1531      @Override
1532      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1533        switch (hash) {
1534        case 116079: // url
1535          this.url = castToUri(value); // UriType
1536          return value;
1537        case -1618432855: // identifier
1538          this.getIdentifier().add(castToIdentifier(value)); // Identifier
1539          return value;
1540        case 351608024: // version
1541          this.version = castToString(value); // StringType
1542          return value;
1543        case -892481550: // status
1544          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
1545          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
1546          return value;
1547        case -404562712: // experimental
1548          this.experimental = castToBoolean(value); // BooleanType
1549          return value;
1550        case 3076014: // date
1551          this.date = castToDateTime(value); // DateTimeType
1552          return value;
1553        case 1447404028: // publisher
1554          this.publisher = castToString(value); // StringType
1555          return value;
1556        case 3373707: // name
1557          this.name = castToString(value); // StringType
1558          return value;
1559        case 110371416: // title
1560          this.title = castToString(value); // StringType
1561          return value;
1562        case 951526432: // contact
1563          this.getContact().add(castToContactDetail(value)); // ContactDetail
1564          return value;
1565        case -669707736: // useContext
1566          this.getUseContext().add(castToUsageContext(value)); // UsageContext
1567          return value;
1568        case -507075711: // jurisdiction
1569          this.getJurisdiction().add(castToCodeableConcept(value)); // CodeableConcept
1570          return value;
1571        case 1522889671: // copyright
1572          this.copyright = castToMarkdown(value); // MarkdownType
1573          return value;
1574        case -1572568464: // stringency
1575          value = new DataElementStringencyEnumFactory().fromType(castToCode(value));
1576          this.stringency = (Enumeration) value; // Enumeration<DataElementStringency>
1577          return value;
1578        case 837556430: // mapping
1579          this.getMapping().add((DataElementMappingComponent) value); // DataElementMappingComponent
1580          return value;
1581        case -1662836996: // element
1582          this.getElement().add(castToElementDefinition(value)); // ElementDefinition
1583          return value;
1584        default: return super.setProperty(hash, name, value);
1585        }
1586
1587      }
1588
1589      @Override
1590      public Base setProperty(String name, Base value) throws FHIRException {
1591        if (name.equals("url")) {
1592          this.url = castToUri(value); // UriType
1593        } else if (name.equals("identifier")) {
1594          this.getIdentifier().add(castToIdentifier(value));
1595        } else if (name.equals("version")) {
1596          this.version = castToString(value); // StringType
1597        } else if (name.equals("status")) {
1598          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
1599          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
1600        } else if (name.equals("experimental")) {
1601          this.experimental = castToBoolean(value); // BooleanType
1602        } else if (name.equals("date")) {
1603          this.date = castToDateTime(value); // DateTimeType
1604        } else if (name.equals("publisher")) {
1605          this.publisher = castToString(value); // StringType
1606        } else if (name.equals("name")) {
1607          this.name = castToString(value); // StringType
1608        } else if (name.equals("title")) {
1609          this.title = castToString(value); // StringType
1610        } else if (name.equals("contact")) {
1611          this.getContact().add(castToContactDetail(value));
1612        } else if (name.equals("useContext")) {
1613          this.getUseContext().add(castToUsageContext(value));
1614        } else if (name.equals("jurisdiction")) {
1615          this.getJurisdiction().add(castToCodeableConcept(value));
1616        } else if (name.equals("copyright")) {
1617          this.copyright = castToMarkdown(value); // MarkdownType
1618        } else if (name.equals("stringency")) {
1619          value = new DataElementStringencyEnumFactory().fromType(castToCode(value));
1620          this.stringency = (Enumeration) value; // Enumeration<DataElementStringency>
1621        } else if (name.equals("mapping")) {
1622          this.getMapping().add((DataElementMappingComponent) value);
1623        } else if (name.equals("element")) {
1624          this.getElement().add(castToElementDefinition(value));
1625        } else
1626          return super.setProperty(name, value);
1627        return value;
1628      }
1629
1630      @Override
1631      public Base makeProperty(int hash, String name) throws FHIRException {
1632        switch (hash) {
1633        case 116079:  return getUrlElement();
1634        case -1618432855:  return addIdentifier(); 
1635        case 351608024:  return getVersionElement();
1636        case -892481550:  return getStatusElement();
1637        case -404562712:  return getExperimentalElement();
1638        case 3076014:  return getDateElement();
1639        case 1447404028:  return getPublisherElement();
1640        case 3373707:  return getNameElement();
1641        case 110371416:  return getTitleElement();
1642        case 951526432:  return addContact(); 
1643        case -669707736:  return addUseContext(); 
1644        case -507075711:  return addJurisdiction(); 
1645        case 1522889671:  return getCopyrightElement();
1646        case -1572568464:  return getStringencyElement();
1647        case 837556430:  return addMapping(); 
1648        case -1662836996:  return addElement(); 
1649        default: return super.makeProperty(hash, name);
1650        }
1651
1652      }
1653
1654      @Override
1655      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1656        switch (hash) {
1657        case 116079: /*url*/ return new String[] {"uri"};
1658        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1659        case 351608024: /*version*/ return new String[] {"string"};
1660        case -892481550: /*status*/ return new String[] {"code"};
1661        case -404562712: /*experimental*/ return new String[] {"boolean"};
1662        case 3076014: /*date*/ return new String[] {"dateTime"};
1663        case 1447404028: /*publisher*/ return new String[] {"string"};
1664        case 3373707: /*name*/ return new String[] {"string"};
1665        case 110371416: /*title*/ return new String[] {"string"};
1666        case 951526432: /*contact*/ return new String[] {"ContactDetail"};
1667        case -669707736: /*useContext*/ return new String[] {"UsageContext"};
1668        case -507075711: /*jurisdiction*/ return new String[] {"CodeableConcept"};
1669        case 1522889671: /*copyright*/ return new String[] {"markdown"};
1670        case -1572568464: /*stringency*/ return new String[] {"code"};
1671        case 837556430: /*mapping*/ return new String[] {};
1672        case -1662836996: /*element*/ return new String[] {"ElementDefinition"};
1673        default: return super.getTypesForProperty(hash, name);
1674        }
1675
1676      }
1677
1678      @Override
1679      public Base addChild(String name) throws FHIRException {
1680        if (name.equals("url")) {
1681          throw new FHIRException("Cannot call addChild on a singleton property DataElement.url");
1682        }
1683        else if (name.equals("identifier")) {
1684          return addIdentifier();
1685        }
1686        else if (name.equals("version")) {
1687          throw new FHIRException("Cannot call addChild on a singleton property DataElement.version");
1688        }
1689        else if (name.equals("status")) {
1690          throw new FHIRException("Cannot call addChild on a singleton property DataElement.status");
1691        }
1692        else if (name.equals("experimental")) {
1693          throw new FHIRException("Cannot call addChild on a singleton property DataElement.experimental");
1694        }
1695        else if (name.equals("date")) {
1696          throw new FHIRException("Cannot call addChild on a singleton property DataElement.date");
1697        }
1698        else if (name.equals("publisher")) {
1699          throw new FHIRException("Cannot call addChild on a singleton property DataElement.publisher");
1700        }
1701        else if (name.equals("name")) {
1702          throw new FHIRException("Cannot call addChild on a singleton property DataElement.name");
1703        }
1704        else if (name.equals("title")) {
1705          throw new FHIRException("Cannot call addChild on a singleton property DataElement.title");
1706        }
1707        else if (name.equals("contact")) {
1708          return addContact();
1709        }
1710        else if (name.equals("useContext")) {
1711          return addUseContext();
1712        }
1713        else if (name.equals("jurisdiction")) {
1714          return addJurisdiction();
1715        }
1716        else if (name.equals("copyright")) {
1717          throw new FHIRException("Cannot call addChild on a singleton property DataElement.copyright");
1718        }
1719        else if (name.equals("stringency")) {
1720          throw new FHIRException("Cannot call addChild on a singleton property DataElement.stringency");
1721        }
1722        else if (name.equals("mapping")) {
1723          return addMapping();
1724        }
1725        else if (name.equals("element")) {
1726          return addElement();
1727        }
1728        else
1729          return super.addChild(name);
1730      }
1731
1732  public String fhirType() {
1733    return "DataElement";
1734
1735  }
1736
1737      public DataElement copy() {
1738        DataElement dst = new DataElement();
1739        copyValues(dst);
1740        dst.url = url == null ? null : url.copy();
1741        if (identifier != null) {
1742          dst.identifier = new ArrayList<Identifier>();
1743          for (Identifier i : identifier)
1744            dst.identifier.add(i.copy());
1745        };
1746        dst.version = version == null ? null : version.copy();
1747        dst.status = status == null ? null : status.copy();
1748        dst.experimental = experimental == null ? null : experimental.copy();
1749        dst.date = date == null ? null : date.copy();
1750        dst.publisher = publisher == null ? null : publisher.copy();
1751        dst.name = name == null ? null : name.copy();
1752        dst.title = title == null ? null : title.copy();
1753        if (contact != null) {
1754          dst.contact = new ArrayList<ContactDetail>();
1755          for (ContactDetail i : contact)
1756            dst.contact.add(i.copy());
1757        };
1758        if (useContext != null) {
1759          dst.useContext = new ArrayList<UsageContext>();
1760          for (UsageContext i : useContext)
1761            dst.useContext.add(i.copy());
1762        };
1763        if (jurisdiction != null) {
1764          dst.jurisdiction = new ArrayList<CodeableConcept>();
1765          for (CodeableConcept i : jurisdiction)
1766            dst.jurisdiction.add(i.copy());
1767        };
1768        dst.copyright = copyright == null ? null : copyright.copy();
1769        dst.stringency = stringency == null ? null : stringency.copy();
1770        if (mapping != null) {
1771          dst.mapping = new ArrayList<DataElementMappingComponent>();
1772          for (DataElementMappingComponent i : mapping)
1773            dst.mapping.add(i.copy());
1774        };
1775        if (element != null) {
1776          dst.element = new ArrayList<ElementDefinition>();
1777          for (ElementDefinition i : element)
1778            dst.element.add(i.copy());
1779        };
1780        return dst;
1781      }
1782
1783      protected DataElement typedCopy() {
1784        return copy();
1785      }
1786
1787      @Override
1788      public boolean equalsDeep(Base other_) {
1789        if (!super.equalsDeep(other_))
1790          return false;
1791        if (!(other_ instanceof DataElement))
1792          return false;
1793        DataElement o = (DataElement) other_;
1794        return compareDeep(identifier, o.identifier, true) && compareDeep(copyright, o.copyright, true)
1795           && compareDeep(stringency, o.stringency, true) && compareDeep(mapping, o.mapping, true) && compareDeep(element, o.element, true)
1796          ;
1797      }
1798
1799      @Override
1800      public boolean equalsShallow(Base other_) {
1801        if (!super.equalsShallow(other_))
1802          return false;
1803        if (!(other_ instanceof DataElement))
1804          return false;
1805        DataElement o = (DataElement) other_;
1806        return compareValues(copyright, o.copyright, true) && compareValues(stringency, o.stringency, true)
1807          ;
1808      }
1809
1810      public boolean isEmpty() {
1811        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, copyright, stringency
1812          , mapping, element);
1813      }
1814
1815  @Override
1816  public ResourceType getResourceType() {
1817    return ResourceType.DataElement;
1818   }
1819
1820 /**
1821   * Search parameter: <b>date</b>
1822   * <p>
1823   * Description: <b>The data element publication date</b><br>
1824   * Type: <b>date</b><br>
1825   * Path: <b>DataElement.date</b><br>
1826   * </p>
1827   */
1828  @SearchParamDefinition(name="date", path="DataElement.date", description="The data element publication date", type="date" )
1829  public static final String SP_DATE = "date";
1830 /**
1831   * <b>Fluent Client</b> search parameter constant for <b>date</b>
1832   * <p>
1833   * Description: <b>The data element publication date</b><br>
1834   * Type: <b>date</b><br>
1835   * Path: <b>DataElement.date</b><br>
1836   * </p>
1837   */
1838  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
1839
1840 /**
1841   * Search parameter: <b>identifier</b>
1842   * <p>
1843   * Description: <b>External identifier for the data element</b><br>
1844   * Type: <b>token</b><br>
1845   * Path: <b>DataElement.identifier</b><br>
1846   * </p>
1847   */
1848  @SearchParamDefinition(name="identifier", path="DataElement.identifier", description="External identifier for the data element", type="token" )
1849  public static final String SP_IDENTIFIER = "identifier";
1850 /**
1851   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
1852   * <p>
1853   * Description: <b>External identifier for the data element</b><br>
1854   * Type: <b>token</b><br>
1855   * Path: <b>DataElement.identifier</b><br>
1856   * </p>
1857   */
1858  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
1859
1860 /**
1861   * Search parameter: <b>code</b>
1862   * <p>
1863   * Description: <b>A code for the data element (server may choose to do subsumption)</b><br>
1864   * Type: <b>token</b><br>
1865   * Path: <b>DataElement.element.code</b><br>
1866   * </p>
1867   */
1868  @SearchParamDefinition(name="code", path="DataElement.element.code", description="A code for the data element (server may choose to do subsumption)", type="token" )
1869  public static final String SP_CODE = "code";
1870 /**
1871   * <b>Fluent Client</b> search parameter constant for <b>code</b>
1872   * <p>
1873   * Description: <b>A code for the data element (server may choose to do subsumption)</b><br>
1874   * Type: <b>token</b><br>
1875   * Path: <b>DataElement.element.code</b><br>
1876   * </p>
1877   */
1878  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
1879
1880 /**
1881   * Search parameter: <b>stringency</b>
1882   * <p>
1883   * Description: <b>The stringency of the data element definition</b><br>
1884   * Type: <b>token</b><br>
1885   * Path: <b>DataElement.stringency</b><br>
1886   * </p>
1887   */
1888  @SearchParamDefinition(name="stringency", path="DataElement.stringency", description="The stringency of the data element definition", type="token" )
1889  public static final String SP_STRINGENCY = "stringency";
1890 /**
1891   * <b>Fluent Client</b> search parameter constant for <b>stringency</b>
1892   * <p>
1893   * Description: <b>The stringency of the data element definition</b><br>
1894   * Type: <b>token</b><br>
1895   * Path: <b>DataElement.stringency</b><br>
1896   * </p>
1897   */
1898  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STRINGENCY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STRINGENCY);
1899
1900 /**
1901   * Search parameter: <b>jurisdiction</b>
1902   * <p>
1903   * Description: <b>Intended jurisdiction for the data element</b><br>
1904   * Type: <b>token</b><br>
1905   * Path: <b>DataElement.jurisdiction</b><br>
1906   * </p>
1907   */
1908  @SearchParamDefinition(name="jurisdiction", path="DataElement.jurisdiction", description="Intended jurisdiction for the data element", type="token" )
1909  public static final String SP_JURISDICTION = "jurisdiction";
1910 /**
1911   * <b>Fluent Client</b> search parameter constant for <b>jurisdiction</b>
1912   * <p>
1913   * Description: <b>Intended jurisdiction for the data element</b><br>
1914   * Type: <b>token</b><br>
1915   * Path: <b>DataElement.jurisdiction</b><br>
1916   * </p>
1917   */
1918  public static final ca.uhn.fhir.rest.gclient.TokenClientParam JURISDICTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_JURISDICTION);
1919
1920 /**
1921   * Search parameter: <b>name</b>
1922   * <p>
1923   * Description: <b>Computationally friendly name of the data element</b><br>
1924   * Type: <b>string</b><br>
1925   * Path: <b>DataElement.name</b><br>
1926   * </p>
1927   */
1928  @SearchParamDefinition(name="name", path="DataElement.name", description="Computationally friendly name of the data element", type="string" )
1929  public static final String SP_NAME = "name";
1930 /**
1931   * <b>Fluent Client</b> search parameter constant for <b>name</b>
1932   * <p>
1933   * Description: <b>Computationally friendly name of the data element</b><br>
1934   * Type: <b>string</b><br>
1935   * Path: <b>DataElement.name</b><br>
1936   * </p>
1937   */
1938  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
1939
1940 /**
1941   * Search parameter: <b>publisher</b>
1942   * <p>
1943   * Description: <b>Name of the publisher of the data element</b><br>
1944   * Type: <b>string</b><br>
1945   * Path: <b>DataElement.publisher</b><br>
1946   * </p>
1947   */
1948  @SearchParamDefinition(name="publisher", path="DataElement.publisher", description="Name of the publisher of the data element", type="string" )
1949  public static final String SP_PUBLISHER = "publisher";
1950 /**
1951   * <b>Fluent Client</b> search parameter constant for <b>publisher</b>
1952   * <p>
1953   * Description: <b>Name of the publisher of the data element</b><br>
1954   * Type: <b>string</b><br>
1955   * Path: <b>DataElement.publisher</b><br>
1956   * </p>
1957   */
1958  public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER);
1959
1960 /**
1961   * Search parameter: <b>description</b>
1962   * <p>
1963   * Description: <b>Text search in the description of the data element.  This corresponds to the definition of the first DataElement.element.</b><br>
1964   * Type: <b>string</b><br>
1965   * Path: <b>DataElement.element.definition</b><br>
1966   * </p>
1967   */
1968  @SearchParamDefinition(name="description", path="DataElement.element.definition", description="Text search in the description of the data element.  This corresponds to the definition of the first DataElement.element.", type="string" )
1969  public static final String SP_DESCRIPTION = "description";
1970 /**
1971   * <b>Fluent Client</b> search parameter constant for <b>description</b>
1972   * <p>
1973   * Description: <b>Text search in the description of the data element.  This corresponds to the definition of the first DataElement.element.</b><br>
1974   * Type: <b>string</b><br>
1975   * Path: <b>DataElement.element.definition</b><br>
1976   * </p>
1977   */
1978  public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION);
1979
1980 /**
1981   * Search parameter: <b>title</b>
1982   * <p>
1983   * Description: <b>The human-friendly name of the data element</b><br>
1984   * Type: <b>string</b><br>
1985   * Path: <b>DataElement.title</b><br>
1986   * </p>
1987   */
1988  @SearchParamDefinition(name="title", path="DataElement.title", description="The human-friendly name of the data element", type="string" )
1989  public static final String SP_TITLE = "title";
1990 /**
1991   * <b>Fluent Client</b> search parameter constant for <b>title</b>
1992   * <p>
1993   * Description: <b>The human-friendly name of the data element</b><br>
1994   * Type: <b>string</b><br>
1995   * Path: <b>DataElement.title</b><br>
1996   * </p>
1997   */
1998  public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE);
1999
2000 /**
2001   * Search parameter: <b>version</b>
2002   * <p>
2003   * Description: <b>The business version of the data element</b><br>
2004   * Type: <b>token</b><br>
2005   * Path: <b>DataElement.version</b><br>
2006   * </p>
2007   */
2008  @SearchParamDefinition(name="version", path="DataElement.version", description="The business version of the data element", type="token" )
2009  public static final String SP_VERSION = "version";
2010 /**
2011   * <b>Fluent Client</b> search parameter constant for <b>version</b>
2012   * <p>
2013   * Description: <b>The business version of the data element</b><br>
2014   * Type: <b>token</b><br>
2015   * Path: <b>DataElement.version</b><br>
2016   * </p>
2017   */
2018  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION);
2019
2020 /**
2021   * Search parameter: <b>url</b>
2022   * <p>
2023   * Description: <b>The uri that identifies the data element</b><br>
2024   * Type: <b>uri</b><br>
2025   * Path: <b>DataElement.url</b><br>
2026   * </p>
2027   */
2028  @SearchParamDefinition(name="url", path="DataElement.url", description="The uri that identifies the data element", type="uri" )
2029  public static final String SP_URL = "url";
2030 /**
2031   * <b>Fluent Client</b> search parameter constant for <b>url</b>
2032   * <p>
2033   * Description: <b>The uri that identifies the data element</b><br>
2034   * Type: <b>uri</b><br>
2035   * Path: <b>DataElement.url</b><br>
2036   * </p>
2037   */
2038  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
2039
2040 /**
2041   * Search parameter: <b>status</b>
2042   * <p>
2043   * Description: <b>The current status of the data element</b><br>
2044   * Type: <b>token</b><br>
2045   * Path: <b>DataElement.status</b><br>
2046   * </p>
2047   */
2048  @SearchParamDefinition(name="status", path="DataElement.status", description="The current status of the data element", type="token" )
2049  public static final String SP_STATUS = "status";
2050 /**
2051   * <b>Fluent Client</b> search parameter constant for <b>status</b>
2052   * <p>
2053   * Description: <b>The current status of the data element</b><br>
2054   * Type: <b>token</b><br>
2055   * Path: <b>DataElement.status</b><br>
2056   * </p>
2057   */
2058  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
2059
2060
2061}