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