001package org.hl7.fhir.dstu3.model;
002
003
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034// Generated on Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.x
035import java.util.ArrayList;
036import java.util.Date;
037import java.util.List;
038
039import org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender;
040import org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGenderEnumFactory;
041import org.hl7.fhir.exceptions.FHIRException;
042import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
043
044import ca.uhn.fhir.model.api.annotation.Block;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.Description;
047import ca.uhn.fhir.model.api.annotation.ResourceDef;
048import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
049/**
050 * Demographics and administrative information about a person independent of a specific health-related context.
051 */
052@ResourceDef(name="Person", profile="http://hl7.org/fhir/Profile/Person")
053public class Person extends DomainResource {
054
055    public enum IdentityAssuranceLevel {
056        /**
057         * Little or no confidence in the asserted identity's accuracy.
058         */
059        LEVEL1, 
060        /**
061         * Some confidence in the asserted identity's accuracy.
062         */
063        LEVEL2, 
064        /**
065         * High confidence in the asserted identity's accuracy.
066         */
067        LEVEL3, 
068        /**
069         * Very high confidence in the asserted identity's accuracy.
070         */
071        LEVEL4, 
072        /**
073         * added to help the parsers with the generic types
074         */
075        NULL;
076        public static IdentityAssuranceLevel fromCode(String codeString) throws FHIRException {
077            if (codeString == null || "".equals(codeString))
078                return null;
079        if ("level1".equals(codeString))
080          return LEVEL1;
081        if ("level2".equals(codeString))
082          return LEVEL2;
083        if ("level3".equals(codeString))
084          return LEVEL3;
085        if ("level4".equals(codeString))
086          return LEVEL4;
087        if (Configuration.isAcceptInvalidEnums())
088          return null;
089        else
090          throw new FHIRException("Unknown IdentityAssuranceLevel code '"+codeString+"'");
091        }
092        public String toCode() {
093          switch (this) {
094            case LEVEL1: return "level1";
095            case LEVEL2: return "level2";
096            case LEVEL3: return "level3";
097            case LEVEL4: return "level4";
098            case NULL: return null;
099            default: return "?";
100          }
101        }
102        public String getSystem() {
103          switch (this) {
104            case LEVEL1: return "http://hl7.org/fhir/identity-assuranceLevel";
105            case LEVEL2: return "http://hl7.org/fhir/identity-assuranceLevel";
106            case LEVEL3: return "http://hl7.org/fhir/identity-assuranceLevel";
107            case LEVEL4: return "http://hl7.org/fhir/identity-assuranceLevel";
108            case NULL: return null;
109            default: return "?";
110          }
111        }
112        public String getDefinition() {
113          switch (this) {
114            case LEVEL1: return "Little or no confidence in the asserted identity's accuracy.";
115            case LEVEL2: return "Some confidence in the asserted identity's accuracy.";
116            case LEVEL3: return "High confidence in the asserted identity's accuracy.";
117            case LEVEL4: return "Very high confidence in the asserted identity's accuracy.";
118            case NULL: return null;
119            default: return "?";
120          }
121        }
122        public String getDisplay() {
123          switch (this) {
124            case LEVEL1: return "Level 1";
125            case LEVEL2: return "Level 2";
126            case LEVEL3: return "Level 3";
127            case LEVEL4: return "Level 4";
128            case NULL: return null;
129            default: return "?";
130          }
131        }
132    }
133
134  public static class IdentityAssuranceLevelEnumFactory implements EnumFactory<IdentityAssuranceLevel> {
135    public IdentityAssuranceLevel fromCode(String codeString) throws IllegalArgumentException {
136      if (codeString == null || "".equals(codeString))
137            if (codeString == null || "".equals(codeString))
138                return null;
139        if ("level1".equals(codeString))
140          return IdentityAssuranceLevel.LEVEL1;
141        if ("level2".equals(codeString))
142          return IdentityAssuranceLevel.LEVEL2;
143        if ("level3".equals(codeString))
144          return IdentityAssuranceLevel.LEVEL3;
145        if ("level4".equals(codeString))
146          return IdentityAssuranceLevel.LEVEL4;
147        throw new IllegalArgumentException("Unknown IdentityAssuranceLevel code '"+codeString+"'");
148        }
149        public Enumeration<IdentityAssuranceLevel> fromType(Base code) throws FHIRException {
150          if (code == null)
151            return null;
152          if (code.isEmpty())
153            return new Enumeration<IdentityAssuranceLevel>(this);
154          String codeString = ((PrimitiveType) code).asStringValue();
155          if (codeString == null || "".equals(codeString))
156            return null;
157        if ("level1".equals(codeString))
158          return new Enumeration<IdentityAssuranceLevel>(this, IdentityAssuranceLevel.LEVEL1);
159        if ("level2".equals(codeString))
160          return new Enumeration<IdentityAssuranceLevel>(this, IdentityAssuranceLevel.LEVEL2);
161        if ("level3".equals(codeString))
162          return new Enumeration<IdentityAssuranceLevel>(this, IdentityAssuranceLevel.LEVEL3);
163        if ("level4".equals(codeString))
164          return new Enumeration<IdentityAssuranceLevel>(this, IdentityAssuranceLevel.LEVEL4);
165        throw new FHIRException("Unknown IdentityAssuranceLevel code '"+codeString+"'");
166        }
167    public String toCode(IdentityAssuranceLevel code) {
168      if (code == IdentityAssuranceLevel.LEVEL1)
169        return "level1";
170      if (code == IdentityAssuranceLevel.LEVEL2)
171        return "level2";
172      if (code == IdentityAssuranceLevel.LEVEL3)
173        return "level3";
174      if (code == IdentityAssuranceLevel.LEVEL4)
175        return "level4";
176      return "?";
177      }
178    public String toSystem(IdentityAssuranceLevel code) {
179      return code.getSystem();
180      }
181    }
182
183    @Block()
184    public static class PersonLinkComponent extends BackboneElement implements IBaseBackboneElement {
185        /**
186         * The resource to which this actual person is associated.
187         */
188        @Child(name = "target", type = {Patient.class, Practitioner.class, RelatedPerson.class, Person.class}, order=1, min=1, max=1, modifier=false, summary=false)
189        @Description(shortDefinition="The resource to which this actual person is associated", formalDefinition="The resource to which this actual person is associated." )
190        protected Reference target;
191
192        /**
193         * The actual object that is the target of the reference (The resource to which this actual person is associated.)
194         */
195        protected Resource targetTarget;
196
197        /**
198         * Level of assurance that this link is actually associated with the target resource.
199         */
200        @Child(name = "assurance", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=false)
201        @Description(shortDefinition="level1 | level2 | level3 | level4", formalDefinition="Level of assurance that this link is actually associated with the target resource." )
202        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/identity-assuranceLevel")
203        protected Enumeration<IdentityAssuranceLevel> assurance;
204
205        private static final long serialVersionUID = 508763647L;
206
207    /**
208     * Constructor
209     */
210      public PersonLinkComponent() {
211        super();
212      }
213
214    /**
215     * Constructor
216     */
217      public PersonLinkComponent(Reference target) {
218        super();
219        this.target = target;
220      }
221
222        /**
223         * @return {@link #target} (The resource to which this actual person is associated.)
224         */
225        public Reference getTarget() { 
226          if (this.target == null)
227            if (Configuration.errorOnAutoCreate())
228              throw new Error("Attempt to auto-create PersonLinkComponent.target");
229            else if (Configuration.doAutoCreate())
230              this.target = new Reference(); // cc
231          return this.target;
232        }
233
234        public boolean hasTarget() { 
235          return this.target != null && !this.target.isEmpty();
236        }
237
238        /**
239         * @param value {@link #target} (The resource to which this actual person is associated.)
240         */
241        public PersonLinkComponent setTarget(Reference value)  { 
242          this.target = value;
243          return this;
244        }
245
246        /**
247         * @return {@link #target} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The resource to which this actual person is associated.)
248         */
249        public Resource getTargetTarget() { 
250          return this.targetTarget;
251        }
252
253        /**
254         * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The resource to which this actual person is associated.)
255         */
256        public PersonLinkComponent setTargetTarget(Resource value) { 
257          this.targetTarget = value;
258          return this;
259        }
260
261        /**
262         * @return {@link #assurance} (Level of assurance that this link is actually associated with the target resource.). This is the underlying object with id, value and extensions. The accessor "getAssurance" gives direct access to the value
263         */
264        public Enumeration<IdentityAssuranceLevel> getAssuranceElement() { 
265          if (this.assurance == null)
266            if (Configuration.errorOnAutoCreate())
267              throw new Error("Attempt to auto-create PersonLinkComponent.assurance");
268            else if (Configuration.doAutoCreate())
269              this.assurance = new Enumeration<IdentityAssuranceLevel>(new IdentityAssuranceLevelEnumFactory()); // bb
270          return this.assurance;
271        }
272
273        public boolean hasAssuranceElement() { 
274          return this.assurance != null && !this.assurance.isEmpty();
275        }
276
277        public boolean hasAssurance() { 
278          return this.assurance != null && !this.assurance.isEmpty();
279        }
280
281        /**
282         * @param value {@link #assurance} (Level of assurance that this link is actually associated with the target resource.). This is the underlying object with id, value and extensions. The accessor "getAssurance" gives direct access to the value
283         */
284        public PersonLinkComponent setAssuranceElement(Enumeration<IdentityAssuranceLevel> value) { 
285          this.assurance = value;
286          return this;
287        }
288
289        /**
290         * @return Level of assurance that this link is actually associated with the target resource.
291         */
292        public IdentityAssuranceLevel getAssurance() { 
293          return this.assurance == null ? null : this.assurance.getValue();
294        }
295
296        /**
297         * @param value Level of assurance that this link is actually associated with the target resource.
298         */
299        public PersonLinkComponent setAssurance(IdentityAssuranceLevel value) { 
300          if (value == null)
301            this.assurance = null;
302          else {
303            if (this.assurance == null)
304              this.assurance = new Enumeration<IdentityAssuranceLevel>(new IdentityAssuranceLevelEnumFactory());
305            this.assurance.setValue(value);
306          }
307          return this;
308        }
309
310        protected void listChildren(List<Property> children) {
311          super.listChildren(children);
312          children.add(new Property("target", "Reference(Patient|Practitioner|RelatedPerson|Person)", "The resource to which this actual person is associated.", 0, 1, target));
313          children.add(new Property("assurance", "code", "Level of assurance that this link is actually associated with the target resource.", 0, 1, assurance));
314        }
315
316        @Override
317        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
318          switch (_hash) {
319          case -880905839: /*target*/  return new Property("target", "Reference(Patient|Practitioner|RelatedPerson|Person)", "The resource to which this actual person is associated.", 0, 1, target);
320          case 1771900717: /*assurance*/  return new Property("assurance", "code", "Level of assurance that this link is actually associated with the target resource.", 0, 1, assurance);
321          default: return super.getNamedProperty(_hash, _name, _checkValid);
322          }
323
324        }
325
326      @Override
327      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
328        switch (hash) {
329        case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Reference
330        case 1771900717: /*assurance*/ return this.assurance == null ? new Base[0] : new Base[] {this.assurance}; // Enumeration<IdentityAssuranceLevel>
331        default: return super.getProperty(hash, name, checkValid);
332        }
333
334      }
335
336      @Override
337      public Base setProperty(int hash, String name, Base value) throws FHIRException {
338        switch (hash) {
339        case -880905839: // target
340          this.target = castToReference(value); // Reference
341          return value;
342        case 1771900717: // assurance
343          value = new IdentityAssuranceLevelEnumFactory().fromType(castToCode(value));
344          this.assurance = (Enumeration) value; // Enumeration<IdentityAssuranceLevel>
345          return value;
346        default: return super.setProperty(hash, name, value);
347        }
348
349      }
350
351      @Override
352      public Base setProperty(String name, Base value) throws FHIRException {
353        if (name.equals("target")) {
354          this.target = castToReference(value); // Reference
355        } else if (name.equals("assurance")) {
356          value = new IdentityAssuranceLevelEnumFactory().fromType(castToCode(value));
357          this.assurance = (Enumeration) value; // Enumeration<IdentityAssuranceLevel>
358        } else
359          return super.setProperty(name, value);
360        return value;
361      }
362
363      @Override
364      public Base makeProperty(int hash, String name) throws FHIRException {
365        switch (hash) {
366        case -880905839:  return getTarget(); 
367        case 1771900717:  return getAssuranceElement();
368        default: return super.makeProperty(hash, name);
369        }
370
371      }
372
373      @Override
374      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
375        switch (hash) {
376        case -880905839: /*target*/ return new String[] {"Reference"};
377        case 1771900717: /*assurance*/ return new String[] {"code"};
378        default: return super.getTypesForProperty(hash, name);
379        }
380
381      }
382
383      @Override
384      public Base addChild(String name) throws FHIRException {
385        if (name.equals("target")) {
386          this.target = new Reference();
387          return this.target;
388        }
389        else if (name.equals("assurance")) {
390          throw new FHIRException("Cannot call addChild on a primitive type Person.assurance");
391        }
392        else
393          return super.addChild(name);
394      }
395
396      public PersonLinkComponent copy() {
397        PersonLinkComponent dst = new PersonLinkComponent();
398        copyValues(dst);
399        dst.target = target == null ? null : target.copy();
400        dst.assurance = assurance == null ? null : assurance.copy();
401        return dst;
402      }
403
404      @Override
405      public boolean equalsDeep(Base other_) {
406        if (!super.equalsDeep(other_))
407          return false;
408        if (!(other_ instanceof PersonLinkComponent))
409          return false;
410        PersonLinkComponent o = (PersonLinkComponent) other_;
411        return compareDeep(target, o.target, true) && compareDeep(assurance, o.assurance, true);
412      }
413
414      @Override
415      public boolean equalsShallow(Base other_) {
416        if (!super.equalsShallow(other_))
417          return false;
418        if (!(other_ instanceof PersonLinkComponent))
419          return false;
420        PersonLinkComponent o = (PersonLinkComponent) other_;
421        return compareValues(assurance, o.assurance, true);
422      }
423
424      public boolean isEmpty() {
425        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(target, assurance);
426      }
427
428  public String fhirType() {
429    return "Person.link";
430
431  }
432
433  }
434
435    /**
436     * Identifier for a person within a particular scope.
437     */
438    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
439    @Description(shortDefinition="A human identifier for this person", formalDefinition="Identifier for a person within a particular scope." )
440    protected List<Identifier> identifier;
441
442    /**
443     * A name associated with the person.
444     */
445    @Child(name = "name", type = {HumanName.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
446    @Description(shortDefinition="A name associated with the person", formalDefinition="A name associated with the person." )
447    protected List<HumanName> name;
448
449    /**
450     * A contact detail for the person, e.g. a telephone number or an email address.
451     */
452    @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
453    @Description(shortDefinition="A contact detail for the person", formalDefinition="A contact detail for the person, e.g. a telephone number or an email address." )
454    protected List<ContactPoint> telecom;
455
456    /**
457     * Administrative Gender.
458     */
459    @Child(name = "gender", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=true)
460    @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender." )
461    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/administrative-gender")
462    protected Enumeration<AdministrativeGender> gender;
463
464    /**
465     * The birth date for the person.
466     */
467    @Child(name = "birthDate", type = {DateType.class}, order=4, min=0, max=1, modifier=false, summary=true)
468    @Description(shortDefinition="The date on which the person was born", formalDefinition="The birth date for the person." )
469    protected DateType birthDate;
470
471    /**
472     * One or more addresses for the person.
473     */
474    @Child(name = "address", type = {Address.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
475    @Description(shortDefinition="One or more addresses for the person", formalDefinition="One or more addresses for the person." )
476    protected List<Address> address;
477
478    /**
479     * An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.
480     */
481    @Child(name = "photo", type = {Attachment.class}, order=6, min=0, max=1, modifier=false, summary=false)
482    @Description(shortDefinition="Image of the person", formalDefinition="An image that can be displayed as a thumbnail of the person to enhance the identification of the individual." )
483    protected Attachment photo;
484
485    /**
486     * The organization that is the custodian of the person record.
487     */
488    @Child(name = "managingOrganization", type = {Organization.class}, order=7, min=0, max=1, modifier=false, summary=true)
489    @Description(shortDefinition="The organization that is the custodian of the person record", formalDefinition="The organization that is the custodian of the person record." )
490    protected Reference managingOrganization;
491
492    /**
493     * The actual object that is the target of the reference (The organization that is the custodian of the person record.)
494     */
495    protected Organization managingOrganizationTarget;
496
497    /**
498     * Whether this person's record is in active use.
499     */
500    @Child(name = "active", type = {BooleanType.class}, order=8, min=0, max=1, modifier=true, summary=true)
501    @Description(shortDefinition="This person's record is in active use", formalDefinition="Whether this person's record is in active use." )
502    protected BooleanType active;
503
504    /**
505     * Link to a resource that concerns the same actual person.
506     */
507    @Child(name = "link", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
508    @Description(shortDefinition="Link to a resource that concerns the same actual person", formalDefinition="Link to a resource that concerns the same actual person." )
509    protected List<PersonLinkComponent> link;
510
511    private static final long serialVersionUID = -117464654L;
512
513  /**
514   * Constructor
515   */
516    public Person() {
517      super();
518    }
519
520    /**
521     * @return {@link #identifier} (Identifier for a person within a particular scope.)
522     */
523    public List<Identifier> getIdentifier() { 
524      if (this.identifier == null)
525        this.identifier = new ArrayList<Identifier>();
526      return this.identifier;
527    }
528
529    /**
530     * @return Returns a reference to <code>this</code> for easy method chaining
531     */
532    public Person setIdentifier(List<Identifier> theIdentifier) { 
533      this.identifier = theIdentifier;
534      return this;
535    }
536
537    public boolean hasIdentifier() { 
538      if (this.identifier == null)
539        return false;
540      for (Identifier item : this.identifier)
541        if (!item.isEmpty())
542          return true;
543      return false;
544    }
545
546    public Identifier addIdentifier() { //3
547      Identifier t = new Identifier();
548      if (this.identifier == null)
549        this.identifier = new ArrayList<Identifier>();
550      this.identifier.add(t);
551      return t;
552    }
553
554    public Person addIdentifier(Identifier t) { //3
555      if (t == null)
556        return this;
557      if (this.identifier == null)
558        this.identifier = new ArrayList<Identifier>();
559      this.identifier.add(t);
560      return this;
561    }
562
563    /**
564     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
565     */
566    public Identifier getIdentifierFirstRep() { 
567      if (getIdentifier().isEmpty()) {
568        addIdentifier();
569      }
570      return getIdentifier().get(0);
571    }
572
573    /**
574     * @return {@link #name} (A name associated with the person.)
575     */
576    public List<HumanName> getName() { 
577      if (this.name == null)
578        this.name = new ArrayList<HumanName>();
579      return this.name;
580    }
581
582    /**
583     * @return Returns a reference to <code>this</code> for easy method chaining
584     */
585    public Person setName(List<HumanName> theName) { 
586      this.name = theName;
587      return this;
588    }
589
590    public boolean hasName() { 
591      if (this.name == null)
592        return false;
593      for (HumanName item : this.name)
594        if (!item.isEmpty())
595          return true;
596      return false;
597    }
598
599    public HumanName addName() { //3
600      HumanName t = new HumanName();
601      if (this.name == null)
602        this.name = new ArrayList<HumanName>();
603      this.name.add(t);
604      return t;
605    }
606
607    public Person addName(HumanName t) { //3
608      if (t == null)
609        return this;
610      if (this.name == null)
611        this.name = new ArrayList<HumanName>();
612      this.name.add(t);
613      return this;
614    }
615
616    /**
617     * @return The first repetition of repeating field {@link #name}, creating it if it does not already exist
618     */
619    public HumanName getNameFirstRep() { 
620      if (getName().isEmpty()) {
621        addName();
622      }
623      return getName().get(0);
624    }
625
626    /**
627     * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.)
628     */
629    public List<ContactPoint> getTelecom() { 
630      if (this.telecom == null)
631        this.telecom = new ArrayList<ContactPoint>();
632      return this.telecom;
633    }
634
635    /**
636     * @return Returns a reference to <code>this</code> for easy method chaining
637     */
638    public Person setTelecom(List<ContactPoint> theTelecom) { 
639      this.telecom = theTelecom;
640      return this;
641    }
642
643    public boolean hasTelecom() { 
644      if (this.telecom == null)
645        return false;
646      for (ContactPoint item : this.telecom)
647        if (!item.isEmpty())
648          return true;
649      return false;
650    }
651
652    public ContactPoint addTelecom() { //3
653      ContactPoint t = new ContactPoint();
654      if (this.telecom == null)
655        this.telecom = new ArrayList<ContactPoint>();
656      this.telecom.add(t);
657      return t;
658    }
659
660    public Person addTelecom(ContactPoint t) { //3
661      if (t == null)
662        return this;
663      if (this.telecom == null)
664        this.telecom = new ArrayList<ContactPoint>();
665      this.telecom.add(t);
666      return this;
667    }
668
669    /**
670     * @return The first repetition of repeating field {@link #telecom}, creating it if it does not already exist
671     */
672    public ContactPoint getTelecomFirstRep() { 
673      if (getTelecom().isEmpty()) {
674        addTelecom();
675      }
676      return getTelecom().get(0);
677    }
678
679    /**
680     * @return {@link #gender} (Administrative Gender.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value
681     */
682    public Enumeration<AdministrativeGender> getGenderElement() { 
683      if (this.gender == null)
684        if (Configuration.errorOnAutoCreate())
685          throw new Error("Attempt to auto-create Person.gender");
686        else if (Configuration.doAutoCreate())
687          this.gender = new Enumeration<AdministrativeGender>(new AdministrativeGenderEnumFactory()); // bb
688      return this.gender;
689    }
690
691    public boolean hasGenderElement() { 
692      return this.gender != null && !this.gender.isEmpty();
693    }
694
695    public boolean hasGender() { 
696      return this.gender != null && !this.gender.isEmpty();
697    }
698
699    /**
700     * @param value {@link #gender} (Administrative Gender.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value
701     */
702    public Person setGenderElement(Enumeration<AdministrativeGender> value) { 
703      this.gender = value;
704      return this;
705    }
706
707    /**
708     * @return Administrative Gender.
709     */
710    public AdministrativeGender getGender() { 
711      return this.gender == null ? null : this.gender.getValue();
712    }
713
714    /**
715     * @param value Administrative Gender.
716     */
717    public Person setGender(AdministrativeGender value) { 
718      if (value == null)
719        this.gender = null;
720      else {
721        if (this.gender == null)
722          this.gender = new Enumeration<AdministrativeGender>(new AdministrativeGenderEnumFactory());
723        this.gender.setValue(value);
724      }
725      return this;
726    }
727
728    /**
729     * @return {@link #birthDate} (The birth date for the person.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value
730     */
731    public DateType getBirthDateElement() { 
732      if (this.birthDate == null)
733        if (Configuration.errorOnAutoCreate())
734          throw new Error("Attempt to auto-create Person.birthDate");
735        else if (Configuration.doAutoCreate())
736          this.birthDate = new DateType(); // bb
737      return this.birthDate;
738    }
739
740    public boolean hasBirthDateElement() { 
741      return this.birthDate != null && !this.birthDate.isEmpty();
742    }
743
744    public boolean hasBirthDate() { 
745      return this.birthDate != null && !this.birthDate.isEmpty();
746    }
747
748    /**
749     * @param value {@link #birthDate} (The birth date for the person.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value
750     */
751    public Person setBirthDateElement(DateType value) { 
752      this.birthDate = value;
753      return this;
754    }
755
756    /**
757     * @return The birth date for the person.
758     */
759    public Date getBirthDate() { 
760      return this.birthDate == null ? null : this.birthDate.getValue();
761    }
762
763    /**
764     * @param value The birth date for the person.
765     */
766    public Person setBirthDate(Date value) { 
767      if (value == null)
768        this.birthDate = null;
769      else {
770        if (this.birthDate == null)
771          this.birthDate = new DateType();
772        this.birthDate.setValue(value);
773      }
774      return this;
775    }
776
777    /**
778     * @return {@link #address} (One or more addresses for the person.)
779     */
780    public List<Address> getAddress() { 
781      if (this.address == null)
782        this.address = new ArrayList<Address>();
783      return this.address;
784    }
785
786    /**
787     * @return Returns a reference to <code>this</code> for easy method chaining
788     */
789    public Person setAddress(List<Address> theAddress) { 
790      this.address = theAddress;
791      return this;
792    }
793
794    public boolean hasAddress() { 
795      if (this.address == null)
796        return false;
797      for (Address item : this.address)
798        if (!item.isEmpty())
799          return true;
800      return false;
801    }
802
803    public Address addAddress() { //3
804      Address t = new Address();
805      if (this.address == null)
806        this.address = new ArrayList<Address>();
807      this.address.add(t);
808      return t;
809    }
810
811    public Person addAddress(Address t) { //3
812      if (t == null)
813        return this;
814      if (this.address == null)
815        this.address = new ArrayList<Address>();
816      this.address.add(t);
817      return this;
818    }
819
820    /**
821     * @return The first repetition of repeating field {@link #address}, creating it if it does not already exist
822     */
823    public Address getAddressFirstRep() { 
824      if (getAddress().isEmpty()) {
825        addAddress();
826      }
827      return getAddress().get(0);
828    }
829
830    /**
831     * @return {@link #photo} (An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.)
832     */
833    public Attachment getPhoto() { 
834      if (this.photo == null)
835        if (Configuration.errorOnAutoCreate())
836          throw new Error("Attempt to auto-create Person.photo");
837        else if (Configuration.doAutoCreate())
838          this.photo = new Attachment(); // cc
839      return this.photo;
840    }
841
842    public boolean hasPhoto() { 
843      return this.photo != null && !this.photo.isEmpty();
844    }
845
846    /**
847     * @param value {@link #photo} (An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.)
848     */
849    public Person setPhoto(Attachment value)  { 
850      this.photo = value;
851      return this;
852    }
853
854    /**
855     * @return {@link #managingOrganization} (The organization that is the custodian of the person record.)
856     */
857    public Reference getManagingOrganization() { 
858      if (this.managingOrganization == null)
859        if (Configuration.errorOnAutoCreate())
860          throw new Error("Attempt to auto-create Person.managingOrganization");
861        else if (Configuration.doAutoCreate())
862          this.managingOrganization = new Reference(); // cc
863      return this.managingOrganization;
864    }
865
866    public boolean hasManagingOrganization() { 
867      return this.managingOrganization != null && !this.managingOrganization.isEmpty();
868    }
869
870    /**
871     * @param value {@link #managingOrganization} (The organization that is the custodian of the person record.)
872     */
873    public Person setManagingOrganization(Reference value)  { 
874      this.managingOrganization = value;
875      return this;
876    }
877
878    /**
879     * @return {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization that is the custodian of the person record.)
880     */
881    public Organization getManagingOrganizationTarget() { 
882      if (this.managingOrganizationTarget == null)
883        if (Configuration.errorOnAutoCreate())
884          throw new Error("Attempt to auto-create Person.managingOrganization");
885        else if (Configuration.doAutoCreate())
886          this.managingOrganizationTarget = new Organization(); // aa
887      return this.managingOrganizationTarget;
888    }
889
890    /**
891     * @param value {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization that is the custodian of the person record.)
892     */
893    public Person setManagingOrganizationTarget(Organization value) { 
894      this.managingOrganizationTarget = value;
895      return this;
896    }
897
898    /**
899     * @return {@link #active} (Whether this person's record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value
900     */
901    public BooleanType getActiveElement() { 
902      if (this.active == null)
903        if (Configuration.errorOnAutoCreate())
904          throw new Error("Attempt to auto-create Person.active");
905        else if (Configuration.doAutoCreate())
906          this.active = new BooleanType(); // bb
907      return this.active;
908    }
909
910    public boolean hasActiveElement() { 
911      return this.active != null && !this.active.isEmpty();
912    }
913
914    public boolean hasActive() { 
915      return this.active != null && !this.active.isEmpty();
916    }
917
918    /**
919     * @param value {@link #active} (Whether this person's record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value
920     */
921    public Person setActiveElement(BooleanType value) { 
922      this.active = value;
923      return this;
924    }
925
926    /**
927     * @return Whether this person's record is in active use.
928     */
929    public boolean getActive() { 
930      return this.active == null || this.active.isEmpty() ? false : this.active.getValue();
931    }
932
933    /**
934     * @param value Whether this person's record is in active use.
935     */
936    public Person setActive(boolean value) { 
937        if (this.active == null)
938          this.active = new BooleanType();
939        this.active.setValue(value);
940      return this;
941    }
942
943    /**
944     * @return {@link #link} (Link to a resource that concerns the same actual person.)
945     */
946    public List<PersonLinkComponent> getLink() { 
947      if (this.link == null)
948        this.link = new ArrayList<PersonLinkComponent>();
949      return this.link;
950    }
951
952    /**
953     * @return Returns a reference to <code>this</code> for easy method chaining
954     */
955    public Person setLink(List<PersonLinkComponent> theLink) { 
956      this.link = theLink;
957      return this;
958    }
959
960    public boolean hasLink() { 
961      if (this.link == null)
962        return false;
963      for (PersonLinkComponent item : this.link)
964        if (!item.isEmpty())
965          return true;
966      return false;
967    }
968
969    public PersonLinkComponent addLink() { //3
970      PersonLinkComponent t = new PersonLinkComponent();
971      if (this.link == null)
972        this.link = new ArrayList<PersonLinkComponent>();
973      this.link.add(t);
974      return t;
975    }
976
977    public Person addLink(PersonLinkComponent t) { //3
978      if (t == null)
979        return this;
980      if (this.link == null)
981        this.link = new ArrayList<PersonLinkComponent>();
982      this.link.add(t);
983      return this;
984    }
985
986    /**
987     * @return The first repetition of repeating field {@link #link}, creating it if it does not already exist
988     */
989    public PersonLinkComponent getLinkFirstRep() { 
990      if (getLink().isEmpty()) {
991        addLink();
992      }
993      return getLink().get(0);
994    }
995
996      protected void listChildren(List<Property> children) {
997        super.listChildren(children);
998        children.add(new Property("identifier", "Identifier", "Identifier for a person within a particular scope.", 0, java.lang.Integer.MAX_VALUE, identifier));
999        children.add(new Property("name", "HumanName", "A name associated with the person.", 0, java.lang.Integer.MAX_VALUE, name));
1000        children.add(new Property("telecom", "ContactPoint", "A contact detail for the person, e.g. a telephone number or an email address.", 0, java.lang.Integer.MAX_VALUE, telecom));
1001        children.add(new Property("gender", "code", "Administrative Gender.", 0, 1, gender));
1002        children.add(new Property("birthDate", "date", "The birth date for the person.", 0, 1, birthDate));
1003        children.add(new Property("address", "Address", "One or more addresses for the person.", 0, java.lang.Integer.MAX_VALUE, address));
1004        children.add(new Property("photo", "Attachment", "An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.", 0, 1, photo));
1005        children.add(new Property("managingOrganization", "Reference(Organization)", "The organization that is the custodian of the person record.", 0, 1, managingOrganization));
1006        children.add(new Property("active", "boolean", "Whether this person's record is in active use.", 0, 1, active));
1007        children.add(new Property("link", "", "Link to a resource that concerns the same actual person.", 0, java.lang.Integer.MAX_VALUE, link));
1008      }
1009
1010      @Override
1011      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1012        switch (_hash) {
1013        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifier for a person within a particular scope.", 0, java.lang.Integer.MAX_VALUE, identifier);
1014        case 3373707: /*name*/  return new Property("name", "HumanName", "A name associated with the person.", 0, java.lang.Integer.MAX_VALUE, name);
1015        case -1429363305: /*telecom*/  return new Property("telecom", "ContactPoint", "A contact detail for the person, e.g. a telephone number or an email address.", 0, java.lang.Integer.MAX_VALUE, telecom);
1016        case -1249512767: /*gender*/  return new Property("gender", "code", "Administrative Gender.", 0, 1, gender);
1017        case -1210031859: /*birthDate*/  return new Property("birthDate", "date", "The birth date for the person.", 0, 1, birthDate);
1018        case -1147692044: /*address*/  return new Property("address", "Address", "One or more addresses for the person.", 0, java.lang.Integer.MAX_VALUE, address);
1019        case 106642994: /*photo*/  return new Property("photo", "Attachment", "An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.", 0, 1, photo);
1020        case -2058947787: /*managingOrganization*/  return new Property("managingOrganization", "Reference(Organization)", "The organization that is the custodian of the person record.", 0, 1, managingOrganization);
1021        case -1422950650: /*active*/  return new Property("active", "boolean", "Whether this person's record is in active use.", 0, 1, active);
1022        case 3321850: /*link*/  return new Property("link", "", "Link to a resource that concerns the same actual person.", 0, java.lang.Integer.MAX_VALUE, link);
1023        default: return super.getNamedProperty(_hash, _name, _checkValid);
1024        }
1025
1026      }
1027
1028      @Override
1029      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1030        switch (hash) {
1031        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1032        case 3373707: /*name*/ return this.name == null ? new Base[0] : this.name.toArray(new Base[this.name.size()]); // HumanName
1033        case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint
1034        case -1249512767: /*gender*/ return this.gender == null ? new Base[0] : new Base[] {this.gender}; // Enumeration<AdministrativeGender>
1035        case -1210031859: /*birthDate*/ return this.birthDate == null ? new Base[0] : new Base[] {this.birthDate}; // DateType
1036        case -1147692044: /*address*/ return this.address == null ? new Base[0] : this.address.toArray(new Base[this.address.size()]); // Address
1037        case 106642994: /*photo*/ return this.photo == null ? new Base[0] : new Base[] {this.photo}; // Attachment
1038        case -2058947787: /*managingOrganization*/ return this.managingOrganization == null ? new Base[0] : new Base[] {this.managingOrganization}; // Reference
1039        case -1422950650: /*active*/ return this.active == null ? new Base[0] : new Base[] {this.active}; // BooleanType
1040        case 3321850: /*link*/ return this.link == null ? new Base[0] : this.link.toArray(new Base[this.link.size()]); // PersonLinkComponent
1041        default: return super.getProperty(hash, name, checkValid);
1042        }
1043
1044      }
1045
1046      @Override
1047      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1048        switch (hash) {
1049        case -1618432855: // identifier
1050          this.getIdentifier().add(castToIdentifier(value)); // Identifier
1051          return value;
1052        case 3373707: // name
1053          this.getName().add(castToHumanName(value)); // HumanName
1054          return value;
1055        case -1429363305: // telecom
1056          this.getTelecom().add(castToContactPoint(value)); // ContactPoint
1057          return value;
1058        case -1249512767: // gender
1059          value = new AdministrativeGenderEnumFactory().fromType(castToCode(value));
1060          this.gender = (Enumeration) value; // Enumeration<AdministrativeGender>
1061          return value;
1062        case -1210031859: // birthDate
1063          this.birthDate = castToDate(value); // DateType
1064          return value;
1065        case -1147692044: // address
1066          this.getAddress().add(castToAddress(value)); // Address
1067          return value;
1068        case 106642994: // photo
1069          this.photo = castToAttachment(value); // Attachment
1070          return value;
1071        case -2058947787: // managingOrganization
1072          this.managingOrganization = castToReference(value); // Reference
1073          return value;
1074        case -1422950650: // active
1075          this.active = castToBoolean(value); // BooleanType
1076          return value;
1077        case 3321850: // link
1078          this.getLink().add((PersonLinkComponent) value); // PersonLinkComponent
1079          return value;
1080        default: return super.setProperty(hash, name, value);
1081        }
1082
1083      }
1084
1085      @Override
1086      public Base setProperty(String name, Base value) throws FHIRException {
1087        if (name.equals("identifier")) {
1088          this.getIdentifier().add(castToIdentifier(value));
1089        } else if (name.equals("name")) {
1090          this.getName().add(castToHumanName(value));
1091        } else if (name.equals("telecom")) {
1092          this.getTelecom().add(castToContactPoint(value));
1093        } else if (name.equals("gender")) {
1094          value = new AdministrativeGenderEnumFactory().fromType(castToCode(value));
1095          this.gender = (Enumeration) value; // Enumeration<AdministrativeGender>
1096        } else if (name.equals("birthDate")) {
1097          this.birthDate = castToDate(value); // DateType
1098        } else if (name.equals("address")) {
1099          this.getAddress().add(castToAddress(value));
1100        } else if (name.equals("photo")) {
1101          this.photo = castToAttachment(value); // Attachment
1102        } else if (name.equals("managingOrganization")) {
1103          this.managingOrganization = castToReference(value); // Reference
1104        } else if (name.equals("active")) {
1105          this.active = castToBoolean(value); // BooleanType
1106        } else if (name.equals("link")) {
1107          this.getLink().add((PersonLinkComponent) value);
1108        } else
1109          return super.setProperty(name, value);
1110        return value;
1111      }
1112
1113      @Override
1114      public Base makeProperty(int hash, String name) throws FHIRException {
1115        switch (hash) {
1116        case -1618432855:  return addIdentifier(); 
1117        case 3373707:  return addName(); 
1118        case -1429363305:  return addTelecom(); 
1119        case -1249512767:  return getGenderElement();
1120        case -1210031859:  return getBirthDateElement();
1121        case -1147692044:  return addAddress(); 
1122        case 106642994:  return getPhoto(); 
1123        case -2058947787:  return getManagingOrganization(); 
1124        case -1422950650:  return getActiveElement();
1125        case 3321850:  return addLink(); 
1126        default: return super.makeProperty(hash, name);
1127        }
1128
1129      }
1130
1131      @Override
1132      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1133        switch (hash) {
1134        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1135        case 3373707: /*name*/ return new String[] {"HumanName"};
1136        case -1429363305: /*telecom*/ return new String[] {"ContactPoint"};
1137        case -1249512767: /*gender*/ return new String[] {"code"};
1138        case -1210031859: /*birthDate*/ return new String[] {"date"};
1139        case -1147692044: /*address*/ return new String[] {"Address"};
1140        case 106642994: /*photo*/ return new String[] {"Attachment"};
1141        case -2058947787: /*managingOrganization*/ return new String[] {"Reference"};
1142        case -1422950650: /*active*/ return new String[] {"boolean"};
1143        case 3321850: /*link*/ return new String[] {};
1144        default: return super.getTypesForProperty(hash, name);
1145        }
1146
1147      }
1148
1149      @Override
1150      public Base addChild(String name) throws FHIRException {
1151        if (name.equals("identifier")) {
1152          return addIdentifier();
1153        }
1154        else if (name.equals("name")) {
1155          return addName();
1156        }
1157        else if (name.equals("telecom")) {
1158          return addTelecom();
1159        }
1160        else if (name.equals("gender")) {
1161          throw new FHIRException("Cannot call addChild on a primitive type Person.gender");
1162        }
1163        else if (name.equals("birthDate")) {
1164          throw new FHIRException("Cannot call addChild on a primitive type Person.birthDate");
1165        }
1166        else if (name.equals("address")) {
1167          return addAddress();
1168        }
1169        else if (name.equals("photo")) {
1170          this.photo = new Attachment();
1171          return this.photo;
1172        }
1173        else if (name.equals("managingOrganization")) {
1174          this.managingOrganization = new Reference();
1175          return this.managingOrganization;
1176        }
1177        else if (name.equals("active")) {
1178          throw new FHIRException("Cannot call addChild on a primitive type Person.active");
1179        }
1180        else if (name.equals("link")) {
1181          return addLink();
1182        }
1183        else
1184          return super.addChild(name);
1185      }
1186
1187  public String fhirType() {
1188    return "Person";
1189
1190  }
1191
1192      public Person copy() {
1193        Person dst = new Person();
1194        copyValues(dst);
1195        if (identifier != null) {
1196          dst.identifier = new ArrayList<Identifier>();
1197          for (Identifier i : identifier)
1198            dst.identifier.add(i.copy());
1199        };
1200        if (name != null) {
1201          dst.name = new ArrayList<HumanName>();
1202          for (HumanName i : name)
1203            dst.name.add(i.copy());
1204        };
1205        if (telecom != null) {
1206          dst.telecom = new ArrayList<ContactPoint>();
1207          for (ContactPoint i : telecom)
1208            dst.telecom.add(i.copy());
1209        };
1210        dst.gender = gender == null ? null : gender.copy();
1211        dst.birthDate = birthDate == null ? null : birthDate.copy();
1212        if (address != null) {
1213          dst.address = new ArrayList<Address>();
1214          for (Address i : address)
1215            dst.address.add(i.copy());
1216        };
1217        dst.photo = photo == null ? null : photo.copy();
1218        dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy();
1219        dst.active = active == null ? null : active.copy();
1220        if (link != null) {
1221          dst.link = new ArrayList<PersonLinkComponent>();
1222          for (PersonLinkComponent i : link)
1223            dst.link.add(i.copy());
1224        };
1225        return dst;
1226      }
1227
1228      protected Person typedCopy() {
1229        return copy();
1230      }
1231
1232      @Override
1233      public boolean equalsDeep(Base other_) {
1234        if (!super.equalsDeep(other_))
1235          return false;
1236        if (!(other_ instanceof Person))
1237          return false;
1238        Person o = (Person) other_;
1239        return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true)
1240           && compareDeep(gender, o.gender, true) && compareDeep(birthDate, o.birthDate, true) && compareDeep(address, o.address, true)
1241           && compareDeep(photo, o.photo, true) && compareDeep(managingOrganization, o.managingOrganization, true)
1242           && compareDeep(active, o.active, true) && compareDeep(link, o.link, true);
1243      }
1244
1245      @Override
1246      public boolean equalsShallow(Base other_) {
1247        if (!super.equalsShallow(other_))
1248          return false;
1249        if (!(other_ instanceof Person))
1250          return false;
1251        Person o = (Person) other_;
1252        return compareValues(gender, o.gender, true) && compareValues(birthDate, o.birthDate, true) && compareValues(active, o.active, true)
1253          ;
1254      }
1255
1256      public boolean isEmpty() {
1257        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, name, telecom
1258          , gender, birthDate, address, photo, managingOrganization, active, link);
1259      }
1260
1261  @Override
1262  public ResourceType getResourceType() {
1263    return ResourceType.Person;
1264   }
1265
1266 /**
1267   * Search parameter: <b>identifier</b>
1268   * <p>
1269   * Description: <b>A person Identifier</b><br>
1270   * Type: <b>token</b><br>
1271   * Path: <b>Person.identifier</b><br>
1272   * </p>
1273   */
1274  @SearchParamDefinition(name="identifier", path="Person.identifier", description="A person Identifier", type="token" )
1275  public static final String SP_IDENTIFIER = "identifier";
1276 /**
1277   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
1278   * <p>
1279   * Description: <b>A person Identifier</b><br>
1280   * Type: <b>token</b><br>
1281   * Path: <b>Person.identifier</b><br>
1282   * </p>
1283   */
1284  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
1285
1286 /**
1287   * Search parameter: <b>address</b>
1288   * <p>
1289   * Description: <b>A server defined search that may match any of the string fields in the Address, including line, city, state, country, postalCode, and/or text</b><br>
1290   * Type: <b>string</b><br>
1291   * Path: <b>Person.address</b><br>
1292   * </p>
1293   */
1294  @SearchParamDefinition(name="address", path="Person.address", description="A server defined search that may match any of the string fields in the Address, including line, city, state, country, postalCode, and/or text", type="string" )
1295  public static final String SP_ADDRESS = "address";
1296 /**
1297   * <b>Fluent Client</b> search parameter constant for <b>address</b>
1298   * <p>
1299   * Description: <b>A server defined search that may match any of the string fields in the Address, including line, city, state, country, postalCode, and/or text</b><br>
1300   * Type: <b>string</b><br>
1301   * Path: <b>Person.address</b><br>
1302   * </p>
1303   */
1304  public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS);
1305
1306 /**
1307   * Search parameter: <b>birthdate</b>
1308   * <p>
1309   * Description: <b>The person's date of birth</b><br>
1310   * Type: <b>date</b><br>
1311   * Path: <b>Person.birthDate</b><br>
1312   * </p>
1313   */
1314  @SearchParamDefinition(name="birthdate", path="Person.birthDate", description="The person's date of birth", type="date" )
1315  public static final String SP_BIRTHDATE = "birthdate";
1316 /**
1317   * <b>Fluent Client</b> search parameter constant for <b>birthdate</b>
1318   * <p>
1319   * Description: <b>The person's date of birth</b><br>
1320   * Type: <b>date</b><br>
1321   * Path: <b>Person.birthDate</b><br>
1322   * </p>
1323   */
1324  public static final ca.uhn.fhir.rest.gclient.DateClientParam BIRTHDATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_BIRTHDATE);
1325
1326 /**
1327   * Search parameter: <b>address-state</b>
1328   * <p>
1329   * Description: <b>A state specified in an address</b><br>
1330   * Type: <b>string</b><br>
1331   * Path: <b>Person.address.state</b><br>
1332   * </p>
1333   */
1334  @SearchParamDefinition(name="address-state", path="Person.address.state", description="A state specified in an address", type="string" )
1335  public static final String SP_ADDRESS_STATE = "address-state";
1336 /**
1337   * <b>Fluent Client</b> search parameter constant for <b>address-state</b>
1338   * <p>
1339   * Description: <b>A state specified in an address</b><br>
1340   * Type: <b>string</b><br>
1341   * Path: <b>Person.address.state</b><br>
1342   * </p>
1343   */
1344  public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_STATE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_STATE);
1345
1346 /**
1347   * Search parameter: <b>gender</b>
1348   * <p>
1349   * Description: <b>The gender of the person</b><br>
1350   * Type: <b>token</b><br>
1351   * Path: <b>Person.gender</b><br>
1352   * </p>
1353   */
1354  @SearchParamDefinition(name="gender", path="Person.gender", description="The gender of the person", type="token" )
1355  public static final String SP_GENDER = "gender";
1356 /**
1357   * <b>Fluent Client</b> search parameter constant for <b>gender</b>
1358   * <p>
1359   * Description: <b>The gender of the person</b><br>
1360   * Type: <b>token</b><br>
1361   * Path: <b>Person.gender</b><br>
1362   * </p>
1363   */
1364  public static final ca.uhn.fhir.rest.gclient.TokenClientParam GENDER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_GENDER);
1365
1366 /**
1367   * Search parameter: <b>practitioner</b>
1368   * <p>
1369   * Description: <b>The Person links to this Practitioner</b><br>
1370   * Type: <b>reference</b><br>
1371   * Path: <b>Person.link.target</b><br>
1372   * </p>
1373   */
1374  @SearchParamDefinition(name="practitioner", path="Person.link.target", description="The Person links to this Practitioner", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Practitioner.class } )
1375  public static final String SP_PRACTITIONER = "practitioner";
1376 /**
1377   * <b>Fluent Client</b> search parameter constant for <b>practitioner</b>
1378   * <p>
1379   * Description: <b>The Person links to this Practitioner</b><br>
1380   * Type: <b>reference</b><br>
1381   * Path: <b>Person.link.target</b><br>
1382   * </p>
1383   */
1384  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRACTITIONER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRACTITIONER);
1385
1386/**
1387   * Constant for fluent queries to be used to add include statements. Specifies
1388   * the path value of "<b>Person:practitioner</b>".
1389   */
1390  public static final ca.uhn.fhir.model.api.Include INCLUDE_PRACTITIONER = new ca.uhn.fhir.model.api.Include("Person:practitioner").toLocked();
1391
1392 /**
1393   * Search parameter: <b>link</b>
1394   * <p>
1395   * Description: <b>Any link has this Patient, Person, RelatedPerson or Practitioner reference</b><br>
1396   * Type: <b>reference</b><br>
1397   * Path: <b>Person.link.target</b><br>
1398   * </p>
1399   */
1400  @SearchParamDefinition(name="link", path="Person.link.target", description="Any link has this Patient, Person, RelatedPerson or Practitioner reference", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="RelatedPerson") }, target={Patient.class, Person.class, Practitioner.class, RelatedPerson.class } )
1401  public static final String SP_LINK = "link";
1402 /**
1403   * <b>Fluent Client</b> search parameter constant for <b>link</b>
1404   * <p>
1405   * Description: <b>Any link has this Patient, Person, RelatedPerson or Practitioner reference</b><br>
1406   * Type: <b>reference</b><br>
1407   * Path: <b>Person.link.target</b><br>
1408   * </p>
1409   */
1410  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LINK = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LINK);
1411
1412/**
1413   * Constant for fluent queries to be used to add include statements. Specifies
1414   * the path value of "<b>Person:link</b>".
1415   */
1416  public static final ca.uhn.fhir.model.api.Include INCLUDE_LINK = new ca.uhn.fhir.model.api.Include("Person:link").toLocked();
1417
1418 /**
1419   * Search parameter: <b>relatedperson</b>
1420   * <p>
1421   * Description: <b>The Person links to this RelatedPerson</b><br>
1422   * Type: <b>reference</b><br>
1423   * Path: <b>Person.link.target</b><br>
1424   * </p>
1425   */
1426  @SearchParamDefinition(name="relatedperson", path="Person.link.target", description="The Person links to this RelatedPerson", type="reference", target={RelatedPerson.class } )
1427  public static final String SP_RELATEDPERSON = "relatedperson";
1428 /**
1429   * <b>Fluent Client</b> search parameter constant for <b>relatedperson</b>
1430   * <p>
1431   * Description: <b>The Person links to this RelatedPerson</b><br>
1432   * Type: <b>reference</b><br>
1433   * Path: <b>Person.link.target</b><br>
1434   * </p>
1435   */
1436  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RELATEDPERSON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RELATEDPERSON);
1437
1438/**
1439   * Constant for fluent queries to be used to add include statements. Specifies
1440   * the path value of "<b>Person:relatedperson</b>".
1441   */
1442  public static final ca.uhn.fhir.model.api.Include INCLUDE_RELATEDPERSON = new ca.uhn.fhir.model.api.Include("Person:relatedperson").toLocked();
1443
1444 /**
1445   * Search parameter: <b>address-postalcode</b>
1446   * <p>
1447   * Description: <b>A postal code specified in an address</b><br>
1448   * Type: <b>string</b><br>
1449   * Path: <b>Person.address.postalCode</b><br>
1450   * </p>
1451   */
1452  @SearchParamDefinition(name="address-postalcode", path="Person.address.postalCode", description="A postal code specified in an address", type="string" )
1453  public static final String SP_ADDRESS_POSTALCODE = "address-postalcode";
1454 /**
1455   * <b>Fluent Client</b> search parameter constant for <b>address-postalcode</b>
1456   * <p>
1457   * Description: <b>A postal code specified in an address</b><br>
1458   * Type: <b>string</b><br>
1459   * Path: <b>Person.address.postalCode</b><br>
1460   * </p>
1461   */
1462  public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_POSTALCODE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_POSTALCODE);
1463
1464 /**
1465   * Search parameter: <b>address-country</b>
1466   * <p>
1467   * Description: <b>A country specified in an address</b><br>
1468   * Type: <b>string</b><br>
1469   * Path: <b>Person.address.country</b><br>
1470   * </p>
1471   */
1472  @SearchParamDefinition(name="address-country", path="Person.address.country", description="A country specified in an address", type="string" )
1473  public static final String SP_ADDRESS_COUNTRY = "address-country";
1474 /**
1475   * <b>Fluent Client</b> search parameter constant for <b>address-country</b>
1476   * <p>
1477   * Description: <b>A country specified in an address</b><br>
1478   * Type: <b>string</b><br>
1479   * Path: <b>Person.address.country</b><br>
1480   * </p>
1481   */
1482  public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_COUNTRY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_COUNTRY);
1483
1484 /**
1485   * Search parameter: <b>phonetic</b>
1486   * <p>
1487   * Description: <b>A portion of name using some kind of phonetic matching algorithm</b><br>
1488   * Type: <b>string</b><br>
1489   * Path: <b>Person.name</b><br>
1490   * </p>
1491   */
1492  @SearchParamDefinition(name="phonetic", path="Person.name", description="A portion of name using some kind of phonetic matching algorithm", type="string" )
1493  public static final String SP_PHONETIC = "phonetic";
1494 /**
1495   * <b>Fluent Client</b> search parameter constant for <b>phonetic</b>
1496   * <p>
1497   * Description: <b>A portion of name using some kind of phonetic matching algorithm</b><br>
1498   * Type: <b>string</b><br>
1499   * Path: <b>Person.name</b><br>
1500   * </p>
1501   */
1502  public static final ca.uhn.fhir.rest.gclient.StringClientParam PHONETIC = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PHONETIC);
1503
1504 /**
1505   * Search parameter: <b>phone</b>
1506   * <p>
1507   * Description: <b>A value in a phone contact</b><br>
1508   * Type: <b>token</b><br>
1509   * Path: <b>Person.telecom(system=phone)</b><br>
1510   * </p>
1511   */
1512  @SearchParamDefinition(name="phone", path="Person.telecom.where(system='phone')", description="A value in a phone contact", type="token" )
1513  public static final String SP_PHONE = "phone";
1514 /**
1515   * <b>Fluent Client</b> search parameter constant for <b>phone</b>
1516   * <p>
1517   * Description: <b>A value in a phone contact</b><br>
1518   * Type: <b>token</b><br>
1519   * Path: <b>Person.telecom(system=phone)</b><br>
1520   * </p>
1521   */
1522  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PHONE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PHONE);
1523
1524 /**
1525   * Search parameter: <b>patient</b>
1526   * <p>
1527   * Description: <b>The Person links to this Patient</b><br>
1528   * Type: <b>reference</b><br>
1529   * Path: <b>Person.link.target</b><br>
1530   * </p>
1531   */
1532  @SearchParamDefinition(name="patient", path="Person.link.target", description="The Person links to this Patient", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Patient.class } )
1533  public static final String SP_PATIENT = "patient";
1534 /**
1535   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
1536   * <p>
1537   * Description: <b>The Person links to this Patient</b><br>
1538   * Type: <b>reference</b><br>
1539   * Path: <b>Person.link.target</b><br>
1540   * </p>
1541   */
1542  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
1543
1544/**
1545   * Constant for fluent queries to be used to add include statements. Specifies
1546   * the path value of "<b>Person:patient</b>".
1547   */
1548  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Person:patient").toLocked();
1549
1550 /**
1551   * Search parameter: <b>organization</b>
1552   * <p>
1553   * Description: <b>The organization at which this person record is being managed</b><br>
1554   * Type: <b>reference</b><br>
1555   * Path: <b>Person.managingOrganization</b><br>
1556   * </p>
1557   */
1558  @SearchParamDefinition(name="organization", path="Person.managingOrganization", description="The organization at which this person record is being managed", type="reference", target={Organization.class } )
1559  public static final String SP_ORGANIZATION = "organization";
1560 /**
1561   * <b>Fluent Client</b> search parameter constant for <b>organization</b>
1562   * <p>
1563   * Description: <b>The organization at which this person record is being managed</b><br>
1564   * Type: <b>reference</b><br>
1565   * Path: <b>Person.managingOrganization</b><br>
1566   * </p>
1567   */
1568  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION);
1569
1570/**
1571   * Constant for fluent queries to be used to add include statements. Specifies
1572   * the path value of "<b>Person:organization</b>".
1573   */
1574  public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("Person:organization").toLocked();
1575
1576 /**
1577   * Search parameter: <b>name</b>
1578   * <p>
1579   * Description: <b>A server defined search that may match any of the string fields in the HumanName, including family, give, prefix, suffix, suffix, and/or text</b><br>
1580   * Type: <b>string</b><br>
1581   * Path: <b>Person.name</b><br>
1582   * </p>
1583   */
1584  @SearchParamDefinition(name="name", path="Person.name", description="A server defined search that may match any of the string fields in the HumanName, including family, give, prefix, suffix, suffix, and/or text", type="string" )
1585  public static final String SP_NAME = "name";
1586 /**
1587   * <b>Fluent Client</b> search parameter constant for <b>name</b>
1588   * <p>
1589   * Description: <b>A server defined search that may match any of the string fields in the HumanName, including family, give, prefix, suffix, suffix, and/or text</b><br>
1590   * Type: <b>string</b><br>
1591   * Path: <b>Person.name</b><br>
1592   * </p>
1593   */
1594  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
1595
1596 /**
1597   * Search parameter: <b>address-use</b>
1598   * <p>
1599   * Description: <b>A use code specified in an address</b><br>
1600   * Type: <b>token</b><br>
1601   * Path: <b>Person.address.use</b><br>
1602   * </p>
1603   */
1604  @SearchParamDefinition(name="address-use", path="Person.address.use", description="A use code specified in an address", type="token" )
1605  public static final String SP_ADDRESS_USE = "address-use";
1606 /**
1607   * <b>Fluent Client</b> search parameter constant for <b>address-use</b>
1608   * <p>
1609   * Description: <b>A use code specified in an address</b><br>
1610   * Type: <b>token</b><br>
1611   * Path: <b>Person.address.use</b><br>
1612   * </p>
1613   */
1614  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ADDRESS_USE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ADDRESS_USE);
1615
1616 /**
1617   * Search parameter: <b>telecom</b>
1618   * <p>
1619   * Description: <b>The value in any kind of contact</b><br>
1620   * Type: <b>token</b><br>
1621   * Path: <b>Person.telecom</b><br>
1622   * </p>
1623   */
1624  @SearchParamDefinition(name="telecom", path="Person.telecom", description="The value in any kind of contact", type="token" )
1625  public static final String SP_TELECOM = "telecom";
1626 /**
1627   * <b>Fluent Client</b> search parameter constant for <b>telecom</b>
1628   * <p>
1629   * Description: <b>The value in any kind of contact</b><br>
1630   * Type: <b>token</b><br>
1631   * Path: <b>Person.telecom</b><br>
1632   * </p>
1633   */
1634  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TELECOM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TELECOM);
1635
1636 /**
1637   * Search parameter: <b>address-city</b>
1638   * <p>
1639   * Description: <b>A city specified in an address</b><br>
1640   * Type: <b>string</b><br>
1641   * Path: <b>Person.address.city</b><br>
1642   * </p>
1643   */
1644  @SearchParamDefinition(name="address-city", path="Person.address.city", description="A city specified in an address", type="string" )
1645  public static final String SP_ADDRESS_CITY = "address-city";
1646 /**
1647   * <b>Fluent Client</b> search parameter constant for <b>address-city</b>
1648   * <p>
1649   * Description: <b>A city specified in an address</b><br>
1650   * Type: <b>string</b><br>
1651   * Path: <b>Person.address.city</b><br>
1652   * </p>
1653   */
1654  public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_CITY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_CITY);
1655
1656 /**
1657   * Search parameter: <b>email</b>
1658   * <p>
1659   * Description: <b>A value in an email contact</b><br>
1660   * Type: <b>token</b><br>
1661   * Path: <b>Person.telecom(system=email)</b><br>
1662   * </p>
1663   */
1664  @SearchParamDefinition(name="email", path="Person.telecom.where(system='email')", description="A value in an email contact", type="token" )
1665  public static final String SP_EMAIL = "email";
1666 /**
1667   * <b>Fluent Client</b> search parameter constant for <b>email</b>
1668   * <p>
1669   * Description: <b>A value in an email contact</b><br>
1670   * Type: <b>token</b><br>
1671   * Path: <b>Person.telecom(system=email)</b><br>
1672   * </p>
1673   */
1674  public static final ca.uhn.fhir.rest.gclient.TokenClientParam EMAIL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EMAIL);
1675
1676
1677}