001package org.hl7.fhir.r4.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Thu, Sep 13, 2018 09:04-0400 for FHIR v3.5.0
033
034import java.util.*;
035
036import org.hl7.fhir.utilities.Utilities;
037import org.hl7.fhir.r4.model.Enumerations.*;
038import ca.uhn.fhir.model.api.annotation.ResourceDef;
039import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
040import ca.uhn.fhir.model.api.annotation.Child;
041import ca.uhn.fhir.model.api.annotation.ChildOrder;
042import ca.uhn.fhir.model.api.annotation.Description;
043import ca.uhn.fhir.model.api.annotation.Block;
044import org.hl7.fhir.instance.model.api.*;
045import org.hl7.fhir.exceptions.FHIRException;
046/**
047 * Demographics and other administrative information about an individual or animal receiving care or other health-related services.
048 */
049@ResourceDef(name="Patient", profile="http://hl7.org/fhir/StructureDefinition/Patient")
050public class Patient extends DomainResource {
051
052    public enum LinkType {
053        /**
054         * The patient resource containing this link must no longer be used. The link points forward to another patient resource that must be used in lieu of the patient resource that contains this link.
055         */
056        REPLACEDBY, 
057        /**
058         * The patient resource containing this link is the current active patient record. The link points back to an inactive patient resource that has been merged into this resource, and should be consulted to retrieve additional referenced information.
059         */
060        REPLACES, 
061        /**
062         * The patient resource containing this link is in use and valid but not considered the main source of information about a patient. The link points forward to another patient resource that should be consulted to retrieve additional patient information.
063         */
064        REFER, 
065        /**
066         * The patient resource containing this link is in use and valid, but points to another patient resource that is known to contain data about the same person. Data in this resource might overlap or contradict information found in the other patient resource. This link does not indicate any relative importance of the resources concerned, and both should be regarded as equally valid.
067         */
068        SEEALSO, 
069        /**
070         * added to help the parsers with the generic types
071         */
072        NULL;
073        public static LinkType fromCode(String codeString) throws FHIRException {
074            if (codeString == null || "".equals(codeString))
075                return null;
076        if ("replaced-by".equals(codeString))
077          return REPLACEDBY;
078        if ("replaces".equals(codeString))
079          return REPLACES;
080        if ("refer".equals(codeString))
081          return REFER;
082        if ("seealso".equals(codeString))
083          return SEEALSO;
084        if (Configuration.isAcceptInvalidEnums())
085          return null;
086        else
087          throw new FHIRException("Unknown LinkType code '"+codeString+"'");
088        }
089        public String toCode() {
090          switch (this) {
091            case REPLACEDBY: return "replaced-by";
092            case REPLACES: return "replaces";
093            case REFER: return "refer";
094            case SEEALSO: return "seealso";
095            default: return "?";
096          }
097        }
098        public String getSystem() {
099          switch (this) {
100            case REPLACEDBY: return "http://hl7.org/fhir/link-type";
101            case REPLACES: return "http://hl7.org/fhir/link-type";
102            case REFER: return "http://hl7.org/fhir/link-type";
103            case SEEALSO: return "http://hl7.org/fhir/link-type";
104            default: return "?";
105          }
106        }
107        public String getDefinition() {
108          switch (this) {
109            case REPLACEDBY: return "The patient resource containing this link must no longer be used. The link points forward to another patient resource that must be used in lieu of the patient resource that contains this link.";
110            case REPLACES: return "The patient resource containing this link is the current active patient record. The link points back to an inactive patient resource that has been merged into this resource, and should be consulted to retrieve additional referenced information.";
111            case REFER: return "The patient resource containing this link is in use and valid but not considered the main source of information about a patient. The link points forward to another patient resource that should be consulted to retrieve additional patient information.";
112            case SEEALSO: return "The patient resource containing this link is in use and valid, but points to another patient resource that is known to contain data about the same person. Data in this resource might overlap or contradict information found in the other patient resource. This link does not indicate any relative importance of the resources concerned, and both should be regarded as equally valid.";
113            default: return "?";
114          }
115        }
116        public String getDisplay() {
117          switch (this) {
118            case REPLACEDBY: return "Replaced-by";
119            case REPLACES: return "Replaces";
120            case REFER: return "Refer";
121            case SEEALSO: return "See also";
122            default: return "?";
123          }
124        }
125    }
126
127  public static class LinkTypeEnumFactory implements EnumFactory<LinkType> {
128    public LinkType fromCode(String codeString) throws IllegalArgumentException {
129      if (codeString == null || "".equals(codeString))
130            if (codeString == null || "".equals(codeString))
131                return null;
132        if ("replaced-by".equals(codeString))
133          return LinkType.REPLACEDBY;
134        if ("replaces".equals(codeString))
135          return LinkType.REPLACES;
136        if ("refer".equals(codeString))
137          return LinkType.REFER;
138        if ("seealso".equals(codeString))
139          return LinkType.SEEALSO;
140        throw new IllegalArgumentException("Unknown LinkType code '"+codeString+"'");
141        }
142        public Enumeration<LinkType> fromType(Base code) throws FHIRException {
143          if (code == null)
144            return null;
145          if (code.isEmpty())
146            return new Enumeration<LinkType>(this);
147          String codeString = ((PrimitiveType) code).asStringValue();
148          if (codeString == null || "".equals(codeString))
149            return null;
150        if ("replaced-by".equals(codeString))
151          return new Enumeration<LinkType>(this, LinkType.REPLACEDBY);
152        if ("replaces".equals(codeString))
153          return new Enumeration<LinkType>(this, LinkType.REPLACES);
154        if ("refer".equals(codeString))
155          return new Enumeration<LinkType>(this, LinkType.REFER);
156        if ("seealso".equals(codeString))
157          return new Enumeration<LinkType>(this, LinkType.SEEALSO);
158        throw new FHIRException("Unknown LinkType code '"+codeString+"'");
159        }
160    public String toCode(LinkType code) {
161      if (code == LinkType.REPLACEDBY)
162        return "replaced-by";
163      if (code == LinkType.REPLACES)
164        return "replaces";
165      if (code == LinkType.REFER)
166        return "refer";
167      if (code == LinkType.SEEALSO)
168        return "seealso";
169      return "?";
170      }
171    public String toSystem(LinkType code) {
172      return code.getSystem();
173      }
174    }
175
176    @Block()
177    public static class ContactComponent extends BackboneElement implements IBaseBackboneElement {
178        /**
179         * The nature of the relationship between the patient and the contact person.
180         */
181        @Child(name = "relationship", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
182        @Description(shortDefinition="The kind of relationship", formalDefinition="The nature of the relationship between the patient and the contact person." )
183        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/patient-contactrelationship")
184        protected List<CodeableConcept> relationship;
185
186        /**
187         * A name associated with the contact person.
188         */
189        @Child(name = "name", type = {HumanName.class}, order=2, min=0, max=1, modifier=false, summary=false)
190        @Description(shortDefinition="A name associated with the contact person", formalDefinition="A name associated with the contact person." )
191        protected HumanName name;
192
193        /**
194         * A contact detail for the person, e.g. a telephone number or an email address.
195         */
196        @Child(name = "telecom", type = {ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
197        @Description(shortDefinition="A contact detail for the person", formalDefinition="A contact detail for the person, e.g. a telephone number or an email address." )
198        protected List<ContactPoint> telecom;
199
200        /**
201         * Address for the contact person.
202         */
203        @Child(name = "address", type = {Address.class}, order=4, min=0, max=1, modifier=false, summary=false)
204        @Description(shortDefinition="Address for the contact person", formalDefinition="Address for the contact person." )
205        protected Address address;
206
207        /**
208         * Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.
209         */
210        @Child(name = "gender", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=false)
211        @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes." )
212        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/administrative-gender")
213        protected Enumeration<AdministrativeGender> gender;
214
215        /**
216         * Organization on behalf of which the contact is acting or for which the contact is working.
217         */
218        @Child(name = "organization", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=false)
219        @Description(shortDefinition="Organization that is associated with the contact", formalDefinition="Organization on behalf of which the contact is acting or for which the contact is working." )
220        protected Reference organization;
221
222        /**
223         * The actual object that is the target of the reference (Organization on behalf of which the contact is acting or for which the contact is working.)
224         */
225        protected Organization organizationTarget;
226
227        /**
228         * The period during which this contact person or organization is valid to be contacted relating to this patient.
229         */
230        @Child(name = "period", type = {Period.class}, order=7, min=0, max=1, modifier=false, summary=false)
231        @Description(shortDefinition="The period during which this contact person or organization is valid to be contacted relating to this patient", formalDefinition="The period during which this contact person or organization is valid to be contacted relating to this patient." )
232        protected Period period;
233
234        private static final long serialVersionUID = 364269017L;
235
236    /**
237     * Constructor
238     */
239      public ContactComponent() {
240        super();
241      }
242
243        /**
244         * @return {@link #relationship} (The nature of the relationship between the patient and the contact person.)
245         */
246        public List<CodeableConcept> getRelationship() { 
247          if (this.relationship == null)
248            this.relationship = new ArrayList<CodeableConcept>();
249          return this.relationship;
250        }
251
252        /**
253         * @return Returns a reference to <code>this</code> for easy method chaining
254         */
255        public ContactComponent setRelationship(List<CodeableConcept> theRelationship) { 
256          this.relationship = theRelationship;
257          return this;
258        }
259
260        public boolean hasRelationship() { 
261          if (this.relationship == null)
262            return false;
263          for (CodeableConcept item : this.relationship)
264            if (!item.isEmpty())
265              return true;
266          return false;
267        }
268
269        public CodeableConcept addRelationship() { //3
270          CodeableConcept t = new CodeableConcept();
271          if (this.relationship == null)
272            this.relationship = new ArrayList<CodeableConcept>();
273          this.relationship.add(t);
274          return t;
275        }
276
277        public ContactComponent addRelationship(CodeableConcept t) { //3
278          if (t == null)
279            return this;
280          if (this.relationship == null)
281            this.relationship = new ArrayList<CodeableConcept>();
282          this.relationship.add(t);
283          return this;
284        }
285
286        /**
287         * @return The first repetition of repeating field {@link #relationship}, creating it if it does not already exist
288         */
289        public CodeableConcept getRelationshipFirstRep() { 
290          if (getRelationship().isEmpty()) {
291            addRelationship();
292          }
293          return getRelationship().get(0);
294        }
295
296        /**
297         * @return {@link #name} (A name associated with the contact person.)
298         */
299        public HumanName getName() { 
300          if (this.name == null)
301            if (Configuration.errorOnAutoCreate())
302              throw new Error("Attempt to auto-create ContactComponent.name");
303            else if (Configuration.doAutoCreate())
304              this.name = new HumanName(); // cc
305          return this.name;
306        }
307
308        public boolean hasName() { 
309          return this.name != null && !this.name.isEmpty();
310        }
311
312        /**
313         * @param value {@link #name} (A name associated with the contact person.)
314         */
315        public ContactComponent setName(HumanName value) { 
316          this.name = value;
317          return this;
318        }
319
320        /**
321         * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.)
322         */
323        public List<ContactPoint> getTelecom() { 
324          if (this.telecom == null)
325            this.telecom = new ArrayList<ContactPoint>();
326          return this.telecom;
327        }
328
329        /**
330         * @return Returns a reference to <code>this</code> for easy method chaining
331         */
332        public ContactComponent setTelecom(List<ContactPoint> theTelecom) { 
333          this.telecom = theTelecom;
334          return this;
335        }
336
337        public boolean hasTelecom() { 
338          if (this.telecom == null)
339            return false;
340          for (ContactPoint item : this.telecom)
341            if (!item.isEmpty())
342              return true;
343          return false;
344        }
345
346        public ContactPoint addTelecom() { //3
347          ContactPoint t = new ContactPoint();
348          if (this.telecom == null)
349            this.telecom = new ArrayList<ContactPoint>();
350          this.telecom.add(t);
351          return t;
352        }
353
354        public ContactComponent addTelecom(ContactPoint t) { //3
355          if (t == null)
356            return this;
357          if (this.telecom == null)
358            this.telecom = new ArrayList<ContactPoint>();
359          this.telecom.add(t);
360          return this;
361        }
362
363        /**
364         * @return The first repetition of repeating field {@link #telecom}, creating it if it does not already exist
365         */
366        public ContactPoint getTelecomFirstRep() { 
367          if (getTelecom().isEmpty()) {
368            addTelecom();
369          }
370          return getTelecom().get(0);
371        }
372
373        /**
374         * @return {@link #address} (Address for the contact person.)
375         */
376        public Address getAddress() { 
377          if (this.address == null)
378            if (Configuration.errorOnAutoCreate())
379              throw new Error("Attempt to auto-create ContactComponent.address");
380            else if (Configuration.doAutoCreate())
381              this.address = new Address(); // cc
382          return this.address;
383        }
384
385        public boolean hasAddress() { 
386          return this.address != null && !this.address.isEmpty();
387        }
388
389        /**
390         * @param value {@link #address} (Address for the contact person.)
391         */
392        public ContactComponent setAddress(Address value) { 
393          this.address = value;
394          return this;
395        }
396
397        /**
398         * @return {@link #gender} (Administrative Gender - the gender that the contact 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
399         */
400        public Enumeration<AdministrativeGender> getGenderElement() { 
401          if (this.gender == null)
402            if (Configuration.errorOnAutoCreate())
403              throw new Error("Attempt to auto-create ContactComponent.gender");
404            else if (Configuration.doAutoCreate())
405              this.gender = new Enumeration<AdministrativeGender>(new AdministrativeGenderEnumFactory()); // bb
406          return this.gender;
407        }
408
409        public boolean hasGenderElement() { 
410          return this.gender != null && !this.gender.isEmpty();
411        }
412
413        public boolean hasGender() { 
414          return this.gender != null && !this.gender.isEmpty();
415        }
416
417        /**
418         * @param value {@link #gender} (Administrative Gender - the gender that the contact 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
419         */
420        public ContactComponent setGenderElement(Enumeration<AdministrativeGender> value) { 
421          this.gender = value;
422          return this;
423        }
424
425        /**
426         * @return Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.
427         */
428        public AdministrativeGender getGender() { 
429          return this.gender == null ? null : this.gender.getValue();
430        }
431
432        /**
433         * @param value Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.
434         */
435        public ContactComponent setGender(AdministrativeGender value) { 
436          if (value == null)
437            this.gender = null;
438          else {
439            if (this.gender == null)
440              this.gender = new Enumeration<AdministrativeGender>(new AdministrativeGenderEnumFactory());
441            this.gender.setValue(value);
442          }
443          return this;
444        }
445
446        /**
447         * @return {@link #organization} (Organization on behalf of which the contact is acting or for which the contact is working.)
448         */
449        public Reference getOrganization() { 
450          if (this.organization == null)
451            if (Configuration.errorOnAutoCreate())
452              throw new Error("Attempt to auto-create ContactComponent.organization");
453            else if (Configuration.doAutoCreate())
454              this.organization = new Reference(); // cc
455          return this.organization;
456        }
457
458        public boolean hasOrganization() { 
459          return this.organization != null && !this.organization.isEmpty();
460        }
461
462        /**
463         * @param value {@link #organization} (Organization on behalf of which the contact is acting or for which the contact is working.)
464         */
465        public ContactComponent setOrganization(Reference value) { 
466          this.organization = value;
467          return this;
468        }
469
470        /**
471         * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Organization on behalf of which the contact is acting or for which the contact is working.)
472         */
473        public Organization getOrganizationTarget() { 
474          if (this.organizationTarget == null)
475            if (Configuration.errorOnAutoCreate())
476              throw new Error("Attempt to auto-create ContactComponent.organization");
477            else if (Configuration.doAutoCreate())
478              this.organizationTarget = new Organization(); // aa
479          return this.organizationTarget;
480        }
481
482        /**
483         * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Organization on behalf of which the contact is acting or for which the contact is working.)
484         */
485        public ContactComponent setOrganizationTarget(Organization value) { 
486          this.organizationTarget = value;
487          return this;
488        }
489
490        /**
491         * @return {@link #period} (The period during which this contact person or organization is valid to be contacted relating to this patient.)
492         */
493        public Period getPeriod() { 
494          if (this.period == null)
495            if (Configuration.errorOnAutoCreate())
496              throw new Error("Attempt to auto-create ContactComponent.period");
497            else if (Configuration.doAutoCreate())
498              this.period = new Period(); // cc
499          return this.period;
500        }
501
502        public boolean hasPeriod() { 
503          return this.period != null && !this.period.isEmpty();
504        }
505
506        /**
507         * @param value {@link #period} (The period during which this contact person or organization is valid to be contacted relating to this patient.)
508         */
509        public ContactComponent setPeriod(Period value) { 
510          this.period = value;
511          return this;
512        }
513
514        protected void listChildren(List<Property> children) {
515          super.listChildren(children);
516          children.add(new Property("relationship", "CodeableConcept", "The nature of the relationship between the patient and the contact person.", 0, java.lang.Integer.MAX_VALUE, relationship));
517          children.add(new Property("name", "HumanName", "A name associated with the contact person.", 0, 1, name));
518          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));
519          children.add(new Property("address", "Address", "Address for the contact person.", 0, 1, address));
520          children.add(new Property("gender", "code", "Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.", 0, 1, gender));
521          children.add(new Property("organization", "Reference(Organization)", "Organization on behalf of which the contact is acting or for which the contact is working.", 0, 1, organization));
522          children.add(new Property("period", "Period", "The period during which this contact person or organization is valid to be contacted relating to this patient.", 0, 1, period));
523        }
524
525        @Override
526        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
527          switch (_hash) {
528          case -261851592: /*relationship*/  return new Property("relationship", "CodeableConcept", "The nature of the relationship between the patient and the contact person.", 0, java.lang.Integer.MAX_VALUE, relationship);
529          case 3373707: /*name*/  return new Property("name", "HumanName", "A name associated with the contact person.", 0, 1, name);
530          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);
531          case -1147692044: /*address*/  return new Property("address", "Address", "Address for the contact person.", 0, 1, address);
532          case -1249512767: /*gender*/  return new Property("gender", "code", "Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.", 0, 1, gender);
533          case 1178922291: /*organization*/  return new Property("organization", "Reference(Organization)", "Organization on behalf of which the contact is acting or for which the contact is working.", 0, 1, organization);
534          case -991726143: /*period*/  return new Property("period", "Period", "The period during which this contact person or organization is valid to be contacted relating to this patient.", 0, 1, period);
535          default: return super.getNamedProperty(_hash, _name, _checkValid);
536          }
537
538        }
539
540      @Override
541      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
542        switch (hash) {
543        case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : this.relationship.toArray(new Base[this.relationship.size()]); // CodeableConcept
544        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // HumanName
545        case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint
546        case -1147692044: /*address*/ return this.address == null ? new Base[0] : new Base[] {this.address}; // Address
547        case -1249512767: /*gender*/ return this.gender == null ? new Base[0] : new Base[] {this.gender}; // Enumeration<AdministrativeGender>
548        case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference
549        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
550        default: return super.getProperty(hash, name, checkValid);
551        }
552
553      }
554
555      @Override
556      public Base setProperty(int hash, String name, Base value) throws FHIRException {
557        switch (hash) {
558        case -261851592: // relationship
559          this.getRelationship().add(castToCodeableConcept(value)); // CodeableConcept
560          return value;
561        case 3373707: // name
562          this.name = castToHumanName(value); // HumanName
563          return value;
564        case -1429363305: // telecom
565          this.getTelecom().add(castToContactPoint(value)); // ContactPoint
566          return value;
567        case -1147692044: // address
568          this.address = castToAddress(value); // Address
569          return value;
570        case -1249512767: // gender
571          value = new AdministrativeGenderEnumFactory().fromType(castToCode(value));
572          this.gender = (Enumeration) value; // Enumeration<AdministrativeGender>
573          return value;
574        case 1178922291: // organization
575          this.organization = castToReference(value); // Reference
576          return value;
577        case -991726143: // period
578          this.period = castToPeriod(value); // Period
579          return value;
580        default: return super.setProperty(hash, name, value);
581        }
582
583      }
584
585      @Override
586      public Base setProperty(String name, Base value) throws FHIRException {
587        if (name.equals("relationship")) {
588          this.getRelationship().add(castToCodeableConcept(value));
589        } else if (name.equals("name")) {
590          this.name = castToHumanName(value); // HumanName
591        } else if (name.equals("telecom")) {
592          this.getTelecom().add(castToContactPoint(value));
593        } else if (name.equals("address")) {
594          this.address = castToAddress(value); // Address
595        } else if (name.equals("gender")) {
596          value = new AdministrativeGenderEnumFactory().fromType(castToCode(value));
597          this.gender = (Enumeration) value; // Enumeration<AdministrativeGender>
598        } else if (name.equals("organization")) {
599          this.organization = castToReference(value); // Reference
600        } else if (name.equals("period")) {
601          this.period = castToPeriod(value); // Period
602        } else
603          return super.setProperty(name, value);
604        return value;
605      }
606
607      @Override
608      public Base makeProperty(int hash, String name) throws FHIRException {
609        switch (hash) {
610        case -261851592:  return addRelationship(); 
611        case 3373707:  return getName(); 
612        case -1429363305:  return addTelecom(); 
613        case -1147692044:  return getAddress(); 
614        case -1249512767:  return getGenderElement();
615        case 1178922291:  return getOrganization(); 
616        case -991726143:  return getPeriod(); 
617        default: return super.makeProperty(hash, name);
618        }
619
620      }
621
622      @Override
623      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
624        switch (hash) {
625        case -261851592: /*relationship*/ return new String[] {"CodeableConcept"};
626        case 3373707: /*name*/ return new String[] {"HumanName"};
627        case -1429363305: /*telecom*/ return new String[] {"ContactPoint"};
628        case -1147692044: /*address*/ return new String[] {"Address"};
629        case -1249512767: /*gender*/ return new String[] {"code"};
630        case 1178922291: /*organization*/ return new String[] {"Reference"};
631        case -991726143: /*period*/ return new String[] {"Period"};
632        default: return super.getTypesForProperty(hash, name);
633        }
634
635      }
636
637      @Override
638      public Base addChild(String name) throws FHIRException {
639        if (name.equals("relationship")) {
640          return addRelationship();
641        }
642        else if (name.equals("name")) {
643          this.name = new HumanName();
644          return this.name;
645        }
646        else if (name.equals("telecom")) {
647          return addTelecom();
648        }
649        else if (name.equals("address")) {
650          this.address = new Address();
651          return this.address;
652        }
653        else if (name.equals("gender")) {
654          throw new FHIRException("Cannot call addChild on a primitive type Patient.gender");
655        }
656        else if (name.equals("organization")) {
657          this.organization = new Reference();
658          return this.organization;
659        }
660        else if (name.equals("period")) {
661          this.period = new Period();
662          return this.period;
663        }
664        else
665          return super.addChild(name);
666      }
667
668      public ContactComponent copy() {
669        ContactComponent dst = new ContactComponent();
670        copyValues(dst);
671        if (relationship != null) {
672          dst.relationship = new ArrayList<CodeableConcept>();
673          for (CodeableConcept i : relationship)
674            dst.relationship.add(i.copy());
675        };
676        dst.name = name == null ? null : name.copy();
677        if (telecom != null) {
678          dst.telecom = new ArrayList<ContactPoint>();
679          for (ContactPoint i : telecom)
680            dst.telecom.add(i.copy());
681        };
682        dst.address = address == null ? null : address.copy();
683        dst.gender = gender == null ? null : gender.copy();
684        dst.organization = organization == null ? null : organization.copy();
685        dst.period = period == null ? null : period.copy();
686        return dst;
687      }
688
689      @Override
690      public boolean equalsDeep(Base other_) {
691        if (!super.equalsDeep(other_))
692          return false;
693        if (!(other_ instanceof ContactComponent))
694          return false;
695        ContactComponent o = (ContactComponent) other_;
696        return compareDeep(relationship, o.relationship, true) && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true)
697           && compareDeep(address, o.address, true) && compareDeep(gender, o.gender, true) && compareDeep(organization, o.organization, true)
698           && compareDeep(period, o.period, true);
699      }
700
701      @Override
702      public boolean equalsShallow(Base other_) {
703        if (!super.equalsShallow(other_))
704          return false;
705        if (!(other_ instanceof ContactComponent))
706          return false;
707        ContactComponent o = (ContactComponent) other_;
708        return compareValues(gender, o.gender, true);
709      }
710
711      public boolean isEmpty() {
712        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(relationship, name, telecom
713          , address, gender, organization, period);
714      }
715
716  public String fhirType() {
717    return "Patient.contact";
718
719  }
720
721  }
722
723    @Block()
724    public static class PatientCommunicationComponent extends BackboneElement implements IBaseBackboneElement {
725        /**
726         * 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.
727         */
728        @Child(name = "language", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
729        @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." )
730        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/languages")
731        protected CodeableConcept language;
732
733        /**
734         * Indicates whether or not the patient prefers this language (over other languages he masters up a certain level).
735         */
736        @Child(name = "preferred", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false)
737        @Description(shortDefinition="Language preference indicator", formalDefinition="Indicates whether or not the patient prefers this language (over other languages he masters up a certain level)." )
738        protected BooleanType preferred;
739
740        private static final long serialVersionUID = 633792918L;
741
742    /**
743     * Constructor
744     */
745      public PatientCommunicationComponent() {
746        super();
747      }
748
749    /**
750     * Constructor
751     */
752      public PatientCommunicationComponent(CodeableConcept language) {
753        super();
754        this.language = language;
755      }
756
757        /**
758         * @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.)
759         */
760        public CodeableConcept getLanguage() { 
761          if (this.language == null)
762            if (Configuration.errorOnAutoCreate())
763              throw new Error("Attempt to auto-create PatientCommunicationComponent.language");
764            else if (Configuration.doAutoCreate())
765              this.language = new CodeableConcept(); // cc
766          return this.language;
767        }
768
769        public boolean hasLanguage() { 
770          return this.language != null && !this.language.isEmpty();
771        }
772
773        /**
774         * @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.)
775         */
776        public PatientCommunicationComponent setLanguage(CodeableConcept value) { 
777          this.language = value;
778          return this;
779        }
780
781        /**
782         * @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
783         */
784        public BooleanType getPreferredElement() { 
785          if (this.preferred == null)
786            if (Configuration.errorOnAutoCreate())
787              throw new Error("Attempt to auto-create PatientCommunicationComponent.preferred");
788            else if (Configuration.doAutoCreate())
789              this.preferred = new BooleanType(); // bb
790          return this.preferred;
791        }
792
793        public boolean hasPreferredElement() { 
794          return this.preferred != null && !this.preferred.isEmpty();
795        }
796
797        public boolean hasPreferred() { 
798          return this.preferred != null && !this.preferred.isEmpty();
799        }
800
801        /**
802         * @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
803         */
804        public PatientCommunicationComponent setPreferredElement(BooleanType value) { 
805          this.preferred = value;
806          return this;
807        }
808
809        /**
810         * @return Indicates whether or not the patient prefers this language (over other languages he masters up a certain level).
811         */
812        public boolean getPreferred() { 
813          return this.preferred == null || this.preferred.isEmpty() ? false : this.preferred.getValue();
814        }
815
816        /**
817         * @param value Indicates whether or not the patient prefers this language (over other languages he masters up a certain level).
818         */
819        public PatientCommunicationComponent setPreferred(boolean value) { 
820            if (this.preferred == null)
821              this.preferred = new BooleanType();
822            this.preferred.setValue(value);
823          return this;
824        }
825
826        protected void listChildren(List<Property> children) {
827          super.listChildren(children);
828          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));
829          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));
830        }
831
832        @Override
833        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
834          switch (_hash) {
835          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);
836          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);
837          default: return super.getNamedProperty(_hash, _name, _checkValid);
838          }
839
840        }
841
842      @Override
843      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
844        switch (hash) {
845        case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeableConcept
846        case -1294005119: /*preferred*/ return this.preferred == null ? new Base[0] : new Base[] {this.preferred}; // BooleanType
847        default: return super.getProperty(hash, name, checkValid);
848        }
849
850      }
851
852      @Override
853      public Base setProperty(int hash, String name, Base value) throws FHIRException {
854        switch (hash) {
855        case -1613589672: // language
856          this.language = castToCodeableConcept(value); // CodeableConcept
857          return value;
858        case -1294005119: // preferred
859          this.preferred = castToBoolean(value); // BooleanType
860          return value;
861        default: return super.setProperty(hash, name, value);
862        }
863
864      }
865
866      @Override
867      public Base setProperty(String name, Base value) throws FHIRException {
868        if (name.equals("language")) {
869          this.language = castToCodeableConcept(value); // CodeableConcept
870        } else if (name.equals("preferred")) {
871          this.preferred = castToBoolean(value); // BooleanType
872        } else
873          return super.setProperty(name, value);
874        return value;
875      }
876
877      @Override
878      public Base makeProperty(int hash, String name) throws FHIRException {
879        switch (hash) {
880        case -1613589672:  return getLanguage(); 
881        case -1294005119:  return getPreferredElement();
882        default: return super.makeProperty(hash, name);
883        }
884
885      }
886
887      @Override
888      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
889        switch (hash) {
890        case -1613589672: /*language*/ return new String[] {"CodeableConcept"};
891        case -1294005119: /*preferred*/ return new String[] {"boolean"};
892        default: return super.getTypesForProperty(hash, name);
893        }
894
895      }
896
897      @Override
898      public Base addChild(String name) throws FHIRException {
899        if (name.equals("language")) {
900          this.language = new CodeableConcept();
901          return this.language;
902        }
903        else if (name.equals("preferred")) {
904          throw new FHIRException("Cannot call addChild on a primitive type Patient.preferred");
905        }
906        else
907          return super.addChild(name);
908      }
909
910      public PatientCommunicationComponent copy() {
911        PatientCommunicationComponent dst = new PatientCommunicationComponent();
912        copyValues(dst);
913        dst.language = language == null ? null : language.copy();
914        dst.preferred = preferred == null ? null : preferred.copy();
915        return dst;
916      }
917
918      @Override
919      public boolean equalsDeep(Base other_) {
920        if (!super.equalsDeep(other_))
921          return false;
922        if (!(other_ instanceof PatientCommunicationComponent))
923          return false;
924        PatientCommunicationComponent o = (PatientCommunicationComponent) other_;
925        return compareDeep(language, o.language, true) && compareDeep(preferred, o.preferred, true);
926      }
927
928      @Override
929      public boolean equalsShallow(Base other_) {
930        if (!super.equalsShallow(other_))
931          return false;
932        if (!(other_ instanceof PatientCommunicationComponent))
933          return false;
934        PatientCommunicationComponent o = (PatientCommunicationComponent) other_;
935        return compareValues(preferred, o.preferred, true);
936      }
937
938      public boolean isEmpty() {
939        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(language, preferred);
940      }
941
942  public String fhirType() {
943    return "Patient.communication";
944
945  }
946
947  }
948
949    @Block()
950    public static class PatientLinkComponent extends BackboneElement implements IBaseBackboneElement {
951        /**
952         * The other patient resource that the link refers to.
953         */
954        @Child(name = "other", type = {Patient.class, RelatedPerson.class}, order=1, min=1, max=1, modifier=false, summary=true)
955        @Description(shortDefinition="The other patient or related person resource that the link refers to", formalDefinition="The other patient resource that the link refers to." )
956        protected Reference other;
957
958        /**
959         * The actual object that is the target of the reference (The other patient resource that the link refers to.)
960         */
961        protected Resource otherTarget;
962
963        /**
964         * The type of link between this patient resource and another patient resource.
965         */
966        @Child(name = "type", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=true)
967        @Description(shortDefinition="replaced-by | replaces | refer | seealso", formalDefinition="The type of link between this patient resource and another patient resource." )
968        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/link-type")
969        protected Enumeration<LinkType> type;
970
971        private static final long serialVersionUID = 1083576633L;
972
973    /**
974     * Constructor
975     */
976      public PatientLinkComponent() {
977        super();
978      }
979
980    /**
981     * Constructor
982     */
983      public PatientLinkComponent(Reference other, Enumeration<LinkType> type) {
984        super();
985        this.other = other;
986        this.type = type;
987      }
988
989        /**
990         * @return {@link #other} (The other patient resource that the link refers to.)
991         */
992        public Reference getOther() { 
993          if (this.other == null)
994            if (Configuration.errorOnAutoCreate())
995              throw new Error("Attempt to auto-create PatientLinkComponent.other");
996            else if (Configuration.doAutoCreate())
997              this.other = new Reference(); // cc
998          return this.other;
999        }
1000
1001        public boolean hasOther() { 
1002          return this.other != null && !this.other.isEmpty();
1003        }
1004
1005        /**
1006         * @param value {@link #other} (The other patient resource that the link refers to.)
1007         */
1008        public PatientLinkComponent setOther(Reference value) { 
1009          this.other = value;
1010          return this;
1011        }
1012
1013        /**
1014         * @return {@link #other} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The other patient resource that the link refers to.)
1015         */
1016        public Resource getOtherTarget() { 
1017          return this.otherTarget;
1018        }
1019
1020        /**
1021         * @param value {@link #other} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The other patient resource that the link refers to.)
1022         */
1023        public PatientLinkComponent setOtherTarget(Resource value) { 
1024          this.otherTarget = value;
1025          return this;
1026        }
1027
1028        /**
1029         * @return {@link #type} (The type of link between this patient resource and another patient resource.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1030         */
1031        public Enumeration<LinkType> getTypeElement() { 
1032          if (this.type == null)
1033            if (Configuration.errorOnAutoCreate())
1034              throw new Error("Attempt to auto-create PatientLinkComponent.type");
1035            else if (Configuration.doAutoCreate())
1036              this.type = new Enumeration<LinkType>(new LinkTypeEnumFactory()); // bb
1037          return this.type;
1038        }
1039
1040        public boolean hasTypeElement() { 
1041          return this.type != null && !this.type.isEmpty();
1042        }
1043
1044        public boolean hasType() { 
1045          return this.type != null && !this.type.isEmpty();
1046        }
1047
1048        /**
1049         * @param value {@link #type} (The type of link between this patient resource and another patient resource.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1050         */
1051        public PatientLinkComponent setTypeElement(Enumeration<LinkType> value) { 
1052          this.type = value;
1053          return this;
1054        }
1055
1056        /**
1057         * @return The type of link between this patient resource and another patient resource.
1058         */
1059        public LinkType getType() { 
1060          return this.type == null ? null : this.type.getValue();
1061        }
1062
1063        /**
1064         * @param value The type of link between this patient resource and another patient resource.
1065         */
1066        public PatientLinkComponent setType(LinkType value) { 
1067            if (this.type == null)
1068              this.type = new Enumeration<LinkType>(new LinkTypeEnumFactory());
1069            this.type.setValue(value);
1070          return this;
1071        }
1072
1073        protected void listChildren(List<Property> children) {
1074          super.listChildren(children);
1075          children.add(new Property("other", "Reference(Patient|RelatedPerson)", "The other patient resource that the link refers to.", 0, 1, other));
1076          children.add(new Property("type", "code", "The type of link between this patient resource and another patient resource.", 0, 1, type));
1077        }
1078
1079        @Override
1080        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1081          switch (_hash) {
1082          case 106069776: /*other*/  return new Property("other", "Reference(Patient|RelatedPerson)", "The other patient resource that the link refers to.", 0, 1, other);
1083          case 3575610: /*type*/  return new Property("type", "code", "The type of link between this patient resource and another patient resource.", 0, 1, type);
1084          default: return super.getNamedProperty(_hash, _name, _checkValid);
1085          }
1086
1087        }
1088
1089      @Override
1090      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1091        switch (hash) {
1092        case 106069776: /*other*/ return this.other == null ? new Base[0] : new Base[] {this.other}; // Reference
1093        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<LinkType>
1094        default: return super.getProperty(hash, name, checkValid);
1095        }
1096
1097      }
1098
1099      @Override
1100      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1101        switch (hash) {
1102        case 106069776: // other
1103          this.other = castToReference(value); // Reference
1104          return value;
1105        case 3575610: // type
1106          value = new LinkTypeEnumFactory().fromType(castToCode(value));
1107          this.type = (Enumeration) value; // Enumeration<LinkType>
1108          return value;
1109        default: return super.setProperty(hash, name, value);
1110        }
1111
1112      }
1113
1114      @Override
1115      public Base setProperty(String name, Base value) throws FHIRException {
1116        if (name.equals("other")) {
1117          this.other = castToReference(value); // Reference
1118        } else if (name.equals("type")) {
1119          value = new LinkTypeEnumFactory().fromType(castToCode(value));
1120          this.type = (Enumeration) value; // Enumeration<LinkType>
1121        } else
1122          return super.setProperty(name, value);
1123        return value;
1124      }
1125
1126      @Override
1127      public Base makeProperty(int hash, String name) throws FHIRException {
1128        switch (hash) {
1129        case 106069776:  return getOther(); 
1130        case 3575610:  return getTypeElement();
1131        default: return super.makeProperty(hash, name);
1132        }
1133
1134      }
1135
1136      @Override
1137      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1138        switch (hash) {
1139        case 106069776: /*other*/ return new String[] {"Reference"};
1140        case 3575610: /*type*/ return new String[] {"code"};
1141        default: return super.getTypesForProperty(hash, name);
1142        }
1143
1144      }
1145
1146      @Override
1147      public Base addChild(String name) throws FHIRException {
1148        if (name.equals("other")) {
1149          this.other = new Reference();
1150          return this.other;
1151        }
1152        else if (name.equals("type")) {
1153          throw new FHIRException("Cannot call addChild on a primitive type Patient.type");
1154        }
1155        else
1156          return super.addChild(name);
1157      }
1158
1159      public PatientLinkComponent copy() {
1160        PatientLinkComponent dst = new PatientLinkComponent();
1161        copyValues(dst);
1162        dst.other = other == null ? null : other.copy();
1163        dst.type = type == null ? null : type.copy();
1164        return dst;
1165      }
1166
1167      @Override
1168      public boolean equalsDeep(Base other_) {
1169        if (!super.equalsDeep(other_))
1170          return false;
1171        if (!(other_ instanceof PatientLinkComponent))
1172          return false;
1173        PatientLinkComponent o = (PatientLinkComponent) other_;
1174        return compareDeep(other, o.other, true) && compareDeep(type, o.type, true);
1175      }
1176
1177      @Override
1178      public boolean equalsShallow(Base other_) {
1179        if (!super.equalsShallow(other_))
1180          return false;
1181        if (!(other_ instanceof PatientLinkComponent))
1182          return false;
1183        PatientLinkComponent o = (PatientLinkComponent) other_;
1184        return compareValues(type, o.type, true);
1185      }
1186
1187      public boolean isEmpty() {
1188        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(other, type);
1189      }
1190
1191  public String fhirType() {
1192    return "Patient.link";
1193
1194  }
1195
1196  }
1197
1198    /**
1199     * An identifier for this patient.
1200     */
1201    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1202    @Description(shortDefinition="An identifier for this patient", formalDefinition="An identifier for this patient." )
1203    protected List<Identifier> identifier;
1204
1205    /**
1206     * Whether this patient record is in active use. 
1207Many systems use this property to mark as non-current patients, such as those that have not been seen for a period of time based on an organization's business rules.
1208
1209It is often used to filter patient lists to exclude inactive patients
1210
1211Deceased patients may also be marked as inactive for the same reasons, but may be active for some time after death.
1212     */
1213    @Child(name = "active", type = {BooleanType.class}, order=1, min=0, max=1, modifier=true, summary=true)
1214    @Description(shortDefinition="Whether this patient's record is in active use", formalDefinition="Whether this patient record is in active use. \nMany systems use this property to mark as non-current patients, such as those that have not been seen for a period of time based on an organization's business rules.\n\nIt is often used to filter patient lists to exclude inactive patients\n\nDeceased patients may also be marked as inactive for the same reasons, but may be active for some time after death." )
1215    protected BooleanType active;
1216
1217    /**
1218     * A name associated with the individual.
1219     */
1220    @Child(name = "name", type = {HumanName.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1221    @Description(shortDefinition="A name associated with the patient", formalDefinition="A name associated with the individual." )
1222    protected List<HumanName> name;
1223
1224    /**
1225     * A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.
1226     */
1227    @Child(name = "telecom", type = {ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1228    @Description(shortDefinition="A contact detail for the individual", formalDefinition="A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted." )
1229    protected List<ContactPoint> telecom;
1230
1231    /**
1232     * Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.
1233     */
1234    @Child(name = "gender", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=true)
1235    @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes." )
1236    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/administrative-gender")
1237    protected Enumeration<AdministrativeGender> gender;
1238
1239    /**
1240     * The date of birth for the individual.
1241     */
1242    @Child(name = "birthDate", type = {DateType.class}, order=5, min=0, max=1, modifier=false, summary=true)
1243    @Description(shortDefinition="The date of birth for the individual", formalDefinition="The date of birth for the individual." )
1244    protected DateType birthDate;
1245
1246    /**
1247     * Indicates if the individual is deceased or not.
1248     */
1249    @Child(name = "deceased", type = {BooleanType.class, DateTimeType.class}, order=6, min=0, max=1, modifier=true, summary=true)
1250    @Description(shortDefinition="Indicates if the individual is deceased or not", formalDefinition="Indicates if the individual is deceased or not." )
1251    protected Type deceased;
1252
1253    /**
1254     * An address for the individual.
1255     */
1256    @Child(name = "address", type = {Address.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1257    @Description(shortDefinition="An address for the individual", formalDefinition="An address for the individual." )
1258    protected List<Address> address;
1259
1260    /**
1261     * This field contains a patient's most recent marital (civil) status.
1262     */
1263    @Child(name = "maritalStatus", type = {CodeableConcept.class}, order=8, min=0, max=1, modifier=false, summary=false)
1264    @Description(shortDefinition="Marital (civil) status of a patient", formalDefinition="This field contains a patient's most recent marital (civil) status." )
1265    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/marital-status")
1266    protected CodeableConcept maritalStatus;
1267
1268    /**
1269     * Indicates whether the patient is part of a multiple (boolean) or indicates the actual birth order (integer).
1270     */
1271    @Child(name = "multipleBirth", type = {BooleanType.class, IntegerType.class}, order=9, min=0, max=1, modifier=false, summary=false)
1272    @Description(shortDefinition="Whether patient is part of a multiple birth", formalDefinition="Indicates whether the patient is part of a multiple (boolean) or indicates the actual birth order (integer)." )
1273    protected Type multipleBirth;
1274
1275    /**
1276     * Image of the patient.
1277     */
1278    @Child(name = "photo", type = {Attachment.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1279    @Description(shortDefinition="Image of the patient", formalDefinition="Image of the patient." )
1280    protected List<Attachment> photo;
1281
1282    /**
1283     * A contact party (e.g. guardian, partner, friend) for the patient.
1284     */
1285    @Child(name = "contact", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1286    @Description(shortDefinition="A contact party (e.g. guardian, partner, friend) for the patient", formalDefinition="A contact party (e.g. guardian, partner, friend) for the patient." )
1287    protected List<ContactComponent> contact;
1288
1289    /**
1290     * A language which may be used to communicate with the patient about his or her health.
1291     */
1292    @Child(name = "communication", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1293    @Description(shortDefinition="A language which may be used to communicate with the patient about his or her health", formalDefinition="A language which may be used to communicate with the patient about his or her health." )
1294    protected List<PatientCommunicationComponent> communication;
1295
1296    /**
1297     * Patient's nominated care provider.
1298     */
1299    @Child(name = "generalPractitioner", type = {Organization.class, Practitioner.class, PractitionerRole.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1300    @Description(shortDefinition="Patient's nominated primary care provider", formalDefinition="Patient's nominated care provider." )
1301    protected List<Reference> generalPractitioner;
1302    /**
1303     * The actual objects that are the target of the reference (Patient's nominated care provider.)
1304     */
1305    protected List<Resource> generalPractitionerTarget;
1306
1307
1308    /**
1309     * Organization that is the custodian of the patient record.
1310     */
1311    @Child(name = "managingOrganization", type = {Organization.class}, order=14, min=0, max=1, modifier=false, summary=true)
1312    @Description(shortDefinition="Organization that is the custodian of the patient record", formalDefinition="Organization that is the custodian of the patient record." )
1313    protected Reference managingOrganization;
1314
1315    /**
1316     * The actual object that is the target of the reference (Organization that is the custodian of the patient record.)
1317     */
1318    protected Organization managingOrganizationTarget;
1319
1320    /**
1321     * Link to another patient resource that concerns the same actual patient.
1322     */
1323    @Child(name = "link", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=true, summary=true)
1324    @Description(shortDefinition="Link to another patient resource that concerns the same actual person", formalDefinition="Link to another patient resource that concerns the same actual patient." )
1325    protected List<PatientLinkComponent> link;
1326
1327    private static final long serialVersionUID = 2138656939L;
1328
1329  /**
1330   * Constructor
1331   */
1332    public Patient() {
1333      super();
1334    }
1335
1336    /**
1337     * @return {@link #identifier} (An identifier for this patient.)
1338     */
1339    public List<Identifier> getIdentifier() { 
1340      if (this.identifier == null)
1341        this.identifier = new ArrayList<Identifier>();
1342      return this.identifier;
1343    }
1344
1345    /**
1346     * @return Returns a reference to <code>this</code> for easy method chaining
1347     */
1348    public Patient setIdentifier(List<Identifier> theIdentifier) { 
1349      this.identifier = theIdentifier;
1350      return this;
1351    }
1352
1353    public boolean hasIdentifier() { 
1354      if (this.identifier == null)
1355        return false;
1356      for (Identifier item : this.identifier)
1357        if (!item.isEmpty())
1358          return true;
1359      return false;
1360    }
1361
1362    public Identifier addIdentifier() { //3
1363      Identifier t = new Identifier();
1364      if (this.identifier == null)
1365        this.identifier = new ArrayList<Identifier>();
1366      this.identifier.add(t);
1367      return t;
1368    }
1369
1370    public Patient addIdentifier(Identifier t) { //3
1371      if (t == null)
1372        return this;
1373      if (this.identifier == null)
1374        this.identifier = new ArrayList<Identifier>();
1375      this.identifier.add(t);
1376      return this;
1377    }
1378
1379    /**
1380     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
1381     */
1382    public Identifier getIdentifierFirstRep() { 
1383      if (getIdentifier().isEmpty()) {
1384        addIdentifier();
1385      }
1386      return getIdentifier().get(0);
1387    }
1388
1389    /**
1390     * @return {@link #active} (Whether this patient record is in active use. 
1391Many systems use this property to mark as non-current patients, such as those that have not been seen for a period of time based on an organization's business rules.
1392
1393It is often used to filter patient lists to exclude inactive patients
1394
1395Deceased patients may also be marked as inactive for the same reasons, but may be active for some time after death.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value
1396     */
1397    public BooleanType getActiveElement() { 
1398      if (this.active == null)
1399        if (Configuration.errorOnAutoCreate())
1400          throw new Error("Attempt to auto-create Patient.active");
1401        else if (Configuration.doAutoCreate())
1402          this.active = new BooleanType(); // bb
1403      return this.active;
1404    }
1405
1406    public boolean hasActiveElement() { 
1407      return this.active != null && !this.active.isEmpty();
1408    }
1409
1410    public boolean hasActive() { 
1411      return this.active != null && !this.active.isEmpty();
1412    }
1413
1414    /**
1415     * @param value {@link #active} (Whether this patient record is in active use. 
1416Many systems use this property to mark as non-current patients, such as those that have not been seen for a period of time based on an organization's business rules.
1417
1418It is often used to filter patient lists to exclude inactive patients
1419
1420Deceased patients may also be marked as inactive for the same reasons, but may be active for some time after death.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value
1421     */
1422    public Patient setActiveElement(BooleanType value) { 
1423      this.active = value;
1424      return this;
1425    }
1426
1427    /**
1428     * @return Whether this patient record is in active use. 
1429Many systems use this property to mark as non-current patients, such as those that have not been seen for a period of time based on an organization's business rules.
1430
1431It is often used to filter patient lists to exclude inactive patients
1432
1433Deceased patients may also be marked as inactive for the same reasons, but may be active for some time after death.
1434     */
1435    public boolean getActive() { 
1436      return this.active == null || this.active.isEmpty() ? false : this.active.getValue();
1437    }
1438
1439    /**
1440     * @param value Whether this patient record is in active use. 
1441Many systems use this property to mark as non-current patients, such as those that have not been seen for a period of time based on an organization's business rules.
1442
1443It is often used to filter patient lists to exclude inactive patients
1444
1445Deceased patients may also be marked as inactive for the same reasons, but may be active for some time after death.
1446     */
1447    public Patient setActive(boolean value) { 
1448        if (this.active == null)
1449          this.active = new BooleanType();
1450        this.active.setValue(value);
1451      return this;
1452    }
1453
1454    /**
1455     * @return {@link #name} (A name associated with the individual.)
1456     */
1457    public List<HumanName> getName() { 
1458      if (this.name == null)
1459        this.name = new ArrayList<HumanName>();
1460      return this.name;
1461    }
1462
1463    /**
1464     * @return Returns a reference to <code>this</code> for easy method chaining
1465     */
1466    public Patient setName(List<HumanName> theName) { 
1467      this.name = theName;
1468      return this;
1469    }
1470
1471    public boolean hasName() { 
1472      if (this.name == null)
1473        return false;
1474      for (HumanName item : this.name)
1475        if (!item.isEmpty())
1476          return true;
1477      return false;
1478    }
1479
1480    public HumanName addName() { //3
1481      HumanName t = new HumanName();
1482      if (this.name == null)
1483        this.name = new ArrayList<HumanName>();
1484      this.name.add(t);
1485      return t;
1486    }
1487
1488    public Patient addName(HumanName t) { //3
1489      if (t == null)
1490        return this;
1491      if (this.name == null)
1492        this.name = new ArrayList<HumanName>();
1493      this.name.add(t);
1494      return this;
1495    }
1496
1497    /**
1498     * @return The first repetition of repeating field {@link #name}, creating it if it does not already exist
1499     */
1500    public HumanName getNameFirstRep() { 
1501      if (getName().isEmpty()) {
1502        addName();
1503      }
1504      return getName().get(0);
1505    }
1506
1507    /**
1508     * @return {@link #telecom} (A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.)
1509     */
1510    public List<ContactPoint> getTelecom() { 
1511      if (this.telecom == null)
1512        this.telecom = new ArrayList<ContactPoint>();
1513      return this.telecom;
1514    }
1515
1516    /**
1517     * @return Returns a reference to <code>this</code> for easy method chaining
1518     */
1519    public Patient setTelecom(List<ContactPoint> theTelecom) { 
1520      this.telecom = theTelecom;
1521      return this;
1522    }
1523
1524    public boolean hasTelecom() { 
1525      if (this.telecom == null)
1526        return false;
1527      for (ContactPoint item : this.telecom)
1528        if (!item.isEmpty())
1529          return true;
1530      return false;
1531    }
1532
1533    public ContactPoint addTelecom() { //3
1534      ContactPoint t = new ContactPoint();
1535      if (this.telecom == null)
1536        this.telecom = new ArrayList<ContactPoint>();
1537      this.telecom.add(t);
1538      return t;
1539    }
1540
1541    public Patient addTelecom(ContactPoint t) { //3
1542      if (t == null)
1543        return this;
1544      if (this.telecom == null)
1545        this.telecom = new ArrayList<ContactPoint>();
1546      this.telecom.add(t);
1547      return this;
1548    }
1549
1550    /**
1551     * @return The first repetition of repeating field {@link #telecom}, creating it if it does not already exist
1552     */
1553    public ContactPoint getTelecomFirstRep() { 
1554      if (getTelecom().isEmpty()) {
1555        addTelecom();
1556      }
1557      return getTelecom().get(0);
1558    }
1559
1560    /**
1561     * @return {@link #gender} (Administrative Gender - the gender that the patient 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
1562     */
1563    public Enumeration<AdministrativeGender> getGenderElement() { 
1564      if (this.gender == null)
1565        if (Configuration.errorOnAutoCreate())
1566          throw new Error("Attempt to auto-create Patient.gender");
1567        else if (Configuration.doAutoCreate())
1568          this.gender = new Enumeration<AdministrativeGender>(new AdministrativeGenderEnumFactory()); // bb
1569      return this.gender;
1570    }
1571
1572    public boolean hasGenderElement() { 
1573      return this.gender != null && !this.gender.isEmpty();
1574    }
1575
1576    public boolean hasGender() { 
1577      return this.gender != null && !this.gender.isEmpty();
1578    }
1579
1580    /**
1581     * @param value {@link #gender} (Administrative Gender - the gender that the patient 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
1582     */
1583    public Patient setGenderElement(Enumeration<AdministrativeGender> value) { 
1584      this.gender = value;
1585      return this;
1586    }
1587
1588    /**
1589     * @return Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.
1590     */
1591    public AdministrativeGender getGender() { 
1592      return this.gender == null ? null : this.gender.getValue();
1593    }
1594
1595    /**
1596     * @param value Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.
1597     */
1598    public Patient setGender(AdministrativeGender value) { 
1599      if (value == null)
1600        this.gender = null;
1601      else {
1602        if (this.gender == null)
1603          this.gender = new Enumeration<AdministrativeGender>(new AdministrativeGenderEnumFactory());
1604        this.gender.setValue(value);
1605      }
1606      return this;
1607    }
1608
1609    /**
1610     * @return {@link #birthDate} (The date of birth for the individual.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value
1611     */
1612    public DateType getBirthDateElement() { 
1613      if (this.birthDate == null)
1614        if (Configuration.errorOnAutoCreate())
1615          throw new Error("Attempt to auto-create Patient.birthDate");
1616        else if (Configuration.doAutoCreate())
1617          this.birthDate = new DateType(); // bb
1618      return this.birthDate;
1619    }
1620
1621    public boolean hasBirthDateElement() { 
1622      return this.birthDate != null && !this.birthDate.isEmpty();
1623    }
1624
1625    public boolean hasBirthDate() { 
1626      return this.birthDate != null && !this.birthDate.isEmpty();
1627    }
1628
1629    /**
1630     * @param value {@link #birthDate} (The date of birth for the individual.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value
1631     */
1632    public Patient setBirthDateElement(DateType value) { 
1633      this.birthDate = value;
1634      return this;
1635    }
1636
1637    /**
1638     * @return The date of birth for the individual.
1639     */
1640    public Date getBirthDate() { 
1641      return this.birthDate == null ? null : this.birthDate.getValue();
1642    }
1643
1644    /**
1645     * @param value The date of birth for the individual.
1646     */
1647    public Patient setBirthDate(Date value) { 
1648      if (value == null)
1649        this.birthDate = null;
1650      else {
1651        if (this.birthDate == null)
1652          this.birthDate = new DateType();
1653        this.birthDate.setValue(value);
1654      }
1655      return this;
1656    }
1657
1658    /**
1659     * @return {@link #deceased} (Indicates if the individual is deceased or not.)
1660     */
1661    public Type getDeceased() { 
1662      return this.deceased;
1663    }
1664
1665    /**
1666     * @return {@link #deceased} (Indicates if the individual is deceased or not.)
1667     */
1668    public BooleanType getDeceasedBooleanType() throws FHIRException { 
1669      if (this.deceased == null)
1670        return null;
1671      if (!(this.deceased instanceof BooleanType))
1672        throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.deceased.getClass().getName()+" was encountered");
1673      return (BooleanType) this.deceased;
1674    }
1675
1676    public boolean hasDeceasedBooleanType() { 
1677      return this != null && this.deceased instanceof BooleanType;
1678    }
1679
1680    /**
1681     * @return {@link #deceased} (Indicates if the individual is deceased or not.)
1682     */
1683    public DateTimeType getDeceasedDateTimeType() throws FHIRException { 
1684      if (this.deceased == null)
1685        return null;
1686      if (!(this.deceased instanceof DateTimeType))
1687        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.deceased.getClass().getName()+" was encountered");
1688      return (DateTimeType) this.deceased;
1689    }
1690
1691    public boolean hasDeceasedDateTimeType() { 
1692      return this != null && this.deceased instanceof DateTimeType;
1693    }
1694
1695    public boolean hasDeceased() { 
1696      return this.deceased != null && !this.deceased.isEmpty();
1697    }
1698
1699    /**
1700     * @param value {@link #deceased} (Indicates if the individual is deceased or not.)
1701     */
1702    public Patient setDeceased(Type value) { 
1703      if (value != null && !(value instanceof BooleanType || value instanceof DateTimeType))
1704        throw new Error("Not the right type for Patient.deceased[x]: "+value.fhirType());
1705      this.deceased = value;
1706      return this;
1707    }
1708
1709    /**
1710     * @return {@link #address} (An address for the individual.)
1711     */
1712    public List<Address> getAddress() { 
1713      if (this.address == null)
1714        this.address = new ArrayList<Address>();
1715      return this.address;
1716    }
1717
1718    /**
1719     * @return Returns a reference to <code>this</code> for easy method chaining
1720     */
1721    public Patient setAddress(List<Address> theAddress) { 
1722      this.address = theAddress;
1723      return this;
1724    }
1725
1726    public boolean hasAddress() { 
1727      if (this.address == null)
1728        return false;
1729      for (Address item : this.address)
1730        if (!item.isEmpty())
1731          return true;
1732      return false;
1733    }
1734
1735    public Address addAddress() { //3
1736      Address t = new Address();
1737      if (this.address == null)
1738        this.address = new ArrayList<Address>();
1739      this.address.add(t);
1740      return t;
1741    }
1742
1743    public Patient addAddress(Address t) { //3
1744      if (t == null)
1745        return this;
1746      if (this.address == null)
1747        this.address = new ArrayList<Address>();
1748      this.address.add(t);
1749      return this;
1750    }
1751
1752    /**
1753     * @return The first repetition of repeating field {@link #address}, creating it if it does not already exist
1754     */
1755    public Address getAddressFirstRep() { 
1756      if (getAddress().isEmpty()) {
1757        addAddress();
1758      }
1759      return getAddress().get(0);
1760    }
1761
1762    /**
1763     * @return {@link #maritalStatus} (This field contains a patient's most recent marital (civil) status.)
1764     */
1765    public CodeableConcept getMaritalStatus() { 
1766      if (this.maritalStatus == null)
1767        if (Configuration.errorOnAutoCreate())
1768          throw new Error("Attempt to auto-create Patient.maritalStatus");
1769        else if (Configuration.doAutoCreate())
1770          this.maritalStatus = new CodeableConcept(); // cc
1771      return this.maritalStatus;
1772    }
1773
1774    public boolean hasMaritalStatus() { 
1775      return this.maritalStatus != null && !this.maritalStatus.isEmpty();
1776    }
1777
1778    /**
1779     * @param value {@link #maritalStatus} (This field contains a patient's most recent marital (civil) status.)
1780     */
1781    public Patient setMaritalStatus(CodeableConcept value) { 
1782      this.maritalStatus = value;
1783      return this;
1784    }
1785
1786    /**
1787     * @return {@link #multipleBirth} (Indicates whether the patient is part of a multiple (boolean) or indicates the actual birth order (integer).)
1788     */
1789    public Type getMultipleBirth() { 
1790      return this.multipleBirth;
1791    }
1792
1793    /**
1794     * @return {@link #multipleBirth} (Indicates whether the patient is part of a multiple (boolean) or indicates the actual birth order (integer).)
1795     */
1796    public BooleanType getMultipleBirthBooleanType() throws FHIRException { 
1797      if (this.multipleBirth == null)
1798        return null;
1799      if (!(this.multipleBirth instanceof BooleanType))
1800        throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.multipleBirth.getClass().getName()+" was encountered");
1801      return (BooleanType) this.multipleBirth;
1802    }
1803
1804    public boolean hasMultipleBirthBooleanType() { 
1805      return this != null && this.multipleBirth instanceof BooleanType;
1806    }
1807
1808    /**
1809     * @return {@link #multipleBirth} (Indicates whether the patient is part of a multiple (boolean) or indicates the actual birth order (integer).)
1810     */
1811    public IntegerType getMultipleBirthIntegerType() throws FHIRException { 
1812      if (this.multipleBirth == null)
1813        return null;
1814      if (!(this.multipleBirth instanceof IntegerType))
1815        throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.multipleBirth.getClass().getName()+" was encountered");
1816      return (IntegerType) this.multipleBirth;
1817    }
1818
1819    public boolean hasMultipleBirthIntegerType() { 
1820      return this != null && this.multipleBirth instanceof IntegerType;
1821    }
1822
1823    public boolean hasMultipleBirth() { 
1824      return this.multipleBirth != null && !this.multipleBirth.isEmpty();
1825    }
1826
1827    /**
1828     * @param value {@link #multipleBirth} (Indicates whether the patient is part of a multiple (boolean) or indicates the actual birth order (integer).)
1829     */
1830    public Patient setMultipleBirth(Type value) { 
1831      if (value != null && !(value instanceof BooleanType || value instanceof IntegerType))
1832        throw new Error("Not the right type for Patient.multipleBirth[x]: "+value.fhirType());
1833      this.multipleBirth = value;
1834      return this;
1835    }
1836
1837    /**
1838     * @return {@link #photo} (Image of the patient.)
1839     */
1840    public List<Attachment> getPhoto() { 
1841      if (this.photo == null)
1842        this.photo = new ArrayList<Attachment>();
1843      return this.photo;
1844    }
1845
1846    /**
1847     * @return Returns a reference to <code>this</code> for easy method chaining
1848     */
1849    public Patient setPhoto(List<Attachment> thePhoto) { 
1850      this.photo = thePhoto;
1851      return this;
1852    }
1853
1854    public boolean hasPhoto() { 
1855      if (this.photo == null)
1856        return false;
1857      for (Attachment item : this.photo)
1858        if (!item.isEmpty())
1859          return true;
1860      return false;
1861    }
1862
1863    public Attachment addPhoto() { //3
1864      Attachment t = new Attachment();
1865      if (this.photo == null)
1866        this.photo = new ArrayList<Attachment>();
1867      this.photo.add(t);
1868      return t;
1869    }
1870
1871    public Patient addPhoto(Attachment t) { //3
1872      if (t == null)
1873        return this;
1874      if (this.photo == null)
1875        this.photo = new ArrayList<Attachment>();
1876      this.photo.add(t);
1877      return this;
1878    }
1879
1880    /**
1881     * @return The first repetition of repeating field {@link #photo}, creating it if it does not already exist
1882     */
1883    public Attachment getPhotoFirstRep() { 
1884      if (getPhoto().isEmpty()) {
1885        addPhoto();
1886      }
1887      return getPhoto().get(0);
1888    }
1889
1890    /**
1891     * @return {@link #contact} (A contact party (e.g. guardian, partner, friend) for the patient.)
1892     */
1893    public List<ContactComponent> getContact() { 
1894      if (this.contact == null)
1895        this.contact = new ArrayList<ContactComponent>();
1896      return this.contact;
1897    }
1898
1899    /**
1900     * @return Returns a reference to <code>this</code> for easy method chaining
1901     */
1902    public Patient setContact(List<ContactComponent> theContact) { 
1903      this.contact = theContact;
1904      return this;
1905    }
1906
1907    public boolean hasContact() { 
1908      if (this.contact == null)
1909        return false;
1910      for (ContactComponent item : this.contact)
1911        if (!item.isEmpty())
1912          return true;
1913      return false;
1914    }
1915
1916    public ContactComponent addContact() { //3
1917      ContactComponent t = new ContactComponent();
1918      if (this.contact == null)
1919        this.contact = new ArrayList<ContactComponent>();
1920      this.contact.add(t);
1921      return t;
1922    }
1923
1924    public Patient addContact(ContactComponent t) { //3
1925      if (t == null)
1926        return this;
1927      if (this.contact == null)
1928        this.contact = new ArrayList<ContactComponent>();
1929      this.contact.add(t);
1930      return this;
1931    }
1932
1933    /**
1934     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist
1935     */
1936    public ContactComponent getContactFirstRep() { 
1937      if (getContact().isEmpty()) {
1938        addContact();
1939      }
1940      return getContact().get(0);
1941    }
1942
1943    /**
1944     * @return {@link #communication} (A language which may be used to communicate with the patient about his or her health.)
1945     */
1946    public List<PatientCommunicationComponent> getCommunication() { 
1947      if (this.communication == null)
1948        this.communication = new ArrayList<PatientCommunicationComponent>();
1949      return this.communication;
1950    }
1951
1952    /**
1953     * @return Returns a reference to <code>this</code> for easy method chaining
1954     */
1955    public Patient setCommunication(List<PatientCommunicationComponent> theCommunication) { 
1956      this.communication = theCommunication;
1957      return this;
1958    }
1959
1960    public boolean hasCommunication() { 
1961      if (this.communication == null)
1962        return false;
1963      for (PatientCommunicationComponent item : this.communication)
1964        if (!item.isEmpty())
1965          return true;
1966      return false;
1967    }
1968
1969    public PatientCommunicationComponent addCommunication() { //3
1970      PatientCommunicationComponent t = new PatientCommunicationComponent();
1971      if (this.communication == null)
1972        this.communication = new ArrayList<PatientCommunicationComponent>();
1973      this.communication.add(t);
1974      return t;
1975    }
1976
1977    public Patient addCommunication(PatientCommunicationComponent t) { //3
1978      if (t == null)
1979        return this;
1980      if (this.communication == null)
1981        this.communication = new ArrayList<PatientCommunicationComponent>();
1982      this.communication.add(t);
1983      return this;
1984    }
1985
1986    /**
1987     * @return The first repetition of repeating field {@link #communication}, creating it if it does not already exist
1988     */
1989    public PatientCommunicationComponent getCommunicationFirstRep() { 
1990      if (getCommunication().isEmpty()) {
1991        addCommunication();
1992      }
1993      return getCommunication().get(0);
1994    }
1995
1996    /**
1997     * @return {@link #generalPractitioner} (Patient's nominated care provider.)
1998     */
1999    public List<Reference> getGeneralPractitioner() { 
2000      if (this.generalPractitioner == null)
2001        this.generalPractitioner = new ArrayList<Reference>();
2002      return this.generalPractitioner;
2003    }
2004
2005    /**
2006     * @return Returns a reference to <code>this</code> for easy method chaining
2007     */
2008    public Patient setGeneralPractitioner(List<Reference> theGeneralPractitioner) { 
2009      this.generalPractitioner = theGeneralPractitioner;
2010      return this;
2011    }
2012
2013    public boolean hasGeneralPractitioner() { 
2014      if (this.generalPractitioner == null)
2015        return false;
2016      for (Reference item : this.generalPractitioner)
2017        if (!item.isEmpty())
2018          return true;
2019      return false;
2020    }
2021
2022    public Reference addGeneralPractitioner() { //3
2023      Reference t = new Reference();
2024      if (this.generalPractitioner == null)
2025        this.generalPractitioner = new ArrayList<Reference>();
2026      this.generalPractitioner.add(t);
2027      return t;
2028    }
2029
2030    public Patient addGeneralPractitioner(Reference t) { //3
2031      if (t == null)
2032        return this;
2033      if (this.generalPractitioner == null)
2034        this.generalPractitioner = new ArrayList<Reference>();
2035      this.generalPractitioner.add(t);
2036      return this;
2037    }
2038
2039    /**
2040     * @return The first repetition of repeating field {@link #generalPractitioner}, creating it if it does not already exist
2041     */
2042    public Reference getGeneralPractitionerFirstRep() { 
2043      if (getGeneralPractitioner().isEmpty()) {
2044        addGeneralPractitioner();
2045      }
2046      return getGeneralPractitioner().get(0);
2047    }
2048
2049    /**
2050     * @deprecated Use Reference#setResource(IBaseResource) instead
2051     */
2052    @Deprecated
2053    public List<Resource> getGeneralPractitionerTarget() { 
2054      if (this.generalPractitionerTarget == null)
2055        this.generalPractitionerTarget = new ArrayList<Resource>();
2056      return this.generalPractitionerTarget;
2057    }
2058
2059    /**
2060     * @return {@link #managingOrganization} (Organization that is the custodian of the patient record.)
2061     */
2062    public Reference getManagingOrganization() { 
2063      if (this.managingOrganization == null)
2064        if (Configuration.errorOnAutoCreate())
2065          throw new Error("Attempt to auto-create Patient.managingOrganization");
2066        else if (Configuration.doAutoCreate())
2067          this.managingOrganization = new Reference(); // cc
2068      return this.managingOrganization;
2069    }
2070
2071    public boolean hasManagingOrganization() { 
2072      return this.managingOrganization != null && !this.managingOrganization.isEmpty();
2073    }
2074
2075    /**
2076     * @param value {@link #managingOrganization} (Organization that is the custodian of the patient record.)
2077     */
2078    public Patient setManagingOrganization(Reference value) { 
2079      this.managingOrganization = value;
2080      return this;
2081    }
2082
2083    /**
2084     * @return {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Organization that is the custodian of the patient record.)
2085     */
2086    public Organization getManagingOrganizationTarget() { 
2087      if (this.managingOrganizationTarget == null)
2088        if (Configuration.errorOnAutoCreate())
2089          throw new Error("Attempt to auto-create Patient.managingOrganization");
2090        else if (Configuration.doAutoCreate())
2091          this.managingOrganizationTarget = new Organization(); // aa
2092      return this.managingOrganizationTarget;
2093    }
2094
2095    /**
2096     * @param value {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Organization that is the custodian of the patient record.)
2097     */
2098    public Patient setManagingOrganizationTarget(Organization value) { 
2099      this.managingOrganizationTarget = value;
2100      return this;
2101    }
2102
2103    /**
2104     * @return {@link #link} (Link to another patient resource that concerns the same actual patient.)
2105     */
2106    public List<PatientLinkComponent> getLink() { 
2107      if (this.link == null)
2108        this.link = new ArrayList<PatientLinkComponent>();
2109      return this.link;
2110    }
2111
2112    /**
2113     * @return Returns a reference to <code>this</code> for easy method chaining
2114     */
2115    public Patient setLink(List<PatientLinkComponent> theLink) { 
2116      this.link = theLink;
2117      return this;
2118    }
2119
2120    public boolean hasLink() { 
2121      if (this.link == null)
2122        return false;
2123      for (PatientLinkComponent item : this.link)
2124        if (!item.isEmpty())
2125          return true;
2126      return false;
2127    }
2128
2129    public PatientLinkComponent addLink() { //3
2130      PatientLinkComponent t = new PatientLinkComponent();
2131      if (this.link == null)
2132        this.link = new ArrayList<PatientLinkComponent>();
2133      this.link.add(t);
2134      return t;
2135    }
2136
2137    public Patient addLink(PatientLinkComponent t) { //3
2138      if (t == null)
2139        return this;
2140      if (this.link == null)
2141        this.link = new ArrayList<PatientLinkComponent>();
2142      this.link.add(t);
2143      return this;
2144    }
2145
2146    /**
2147     * @return The first repetition of repeating field {@link #link}, creating it if it does not already exist
2148     */
2149    public PatientLinkComponent getLinkFirstRep() { 
2150      if (getLink().isEmpty()) {
2151        addLink();
2152      }
2153      return getLink().get(0);
2154    }
2155
2156      protected void listChildren(List<Property> children) {
2157        super.listChildren(children);
2158        children.add(new Property("identifier", "Identifier", "An identifier for this patient.", 0, java.lang.Integer.MAX_VALUE, identifier));
2159        children.add(new Property("active", "boolean", "Whether this patient record is in active use. \nMany systems use this property to mark as non-current patients, such as those that have not been seen for a period of time based on an organization's business rules.\n\nIt is often used to filter patient lists to exclude inactive patients\n\nDeceased patients may also be marked as inactive for the same reasons, but may be active for some time after death.", 0, 1, active));
2160        children.add(new Property("name", "HumanName", "A name associated with the individual.", 0, java.lang.Integer.MAX_VALUE, name));
2161        children.add(new Property("telecom", "ContactPoint", "A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.", 0, java.lang.Integer.MAX_VALUE, telecom));
2162        children.add(new Property("gender", "code", "Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.", 0, 1, gender));
2163        children.add(new Property("birthDate", "date", "The date of birth for the individual.", 0, 1, birthDate));
2164        children.add(new Property("deceased[x]", "boolean|dateTime", "Indicates if the individual is deceased or not.", 0, 1, deceased));
2165        children.add(new Property("address", "Address", "An address for the individual.", 0, java.lang.Integer.MAX_VALUE, address));
2166        children.add(new Property("maritalStatus", "CodeableConcept", "This field contains a patient's most recent marital (civil) status.", 0, 1, maritalStatus));
2167        children.add(new Property("multipleBirth[x]", "boolean|integer", "Indicates whether the patient is part of a multiple (boolean) or indicates the actual birth order (integer).", 0, 1, multipleBirth));
2168        children.add(new Property("photo", "Attachment", "Image of the patient.", 0, java.lang.Integer.MAX_VALUE, photo));
2169        children.add(new Property("contact", "", "A contact party (e.g. guardian, partner, friend) for the patient.", 0, java.lang.Integer.MAX_VALUE, contact));
2170        children.add(new Property("communication", "", "A language which may be used to communicate with the patient about his or her health.", 0, java.lang.Integer.MAX_VALUE, communication));
2171        children.add(new Property("generalPractitioner", "Reference(Organization|Practitioner|PractitionerRole)", "Patient's nominated care provider.", 0, java.lang.Integer.MAX_VALUE, generalPractitioner));
2172        children.add(new Property("managingOrganization", "Reference(Organization)", "Organization that is the custodian of the patient record.", 0, 1, managingOrganization));
2173        children.add(new Property("link", "", "Link to another patient resource that concerns the same actual patient.", 0, java.lang.Integer.MAX_VALUE, link));
2174      }
2175
2176      @Override
2177      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2178        switch (_hash) {
2179        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "An identifier for this patient.", 0, java.lang.Integer.MAX_VALUE, identifier);
2180        case -1422950650: /*active*/  return new Property("active", "boolean", "Whether this patient record is in active use. \nMany systems use this property to mark as non-current patients, such as those that have not been seen for a period of time based on an organization's business rules.\n\nIt is often used to filter patient lists to exclude inactive patients\n\nDeceased patients may also be marked as inactive for the same reasons, but may be active for some time after death.", 0, 1, active);
2181        case 3373707: /*name*/  return new Property("name", "HumanName", "A name associated with the individual.", 0, java.lang.Integer.MAX_VALUE, name);
2182        case -1429363305: /*telecom*/  return new Property("telecom", "ContactPoint", "A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.", 0, java.lang.Integer.MAX_VALUE, telecom);
2183        case -1249512767: /*gender*/  return new Property("gender", "code", "Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.", 0, 1, gender);
2184        case -1210031859: /*birthDate*/  return new Property("birthDate", "date", "The date of birth for the individual.", 0, 1, birthDate);
2185        case -1311442804: /*deceased[x]*/  return new Property("deceased[x]", "boolean|dateTime", "Indicates if the individual is deceased or not.", 0, 1, deceased);
2186        case 561497972: /*deceased*/  return new Property("deceased[x]", "boolean|dateTime", "Indicates if the individual is deceased or not.", 0, 1, deceased);
2187        case 497463828: /*deceasedBoolean*/  return new Property("deceased[x]", "boolean|dateTime", "Indicates if the individual is deceased or not.", 0, 1, deceased);
2188        case -1971804369: /*deceasedDateTime*/  return new Property("deceased[x]", "boolean|dateTime", "Indicates if the individual is deceased or not.", 0, 1, deceased);
2189        case -1147692044: /*address*/  return new Property("address", "Address", "An address for the individual.", 0, java.lang.Integer.MAX_VALUE, address);
2190        case 1756919302: /*maritalStatus*/  return new Property("maritalStatus", "CodeableConcept", "This field contains a patient's most recent marital (civil) status.", 0, 1, maritalStatus);
2191        case -1764672111: /*multipleBirth[x]*/  return new Property("multipleBirth[x]", "boolean|integer", "Indicates whether the patient is part of a multiple (boolean) or indicates the actual birth order (integer).", 0, 1, multipleBirth);
2192        case -677369713: /*multipleBirth*/  return new Property("multipleBirth[x]", "boolean|integer", "Indicates whether the patient is part of a multiple (boolean) or indicates the actual birth order (integer).", 0, 1, multipleBirth);
2193        case -247534439: /*multipleBirthBoolean*/  return new Property("multipleBirth[x]", "boolean|integer", "Indicates whether the patient is part of a multiple (boolean) or indicates the actual birth order (integer).", 0, 1, multipleBirth);
2194        case 1645805999: /*multipleBirthInteger*/  return new Property("multipleBirth[x]", "boolean|integer", "Indicates whether the patient is part of a multiple (boolean) or indicates the actual birth order (integer).", 0, 1, multipleBirth);
2195        case 106642994: /*photo*/  return new Property("photo", "Attachment", "Image of the patient.", 0, java.lang.Integer.MAX_VALUE, photo);
2196        case 951526432: /*contact*/  return new Property("contact", "", "A contact party (e.g. guardian, partner, friend) for the patient.", 0, java.lang.Integer.MAX_VALUE, contact);
2197        case -1035284522: /*communication*/  return new Property("communication", "", "A language which may be used to communicate with the patient about his or her health.", 0, java.lang.Integer.MAX_VALUE, communication);
2198        case 1488292898: /*generalPractitioner*/  return new Property("generalPractitioner", "Reference(Organization|Practitioner|PractitionerRole)", "Patient's nominated care provider.", 0, java.lang.Integer.MAX_VALUE, generalPractitioner);
2199        case -2058947787: /*managingOrganization*/  return new Property("managingOrganization", "Reference(Organization)", "Organization that is the custodian of the patient record.", 0, 1, managingOrganization);
2200        case 3321850: /*link*/  return new Property("link", "", "Link to another patient resource that concerns the same actual patient.", 0, java.lang.Integer.MAX_VALUE, link);
2201        default: return super.getNamedProperty(_hash, _name, _checkValid);
2202        }
2203
2204      }
2205
2206      @Override
2207      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2208        switch (hash) {
2209        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2210        case -1422950650: /*active*/ return this.active == null ? new Base[0] : new Base[] {this.active}; // BooleanType
2211        case 3373707: /*name*/ return this.name == null ? new Base[0] : this.name.toArray(new Base[this.name.size()]); // HumanName
2212        case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint
2213        case -1249512767: /*gender*/ return this.gender == null ? new Base[0] : new Base[] {this.gender}; // Enumeration<AdministrativeGender>
2214        case -1210031859: /*birthDate*/ return this.birthDate == null ? new Base[0] : new Base[] {this.birthDate}; // DateType
2215        case 561497972: /*deceased*/ return this.deceased == null ? new Base[0] : new Base[] {this.deceased}; // Type
2216        case -1147692044: /*address*/ return this.address == null ? new Base[0] : this.address.toArray(new Base[this.address.size()]); // Address
2217        case 1756919302: /*maritalStatus*/ return this.maritalStatus == null ? new Base[0] : new Base[] {this.maritalStatus}; // CodeableConcept
2218        case -677369713: /*multipleBirth*/ return this.multipleBirth == null ? new Base[0] : new Base[] {this.multipleBirth}; // Type
2219        case 106642994: /*photo*/ return this.photo == null ? new Base[0] : this.photo.toArray(new Base[this.photo.size()]); // Attachment
2220        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactComponent
2221        case -1035284522: /*communication*/ return this.communication == null ? new Base[0] : this.communication.toArray(new Base[this.communication.size()]); // PatientCommunicationComponent
2222        case 1488292898: /*generalPractitioner*/ return this.generalPractitioner == null ? new Base[0] : this.generalPractitioner.toArray(new Base[this.generalPractitioner.size()]); // Reference
2223        case -2058947787: /*managingOrganization*/ return this.managingOrganization == null ? new Base[0] : new Base[] {this.managingOrganization}; // Reference
2224        case 3321850: /*link*/ return this.link == null ? new Base[0] : this.link.toArray(new Base[this.link.size()]); // PatientLinkComponent
2225        default: return super.getProperty(hash, name, checkValid);
2226        }
2227
2228      }
2229
2230      @Override
2231      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2232        switch (hash) {
2233        case -1618432855: // identifier
2234          this.getIdentifier().add(castToIdentifier(value)); // Identifier
2235          return value;
2236        case -1422950650: // active
2237          this.active = castToBoolean(value); // BooleanType
2238          return value;
2239        case 3373707: // name
2240          this.getName().add(castToHumanName(value)); // HumanName
2241          return value;
2242        case -1429363305: // telecom
2243          this.getTelecom().add(castToContactPoint(value)); // ContactPoint
2244          return value;
2245        case -1249512767: // gender
2246          value = new AdministrativeGenderEnumFactory().fromType(castToCode(value));
2247          this.gender = (Enumeration) value; // Enumeration<AdministrativeGender>
2248          return value;
2249        case -1210031859: // birthDate
2250          this.birthDate = castToDate(value); // DateType
2251          return value;
2252        case 561497972: // deceased
2253          this.deceased = castToType(value); // Type
2254          return value;
2255        case -1147692044: // address
2256          this.getAddress().add(castToAddress(value)); // Address
2257          return value;
2258        case 1756919302: // maritalStatus
2259          this.maritalStatus = castToCodeableConcept(value); // CodeableConcept
2260          return value;
2261        case -677369713: // multipleBirth
2262          this.multipleBirth = castToType(value); // Type
2263          return value;
2264        case 106642994: // photo
2265          this.getPhoto().add(castToAttachment(value)); // Attachment
2266          return value;
2267        case 951526432: // contact
2268          this.getContact().add((ContactComponent) value); // ContactComponent
2269          return value;
2270        case -1035284522: // communication
2271          this.getCommunication().add((PatientCommunicationComponent) value); // PatientCommunicationComponent
2272          return value;
2273        case 1488292898: // generalPractitioner
2274          this.getGeneralPractitioner().add(castToReference(value)); // Reference
2275          return value;
2276        case -2058947787: // managingOrganization
2277          this.managingOrganization = castToReference(value); // Reference
2278          return value;
2279        case 3321850: // link
2280          this.getLink().add((PatientLinkComponent) value); // PatientLinkComponent
2281          return value;
2282        default: return super.setProperty(hash, name, value);
2283        }
2284
2285      }
2286
2287      @Override
2288      public Base setProperty(String name, Base value) throws FHIRException {
2289        if (name.equals("identifier")) {
2290          this.getIdentifier().add(castToIdentifier(value));
2291        } else if (name.equals("active")) {
2292          this.active = castToBoolean(value); // BooleanType
2293        } else if (name.equals("name")) {
2294          this.getName().add(castToHumanName(value));
2295        } else if (name.equals("telecom")) {
2296          this.getTelecom().add(castToContactPoint(value));
2297        } else if (name.equals("gender")) {
2298          value = new AdministrativeGenderEnumFactory().fromType(castToCode(value));
2299          this.gender = (Enumeration) value; // Enumeration<AdministrativeGender>
2300        } else if (name.equals("birthDate")) {
2301          this.birthDate = castToDate(value); // DateType
2302        } else if (name.equals("deceased[x]")) {
2303          this.deceased = castToType(value); // Type
2304        } else if (name.equals("address")) {
2305          this.getAddress().add(castToAddress(value));
2306        } else if (name.equals("maritalStatus")) {
2307          this.maritalStatus = castToCodeableConcept(value); // CodeableConcept
2308        } else if (name.equals("multipleBirth[x]")) {
2309          this.multipleBirth = castToType(value); // Type
2310        } else if (name.equals("photo")) {
2311          this.getPhoto().add(castToAttachment(value));
2312        } else if (name.equals("contact")) {
2313          this.getContact().add((ContactComponent) value);
2314        } else if (name.equals("communication")) {
2315          this.getCommunication().add((PatientCommunicationComponent) value);
2316        } else if (name.equals("generalPractitioner")) {
2317          this.getGeneralPractitioner().add(castToReference(value));
2318        } else if (name.equals("managingOrganization")) {
2319          this.managingOrganization = castToReference(value); // Reference
2320        } else if (name.equals("link")) {
2321          this.getLink().add((PatientLinkComponent) value);
2322        } else
2323          return super.setProperty(name, value);
2324        return value;
2325      }
2326
2327      @Override
2328      public Base makeProperty(int hash, String name) throws FHIRException {
2329        switch (hash) {
2330        case -1618432855:  return addIdentifier(); 
2331        case -1422950650:  return getActiveElement();
2332        case 3373707:  return addName(); 
2333        case -1429363305:  return addTelecom(); 
2334        case -1249512767:  return getGenderElement();
2335        case -1210031859:  return getBirthDateElement();
2336        case -1311442804:  return getDeceased(); 
2337        case 561497972:  return getDeceased(); 
2338        case -1147692044:  return addAddress(); 
2339        case 1756919302:  return getMaritalStatus(); 
2340        case -1764672111:  return getMultipleBirth(); 
2341        case -677369713:  return getMultipleBirth(); 
2342        case 106642994:  return addPhoto(); 
2343        case 951526432:  return addContact(); 
2344        case -1035284522:  return addCommunication(); 
2345        case 1488292898:  return addGeneralPractitioner(); 
2346        case -2058947787:  return getManagingOrganization(); 
2347        case 3321850:  return addLink(); 
2348        default: return super.makeProperty(hash, name);
2349        }
2350
2351      }
2352
2353      @Override
2354      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2355        switch (hash) {
2356        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2357        case -1422950650: /*active*/ return new String[] {"boolean"};
2358        case 3373707: /*name*/ return new String[] {"HumanName"};
2359        case -1429363305: /*telecom*/ return new String[] {"ContactPoint"};
2360        case -1249512767: /*gender*/ return new String[] {"code"};
2361        case -1210031859: /*birthDate*/ return new String[] {"date"};
2362        case 561497972: /*deceased*/ return new String[] {"boolean", "dateTime"};
2363        case -1147692044: /*address*/ return new String[] {"Address"};
2364        case 1756919302: /*maritalStatus*/ return new String[] {"CodeableConcept"};
2365        case -677369713: /*multipleBirth*/ return new String[] {"boolean", "integer"};
2366        case 106642994: /*photo*/ return new String[] {"Attachment"};
2367        case 951526432: /*contact*/ return new String[] {};
2368        case -1035284522: /*communication*/ return new String[] {};
2369        case 1488292898: /*generalPractitioner*/ return new String[] {"Reference"};
2370        case -2058947787: /*managingOrganization*/ return new String[] {"Reference"};
2371        case 3321850: /*link*/ return new String[] {};
2372        default: return super.getTypesForProperty(hash, name);
2373        }
2374
2375      }
2376
2377      @Override
2378      public Base addChild(String name) throws FHIRException {
2379        if (name.equals("identifier")) {
2380          return addIdentifier();
2381        }
2382        else if (name.equals("active")) {
2383          throw new FHIRException("Cannot call addChild on a primitive type Patient.active");
2384        }
2385        else if (name.equals("name")) {
2386          return addName();
2387        }
2388        else if (name.equals("telecom")) {
2389          return addTelecom();
2390        }
2391        else if (name.equals("gender")) {
2392          throw new FHIRException("Cannot call addChild on a primitive type Patient.gender");
2393        }
2394        else if (name.equals("birthDate")) {
2395          throw new FHIRException("Cannot call addChild on a primitive type Patient.birthDate");
2396        }
2397        else if (name.equals("deceasedBoolean")) {
2398          this.deceased = new BooleanType();
2399          return this.deceased;
2400        }
2401        else if (name.equals("deceasedDateTime")) {
2402          this.deceased = new DateTimeType();
2403          return this.deceased;
2404        }
2405        else if (name.equals("address")) {
2406          return addAddress();
2407        }
2408        else if (name.equals("maritalStatus")) {
2409          this.maritalStatus = new CodeableConcept();
2410          return this.maritalStatus;
2411        }
2412        else if (name.equals("multipleBirthBoolean")) {
2413          this.multipleBirth = new BooleanType();
2414          return this.multipleBirth;
2415        }
2416        else if (name.equals("multipleBirthInteger")) {
2417          this.multipleBirth = new IntegerType();
2418          return this.multipleBirth;
2419        }
2420        else if (name.equals("photo")) {
2421          return addPhoto();
2422        }
2423        else if (name.equals("contact")) {
2424          return addContact();
2425        }
2426        else if (name.equals("communication")) {
2427          return addCommunication();
2428        }
2429        else if (name.equals("generalPractitioner")) {
2430          return addGeneralPractitioner();
2431        }
2432        else if (name.equals("managingOrganization")) {
2433          this.managingOrganization = new Reference();
2434          return this.managingOrganization;
2435        }
2436        else if (name.equals("link")) {
2437          return addLink();
2438        }
2439        else
2440          return super.addChild(name);
2441      }
2442
2443  public String fhirType() {
2444    return "Patient";
2445
2446  }
2447
2448      public Patient copy() {
2449        Patient dst = new Patient();
2450        copyValues(dst);
2451        if (identifier != null) {
2452          dst.identifier = new ArrayList<Identifier>();
2453          for (Identifier i : identifier)
2454            dst.identifier.add(i.copy());
2455        };
2456        dst.active = active == null ? null : active.copy();
2457        if (name != null) {
2458          dst.name = new ArrayList<HumanName>();
2459          for (HumanName i : name)
2460            dst.name.add(i.copy());
2461        };
2462        if (telecom != null) {
2463          dst.telecom = new ArrayList<ContactPoint>();
2464          for (ContactPoint i : telecom)
2465            dst.telecom.add(i.copy());
2466        };
2467        dst.gender = gender == null ? null : gender.copy();
2468        dst.birthDate = birthDate == null ? null : birthDate.copy();
2469        dst.deceased = deceased == null ? null : deceased.copy();
2470        if (address != null) {
2471          dst.address = new ArrayList<Address>();
2472          for (Address i : address)
2473            dst.address.add(i.copy());
2474        };
2475        dst.maritalStatus = maritalStatus == null ? null : maritalStatus.copy();
2476        dst.multipleBirth = multipleBirth == null ? null : multipleBirth.copy();
2477        if (photo != null) {
2478          dst.photo = new ArrayList<Attachment>();
2479          for (Attachment i : photo)
2480            dst.photo.add(i.copy());
2481        };
2482        if (contact != null) {
2483          dst.contact = new ArrayList<ContactComponent>();
2484          for (ContactComponent i : contact)
2485            dst.contact.add(i.copy());
2486        };
2487        if (communication != null) {
2488          dst.communication = new ArrayList<PatientCommunicationComponent>();
2489          for (PatientCommunicationComponent i : communication)
2490            dst.communication.add(i.copy());
2491        };
2492        if (generalPractitioner != null) {
2493          dst.generalPractitioner = new ArrayList<Reference>();
2494          for (Reference i : generalPractitioner)
2495            dst.generalPractitioner.add(i.copy());
2496        };
2497        dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy();
2498        if (link != null) {
2499          dst.link = new ArrayList<PatientLinkComponent>();
2500          for (PatientLinkComponent i : link)
2501            dst.link.add(i.copy());
2502        };
2503        return dst;
2504      }
2505
2506      protected Patient typedCopy() {
2507        return copy();
2508      }
2509
2510      @Override
2511      public boolean equalsDeep(Base other_) {
2512        if (!super.equalsDeep(other_))
2513          return false;
2514        if (!(other_ instanceof Patient))
2515          return false;
2516        Patient o = (Patient) other_;
2517        return compareDeep(identifier, o.identifier, true) && compareDeep(active, o.active, true) && compareDeep(name, o.name, true)
2518           && compareDeep(telecom, o.telecom, true) && compareDeep(gender, o.gender, true) && compareDeep(birthDate, o.birthDate, true)
2519           && compareDeep(deceased, o.deceased, true) && compareDeep(address, o.address, true) && compareDeep(maritalStatus, o.maritalStatus, true)
2520           && compareDeep(multipleBirth, o.multipleBirth, true) && compareDeep(photo, o.photo, true) && compareDeep(contact, o.contact, true)
2521           && compareDeep(communication, o.communication, true) && compareDeep(generalPractitioner, o.generalPractitioner, true)
2522           && compareDeep(managingOrganization, o.managingOrganization, true) && compareDeep(link, o.link, true)
2523          ;
2524      }
2525
2526      @Override
2527      public boolean equalsShallow(Base other_) {
2528        if (!super.equalsShallow(other_))
2529          return false;
2530        if (!(other_ instanceof Patient))
2531          return false;
2532        Patient o = (Patient) other_;
2533        return compareValues(active, o.active, true) && compareValues(gender, o.gender, true) && compareValues(birthDate, o.birthDate, true)
2534          ;
2535      }
2536
2537      public boolean isEmpty() {
2538        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, active, name
2539          , telecom, gender, birthDate, deceased, address, maritalStatus, multipleBirth
2540          , photo, contact, communication, generalPractitioner, managingOrganization, link
2541          );
2542      }
2543
2544  @Override
2545  public ResourceType getResourceType() {
2546    return ResourceType.Patient;
2547   }
2548
2549 /**
2550   * Search parameter: <b>identifier</b>
2551   * <p>
2552   * Description: <b>A patient identifier</b><br>
2553   * Type: <b>token</b><br>
2554   * Path: <b>Patient.identifier</b><br>
2555   * </p>
2556   */
2557  @SearchParamDefinition(name="identifier", path="Patient.identifier", description="A patient identifier", type="token" )
2558  public static final String SP_IDENTIFIER = "identifier";
2559 /**
2560   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2561   * <p>
2562   * Description: <b>A patient identifier</b><br>
2563   * Type: <b>token</b><br>
2564   * Path: <b>Patient.identifier</b><br>
2565   * </p>
2566   */
2567  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2568
2569 /**
2570   * Search parameter: <b>given</b>
2571   * <p>
2572   * Description: <b>A portion of the given name of the patient</b><br>
2573   * Type: <b>string</b><br>
2574   * Path: <b>Patient.name.given</b><br>
2575   * </p>
2576   */
2577  @SearchParamDefinition(name="given", path="Patient.name.given", description="A portion of the given name of the patient", type="string" )
2578  public static final String SP_GIVEN = "given";
2579 /**
2580   * <b>Fluent Client</b> search parameter constant for <b>given</b>
2581   * <p>
2582   * Description: <b>A portion of the given name of the patient</b><br>
2583   * Type: <b>string</b><br>
2584   * Path: <b>Patient.name.given</b><br>
2585   * </p>
2586   */
2587  public static final ca.uhn.fhir.rest.gclient.StringClientParam GIVEN = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_GIVEN);
2588
2589 /**
2590   * Search parameter: <b>address</b>
2591   * <p>
2592   * 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>
2593   * Type: <b>string</b><br>
2594   * Path: <b>Patient.address</b><br>
2595   * </p>
2596   */
2597  @SearchParamDefinition(name="address", path="Patient.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" )
2598  public static final String SP_ADDRESS = "address";
2599 /**
2600   * <b>Fluent Client</b> search parameter constant for <b>address</b>
2601   * <p>
2602   * 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>
2603   * Type: <b>string</b><br>
2604   * Path: <b>Patient.address</b><br>
2605   * </p>
2606   */
2607  public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS);
2608
2609 /**
2610   * Search parameter: <b>birthdate</b>
2611   * <p>
2612   * Description: <b>The patient's date of birth</b><br>
2613   * Type: <b>date</b><br>
2614   * Path: <b>Patient.birthDate</b><br>
2615   * </p>
2616   */
2617  @SearchParamDefinition(name="birthdate", path="Patient.birthDate", description="The patient's date of birth", type="date" )
2618  public static final String SP_BIRTHDATE = "birthdate";
2619 /**
2620   * <b>Fluent Client</b> search parameter constant for <b>birthdate</b>
2621   * <p>
2622   * Description: <b>The patient's date of birth</b><br>
2623   * Type: <b>date</b><br>
2624   * Path: <b>Patient.birthDate</b><br>
2625   * </p>
2626   */
2627  public static final ca.uhn.fhir.rest.gclient.DateClientParam BIRTHDATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_BIRTHDATE);
2628
2629 /**
2630   * Search parameter: <b>deceased</b>
2631   * <p>
2632   * Description: <b>This patient has been marked as deceased, or as a death date entered</b><br>
2633   * Type: <b>token</b><br>
2634   * Path: <b>Patient.deceased[x]</b><br>
2635   * </p>
2636   */
2637  @SearchParamDefinition(name="deceased", path="Patient.deceased.exists() and Patient.deceased != false", description="This patient has been marked as deceased, or as a death date entered", type="token" )
2638  public static final String SP_DECEASED = "deceased";
2639 /**
2640   * <b>Fluent Client</b> search parameter constant for <b>deceased</b>
2641   * <p>
2642   * Description: <b>This patient has been marked as deceased, or as a death date entered</b><br>
2643   * Type: <b>token</b><br>
2644   * Path: <b>Patient.deceased[x]</b><br>
2645   * </p>
2646   */
2647  public static final ca.uhn.fhir.rest.gclient.TokenClientParam DECEASED = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_DECEASED);
2648
2649 /**
2650   * Search parameter: <b>address-state</b>
2651   * <p>
2652   * Description: <b>A state specified in an address</b><br>
2653   * Type: <b>string</b><br>
2654   * Path: <b>Patient.address.state</b><br>
2655   * </p>
2656   */
2657  @SearchParamDefinition(name="address-state", path="Patient.address.state", description="A state specified in an address", type="string" )
2658  public static final String SP_ADDRESS_STATE = "address-state";
2659 /**
2660   * <b>Fluent Client</b> search parameter constant for <b>address-state</b>
2661   * <p>
2662   * Description: <b>A state specified in an address</b><br>
2663   * Type: <b>string</b><br>
2664   * Path: <b>Patient.address.state</b><br>
2665   * </p>
2666   */
2667  public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_STATE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_STATE);
2668
2669 /**
2670   * Search parameter: <b>gender</b>
2671   * <p>
2672   * Description: <b>Gender of the patient</b><br>
2673   * Type: <b>token</b><br>
2674   * Path: <b>Patient.gender</b><br>
2675   * </p>
2676   */
2677  @SearchParamDefinition(name="gender", path="Patient.gender", description="Gender of the patient", type="token" )
2678  public static final String SP_GENDER = "gender";
2679 /**
2680   * <b>Fluent Client</b> search parameter constant for <b>gender</b>
2681   * <p>
2682   * Description: <b>Gender of the patient</b><br>
2683   * Type: <b>token</b><br>
2684   * Path: <b>Patient.gender</b><br>
2685   * </p>
2686   */
2687  public static final ca.uhn.fhir.rest.gclient.TokenClientParam GENDER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_GENDER);
2688
2689 /**
2690   * Search parameter: <b>general-practitioner</b>
2691   * <p>
2692   * Description: <b>Patient's nominated general practitioner, not the organization that manages the record</b><br>
2693   * Type: <b>reference</b><br>
2694   * Path: <b>Patient.generalPractitioner</b><br>
2695   * </p>
2696   */
2697  @SearchParamDefinition(name="general-practitioner", path="Patient.generalPractitioner", description="Patient's nominated general practitioner, not the organization that manages the record", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Organization.class, Practitioner.class, PractitionerRole.class } )
2698  public static final String SP_GENERAL_PRACTITIONER = "general-practitioner";
2699 /**
2700   * <b>Fluent Client</b> search parameter constant for <b>general-practitioner</b>
2701   * <p>
2702   * Description: <b>Patient's nominated general practitioner, not the organization that manages the record</b><br>
2703   * Type: <b>reference</b><br>
2704   * Path: <b>Patient.generalPractitioner</b><br>
2705   * </p>
2706   */
2707  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam GENERAL_PRACTITIONER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_GENERAL_PRACTITIONER);
2708
2709/**
2710   * Constant for fluent queries to be used to add include statements. Specifies
2711   * the path value of "<b>Patient:general-practitioner</b>".
2712   */
2713  public static final ca.uhn.fhir.model.api.Include INCLUDE_GENERAL_PRACTITIONER = new ca.uhn.fhir.model.api.Include("Patient:general-practitioner").toLocked();
2714
2715 /**
2716   * Search parameter: <b>link</b>
2717   * <p>
2718   * Description: <b>All patients linked to the given patient</b><br>
2719   * Type: <b>reference</b><br>
2720   * Path: <b>Patient.link.other</b><br>
2721   * </p>
2722   */
2723  @SearchParamDefinition(name="link", path="Patient.link.other", description="All patients linked to the given patient", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="RelatedPerson") }, target={Patient.class, RelatedPerson.class } )
2724  public static final String SP_LINK = "link";
2725 /**
2726   * <b>Fluent Client</b> search parameter constant for <b>link</b>
2727   * <p>
2728   * Description: <b>All patients linked to the given patient</b><br>
2729   * Type: <b>reference</b><br>
2730   * Path: <b>Patient.link.other</b><br>
2731   * </p>
2732   */
2733  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LINK = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LINK);
2734
2735/**
2736   * Constant for fluent queries to be used to add include statements. Specifies
2737   * the path value of "<b>Patient:link</b>".
2738   */
2739  public static final ca.uhn.fhir.model.api.Include INCLUDE_LINK = new ca.uhn.fhir.model.api.Include("Patient:link").toLocked();
2740
2741 /**
2742   * Search parameter: <b>active</b>
2743   * <p>
2744   * Description: <b>Whether the patient record is active</b><br>
2745   * Type: <b>token</b><br>
2746   * Path: <b>Patient.active</b><br>
2747   * </p>
2748   */
2749  @SearchParamDefinition(name="active", path="Patient.active", description="Whether the patient record is active", type="token" )
2750  public static final String SP_ACTIVE = "active";
2751 /**
2752   * <b>Fluent Client</b> search parameter constant for <b>active</b>
2753   * <p>
2754   * Description: <b>Whether the patient record is active</b><br>
2755   * Type: <b>token</b><br>
2756   * Path: <b>Patient.active</b><br>
2757   * </p>
2758   */
2759  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACTIVE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACTIVE);
2760
2761 /**
2762   * Search parameter: <b>language</b>
2763   * <p>
2764   * Description: <b>Language code (irrespective of use value)</b><br>
2765   * Type: <b>token</b><br>
2766   * Path: <b>Patient.communication.language</b><br>
2767   * </p>
2768   */
2769  @SearchParamDefinition(name="language", path="Patient.communication.language", description="Language code (irrespective of use value)", type="token" )
2770  public static final String SP_LANGUAGE = "language";
2771 /**
2772   * <b>Fluent Client</b> search parameter constant for <b>language</b>
2773   * <p>
2774   * Description: <b>Language code (irrespective of use value)</b><br>
2775   * Type: <b>token</b><br>
2776   * Path: <b>Patient.communication.language</b><br>
2777   * </p>
2778   */
2779  public static final ca.uhn.fhir.rest.gclient.TokenClientParam LANGUAGE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_LANGUAGE);
2780
2781 /**
2782   * Search parameter: <b>address-postalcode</b>
2783   * <p>
2784   * Description: <b>A postalCode specified in an address</b><br>
2785   * Type: <b>string</b><br>
2786   * Path: <b>Patient.address.postalCode</b><br>
2787   * </p>
2788   */
2789  @SearchParamDefinition(name="address-postalcode", path="Patient.address.postalCode", description="A postalCode specified in an address", type="string" )
2790  public static final String SP_ADDRESS_POSTALCODE = "address-postalcode";
2791 /**
2792   * <b>Fluent Client</b> search parameter constant for <b>address-postalcode</b>
2793   * <p>
2794   * Description: <b>A postalCode specified in an address</b><br>
2795   * Type: <b>string</b><br>
2796   * Path: <b>Patient.address.postalCode</b><br>
2797   * </p>
2798   */
2799  public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_POSTALCODE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_POSTALCODE);
2800
2801 /**
2802   * Search parameter: <b>address-country</b>
2803   * <p>
2804   * Description: <b>A country specified in an address</b><br>
2805   * Type: <b>string</b><br>
2806   * Path: <b>Patient.address.country</b><br>
2807   * </p>
2808   */
2809  @SearchParamDefinition(name="address-country", path="Patient.address.country", description="A country specified in an address", type="string" )
2810  public static final String SP_ADDRESS_COUNTRY = "address-country";
2811 /**
2812   * <b>Fluent Client</b> search parameter constant for <b>address-country</b>
2813   * <p>
2814   * Description: <b>A country specified in an address</b><br>
2815   * Type: <b>string</b><br>
2816   * Path: <b>Patient.address.country</b><br>
2817   * </p>
2818   */
2819  public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_COUNTRY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_COUNTRY);
2820
2821 /**
2822   * Search parameter: <b>death-date</b>
2823   * <p>
2824   * Description: <b>The date of death has been provided and satisfies this search value</b><br>
2825   * Type: <b>date</b><br>
2826   * Path: <b>Patient.deceasedDateTime</b><br>
2827   * </p>
2828   */
2829  @SearchParamDefinition(name="death-date", path="(Patient.deceased as dateTime)", description="The date of death has been provided and satisfies this search value", type="date" )
2830  public static final String SP_DEATH_DATE = "death-date";
2831 /**
2832   * <b>Fluent Client</b> search parameter constant for <b>death-date</b>
2833   * <p>
2834   * Description: <b>The date of death has been provided and satisfies this search value</b><br>
2835   * Type: <b>date</b><br>
2836   * Path: <b>Patient.deceasedDateTime</b><br>
2837   * </p>
2838   */
2839  public static final ca.uhn.fhir.rest.gclient.DateClientParam DEATH_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DEATH_DATE);
2840
2841 /**
2842   * Search parameter: <b>phonetic</b>
2843   * <p>
2844   * Description: <b>A portion of either family or given name using some kind of phonetic matching algorithm</b><br>
2845   * Type: <b>string</b><br>
2846   * Path: <b>Patient.name</b><br>
2847   * </p>
2848   */
2849  @SearchParamDefinition(name="phonetic", path="Patient.name", description="A portion of either family or given name using some kind of phonetic matching algorithm", type="string" )
2850  public static final String SP_PHONETIC = "phonetic";
2851 /**
2852   * <b>Fluent Client</b> search parameter constant for <b>phonetic</b>
2853   * <p>
2854   * Description: <b>A portion of either family or given name using some kind of phonetic matching algorithm</b><br>
2855   * Type: <b>string</b><br>
2856   * Path: <b>Patient.name</b><br>
2857   * </p>
2858   */
2859  public static final ca.uhn.fhir.rest.gclient.StringClientParam PHONETIC = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PHONETIC);
2860
2861 /**
2862   * Search parameter: <b>phone</b>
2863   * <p>
2864   * Description: <b>A value in a phone contact</b><br>
2865   * Type: <b>token</b><br>
2866   * Path: <b>Patient.telecom(system=phone)</b><br>
2867   * </p>
2868   */
2869  @SearchParamDefinition(name="phone", path="Patient.telecom.where(system='phone')", description="A value in a phone contact", type="token" )
2870  public static final String SP_PHONE = "phone";
2871 /**
2872   * <b>Fluent Client</b> search parameter constant for <b>phone</b>
2873   * <p>
2874   * Description: <b>A value in a phone contact</b><br>
2875   * Type: <b>token</b><br>
2876   * Path: <b>Patient.telecom(system=phone)</b><br>
2877   * </p>
2878   */
2879  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PHONE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PHONE);
2880
2881 /**
2882   * Search parameter: <b>organization</b>
2883   * <p>
2884   * Description: <b>The organization that is the custodian of the patient record</b><br>
2885   * Type: <b>reference</b><br>
2886   * Path: <b>Patient.managingOrganization</b><br>
2887   * </p>
2888   */
2889  @SearchParamDefinition(name="organization", path="Patient.managingOrganization", description="The organization that is the custodian of the patient record", type="reference", target={Organization.class } )
2890  public static final String SP_ORGANIZATION = "organization";
2891 /**
2892   * <b>Fluent Client</b> search parameter constant for <b>organization</b>
2893   * <p>
2894   * Description: <b>The organization that is the custodian of the patient record</b><br>
2895   * Type: <b>reference</b><br>
2896   * Path: <b>Patient.managingOrganization</b><br>
2897   * </p>
2898   */
2899  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION);
2900
2901/**
2902   * Constant for fluent queries to be used to add include statements. Specifies
2903   * the path value of "<b>Patient:organization</b>".
2904   */
2905  public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("Patient:organization").toLocked();
2906
2907 /**
2908   * Search parameter: <b>name</b>
2909   * <p>
2910   * 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>
2911   * Type: <b>string</b><br>
2912   * Path: <b>Patient.name</b><br>
2913   * </p>
2914   */
2915  @SearchParamDefinition(name="name", path="Patient.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" )
2916  public static final String SP_NAME = "name";
2917 /**
2918   * <b>Fluent Client</b> search parameter constant for <b>name</b>
2919   * <p>
2920   * 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>
2921   * Type: <b>string</b><br>
2922   * Path: <b>Patient.name</b><br>
2923   * </p>
2924   */
2925  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
2926
2927 /**
2928   * Search parameter: <b>address-use</b>
2929   * <p>
2930   * Description: <b>A use code specified in an address</b><br>
2931   * Type: <b>token</b><br>
2932   * Path: <b>Patient.address.use</b><br>
2933   * </p>
2934   */
2935  @SearchParamDefinition(name="address-use", path="Patient.address.use", description="A use code specified in an address", type="token" )
2936  public static final String SP_ADDRESS_USE = "address-use";
2937 /**
2938   * <b>Fluent Client</b> search parameter constant for <b>address-use</b>
2939   * <p>
2940   * Description: <b>A use code specified in an address</b><br>
2941   * Type: <b>token</b><br>
2942   * Path: <b>Patient.address.use</b><br>
2943   * </p>
2944   */
2945  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ADDRESS_USE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ADDRESS_USE);
2946
2947 /**
2948   * Search parameter: <b>telecom</b>
2949   * <p>
2950   * Description: <b>The value in any kind of telecom details of the patient</b><br>
2951   * Type: <b>token</b><br>
2952   * Path: <b>Patient.telecom</b><br>
2953   * </p>
2954   */
2955  @SearchParamDefinition(name="telecom", path="Patient.telecom", description="The value in any kind of telecom details of the patient", type="token" )
2956  public static final String SP_TELECOM = "telecom";
2957 /**
2958   * <b>Fluent Client</b> search parameter constant for <b>telecom</b>
2959   * <p>
2960   * Description: <b>The value in any kind of telecom details of the patient</b><br>
2961   * Type: <b>token</b><br>
2962   * Path: <b>Patient.telecom</b><br>
2963   * </p>
2964   */
2965  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TELECOM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TELECOM);
2966
2967 /**
2968   * Search parameter: <b>family</b>
2969   * <p>
2970   * Description: <b>A portion of the family name of the patient</b><br>
2971   * Type: <b>string</b><br>
2972   * Path: <b>Patient.name.family</b><br>
2973   * </p>
2974   */
2975  @SearchParamDefinition(name="family", path="Patient.name.family", description="A portion of the family name of the patient", type="string" )
2976  public static final String SP_FAMILY = "family";
2977 /**
2978   * <b>Fluent Client</b> search parameter constant for <b>family</b>
2979   * <p>
2980   * Description: <b>A portion of the family name of the patient</b><br>
2981   * Type: <b>string</b><br>
2982   * Path: <b>Patient.name.family</b><br>
2983   * </p>
2984   */
2985  public static final ca.uhn.fhir.rest.gclient.StringClientParam FAMILY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_FAMILY);
2986
2987 /**
2988   * Search parameter: <b>address-city</b>
2989   * <p>
2990   * Description: <b>A city specified in an address</b><br>
2991   * Type: <b>string</b><br>
2992   * Path: <b>Patient.address.city</b><br>
2993   * </p>
2994   */
2995  @SearchParamDefinition(name="address-city", path="Patient.address.city", description="A city specified in an address", type="string" )
2996  public static final String SP_ADDRESS_CITY = "address-city";
2997 /**
2998   * <b>Fluent Client</b> search parameter constant for <b>address-city</b>
2999   * <p>
3000   * Description: <b>A city specified in an address</b><br>
3001   * Type: <b>string</b><br>
3002   * Path: <b>Patient.address.city</b><br>
3003   * </p>
3004   */
3005  public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_CITY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_CITY);
3006
3007 /**
3008   * Search parameter: <b>email</b>
3009   * <p>
3010   * Description: <b>A value in an email contact</b><br>
3011   * Type: <b>token</b><br>
3012   * Path: <b>Patient.telecom(system=email)</b><br>
3013   * </p>
3014   */
3015  @SearchParamDefinition(name="email", path="Patient.telecom.where(system='email')", description="A value in an email contact", type="token" )
3016  public static final String SP_EMAIL = "email";
3017 /**
3018   * <b>Fluent Client</b> search parameter constant for <b>email</b>
3019   * <p>
3020   * Description: <b>A value in an email contact</b><br>
3021   * Type: <b>token</b><br>
3022   * Path: <b>Patient.telecom(system=email)</b><br>
3023   * </p>
3024   */
3025  public static final ca.uhn.fhir.rest.gclient.TokenClientParam EMAIL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EMAIL);
3026
3027
3028}
3029