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