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