001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017package ca.uhn.fhir.model.dstu2.composite; 018 019import java.net.URI; 020import java.math.BigDecimal; 021import org.apache.commons.lang3.StringUtils; 022import java.util.*; 023import ca.uhn.fhir.model.api.*; 024import ca.uhn.fhir.model.primitive.*; 025import ca.uhn.fhir.model.api.annotation.*; 026import ca.uhn.fhir.model.base.composite.*; 027 028import ca.uhn.fhir.model.dstu2.valueset.AddressTypeEnum; 029import ca.uhn.fhir.model.dstu2.valueset.AddressUseEnum; 030import ca.uhn.fhir.model.dstu2.valueset.AggregationModeEnum; 031import ca.uhn.fhir.model.dstu2.valueset.BindingStrengthEnum; 032import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; 033import ca.uhn.fhir.model.dstu2.composite.CodingDt; 034import ca.uhn.fhir.model.dstu2.valueset.ConstraintSeverityEnum; 035import ca.uhn.fhir.model.dstu2.valueset.ContactPointSystemEnum; 036import ca.uhn.fhir.model.dstu2.valueset.ContactPointUseEnum; 037import ca.uhn.fhir.model.dstu2.resource.Device; 038import ca.uhn.fhir.model.dstu2.valueset.EventTimingEnum; 039import ca.uhn.fhir.model.dstu2.valueset.IdentifierTypeCodesEnum; 040import ca.uhn.fhir.model.dstu2.valueset.IdentifierUseEnum; 041import ca.uhn.fhir.model.dstu2.valueset.NameUseEnum; 042import ca.uhn.fhir.model.dstu2.resource.Organization; 043import ca.uhn.fhir.model.dstu2.resource.Patient; 044import ca.uhn.fhir.model.dstu2.composite.PeriodDt; 045import ca.uhn.fhir.model.dstu2.resource.Practitioner; 046import ca.uhn.fhir.model.dstu2.valueset.PropertyRepresentationEnum; 047import ca.uhn.fhir.model.dstu2.valueset.QuantityComparatorEnum; 048import ca.uhn.fhir.model.dstu2.composite.QuantityDt; 049import ca.uhn.fhir.model.dstu2.composite.RangeDt; 050import ca.uhn.fhir.model.dstu2.resource.RelatedPerson; 051import ca.uhn.fhir.model.dstu2.valueset.SignatureTypeCodesEnum; 052import ca.uhn.fhir.model.dstu2.valueset.SlicingRulesEnum; 053import ca.uhn.fhir.model.api.TemporalPrecisionEnum; 054import ca.uhn.fhir.model.dstu2.valueset.TimingAbbreviationEnum; 055import ca.uhn.fhir.model.dstu2.valueset.UnitsOfTimeEnum; 056import ca.uhn.fhir.model.dstu2.resource.ValueSet; 057import ca.uhn.fhir.model.dstu2.composite.BoundCodeableConceptDt; 058import ca.uhn.fhir.model.dstu2.composite.DurationDt; 059import ca.uhn.fhir.model.dstu2.composite.ResourceReferenceDt; 060import ca.uhn.fhir.model.dstu2.composite.SimpleQuantityDt; 061import ca.uhn.fhir.model.primitive.Base64BinaryDt; 062import ca.uhn.fhir.model.primitive.BooleanDt; 063import ca.uhn.fhir.model.primitive.BoundCodeDt; 064import ca.uhn.fhir.model.primitive.CodeDt; 065import ca.uhn.fhir.model.primitive.DateTimeDt; 066import ca.uhn.fhir.model.primitive.DecimalDt; 067import ca.uhn.fhir.model.primitive.IdDt; 068import ca.uhn.fhir.model.primitive.InstantDt; 069import ca.uhn.fhir.model.primitive.IntegerDt; 070import ca.uhn.fhir.model.primitive.MarkdownDt; 071import ca.uhn.fhir.model.primitive.PositiveIntDt; 072import ca.uhn.fhir.model.primitive.StringDt; 073import ca.uhn.fhir.model.primitive.UnsignedIntDt; 074import ca.uhn.fhir.model.primitive.UriDt; 075 076/** 077 * HAPI/FHIR <b>AddressDt</b> Datatype 078 * () 079 * 080 * <p> 081 * <b>Definition:</b> 082 * There is a variety of postal address formats defined around the world. This format defines a superset that is the basis for all addresses around the world 083 * </p> 084 * 085 * <p> 086 * <b>Requirements:</b> 087 * Need to be able to record postal addresses, along with notes about their use 088 * </p> 089 */ 090@DatatypeDef(name="Address") 091public class AddressDt 092 extends BaseIdentifiableElement implements ICompositeDatatype{ 093 094 /** 095 * Constructor 096 */ 097 public AddressDt() { 098 // nothing 099 } 100 101 102 @Child(name="use", type=CodeDt.class, order=0, min=0, max=1, summary=true, modifier=true) 103 @Description( 104 shortDefinition="", 105 formalDefinition="The purpose of this address" 106 ) 107 @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/address-use") 108 private BoundCodeDt<AddressUseEnum> myUse; 109 110 @Child(name="type", type=CodeDt.class, order=1, min=0, max=1, summary=true, modifier=false) 111 @Description( 112 shortDefinition="", 113 formalDefinition="Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both" 114 ) 115 @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/address-type") 116 private BoundCodeDt<AddressTypeEnum> myType; 117 118 @Child(name="text", type=StringDt.class, order=2, min=0, max=1, summary=true, modifier=false) 119 @Description( 120 shortDefinition="", 121 formalDefinition="A full text representation of the address" 122 ) 123 private StringDt myText; 124 125 @Child(name="line", type=StringDt.class, order=3, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false) 126 @Description( 127 shortDefinition="", 128 formalDefinition="This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information" 129 ) 130 private java.util.List<StringDt> myLine; 131 132 @Child(name="city", type=StringDt.class, order=4, min=0, max=1, summary=true, modifier=false) 133 @Description( 134 shortDefinition="", 135 formalDefinition="The name of the city, town, village or other community or delivery center" 136 ) 137 private StringDt myCity; 138 139 @Child(name="district", type=StringDt.class, order=5, min=0, max=1, summary=true, modifier=false) 140 @Description( 141 shortDefinition="", 142 formalDefinition="The name of the administrative area (county)" 143 ) 144 private StringDt myDistrict; 145 146 @Child(name="state", type=StringDt.class, order=6, min=0, max=1, summary=true, modifier=false) 147 @Description( 148 shortDefinition="", 149 formalDefinition="Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes)" 150 ) 151 private StringDt myState; 152 153 @Child(name="postalCode", type=StringDt.class, order=7, min=0, max=1, summary=true, modifier=false) 154 @Description( 155 shortDefinition="", 156 formalDefinition="A postal code designating a region defined by the postal service" 157 ) 158 private StringDt myPostalCode; 159 160 @Child(name="country", type=StringDt.class, order=8, min=0, max=1, summary=true, modifier=false) 161 @Description( 162 shortDefinition="", 163 formalDefinition="Country - a nation as commonly understood or generally accepted" 164 ) 165 private StringDt myCountry; 166 167 @Child(name="period", type=PeriodDt.class, order=9, min=0, max=1, summary=true, modifier=false) 168 @Description( 169 shortDefinition="", 170 formalDefinition="Time period when address was/is in use" 171 ) 172 private PeriodDt myPeriod; 173 174 175 @Override 176 public boolean isEmpty() { 177 return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myUse, myType, myText, myLine, myCity, myDistrict, myState, myPostalCode, myCountry, myPeriod); 178 } 179 180 @Override 181 public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) { 182 return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myUse, myType, myText, myLine, myCity, myDistrict, myState, myPostalCode, myCountry, myPeriod); 183 } 184 185 /** 186 * Gets the value(s) for <b>use</b> (). 187 * creating it if it does 188 * not exist. Will not return <code>null</code>. 189 * 190 * <p> 191 * <b>Definition:</b> 192 * The purpose of this address 193 * </p> 194 */ 195 public BoundCodeDt<AddressUseEnum> getUseElement() { 196 if (myUse == null) { 197 myUse = new BoundCodeDt<AddressUseEnum>(AddressUseEnum.VALUESET_BINDER); 198 } 199 return myUse; 200 } 201 202 203 /** 204 * Gets the value(s) for <b>use</b> (). 205 * creating it if it does 206 * not exist. This method may return <code>null</code>. 207 * 208 * <p> 209 * <b>Definition:</b> 210 * The purpose of this address 211 * </p> 212 */ 213 public String getUse() { 214 return getUseElement().getValue(); 215 } 216 217 /** 218 * Sets the value(s) for <b>use</b> () 219 * 220 * <p> 221 * <b>Definition:</b> 222 * The purpose of this address 223 * </p> 224 */ 225 public AddressDt setUse(BoundCodeDt<AddressUseEnum> theValue) { 226 myUse = theValue; 227 return this; 228 } 229 230 231 232 /** 233 * Sets the value(s) for <b>use</b> () 234 * 235 * <p> 236 * <b>Definition:</b> 237 * The purpose of this address 238 * </p> 239 */ 240 public AddressDt setUse(AddressUseEnum theValue) { 241 setUse(new BoundCodeDt<AddressUseEnum>(AddressUseEnum.VALUESET_BINDER, theValue)); 242 243/* 244 getUseElement().setValueAsEnum(theValue); 245*/ 246 return this; 247 } 248 249 250 /** 251 * Gets the value(s) for <b>type</b> (). 252 * creating it if it does 253 * not exist. Will not return <code>null</code>. 254 * 255 * <p> 256 * <b>Definition:</b> 257 * Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both 258 * </p> 259 */ 260 public BoundCodeDt<AddressTypeEnum> getTypeElement() { 261 if (myType == null) { 262 myType = new BoundCodeDt<AddressTypeEnum>(AddressTypeEnum.VALUESET_BINDER); 263 } 264 return myType; 265 } 266 267 268 /** 269 * Gets the value(s) for <b>type</b> (). 270 * creating it if it does 271 * not exist. This method may return <code>null</code>. 272 * 273 * <p> 274 * <b>Definition:</b> 275 * Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both 276 * </p> 277 */ 278 public String getType() { 279 return getTypeElement().getValue(); 280 } 281 282 /** 283 * Sets the value(s) for <b>type</b> () 284 * 285 * <p> 286 * <b>Definition:</b> 287 * Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both 288 * </p> 289 */ 290 public AddressDt setType(BoundCodeDt<AddressTypeEnum> theValue) { 291 myType = theValue; 292 return this; 293 } 294 295 296 297 /** 298 * Sets the value(s) for <b>type</b> () 299 * 300 * <p> 301 * <b>Definition:</b> 302 * Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both 303 * </p> 304 */ 305 public AddressDt setType(AddressTypeEnum theValue) { 306 setType(new BoundCodeDt<AddressTypeEnum>(AddressTypeEnum.VALUESET_BINDER, theValue)); 307 308/* 309 getTypeElement().setValueAsEnum(theValue); 310*/ 311 return this; 312 } 313 314 315 /** 316 * Gets the value(s) for <b>text</b> (). 317 * creating it if it does 318 * not exist. Will not return <code>null</code>. 319 * 320 * <p> 321 * <b>Definition:</b> 322 * A full text representation of the address 323 * </p> 324 */ 325 public StringDt getTextElement() { 326 if (myText == null) { 327 myText = new StringDt(); 328 } 329 return myText; 330 } 331 332 333 /** 334 * Gets the value(s) for <b>text</b> (). 335 * creating it if it does 336 * not exist. This method may return <code>null</code>. 337 * 338 * <p> 339 * <b>Definition:</b> 340 * A full text representation of the address 341 * </p> 342 */ 343 public String getText() { 344 return getTextElement().getValue(); 345 } 346 347 /** 348 * Sets the value(s) for <b>text</b> () 349 * 350 * <p> 351 * <b>Definition:</b> 352 * A full text representation of the address 353 * </p> 354 */ 355 public AddressDt setText(StringDt theValue) { 356 myText = theValue; 357 return this; 358 } 359 360 361 362 /** 363 * Sets the value for <b>text</b> () 364 * 365 * <p> 366 * <b>Definition:</b> 367 * A full text representation of the address 368 * </p> 369 */ 370 public AddressDt setText( String theString) { 371 myText = new StringDt(theString); 372 return this; 373 } 374 375 376 /** 377 * Gets the value(s) for <b>line</b> (). 378 * creating it if it does 379 * not exist. Will not return <code>null</code>. 380 * 381 * <p> 382 * <b>Definition:</b> 383 * This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information 384 * </p> 385 */ 386 public java.util.List<StringDt> getLine() { 387 if (myLine == null) { 388 myLine = new java.util.ArrayList<StringDt>(); 389 } 390 return myLine; 391 } 392 393 /** 394 * Sets the value(s) for <b>line</b> () 395 * 396 * <p> 397 * <b>Definition:</b> 398 * This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information 399 * </p> 400 */ 401 public AddressDt setLine(java.util.List<StringDt> theValue) { 402 myLine = theValue; 403 return this; 404 } 405 406 407 408 /** 409 * Adds and returns a new value for <b>line</b> () 410 * 411 * <p> 412 * <b>Definition:</b> 413 * This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information 414 * </p> 415 */ 416 public StringDt addLine() { 417 StringDt newType = new StringDt(); 418 getLine().add(newType); 419 return newType; 420 } 421 422 /** 423 * Adds a given new value for <b>line</b> () 424 * 425 * <p> 426 * <b>Definition:</b> 427 * This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information 428 * </p> 429 * @param theValue The line to add (must not be <code>null</code>) 430 */ 431 public AddressDt addLine(StringDt theValue) { 432 if (theValue == null) { 433 throw new NullPointerException("theValue must not be null"); 434 } 435 getLine().add(theValue); 436 return this; 437 } 438 439 /** 440 * Gets the first repetition for <b>line</b> (), 441 * creating it if it does not already exist. 442 * 443 * <p> 444 * <b>Definition:</b> 445 * This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information 446 * </p> 447 */ 448 public StringDt getLineFirstRep() { 449 if (getLine().isEmpty()) { 450 return addLine(); 451 } 452 return getLine().get(0); 453 } 454 /** 455 * Adds a new value for <b>line</b> () 456 * 457 * <p> 458 * <b>Definition:</b> 459 * This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information 460 * </p> 461 * 462 * @return Returns a reference to this object, to allow for simple chaining. 463 */ 464 public AddressDt addLine( String theString) { 465 if (myLine == null) { 466 myLine = new java.util.ArrayList<StringDt>(); 467 } 468 myLine.add(new StringDt(theString)); 469 return this; 470 } 471 472 473 /** 474 * Gets the value(s) for <b>city</b> (). 475 * creating it if it does 476 * not exist. Will not return <code>null</code>. 477 * 478 * <p> 479 * <b>Definition:</b> 480 * The name of the city, town, village or other community or delivery center 481 * </p> 482 */ 483 public StringDt getCityElement() { 484 if (myCity == null) { 485 myCity = new StringDt(); 486 } 487 return myCity; 488 } 489 490 491 /** 492 * Gets the value(s) for <b>city</b> (). 493 * creating it if it does 494 * not exist. This method may return <code>null</code>. 495 * 496 * <p> 497 * <b>Definition:</b> 498 * The name of the city, town, village or other community or delivery center 499 * </p> 500 */ 501 public String getCity() { 502 return getCityElement().getValue(); 503 } 504 505 /** 506 * Sets the value(s) for <b>city</b> () 507 * 508 * <p> 509 * <b>Definition:</b> 510 * The name of the city, town, village or other community or delivery center 511 * </p> 512 */ 513 public AddressDt setCity(StringDt theValue) { 514 myCity = theValue; 515 return this; 516 } 517 518 519 520 /** 521 * Sets the value for <b>city</b> () 522 * 523 * <p> 524 * <b>Definition:</b> 525 * The name of the city, town, village or other community or delivery center 526 * </p> 527 */ 528 public AddressDt setCity( String theString) { 529 myCity = new StringDt(theString); 530 return this; 531 } 532 533 534 /** 535 * Gets the value(s) for <b>district</b> (). 536 * creating it if it does 537 * not exist. Will not return <code>null</code>. 538 * 539 * <p> 540 * <b>Definition:</b> 541 * The name of the administrative area (county) 542 * </p> 543 */ 544 public StringDt getDistrictElement() { 545 if (myDistrict == null) { 546 myDistrict = new StringDt(); 547 } 548 return myDistrict; 549 } 550 551 552 /** 553 * Gets the value(s) for <b>district</b> (). 554 * creating it if it does 555 * not exist. This method may return <code>null</code>. 556 * 557 * <p> 558 * <b>Definition:</b> 559 * The name of the administrative area (county) 560 * </p> 561 */ 562 public String getDistrict() { 563 return getDistrictElement().getValue(); 564 } 565 566 /** 567 * Sets the value(s) for <b>district</b> () 568 * 569 * <p> 570 * <b>Definition:</b> 571 * The name of the administrative area (county) 572 * </p> 573 */ 574 public AddressDt setDistrict(StringDt theValue) { 575 myDistrict = theValue; 576 return this; 577 } 578 579 580 581 /** 582 * Sets the value for <b>district</b> () 583 * 584 * <p> 585 * <b>Definition:</b> 586 * The name of the administrative area (county) 587 * </p> 588 */ 589 public AddressDt setDistrict( String theString) { 590 myDistrict = new StringDt(theString); 591 return this; 592 } 593 594 595 /** 596 * Gets the value(s) for <b>state</b> (). 597 * creating it if it does 598 * not exist. Will not return <code>null</code>. 599 * 600 * <p> 601 * <b>Definition:</b> 602 * Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes) 603 * </p> 604 */ 605 public StringDt getStateElement() { 606 if (myState == null) { 607 myState = new StringDt(); 608 } 609 return myState; 610 } 611 612 613 /** 614 * Gets the value(s) for <b>state</b> (). 615 * creating it if it does 616 * not exist. This method may return <code>null</code>. 617 * 618 * <p> 619 * <b>Definition:</b> 620 * Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes) 621 * </p> 622 */ 623 public String getState() { 624 return getStateElement().getValue(); 625 } 626 627 /** 628 * Sets the value(s) for <b>state</b> () 629 * 630 * <p> 631 * <b>Definition:</b> 632 * Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes) 633 * </p> 634 */ 635 public AddressDt setState(StringDt theValue) { 636 myState = theValue; 637 return this; 638 } 639 640 641 642 /** 643 * Sets the value for <b>state</b> () 644 * 645 * <p> 646 * <b>Definition:</b> 647 * Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes) 648 * </p> 649 */ 650 public AddressDt setState( String theString) { 651 myState = new StringDt(theString); 652 return this; 653 } 654 655 656 /** 657 * Gets the value(s) for <b>postalCode</b> (). 658 * creating it if it does 659 * not exist. Will not return <code>null</code>. 660 * 661 * <p> 662 * <b>Definition:</b> 663 * A postal code designating a region defined by the postal service 664 * </p> 665 */ 666 public StringDt getPostalCodeElement() { 667 if (myPostalCode == null) { 668 myPostalCode = new StringDt(); 669 } 670 return myPostalCode; 671 } 672 673 674 /** 675 * Gets the value(s) for <b>postalCode</b> (). 676 * creating it if it does 677 * not exist. This method may return <code>null</code>. 678 * 679 * <p> 680 * <b>Definition:</b> 681 * A postal code designating a region defined by the postal service 682 * </p> 683 */ 684 public String getPostalCode() { 685 return getPostalCodeElement().getValue(); 686 } 687 688 /** 689 * Sets the value(s) for <b>postalCode</b> () 690 * 691 * <p> 692 * <b>Definition:</b> 693 * A postal code designating a region defined by the postal service 694 * </p> 695 */ 696 public AddressDt setPostalCode(StringDt theValue) { 697 myPostalCode = theValue; 698 return this; 699 } 700 701 702 703 /** 704 * Sets the value for <b>postalCode</b> () 705 * 706 * <p> 707 * <b>Definition:</b> 708 * A postal code designating a region defined by the postal service 709 * </p> 710 */ 711 public AddressDt setPostalCode( String theString) { 712 myPostalCode = new StringDt(theString); 713 return this; 714 } 715 716 717 /** 718 * Gets the value(s) for <b>country</b> (). 719 * creating it if it does 720 * not exist. Will not return <code>null</code>. 721 * 722 * <p> 723 * <b>Definition:</b> 724 * Country - a nation as commonly understood or generally accepted 725 * </p> 726 */ 727 public StringDt getCountryElement() { 728 if (myCountry == null) { 729 myCountry = new StringDt(); 730 } 731 return myCountry; 732 } 733 734 735 /** 736 * Gets the value(s) for <b>country</b> (). 737 * creating it if it does 738 * not exist. This method may return <code>null</code>. 739 * 740 * <p> 741 * <b>Definition:</b> 742 * Country - a nation as commonly understood or generally accepted 743 * </p> 744 */ 745 public String getCountry() { 746 return getCountryElement().getValue(); 747 } 748 749 /** 750 * Sets the value(s) for <b>country</b> () 751 * 752 * <p> 753 * <b>Definition:</b> 754 * Country - a nation as commonly understood or generally accepted 755 * </p> 756 */ 757 public AddressDt setCountry(StringDt theValue) { 758 myCountry = theValue; 759 return this; 760 } 761 762 763 764 /** 765 * Sets the value for <b>country</b> () 766 * 767 * <p> 768 * <b>Definition:</b> 769 * Country - a nation as commonly understood or generally accepted 770 * </p> 771 */ 772 public AddressDt setCountry( String theString) { 773 myCountry = new StringDt(theString); 774 return this; 775 } 776 777 778 /** 779 * Gets the value(s) for <b>period</b> (). 780 * creating it if it does 781 * not exist. Will not return <code>null</code>. 782 * 783 * <p> 784 * <b>Definition:</b> 785 * Time period when address was/is in use 786 * </p> 787 */ 788 public PeriodDt getPeriod() { 789 if (myPeriod == null) { 790 myPeriod = new PeriodDt(); 791 } 792 return myPeriod; 793 } 794 795 /** 796 * Sets the value(s) for <b>period</b> () 797 * 798 * <p> 799 * <b>Definition:</b> 800 * Time period when address was/is in use 801 * </p> 802 */ 803 public AddressDt setPeriod(PeriodDt theValue) { 804 myPeriod = theValue; 805 return this; 806 } 807 808 809 810 811 812 813}