001package org.hl7.fhir.r4.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
035// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
036
037import java.util.*;
038
039import org.hl7.fhir.utilities.Utilities;
040import org.hl7.fhir.r4.model.Enumerations.*;
041import ca.uhn.fhir.model.api.annotation.ResourceDef;
042import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
043import ca.uhn.fhir.model.api.annotation.Child;
044import ca.uhn.fhir.model.api.annotation.ChildOrder;
045import ca.uhn.fhir.model.api.annotation.Description;
046import ca.uhn.fhir.model.api.annotation.Block;
047import org.hl7.fhir.instance.model.api.*;
048import org.hl7.fhir.exceptions.FHIRException;
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/StructureDefinition/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 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 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 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 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 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 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 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 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        return dst;
400      }
401
402      public void copyValues(PersonLinkComponent dst) {
403        super.copyValues(dst);
404        dst.target = target == null ? null : target.copy();
405        dst.assurance = assurance == null ? null : assurance.copy();
406      }
407
408      @Override
409      public boolean equalsDeep(Base other_) {
410        if (!super.equalsDeep(other_))
411          return false;
412        if (!(other_ instanceof PersonLinkComponent))
413          return false;
414        PersonLinkComponent o = (PersonLinkComponent) other_;
415        return compareDeep(target, o.target, true) && compareDeep(assurance, o.assurance, true);
416      }
417
418      @Override
419      public boolean equalsShallow(Base other_) {
420        if (!super.equalsShallow(other_))
421          return false;
422        if (!(other_ instanceof PersonLinkComponent))
423          return false;
424        PersonLinkComponent o = (PersonLinkComponent) other_;
425        return compareValues(assurance, o.assurance, true);
426      }
427
428      public boolean isEmpty() {
429        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(target, assurance);
430      }
431
432  public String fhirType() {
433    return "Person.link";
434
435  }
436
437  }
438
439    /**
440     * Identifier for a person within a particular scope.
441     */
442    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
443    @Description(shortDefinition="A human identifier for this person", formalDefinition="Identifier for a person within a particular scope." )
444    protected List<Identifier> identifier;
445
446    /**
447     * A name associated with the person.
448     */
449    @Child(name = "name", type = {HumanName.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
450    @Description(shortDefinition="A name associated with the person", formalDefinition="A name associated with the person." )
451    protected List<HumanName> name;
452
453    /**
454     * A contact detail for the person, e.g. a telephone number or an email address.
455     */
456    @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
457    @Description(shortDefinition="A contact detail for the person", formalDefinition="A contact detail for the person, e.g. a telephone number or an email address." )
458    protected List<ContactPoint> telecom;
459
460    /**
461     * Administrative Gender.
462     */
463    @Child(name = "gender", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=true)
464    @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender." )
465    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/administrative-gender")
466    protected Enumeration<AdministrativeGender> gender;
467
468    /**
469     * The birth date for the person.
470     */
471    @Child(name = "birthDate", type = {DateType.class}, order=4, min=0, max=1, modifier=false, summary=true)
472    @Description(shortDefinition="The date on which the person was born", formalDefinition="The birth date for the person." )
473    protected DateType birthDate;
474
475    /**
476     * One or more addresses for the person.
477     */
478    @Child(name = "address", type = {Address.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
479    @Description(shortDefinition="One or more addresses for the person", formalDefinition="One or more addresses for the person." )
480    protected List<Address> address;
481
482    /**
483     * An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.
484     */
485    @Child(name = "photo", type = {Attachment.class}, order=6, min=0, max=1, modifier=false, summary=false)
486    @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." )
487    protected Attachment photo;
488
489    /**
490     * The organization that is the custodian of the person record.
491     */
492    @Child(name = "managingOrganization", type = {Organization.class}, order=7, min=0, max=1, modifier=false, summary=true)
493    @Description(shortDefinition="The organization that is the custodian of the person record", formalDefinition="The organization that is the custodian of the person record." )
494    protected Reference managingOrganization;
495
496    /**
497     * The actual object that is the target of the reference (The organization that is the custodian of the person record.)
498     */
499    protected Organization managingOrganizationTarget;
500
501    /**
502     * Whether this person's record is in active use.
503     */
504    @Child(name = "active", type = {BooleanType.class}, order=8, min=0, max=1, modifier=true, summary=true)
505    @Description(shortDefinition="This person's record is in active use", formalDefinition="Whether this person's record is in active use." )
506    protected BooleanType active;
507
508    /**
509     * Link to a resource that concerns the same actual person.
510     */
511    @Child(name = "link", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
512    @Description(shortDefinition="Link to a resource that concerns the same actual person", formalDefinition="Link to a resource that concerns the same actual person." )
513    protected List<PersonLinkComponent> link;
514
515    private static final long serialVersionUID = -117464654L;
516
517  /**
518   * Constructor
519   */
520    public Person() {
521      super();
522    }
523
524    /**
525     * @return {@link #identifier} (Identifier for a person within a particular scope.)
526     */
527    public List<Identifier> getIdentifier() { 
528      if (this.identifier == null)
529        this.identifier = new ArrayList<Identifier>();
530      return this.identifier;
531    }
532
533    /**
534     * @return Returns a reference to <code>this</code> for easy method chaining
535     */
536    public Person setIdentifier(List<Identifier> theIdentifier) { 
537      this.identifier = theIdentifier;
538      return this;
539    }
540
541    public boolean hasIdentifier() { 
542      if (this.identifier == null)
543        return false;
544      for (Identifier item : this.identifier)
545        if (!item.isEmpty())
546          return true;
547      return false;
548    }
549
550    public Identifier addIdentifier() { //3
551      Identifier t = new Identifier();
552      if (this.identifier == null)
553        this.identifier = new ArrayList<Identifier>();
554      this.identifier.add(t);
555      return t;
556    }
557
558    public Person addIdentifier(Identifier t) { //3
559      if (t == null)
560        return this;
561      if (this.identifier == null)
562        this.identifier = new ArrayList<Identifier>();
563      this.identifier.add(t);
564      return this;
565    }
566
567    /**
568     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
569     */
570    public Identifier getIdentifierFirstRep() { 
571      if (getIdentifier().isEmpty()) {
572        addIdentifier();
573      }
574      return getIdentifier().get(0);
575    }
576
577    /**
578     * @return {@link #name} (A name associated with the person.)
579     */
580    public List<HumanName> getName() { 
581      if (this.name == null)
582        this.name = new ArrayList<HumanName>();
583      return this.name;
584    }
585
586    /**
587     * @return Returns a reference to <code>this</code> for easy method chaining
588     */
589    public Person setName(List<HumanName> theName) { 
590      this.name = theName;
591      return this;
592    }
593
594    public boolean hasName() { 
595      if (this.name == null)
596        return false;
597      for (HumanName item : this.name)
598        if (!item.isEmpty())
599          return true;
600      return false;
601    }
602
603    public HumanName addName() { //3
604      HumanName t = new HumanName();
605      if (this.name == null)
606        this.name = new ArrayList<HumanName>();
607      this.name.add(t);
608      return t;
609    }
610
611    public Person addName(HumanName t) { //3
612      if (t == null)
613        return this;
614      if (this.name == null)
615        this.name = new ArrayList<HumanName>();
616      this.name.add(t);
617      return this;
618    }
619
620    /**
621     * @return The first repetition of repeating field {@link #name}, creating it if it does not already exist
622     */
623    public HumanName getNameFirstRep() { 
624      if (getName().isEmpty()) {
625        addName();
626      }
627      return getName().get(0);
628    }
629
630    /**
631     * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.)
632     */
633    public List<ContactPoint> getTelecom() { 
634      if (this.telecom == null)
635        this.telecom = new ArrayList<ContactPoint>();
636      return this.telecom;
637    }
638
639    /**
640     * @return Returns a reference to <code>this</code> for easy method chaining
641     */
642    public Person setTelecom(List<ContactPoint> theTelecom) { 
643      this.telecom = theTelecom;
644      return this;
645    }
646
647    public boolean hasTelecom() { 
648      if (this.telecom == null)
649        return false;
650      for (ContactPoint item : this.telecom)
651        if (!item.isEmpty())
652          return true;
653      return false;
654    }
655
656    public ContactPoint addTelecom() { //3
657      ContactPoint t = new ContactPoint();
658      if (this.telecom == null)
659        this.telecom = new ArrayList<ContactPoint>();
660      this.telecom.add(t);
661      return t;
662    }
663
664    public Person addTelecom(ContactPoint t) { //3
665      if (t == null)
666        return this;
667      if (this.telecom == null)
668        this.telecom = new ArrayList<ContactPoint>();
669      this.telecom.add(t);
670      return this;
671    }
672
673    /**
674     * @return The first repetition of repeating field {@link #telecom}, creating it if it does not already exist
675     */
676    public ContactPoint getTelecomFirstRep() { 
677      if (getTelecom().isEmpty()) {
678        addTelecom();
679      }
680      return getTelecom().get(0);
681    }
682
683    /**
684     * @return {@link #gender} (Administrative Gender.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value
685     */
686    public Enumeration<AdministrativeGender> getGenderElement() { 
687      if (this.gender == null)
688        if (Configuration.errorOnAutoCreate())
689          throw new Error("Attempt to auto-create Person.gender");
690        else if (Configuration.doAutoCreate())
691          this.gender = new Enumeration<AdministrativeGender>(new AdministrativeGenderEnumFactory()); // bb
692      return this.gender;
693    }
694
695    public boolean hasGenderElement() { 
696      return this.gender != null && !this.gender.isEmpty();
697    }
698
699    public boolean hasGender() { 
700      return this.gender != null && !this.gender.isEmpty();
701    }
702
703    /**
704     * @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
705     */
706    public Person setGenderElement(Enumeration<AdministrativeGender> value) { 
707      this.gender = value;
708      return this;
709    }
710
711    /**
712     * @return Administrative Gender.
713     */
714    public AdministrativeGender getGender() { 
715      return this.gender == null ? null : this.gender.getValue();
716    }
717
718    /**
719     * @param value Administrative Gender.
720     */
721    public Person setGender(AdministrativeGender value) { 
722      if (value == null)
723        this.gender = null;
724      else {
725        if (this.gender == null)
726          this.gender = new Enumeration<AdministrativeGender>(new AdministrativeGenderEnumFactory());
727        this.gender.setValue(value);
728      }
729      return this;
730    }
731
732    /**
733     * @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
734     */
735    public DateType getBirthDateElement() { 
736      if (this.birthDate == null)
737        if (Configuration.errorOnAutoCreate())
738          throw new Error("Attempt to auto-create Person.birthDate");
739        else if (Configuration.doAutoCreate())
740          this.birthDate = new DateType(); // bb
741      return this.birthDate;
742    }
743
744    public boolean hasBirthDateElement() { 
745      return this.birthDate != null && !this.birthDate.isEmpty();
746    }
747
748    public boolean hasBirthDate() { 
749      return this.birthDate != null && !this.birthDate.isEmpty();
750    }
751
752    /**
753     * @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
754     */
755    public Person setBirthDateElement(DateType value) { 
756      this.birthDate = value;
757      return this;
758    }
759
760    /**
761     * @return The birth date for the person.
762     */
763    public Date getBirthDate() { 
764      return this.birthDate == null ? null : this.birthDate.getValue();
765    }
766
767    /**
768     * @param value The birth date for the person.
769     */
770    public Person setBirthDate(Date value) { 
771      if (value == null)
772        this.birthDate = null;
773      else {
774        if (this.birthDate == null)
775          this.birthDate = new DateType();
776        this.birthDate.setValue(value);
777      }
778      return this;
779    }
780
781    /**
782     * @return {@link #address} (One or more addresses for the person.)
783     */
784    public List<Address> getAddress() { 
785      if (this.address == null)
786        this.address = new ArrayList<Address>();
787      return this.address;
788    }
789
790    /**
791     * @return Returns a reference to <code>this</code> for easy method chaining
792     */
793    public Person setAddress(List<Address> theAddress) { 
794      this.address = theAddress;
795      return this;
796    }
797
798    public boolean hasAddress() { 
799      if (this.address == null)
800        return false;
801      for (Address item : this.address)
802        if (!item.isEmpty())
803          return true;
804      return false;
805    }
806
807    public Address addAddress() { //3
808      Address t = new Address();
809      if (this.address == null)
810        this.address = new ArrayList<Address>();
811      this.address.add(t);
812      return t;
813    }
814
815    public Person addAddress(Address t) { //3
816      if (t == null)
817        return this;
818      if (this.address == null)
819        this.address = new ArrayList<Address>();
820      this.address.add(t);
821      return this;
822    }
823
824    /**
825     * @return The first repetition of repeating field {@link #address}, creating it if it does not already exist
826     */
827    public Address getAddressFirstRep() { 
828      if (getAddress().isEmpty()) {
829        addAddress();
830      }
831      return getAddress().get(0);
832    }
833
834    /**
835     * @return {@link #photo} (An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.)
836     */
837    public Attachment getPhoto() { 
838      if (this.photo == null)
839        if (Configuration.errorOnAutoCreate())
840          throw new Error("Attempt to auto-create Person.photo");
841        else if (Configuration.doAutoCreate())
842          this.photo = new Attachment(); // cc
843      return this.photo;
844    }
845
846    public boolean hasPhoto() { 
847      return this.photo != null && !this.photo.isEmpty();
848    }
849
850    /**
851     * @param value {@link #photo} (An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.)
852     */
853    public Person setPhoto(Attachment value) { 
854      this.photo = value;
855      return this;
856    }
857
858    /**
859     * @return {@link #managingOrganization} (The organization that is the custodian of the person record.)
860     */
861    public Reference getManagingOrganization() { 
862      if (this.managingOrganization == null)
863        if (Configuration.errorOnAutoCreate())
864          throw new Error("Attempt to auto-create Person.managingOrganization");
865        else if (Configuration.doAutoCreate())
866          this.managingOrganization = new Reference(); // cc
867      return this.managingOrganization;
868    }
869
870    public boolean hasManagingOrganization() { 
871      return this.managingOrganization != null && !this.managingOrganization.isEmpty();
872    }
873
874    /**
875     * @param value {@link #managingOrganization} (The organization that is the custodian of the person record.)
876     */
877    public Person setManagingOrganization(Reference value) { 
878      this.managingOrganization = value;
879      return this;
880    }
881
882    /**
883     * @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.)
884     */
885    public Organization getManagingOrganizationTarget() { 
886      if (this.managingOrganizationTarget == null)
887        if (Configuration.errorOnAutoCreate())
888          throw new Error("Attempt to auto-create Person.managingOrganization");
889        else if (Configuration.doAutoCreate())
890          this.managingOrganizationTarget = new Organization(); // aa
891      return this.managingOrganizationTarget;
892    }
893
894    /**
895     * @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.)
896     */
897    public Person setManagingOrganizationTarget(Organization value) { 
898      this.managingOrganizationTarget = value;
899      return this;
900    }
901
902    /**
903     * @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
904     */
905    public BooleanType getActiveElement() { 
906      if (this.active == null)
907        if (Configuration.errorOnAutoCreate())
908          throw new Error("Attempt to auto-create Person.active");
909        else if (Configuration.doAutoCreate())
910          this.active = new BooleanType(); // bb
911      return this.active;
912    }
913
914    public boolean hasActiveElement() { 
915      return this.active != null && !this.active.isEmpty();
916    }
917
918    public boolean hasActive() { 
919      return this.active != null && !this.active.isEmpty();
920    }
921
922    /**
923     * @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
924     */
925    public Person setActiveElement(BooleanType value) { 
926      this.active = value;
927      return this;
928    }
929
930    /**
931     * @return Whether this person's record is in active use.
932     */
933    public boolean getActive() { 
934      return this.active == null || this.active.isEmpty() ? false : this.active.getValue();
935    }
936
937    /**
938     * @param value Whether this person's record is in active use.
939     */
940    public Person setActive(boolean value) { 
941        if (this.active == null)
942          this.active = new BooleanType();
943        this.active.setValue(value);
944      return this;
945    }
946
947    /**
948     * @return {@link #link} (Link to a resource that concerns the same actual person.)
949     */
950    public List<PersonLinkComponent> getLink() { 
951      if (this.link == null)
952        this.link = new ArrayList<PersonLinkComponent>();
953      return this.link;
954    }
955
956    /**
957     * @return Returns a reference to <code>this</code> for easy method chaining
958     */
959    public Person setLink(List<PersonLinkComponent> theLink) { 
960      this.link = theLink;
961      return this;
962    }
963
964    public boolean hasLink() { 
965      if (this.link == null)
966        return false;
967      for (PersonLinkComponent item : this.link)
968        if (!item.isEmpty())
969          return true;
970      return false;
971    }
972
973    public PersonLinkComponent addLink() { //3
974      PersonLinkComponent t = new PersonLinkComponent();
975      if (this.link == null)
976        this.link = new ArrayList<PersonLinkComponent>();
977      this.link.add(t);
978      return t;
979    }
980
981    public Person addLink(PersonLinkComponent t) { //3
982      if (t == null)
983        return this;
984      if (this.link == null)
985        this.link = new ArrayList<PersonLinkComponent>();
986      this.link.add(t);
987      return this;
988    }
989
990    /**
991     * @return The first repetition of repeating field {@link #link}, creating it if it does not already exist
992     */
993    public PersonLinkComponent getLinkFirstRep() { 
994      if (getLink().isEmpty()) {
995        addLink();
996      }
997      return getLink().get(0);
998    }
999
1000      protected void listChildren(List<Property> children) {
1001        super.listChildren(children);
1002        children.add(new Property("identifier", "Identifier", "Identifier for a person within a particular scope.", 0, java.lang.Integer.MAX_VALUE, identifier));
1003        children.add(new Property("name", "HumanName", "A name associated with the person.", 0, java.lang.Integer.MAX_VALUE, name));
1004        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));
1005        children.add(new Property("gender", "code", "Administrative Gender.", 0, 1, gender));
1006        children.add(new Property("birthDate", "date", "The birth date for the person.", 0, 1, birthDate));
1007        children.add(new Property("address", "Address", "One or more addresses for the person.", 0, java.lang.Integer.MAX_VALUE, address));
1008        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));
1009        children.add(new Property("managingOrganization", "Reference(Organization)", "The organization that is the custodian of the person record.", 0, 1, managingOrganization));
1010        children.add(new Property("active", "boolean", "Whether this person's record is in active use.", 0, 1, active));
1011        children.add(new Property("link", "", "Link to a resource that concerns the same actual person.", 0, java.lang.Integer.MAX_VALUE, link));
1012      }
1013
1014      @Override
1015      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1016        switch (_hash) {
1017        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifier for a person within a particular scope.", 0, java.lang.Integer.MAX_VALUE, identifier);
1018        case 3373707: /*name*/  return new Property("name", "HumanName", "A name associated with the person.", 0, java.lang.Integer.MAX_VALUE, name);
1019        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);
1020        case -1249512767: /*gender*/  return new Property("gender", "code", "Administrative Gender.", 0, 1, gender);
1021        case -1210031859: /*birthDate*/  return new Property("birthDate", "date", "The birth date for the person.", 0, 1, birthDate);
1022        case -1147692044: /*address*/  return new Property("address", "Address", "One or more addresses for the person.", 0, java.lang.Integer.MAX_VALUE, address);
1023        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);
1024        case -2058947787: /*managingOrganization*/  return new Property("managingOrganization", "Reference(Organization)", "The organization that is the custodian of the person record.", 0, 1, managingOrganization);
1025        case -1422950650: /*active*/  return new Property("active", "boolean", "Whether this person's record is in active use.", 0, 1, active);
1026        case 3321850: /*link*/  return new Property("link", "", "Link to a resource that concerns the same actual person.", 0, java.lang.Integer.MAX_VALUE, link);
1027        default: return super.getNamedProperty(_hash, _name, _checkValid);
1028        }
1029
1030      }
1031
1032      @Override
1033      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1034        switch (hash) {
1035        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1036        case 3373707: /*name*/ return this.name == null ? new Base[0] : this.name.toArray(new Base[this.name.size()]); // HumanName
1037        case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint
1038        case -1249512767: /*gender*/ return this.gender == null ? new Base[0] : new Base[] {this.gender}; // Enumeration<AdministrativeGender>
1039        case -1210031859: /*birthDate*/ return this.birthDate == null ? new Base[0] : new Base[] {this.birthDate}; // DateType
1040        case -1147692044: /*address*/ return this.address == null ? new Base[0] : this.address.toArray(new Base[this.address.size()]); // Address
1041        case 106642994: /*photo*/ return this.photo == null ? new Base[0] : new Base[] {this.photo}; // Attachment
1042        case -2058947787: /*managingOrganization*/ return this.managingOrganization == null ? new Base[0] : new Base[] {this.managingOrganization}; // Reference
1043        case -1422950650: /*active*/ return this.active == null ? new Base[0] : new Base[] {this.active}; // BooleanType
1044        case 3321850: /*link*/ return this.link == null ? new Base[0] : this.link.toArray(new Base[this.link.size()]); // PersonLinkComponent
1045        default: return super.getProperty(hash, name, checkValid);
1046        }
1047
1048      }
1049
1050      @Override
1051      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1052        switch (hash) {
1053        case -1618432855: // identifier
1054          this.getIdentifier().add(castToIdentifier(value)); // Identifier
1055          return value;
1056        case 3373707: // name
1057          this.getName().add(castToHumanName(value)); // HumanName
1058          return value;
1059        case -1429363305: // telecom
1060          this.getTelecom().add(castToContactPoint(value)); // ContactPoint
1061          return value;
1062        case -1249512767: // gender
1063          value = new AdministrativeGenderEnumFactory().fromType(castToCode(value));
1064          this.gender = (Enumeration) value; // Enumeration<AdministrativeGender>
1065          return value;
1066        case -1210031859: // birthDate
1067          this.birthDate = castToDate(value); // DateType
1068          return value;
1069        case -1147692044: // address
1070          this.getAddress().add(castToAddress(value)); // Address
1071          return value;
1072        case 106642994: // photo
1073          this.photo = castToAttachment(value); // Attachment
1074          return value;
1075        case -2058947787: // managingOrganization
1076          this.managingOrganization = castToReference(value); // Reference
1077          return value;
1078        case -1422950650: // active
1079          this.active = castToBoolean(value); // BooleanType
1080          return value;
1081        case 3321850: // link
1082          this.getLink().add((PersonLinkComponent) value); // PersonLinkComponent
1083          return value;
1084        default: return super.setProperty(hash, name, value);
1085        }
1086
1087      }
1088
1089      @Override
1090      public Base setProperty(String name, Base value) throws FHIRException {
1091        if (name.equals("identifier")) {
1092          this.getIdentifier().add(castToIdentifier(value));
1093        } else if (name.equals("name")) {
1094          this.getName().add(castToHumanName(value));
1095        } else if (name.equals("telecom")) {
1096          this.getTelecom().add(castToContactPoint(value));
1097        } else if (name.equals("gender")) {
1098          value = new AdministrativeGenderEnumFactory().fromType(castToCode(value));
1099          this.gender = (Enumeration) value; // Enumeration<AdministrativeGender>
1100        } else if (name.equals("birthDate")) {
1101          this.birthDate = castToDate(value); // DateType
1102        } else if (name.equals("address")) {
1103          this.getAddress().add(castToAddress(value));
1104        } else if (name.equals("photo")) {
1105          this.photo = castToAttachment(value); // Attachment
1106        } else if (name.equals("managingOrganization")) {
1107          this.managingOrganization = castToReference(value); // Reference
1108        } else if (name.equals("active")) {
1109          this.active = castToBoolean(value); // BooleanType
1110        } else if (name.equals("link")) {
1111          this.getLink().add((PersonLinkComponent) value);
1112        } else
1113          return super.setProperty(name, value);
1114        return value;
1115      }
1116
1117      @Override
1118      public Base makeProperty(int hash, String name) throws FHIRException {
1119        switch (hash) {
1120        case -1618432855:  return addIdentifier(); 
1121        case 3373707:  return addName(); 
1122        case -1429363305:  return addTelecom(); 
1123        case -1249512767:  return getGenderElement();
1124        case -1210031859:  return getBirthDateElement();
1125        case -1147692044:  return addAddress(); 
1126        case 106642994:  return getPhoto(); 
1127        case -2058947787:  return getManagingOrganization(); 
1128        case -1422950650:  return getActiveElement();
1129        case 3321850:  return addLink(); 
1130        default: return super.makeProperty(hash, name);
1131        }
1132
1133      }
1134
1135      @Override
1136      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1137        switch (hash) {
1138        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1139        case 3373707: /*name*/ return new String[] {"HumanName"};
1140        case -1429363305: /*telecom*/ return new String[] {"ContactPoint"};
1141        case -1249512767: /*gender*/ return new String[] {"code"};
1142        case -1210031859: /*birthDate*/ return new String[] {"date"};
1143        case -1147692044: /*address*/ return new String[] {"Address"};
1144        case 106642994: /*photo*/ return new String[] {"Attachment"};
1145        case -2058947787: /*managingOrganization*/ return new String[] {"Reference"};
1146        case -1422950650: /*active*/ return new String[] {"boolean"};
1147        case 3321850: /*link*/ return new String[] {};
1148        default: return super.getTypesForProperty(hash, name);
1149        }
1150
1151      }
1152
1153      @Override
1154      public Base addChild(String name) throws FHIRException {
1155        if (name.equals("identifier")) {
1156          return addIdentifier();
1157        }
1158        else if (name.equals("name")) {
1159          return addName();
1160        }
1161        else if (name.equals("telecom")) {
1162          return addTelecom();
1163        }
1164        else if (name.equals("gender")) {
1165          throw new FHIRException("Cannot call addChild on a primitive type Person.gender");
1166        }
1167        else if (name.equals("birthDate")) {
1168          throw new FHIRException("Cannot call addChild on a primitive type Person.birthDate");
1169        }
1170        else if (name.equals("address")) {
1171          return addAddress();
1172        }
1173        else if (name.equals("photo")) {
1174          this.photo = new Attachment();
1175          return this.photo;
1176        }
1177        else if (name.equals("managingOrganization")) {
1178          this.managingOrganization = new Reference();
1179          return this.managingOrganization;
1180        }
1181        else if (name.equals("active")) {
1182          throw new FHIRException("Cannot call addChild on a primitive type Person.active");
1183        }
1184        else if (name.equals("link")) {
1185          return addLink();
1186        }
1187        else
1188          return super.addChild(name);
1189      }
1190
1191  public String fhirType() {
1192    return "Person";
1193
1194  }
1195
1196      public Person copy() {
1197        Person dst = new Person();
1198        copyValues(dst);
1199        return dst;
1200      }
1201
1202      public void copyValues(Person dst) {
1203        super.copyValues(dst);
1204        if (identifier != null) {
1205          dst.identifier = new ArrayList<Identifier>();
1206          for (Identifier i : identifier)
1207            dst.identifier.add(i.copy());
1208        };
1209        if (name != null) {
1210          dst.name = new ArrayList<HumanName>();
1211          for (HumanName i : name)
1212            dst.name.add(i.copy());
1213        };
1214        if (telecom != null) {
1215          dst.telecom = new ArrayList<ContactPoint>();
1216          for (ContactPoint i : telecom)
1217            dst.telecom.add(i.copy());
1218        };
1219        dst.gender = gender == null ? null : gender.copy();
1220        dst.birthDate = birthDate == null ? null : birthDate.copy();
1221        if (address != null) {
1222          dst.address = new ArrayList<Address>();
1223          for (Address i : address)
1224            dst.address.add(i.copy());
1225        };
1226        dst.photo = photo == null ? null : photo.copy();
1227        dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy();
1228        dst.active = active == null ? null : active.copy();
1229        if (link != null) {
1230          dst.link = new ArrayList<PersonLinkComponent>();
1231          for (PersonLinkComponent i : link)
1232            dst.link.add(i.copy());
1233        };
1234      }
1235
1236      protected Person typedCopy() {
1237        return copy();
1238      }
1239
1240      @Override
1241      public boolean equalsDeep(Base other_) {
1242        if (!super.equalsDeep(other_))
1243          return false;
1244        if (!(other_ instanceof Person))
1245          return false;
1246        Person o = (Person) other_;
1247        return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true)
1248           && compareDeep(gender, o.gender, true) && compareDeep(birthDate, o.birthDate, true) && compareDeep(address, o.address, true)
1249           && compareDeep(photo, o.photo, true) && compareDeep(managingOrganization, o.managingOrganization, true)
1250           && compareDeep(active, o.active, true) && compareDeep(link, o.link, true);
1251      }
1252
1253      @Override
1254      public boolean equalsShallow(Base other_) {
1255        if (!super.equalsShallow(other_))
1256          return false;
1257        if (!(other_ instanceof Person))
1258          return false;
1259        Person o = (Person) other_;
1260        return compareValues(gender, o.gender, true) && compareValues(birthDate, o.birthDate, true) && compareValues(active, o.active, true)
1261          ;
1262      }
1263
1264      public boolean isEmpty() {
1265        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, name, telecom
1266          , gender, birthDate, address, photo, managingOrganization, active, link);
1267      }
1268
1269  @Override
1270  public ResourceType getResourceType() {
1271    return ResourceType.Person;
1272   }
1273
1274 /**
1275   * Search parameter: <b>identifier</b>
1276   * <p>
1277   * Description: <b>A person Identifier</b><br>
1278   * Type: <b>token</b><br>
1279   * Path: <b>Person.identifier</b><br>
1280   * </p>
1281   */
1282  @SearchParamDefinition(name="identifier", path="Person.identifier", description="A person Identifier", type="token" )
1283  public static final String SP_IDENTIFIER = "identifier";
1284 /**
1285   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
1286   * <p>
1287   * Description: <b>A person Identifier</b><br>
1288   * Type: <b>token</b><br>
1289   * Path: <b>Person.identifier</b><br>
1290   * </p>
1291   */
1292  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
1293
1294 /**
1295   * Search parameter: <b>address</b>
1296   * <p>
1297   * Description: <b>A server defined search that may match any of the string fields in the Address, including line, city, district, state, country, postalCode, and/or text</b><br>
1298   * Type: <b>string</b><br>
1299   * Path: <b>Person.address</b><br>
1300   * </p>
1301   */
1302  @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, district, state, country, postalCode, and/or text", type="string" )
1303  public static final String SP_ADDRESS = "address";
1304 /**
1305   * <b>Fluent Client</b> search parameter constant for <b>address</b>
1306   * <p>
1307   * Description: <b>A server defined search that may match any of the string fields in the Address, including line, city, district, state, country, postalCode, and/or text</b><br>
1308   * Type: <b>string</b><br>
1309   * Path: <b>Person.address</b><br>
1310   * </p>
1311   */
1312  public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS);
1313
1314 /**
1315   * Search parameter: <b>birthdate</b>
1316   * <p>
1317   * Description: <b>The person's date of birth</b><br>
1318   * Type: <b>date</b><br>
1319   * Path: <b>Person.birthDate</b><br>
1320   * </p>
1321   */
1322  @SearchParamDefinition(name="birthdate", path="Person.birthDate", description="The person's date of birth", type="date" )
1323  public static final String SP_BIRTHDATE = "birthdate";
1324 /**
1325   * <b>Fluent Client</b> search parameter constant for <b>birthdate</b>
1326   * <p>
1327   * Description: <b>The person's date of birth</b><br>
1328   * Type: <b>date</b><br>
1329   * Path: <b>Person.birthDate</b><br>
1330   * </p>
1331   */
1332  public static final ca.uhn.fhir.rest.gclient.DateClientParam BIRTHDATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_BIRTHDATE);
1333
1334 /**
1335   * Search parameter: <b>address-state</b>
1336   * <p>
1337   * Description: <b>A state specified in an address</b><br>
1338   * Type: <b>string</b><br>
1339   * Path: <b>Person.address.state</b><br>
1340   * </p>
1341   */
1342  @SearchParamDefinition(name="address-state", path="Person.address.state", description="A state specified in an address", type="string" )
1343  public static final String SP_ADDRESS_STATE = "address-state";
1344 /**
1345   * <b>Fluent Client</b> search parameter constant for <b>address-state</b>
1346   * <p>
1347   * Description: <b>A state specified in an address</b><br>
1348   * Type: <b>string</b><br>
1349   * Path: <b>Person.address.state</b><br>
1350   * </p>
1351   */
1352  public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_STATE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_STATE);
1353
1354 /**
1355   * Search parameter: <b>gender</b>
1356   * <p>
1357   * Description: <b>The gender of the person</b><br>
1358   * Type: <b>token</b><br>
1359   * Path: <b>Person.gender</b><br>
1360   * </p>
1361   */
1362  @SearchParamDefinition(name="gender", path="Person.gender", description="The gender of the person", type="token" )
1363  public static final String SP_GENDER = "gender";
1364 /**
1365   * <b>Fluent Client</b> search parameter constant for <b>gender</b>
1366   * <p>
1367   * Description: <b>The gender of the person</b><br>
1368   * Type: <b>token</b><br>
1369   * Path: <b>Person.gender</b><br>
1370   * </p>
1371   */
1372  public static final ca.uhn.fhir.rest.gclient.TokenClientParam GENDER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_GENDER);
1373
1374 /**
1375   * Search parameter: <b>practitioner</b>
1376   * <p>
1377   * Description: <b>The Person links to this Practitioner</b><br>
1378   * Type: <b>reference</b><br>
1379   * Path: <b>Person.link.target</b><br>
1380   * </p>
1381   */
1382  @SearchParamDefinition(name="practitioner", path="Person.link.target.where(resolve() is Practitioner)", description="The Person links to this Practitioner", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Practitioner.class } )
1383  public static final String SP_PRACTITIONER = "practitioner";
1384 /**
1385   * <b>Fluent Client</b> search parameter constant for <b>practitioner</b>
1386   * <p>
1387   * Description: <b>The Person links to this Practitioner</b><br>
1388   * Type: <b>reference</b><br>
1389   * Path: <b>Person.link.target</b><br>
1390   * </p>
1391   */
1392  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRACTITIONER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRACTITIONER);
1393
1394/**
1395   * Constant for fluent queries to be used to add include statements. Specifies
1396   * the path value of "<b>Person:practitioner</b>".
1397   */
1398  public static final ca.uhn.fhir.model.api.Include INCLUDE_PRACTITIONER = new ca.uhn.fhir.model.api.Include("Person:practitioner").toLocked();
1399
1400 /**
1401   * Search parameter: <b>link</b>
1402   * <p>
1403   * Description: <b>Any link has this Patient, Person, RelatedPerson or Practitioner reference</b><br>
1404   * Type: <b>reference</b><br>
1405   * Path: <b>Person.link.target</b><br>
1406   * </p>
1407   */
1408  @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 } )
1409  public static final String SP_LINK = "link";
1410 /**
1411   * <b>Fluent Client</b> search parameter constant for <b>link</b>
1412   * <p>
1413   * Description: <b>Any link has this Patient, Person, RelatedPerson or Practitioner reference</b><br>
1414   * Type: <b>reference</b><br>
1415   * Path: <b>Person.link.target</b><br>
1416   * </p>
1417   */
1418  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LINK = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LINK);
1419
1420/**
1421   * Constant for fluent queries to be used to add include statements. Specifies
1422   * the path value of "<b>Person:link</b>".
1423   */
1424  public static final ca.uhn.fhir.model.api.Include INCLUDE_LINK = new ca.uhn.fhir.model.api.Include("Person:link").toLocked();
1425
1426 /**
1427   * Search parameter: <b>relatedperson</b>
1428   * <p>
1429   * Description: <b>The Person links to this RelatedPerson</b><br>
1430   * Type: <b>reference</b><br>
1431   * Path: <b>Person.link.target</b><br>
1432   * </p>
1433   */
1434  @SearchParamDefinition(name="relatedperson", path="Person.link.target.where(resolve() is RelatedPerson)", description="The Person links to this RelatedPerson", type="reference", target={RelatedPerson.class } )
1435  public static final String SP_RELATEDPERSON = "relatedperson";
1436 /**
1437   * <b>Fluent Client</b> search parameter constant for <b>relatedperson</b>
1438   * <p>
1439   * Description: <b>The Person links to this RelatedPerson</b><br>
1440   * Type: <b>reference</b><br>
1441   * Path: <b>Person.link.target</b><br>
1442   * </p>
1443   */
1444  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RELATEDPERSON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RELATEDPERSON);
1445
1446/**
1447   * Constant for fluent queries to be used to add include statements. Specifies
1448   * the path value of "<b>Person:relatedperson</b>".
1449   */
1450  public static final ca.uhn.fhir.model.api.Include INCLUDE_RELATEDPERSON = new ca.uhn.fhir.model.api.Include("Person:relatedperson").toLocked();
1451
1452 /**
1453   * Search parameter: <b>address-postalcode</b>
1454   * <p>
1455   * Description: <b>A postal code specified in an address</b><br>
1456   * Type: <b>string</b><br>
1457   * Path: <b>Person.address.postalCode</b><br>
1458   * </p>
1459   */
1460  @SearchParamDefinition(name="address-postalcode", path="Person.address.postalCode", description="A postal code specified in an address", type="string" )
1461  public static final String SP_ADDRESS_POSTALCODE = "address-postalcode";
1462 /**
1463   * <b>Fluent Client</b> search parameter constant for <b>address-postalcode</b>
1464   * <p>
1465   * Description: <b>A postal code specified in an address</b><br>
1466   * Type: <b>string</b><br>
1467   * Path: <b>Person.address.postalCode</b><br>
1468   * </p>
1469   */
1470  public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_POSTALCODE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_POSTALCODE);
1471
1472 /**
1473   * Search parameter: <b>address-country</b>
1474   * <p>
1475   * Description: <b>A country specified in an address</b><br>
1476   * Type: <b>string</b><br>
1477   * Path: <b>Person.address.country</b><br>
1478   * </p>
1479   */
1480  @SearchParamDefinition(name="address-country", path="Person.address.country", description="A country specified in an address", type="string" )
1481  public static final String SP_ADDRESS_COUNTRY = "address-country";
1482 /**
1483   * <b>Fluent Client</b> search parameter constant for <b>address-country</b>
1484   * <p>
1485   * Description: <b>A country specified in an address</b><br>
1486   * Type: <b>string</b><br>
1487   * Path: <b>Person.address.country</b><br>
1488   * </p>
1489   */
1490  public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_COUNTRY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_COUNTRY);
1491
1492 /**
1493   * Search parameter: <b>phonetic</b>
1494   * <p>
1495   * Description: <b>A portion of name using some kind of phonetic matching algorithm</b><br>
1496   * Type: <b>string</b><br>
1497   * Path: <b>Person.name</b><br>
1498   * </p>
1499   */
1500  @SearchParamDefinition(name="phonetic", path="Person.name", description="A portion of name using some kind of phonetic matching algorithm", type="string" )
1501  public static final String SP_PHONETIC = "phonetic";
1502 /**
1503   * <b>Fluent Client</b> search parameter constant for <b>phonetic</b>
1504   * <p>
1505   * Description: <b>A portion of name using some kind of phonetic matching algorithm</b><br>
1506   * Type: <b>string</b><br>
1507   * Path: <b>Person.name</b><br>
1508   * </p>
1509   */
1510  public static final ca.uhn.fhir.rest.gclient.StringClientParam PHONETIC = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PHONETIC);
1511
1512 /**
1513   * Search parameter: <b>phone</b>
1514   * <p>
1515   * Description: <b>A value in a phone contact</b><br>
1516   * Type: <b>token</b><br>
1517   * Path: <b>Person.telecom(system=phone)</b><br>
1518   * </p>
1519   */
1520  @SearchParamDefinition(name="phone", path="Person.telecom.where(system='phone')", description="A value in a phone contact", type="token" )
1521  public static final String SP_PHONE = "phone";
1522 /**
1523   * <b>Fluent Client</b> search parameter constant for <b>phone</b>
1524   * <p>
1525   * Description: <b>A value in a phone contact</b><br>
1526   * Type: <b>token</b><br>
1527   * Path: <b>Person.telecom(system=phone)</b><br>
1528   * </p>
1529   */
1530  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PHONE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PHONE);
1531
1532 /**
1533   * Search parameter: <b>patient</b>
1534   * <p>
1535   * Description: <b>The Person links to this Patient</b><br>
1536   * Type: <b>reference</b><br>
1537   * Path: <b>Person.link.target</b><br>
1538   * </p>
1539   */
1540  @SearchParamDefinition(name="patient", path="Person.link.target.where(resolve() is Patient)", description="The Person links to this Patient", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Patient.class } )
1541  public static final String SP_PATIENT = "patient";
1542 /**
1543   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
1544   * <p>
1545   * Description: <b>The Person links to this Patient</b><br>
1546   * Type: <b>reference</b><br>
1547   * Path: <b>Person.link.target</b><br>
1548   * </p>
1549   */
1550  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
1551
1552/**
1553   * Constant for fluent queries to be used to add include statements. Specifies
1554   * the path value of "<b>Person:patient</b>".
1555   */
1556  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Person:patient").toLocked();
1557
1558 /**
1559   * Search parameter: <b>organization</b>
1560   * <p>
1561   * Description: <b>The organization at which this person record is being managed</b><br>
1562   * Type: <b>reference</b><br>
1563   * Path: <b>Person.managingOrganization</b><br>
1564   * </p>
1565   */
1566  @SearchParamDefinition(name="organization", path="Person.managingOrganization", description="The organization at which this person record is being managed", type="reference", target={Organization.class } )
1567  public static final String SP_ORGANIZATION = "organization";
1568 /**
1569   * <b>Fluent Client</b> search parameter constant for <b>organization</b>
1570   * <p>
1571   * Description: <b>The organization at which this person record is being managed</b><br>
1572   * Type: <b>reference</b><br>
1573   * Path: <b>Person.managingOrganization</b><br>
1574   * </p>
1575   */
1576  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION);
1577
1578/**
1579   * Constant for fluent queries to be used to add include statements. Specifies
1580   * the path value of "<b>Person:organization</b>".
1581   */
1582  public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("Person:organization").toLocked();
1583
1584 /**
1585   * Search parameter: <b>name</b>
1586   * <p>
1587   * 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>
1588   * Type: <b>string</b><br>
1589   * Path: <b>Person.name</b><br>
1590   * </p>
1591   */
1592  @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" )
1593  public static final String SP_NAME = "name";
1594 /**
1595   * <b>Fluent Client</b> search parameter constant for <b>name</b>
1596   * <p>
1597   * 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>
1598   * Type: <b>string</b><br>
1599   * Path: <b>Person.name</b><br>
1600   * </p>
1601   */
1602  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
1603
1604 /**
1605   * Search parameter: <b>address-use</b>
1606   * <p>
1607   * Description: <b>A use code specified in an address</b><br>
1608   * Type: <b>token</b><br>
1609   * Path: <b>Person.address.use</b><br>
1610   * </p>
1611   */
1612  @SearchParamDefinition(name="address-use", path="Person.address.use", description="A use code specified in an address", type="token" )
1613  public static final String SP_ADDRESS_USE = "address-use";
1614 /**
1615   * <b>Fluent Client</b> search parameter constant for <b>address-use</b>
1616   * <p>
1617   * Description: <b>A use code specified in an address</b><br>
1618   * Type: <b>token</b><br>
1619   * Path: <b>Person.address.use</b><br>
1620   * </p>
1621   */
1622  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ADDRESS_USE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ADDRESS_USE);
1623
1624 /**
1625   * Search parameter: <b>telecom</b>
1626   * <p>
1627   * Description: <b>The value in any kind of contact</b><br>
1628   * Type: <b>token</b><br>
1629   * Path: <b>Person.telecom</b><br>
1630   * </p>
1631   */
1632  @SearchParamDefinition(name="telecom", path="Person.telecom", description="The value in any kind of contact", type="token" )
1633  public static final String SP_TELECOM = "telecom";
1634 /**
1635   * <b>Fluent Client</b> search parameter constant for <b>telecom</b>
1636   * <p>
1637   * Description: <b>The value in any kind of contact</b><br>
1638   * Type: <b>token</b><br>
1639   * Path: <b>Person.telecom</b><br>
1640   * </p>
1641   */
1642  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TELECOM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TELECOM);
1643
1644 /**
1645   * Search parameter: <b>address-city</b>
1646   * <p>
1647   * Description: <b>A city specified in an address</b><br>
1648   * Type: <b>string</b><br>
1649   * Path: <b>Person.address.city</b><br>
1650   * </p>
1651   */
1652  @SearchParamDefinition(name="address-city", path="Person.address.city", description="A city specified in an address", type="string" )
1653  public static final String SP_ADDRESS_CITY = "address-city";
1654 /**
1655   * <b>Fluent Client</b> search parameter constant for <b>address-city</b>
1656   * <p>
1657   * Description: <b>A city specified in an address</b><br>
1658   * Type: <b>string</b><br>
1659   * Path: <b>Person.address.city</b><br>
1660   * </p>
1661   */
1662  public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_CITY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_CITY);
1663
1664 /**
1665   * Search parameter: <b>email</b>
1666   * <p>
1667   * Description: <b>A value in an email contact</b><br>
1668   * Type: <b>token</b><br>
1669   * Path: <b>Person.telecom(system=email)</b><br>
1670   * </p>
1671   */
1672  @SearchParamDefinition(name="email", path="Person.telecom.where(system='email')", description="A value in an email contact", type="token" )
1673  public static final String SP_EMAIL = "email";
1674 /**
1675   * <b>Fluent Client</b> search parameter constant for <b>email</b>
1676   * <p>
1677   * Description: <b>A value in an email contact</b><br>
1678   * Type: <b>token</b><br>
1679   * Path: <b>Person.telecom(system=email)</b><br>
1680   * </p>
1681   */
1682  public static final ca.uhn.fhir.rest.gclient.TokenClientParam EMAIL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EMAIL);
1683
1684
1685}