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