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