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