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