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