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