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