001package org.hl7.fhir.dstu2.model;
002
003
004
005
006/*
007  Copyright (c) 2011+, HL7, Inc.
008  All rights reserved.
009  
010  Redistribution and use in source and binary forms, with or without modification, 
011  are permitted provided that the following conditions are met:
012  
013   * Redistributions of source code must retain the above copyright notice, this 
014     list of conditions and the following disclaimer.
015   * Redistributions in binary form must reproduce the above copyright notice, 
016     this list of conditions and the following disclaimer in the documentation 
017     and/or other materials provided with the distribution.
018   * Neither the name of HL7 nor the names of its contributors may be used to 
019     endorse or promote products derived from this software without specific 
020     prior written permission.
021  
022  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
023  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
024  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
025  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
026  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
027  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
028  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
029  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
030  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
031  POSSIBILITY OF SUCH DAMAGE.
032  
033*/
034
035// Generated on Wed, Jul 13, 2016 05:32+1000 for FHIR v1.0.2
036import java.util.ArrayList;
037import java.util.Date;
038import java.util.List;
039
040import org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender;
041import org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGenderEnumFactory;
042import ca.uhn.fhir.model.api.annotation.Child;
043import ca.uhn.fhir.model.api.annotation.Description;
044import ca.uhn.fhir.model.api.annotation.ResourceDef;
045import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
046import org.hl7.fhir.exceptions.FHIRException;
047/**
048 * Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process.
049 */
050@ResourceDef(name="RelatedPerson", profile="http://hl7.org/fhir/Profile/RelatedPerson")
051public class RelatedPerson extends DomainResource {
052
053    /**
054     * Identifier for a person within a particular scope.
055     */
056    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
057    @Description(shortDefinition="A human identifier for this person", formalDefinition="Identifier for a person within a particular scope." )
058    protected List<Identifier> identifier;
059
060    /**
061     * The patient this person is related to.
062     */
063    @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1, modifier=false, summary=true)
064    @Description(shortDefinition="The patient this person is related to", formalDefinition="The patient this person is related to." )
065    protected Reference patient;
066
067    /**
068     * The actual object that is the target of the reference (The patient this person is related to.)
069     */
070    protected Patient patientTarget;
071
072    /**
073     * The nature of the relationship between a patient and the related person.
074     */
075    @Child(name = "relationship", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
076    @Description(shortDefinition="The nature of the relationship", formalDefinition="The nature of the relationship between a patient and the related person." )
077    protected CodeableConcept relationship;
078
079    /**
080     * A name associated with the person.
081     */
082    @Child(name = "name", type = {HumanName.class}, order=3, min=0, max=1, modifier=false, summary=true)
083    @Description(shortDefinition="A name associated with the person", formalDefinition="A name associated with the person." )
084    protected HumanName name;
085
086    /**
087     * A contact detail for the person, e.g. a telephone number or an email address.
088     */
089    @Child(name = "telecom", type = {ContactPoint.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
090    @Description(shortDefinition="A contact detail for the person", formalDefinition="A contact detail for the person, e.g. a telephone number or an email address." )
091    protected List<ContactPoint> telecom;
092
093    /**
094     * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.
095     */
096    @Child(name = "gender", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=true)
097    @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes." )
098    protected Enumeration<AdministrativeGender> gender;
099
100    /**
101     * The date on which the related person was born.
102     */
103    @Child(name = "birthDate", type = {DateType.class}, order=6, min=0, max=1, modifier=false, summary=true)
104    @Description(shortDefinition="The date on which the related person was born", formalDefinition="The date on which the related person was born." )
105    protected DateType birthDate;
106
107    /**
108     * Address where the related person can be contacted or visited.
109     */
110    @Child(name = "address", type = {Address.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
111    @Description(shortDefinition="Address where the related person can be contacted or visited", formalDefinition="Address where the related person can be contacted or visited." )
112    protected List<Address> address;
113
114    /**
115     * Image of the person.
116     */
117    @Child(name = "photo", type = {Attachment.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
118    @Description(shortDefinition="Image of the person", formalDefinition="Image of the person." )
119    protected List<Attachment> photo;
120
121    /**
122     * The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown.
123     */
124    @Child(name = "period", type = {Period.class}, order=9, min=0, max=1, modifier=false, summary=false)
125    @Description(shortDefinition="Period of time that this relationship is considered valid", formalDefinition="The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown." )
126    protected Period period;
127
128    private static final long serialVersionUID = 7777543L;
129
130  /*
131   * Constructor
132   */
133    public RelatedPerson() {
134      super();
135    }
136
137  /*
138   * Constructor
139   */
140    public RelatedPerson(Reference patient) {
141      super();
142      this.patient = patient;
143    }
144
145    /**
146     * @return {@link #identifier} (Identifier for a person within a particular scope.)
147     */
148    public List<Identifier> getIdentifier() { 
149      if (this.identifier == null)
150        this.identifier = new ArrayList<Identifier>();
151      return this.identifier;
152    }
153
154    public boolean hasIdentifier() { 
155      if (this.identifier == null)
156        return false;
157      for (Identifier item : this.identifier)
158        if (!item.isEmpty())
159          return true;
160      return false;
161    }
162
163    /**
164     * @return {@link #identifier} (Identifier for a person within a particular scope.)
165     */
166    // syntactic sugar
167    public Identifier addIdentifier() { //3
168      Identifier t = new Identifier();
169      if (this.identifier == null)
170        this.identifier = new ArrayList<Identifier>();
171      this.identifier.add(t);
172      return t;
173    }
174
175    // syntactic sugar
176    public RelatedPerson addIdentifier(Identifier t) { //3
177      if (t == null)
178        return this;
179      if (this.identifier == null)
180        this.identifier = new ArrayList<Identifier>();
181      this.identifier.add(t);
182      return this;
183    }
184
185    /**
186     * @return {@link #patient} (The patient this person is related to.)
187     */
188    public Reference getPatient() { 
189      if (this.patient == null)
190        if (Configuration.errorOnAutoCreate())
191          throw new Error("Attempt to auto-create RelatedPerson.patient");
192        else if (Configuration.doAutoCreate())
193          this.patient = new Reference(); // cc
194      return this.patient;
195    }
196
197    public boolean hasPatient() { 
198      return this.patient != null && !this.patient.isEmpty();
199    }
200
201    /**
202     * @param value {@link #patient} (The patient this person is related to.)
203     */
204    public RelatedPerson setPatient(Reference value) { 
205      this.patient = value;
206      return this;
207    }
208
209    /**
210     * @return {@link #patient} 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 patient this person is related to.)
211     */
212    public Patient getPatientTarget() { 
213      if (this.patientTarget == null)
214        if (Configuration.errorOnAutoCreate())
215          throw new Error("Attempt to auto-create RelatedPerson.patient");
216        else if (Configuration.doAutoCreate())
217          this.patientTarget = new Patient(); // aa
218      return this.patientTarget;
219    }
220
221    /**
222     * @param value {@link #patient} 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 patient this person is related to.)
223     */
224    public RelatedPerson setPatientTarget(Patient value) { 
225      this.patientTarget = value;
226      return this;
227    }
228
229    /**
230     * @return {@link #relationship} (The nature of the relationship between a patient and the related person.)
231     */
232    public CodeableConcept getRelationship() { 
233      if (this.relationship == null)
234        if (Configuration.errorOnAutoCreate())
235          throw new Error("Attempt to auto-create RelatedPerson.relationship");
236        else if (Configuration.doAutoCreate())
237          this.relationship = new CodeableConcept(); // cc
238      return this.relationship;
239    }
240
241    public boolean hasRelationship() { 
242      return this.relationship != null && !this.relationship.isEmpty();
243    }
244
245    /**
246     * @param value {@link #relationship} (The nature of the relationship between a patient and the related person.)
247     */
248    public RelatedPerson setRelationship(CodeableConcept value) { 
249      this.relationship = value;
250      return this;
251    }
252
253    /**
254     * @return {@link #name} (A name associated with the person.)
255     */
256    public HumanName getName() { 
257      if (this.name == null)
258        if (Configuration.errorOnAutoCreate())
259          throw new Error("Attempt to auto-create RelatedPerson.name");
260        else if (Configuration.doAutoCreate())
261          this.name = new HumanName(); // cc
262      return this.name;
263    }
264
265    public boolean hasName() { 
266      return this.name != null && !this.name.isEmpty();
267    }
268
269    /**
270     * @param value {@link #name} (A name associated with the person.)
271     */
272    public RelatedPerson setName(HumanName value) { 
273      this.name = value;
274      return this;
275    }
276
277    /**
278     * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.)
279     */
280    public List<ContactPoint> getTelecom() { 
281      if (this.telecom == null)
282        this.telecom = new ArrayList<ContactPoint>();
283      return this.telecom;
284    }
285
286    public boolean hasTelecom() { 
287      if (this.telecom == null)
288        return false;
289      for (ContactPoint item : this.telecom)
290        if (!item.isEmpty())
291          return true;
292      return false;
293    }
294
295    /**
296     * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.)
297     */
298    // syntactic sugar
299    public ContactPoint addTelecom() { //3
300      ContactPoint t = new ContactPoint();
301      if (this.telecom == null)
302        this.telecom = new ArrayList<ContactPoint>();
303      this.telecom.add(t);
304      return t;
305    }
306
307    // syntactic sugar
308    public RelatedPerson addTelecom(ContactPoint t) { //3
309      if (t == null)
310        return this;
311      if (this.telecom == null)
312        this.telecom = new ArrayList<ContactPoint>();
313      this.telecom.add(t);
314      return this;
315    }
316
317    /**
318     * @return {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value
319     */
320    public Enumeration<AdministrativeGender> getGenderElement() { 
321      if (this.gender == null)
322        if (Configuration.errorOnAutoCreate())
323          throw new Error("Attempt to auto-create RelatedPerson.gender");
324        else if (Configuration.doAutoCreate())
325          this.gender = new Enumeration<AdministrativeGender>(new AdministrativeGenderEnumFactory()); // bb
326      return this.gender;
327    }
328
329    public boolean hasGenderElement() { 
330      return this.gender != null && !this.gender.isEmpty();
331    }
332
333    public boolean hasGender() { 
334      return this.gender != null && !this.gender.isEmpty();
335    }
336
337    /**
338     * @param value {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value
339     */
340    public RelatedPerson setGenderElement(Enumeration<AdministrativeGender> value) { 
341      this.gender = value;
342      return this;
343    }
344
345    /**
346     * @return Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.
347     */
348    public AdministrativeGender getGender() { 
349      return this.gender == null ? null : this.gender.getValue();
350    }
351
352    /**
353     * @param value Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.
354     */
355    public RelatedPerson setGender(AdministrativeGender value) { 
356      if (value == null)
357        this.gender = null;
358      else {
359        if (this.gender == null)
360          this.gender = new Enumeration<AdministrativeGender>(new AdministrativeGenderEnumFactory());
361        this.gender.setValue(value);
362      }
363      return this;
364    }
365
366    /**
367     * @return {@link #birthDate} (The date on which the related person was born.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value
368     */
369    public DateType getBirthDateElement() { 
370      if (this.birthDate == null)
371        if (Configuration.errorOnAutoCreate())
372          throw new Error("Attempt to auto-create RelatedPerson.birthDate");
373        else if (Configuration.doAutoCreate())
374          this.birthDate = new DateType(); // bb
375      return this.birthDate;
376    }
377
378    public boolean hasBirthDateElement() { 
379      return this.birthDate != null && !this.birthDate.isEmpty();
380    }
381
382    public boolean hasBirthDate() { 
383      return this.birthDate != null && !this.birthDate.isEmpty();
384    }
385
386    /**
387     * @param value {@link #birthDate} (The date on which the related person was born.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value
388     */
389    public RelatedPerson setBirthDateElement(DateType value) { 
390      this.birthDate = value;
391      return this;
392    }
393
394    /**
395     * @return The date on which the related person was born.
396     */
397    public Date getBirthDate() { 
398      return this.birthDate == null ? null : this.birthDate.getValue();
399    }
400
401    /**
402     * @param value The date on which the related person was born.
403     */
404    public RelatedPerson setBirthDate(Date value) { 
405      if (value == null)
406        this.birthDate = null;
407      else {
408        if (this.birthDate == null)
409          this.birthDate = new DateType();
410        this.birthDate.setValue(value);
411      }
412      return this;
413    }
414
415    /**
416     * @return {@link #address} (Address where the related person can be contacted or visited.)
417     */
418    public List<Address> getAddress() { 
419      if (this.address == null)
420        this.address = new ArrayList<Address>();
421      return this.address;
422    }
423
424    public boolean hasAddress() { 
425      if (this.address == null)
426        return false;
427      for (Address item : this.address)
428        if (!item.isEmpty())
429          return true;
430      return false;
431    }
432
433    /**
434     * @return {@link #address} (Address where the related person can be contacted or visited.)
435     */
436    // syntactic sugar
437    public Address addAddress() { //3
438      Address t = new Address();
439      if (this.address == null)
440        this.address = new ArrayList<Address>();
441      this.address.add(t);
442      return t;
443    }
444
445    // syntactic sugar
446    public RelatedPerson addAddress(Address t) { //3
447      if (t == null)
448        return this;
449      if (this.address == null)
450        this.address = new ArrayList<Address>();
451      this.address.add(t);
452      return this;
453    }
454
455    /**
456     * @return {@link #photo} (Image of the person.)
457     */
458    public List<Attachment> getPhoto() { 
459      if (this.photo == null)
460        this.photo = new ArrayList<Attachment>();
461      return this.photo;
462    }
463
464    public boolean hasPhoto() { 
465      if (this.photo == null)
466        return false;
467      for (Attachment item : this.photo)
468        if (!item.isEmpty())
469          return true;
470      return false;
471    }
472
473    /**
474     * @return {@link #photo} (Image of the person.)
475     */
476    // syntactic sugar
477    public Attachment addPhoto() { //3
478      Attachment t = new Attachment();
479      if (this.photo == null)
480        this.photo = new ArrayList<Attachment>();
481      this.photo.add(t);
482      return t;
483    }
484
485    // syntactic sugar
486    public RelatedPerson addPhoto(Attachment t) { //3
487      if (t == null)
488        return this;
489      if (this.photo == null)
490        this.photo = new ArrayList<Attachment>();
491      this.photo.add(t);
492      return this;
493    }
494
495    /**
496     * @return {@link #period} (The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown.)
497     */
498    public Period getPeriod() { 
499      if (this.period == null)
500        if (Configuration.errorOnAutoCreate())
501          throw new Error("Attempt to auto-create RelatedPerson.period");
502        else if (Configuration.doAutoCreate())
503          this.period = new Period(); // cc
504      return this.period;
505    }
506
507    public boolean hasPeriod() { 
508      return this.period != null && !this.period.isEmpty();
509    }
510
511    /**
512     * @param value {@link #period} (The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown.)
513     */
514    public RelatedPerson setPeriod(Period value) { 
515      this.period = value;
516      return this;
517    }
518
519      protected void listChildren(List<Property> childrenList) {
520        super.listChildren(childrenList);
521        childrenList.add(new Property("identifier", "Identifier", "Identifier for a person within a particular scope.", 0, java.lang.Integer.MAX_VALUE, identifier));
522        childrenList.add(new Property("patient", "Reference(Patient)", "The patient this person is related to.", 0, java.lang.Integer.MAX_VALUE, patient));
523        childrenList.add(new Property("relationship", "CodeableConcept", "The nature of the relationship between a patient and the related person.", 0, java.lang.Integer.MAX_VALUE, relationship));
524        childrenList.add(new Property("name", "HumanName", "A name associated with the person.", 0, java.lang.Integer.MAX_VALUE, name));
525        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));
526        childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender));
527        childrenList.add(new Property("birthDate", "date", "The date on which the related person was born.", 0, java.lang.Integer.MAX_VALUE, birthDate));
528        childrenList.add(new Property("address", "Address", "Address where the related person can be contacted or visited.", 0, java.lang.Integer.MAX_VALUE, address));
529        childrenList.add(new Property("photo", "Attachment", "Image of the person.", 0, java.lang.Integer.MAX_VALUE, photo));
530        childrenList.add(new Property("period", "Period", "The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown.", 0, java.lang.Integer.MAX_VALUE, period));
531      }
532
533      @Override
534      public void setProperty(String name, Base value) throws FHIRException {
535        if (name.equals("identifier"))
536          this.getIdentifier().add(castToIdentifier(value));
537        else if (name.equals("patient"))
538          this.patient = castToReference(value); // Reference
539        else if (name.equals("relationship"))
540          this.relationship = castToCodeableConcept(value); // CodeableConcept
541        else if (name.equals("name"))
542          this.name = castToHumanName(value); // HumanName
543        else if (name.equals("telecom"))
544          this.getTelecom().add(castToContactPoint(value));
545        else if (name.equals("gender"))
546          this.gender = new AdministrativeGenderEnumFactory().fromType(value); // Enumeration<AdministrativeGender>
547        else if (name.equals("birthDate"))
548          this.birthDate = castToDate(value); // DateType
549        else if (name.equals("address"))
550          this.getAddress().add(castToAddress(value));
551        else if (name.equals("photo"))
552          this.getPhoto().add(castToAttachment(value));
553        else if (name.equals("period"))
554          this.period = castToPeriod(value); // Period
555        else
556          super.setProperty(name, value);
557      }
558
559      @Override
560      public Base addChild(String name) throws FHIRException {
561        if (name.equals("identifier")) {
562          return addIdentifier();
563        }
564        else if (name.equals("patient")) {
565          this.patient = new Reference();
566          return this.patient;
567        }
568        else if (name.equals("relationship")) {
569          this.relationship = new CodeableConcept();
570          return this.relationship;
571        }
572        else if (name.equals("name")) {
573          this.name = new HumanName();
574          return this.name;
575        }
576        else if (name.equals("telecom")) {
577          return addTelecom();
578        }
579        else if (name.equals("gender")) {
580          throw new FHIRException("Cannot call addChild on a primitive type RelatedPerson.gender");
581        }
582        else if (name.equals("birthDate")) {
583          throw new FHIRException("Cannot call addChild on a primitive type RelatedPerson.birthDate");
584        }
585        else if (name.equals("address")) {
586          return addAddress();
587        }
588        else if (name.equals("photo")) {
589          return addPhoto();
590        }
591        else if (name.equals("period")) {
592          this.period = new Period();
593          return this.period;
594        }
595        else
596          return super.addChild(name);
597      }
598
599  public String fhirType() {
600    return "RelatedPerson";
601
602  }
603
604      public RelatedPerson copy() {
605        RelatedPerson dst = new RelatedPerson();
606        copyValues(dst);
607        if (identifier != null) {
608          dst.identifier = new ArrayList<Identifier>();
609          for (Identifier i : identifier)
610            dst.identifier.add(i.copy());
611        };
612        dst.patient = patient == null ? null : patient.copy();
613        dst.relationship = relationship == null ? null : relationship.copy();
614        dst.name = name == null ? null : name.copy();
615        if (telecom != null) {
616          dst.telecom = new ArrayList<ContactPoint>();
617          for (ContactPoint i : telecom)
618            dst.telecom.add(i.copy());
619        };
620        dst.gender = gender == null ? null : gender.copy();
621        dst.birthDate = birthDate == null ? null : birthDate.copy();
622        if (address != null) {
623          dst.address = new ArrayList<Address>();
624          for (Address i : address)
625            dst.address.add(i.copy());
626        };
627        if (photo != null) {
628          dst.photo = new ArrayList<Attachment>();
629          for (Attachment i : photo)
630            dst.photo.add(i.copy());
631        };
632        dst.period = period == null ? null : period.copy();
633        return dst;
634      }
635
636      protected RelatedPerson typedCopy() {
637        return copy();
638      }
639
640      @Override
641      public boolean equalsDeep(Base other) {
642        if (!super.equalsDeep(other))
643          return false;
644        if (!(other instanceof RelatedPerson))
645          return false;
646        RelatedPerson o = (RelatedPerson) other;
647        return compareDeep(identifier, o.identifier, true) && compareDeep(patient, o.patient, true) && compareDeep(relationship, o.relationship, true)
648           && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true) && compareDeep(gender, o.gender, true)
649           && compareDeep(birthDate, o.birthDate, true) && compareDeep(address, o.address, true) && compareDeep(photo, o.photo, true)
650           && compareDeep(period, o.period, true);
651      }
652
653      @Override
654      public boolean equalsShallow(Base other) {
655        if (!super.equalsShallow(other))
656          return false;
657        if (!(other instanceof RelatedPerson))
658          return false;
659        RelatedPerson o = (RelatedPerson) other;
660        return compareValues(gender, o.gender, true) && compareValues(birthDate, o.birthDate, true);
661      }
662
663      public boolean isEmpty() {
664        return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty())
665           && (relationship == null || relationship.isEmpty()) && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty())
666           && (gender == null || gender.isEmpty()) && (birthDate == null || birthDate.isEmpty()) && (address == null || address.isEmpty())
667           && (photo == null || photo.isEmpty()) && (period == null || period.isEmpty());
668      }
669
670  @Override
671  public ResourceType getResourceType() {
672    return ResourceType.RelatedPerson;
673   }
674
675  @SearchParamDefinition(name="identifier", path="RelatedPerson.identifier", description="A patient Identifier", type="token" )
676  public static final String SP_IDENTIFIER = "identifier";
677  @SearchParamDefinition(name="address", path="RelatedPerson.address", description="An address in any kind of address/part", type="string" )
678  public static final String SP_ADDRESS = "address";
679  @SearchParamDefinition(name="birthdate", path="RelatedPerson.birthDate", description="The Related Person's date of birth", type="date" )
680  public static final String SP_BIRTHDATE = "birthdate";
681  @SearchParamDefinition(name="address-state", path="RelatedPerson.address.state", description="A state specified in an address", type="string" )
682  public static final String SP_ADDRESSSTATE = "address-state";
683  @SearchParamDefinition(name="gender", path="RelatedPerson.gender", description="Gender of the person", type="token" )
684  public static final String SP_GENDER = "gender";
685  @SearchParamDefinition(name="address-postalcode", path="RelatedPerson.address.postalCode", description="A postal code specified in an address", type="string" )
686  public static final String SP_ADDRESSPOSTALCODE = "address-postalcode";
687  @SearchParamDefinition(name="address-country", path="RelatedPerson.address.country", description="A country specified in an address", type="string" )
688  public static final String SP_ADDRESSCOUNTRY = "address-country";
689  @SearchParamDefinition(name="phonetic", path="RelatedPerson.name", description="A portion of name using some kind of phonetic matching algorithm", type="string" )
690  public static final String SP_PHONETIC = "phonetic";
691  @SearchParamDefinition(name="phone", path="RelatedPerson.telecom.where(system='phone')", description="A value in a phone contact", type="token" )
692  public static final String SP_PHONE = "phone";
693  @SearchParamDefinition(name="patient", path="RelatedPerson.patient", description="The patient this person is related to", type="reference" )
694  public static final String SP_PATIENT = "patient";
695  @SearchParamDefinition(name="name", path="RelatedPerson.name", description="A portion of name in any name part", type="string" )
696  public static final String SP_NAME = "name";
697  @SearchParamDefinition(name="address-use", path="RelatedPerson.address.use", description="A use code specified in an address", type="token" )
698  public static final String SP_ADDRESSUSE = "address-use";
699  @SearchParamDefinition(name="telecom", path="RelatedPerson.telecom", description="The value in any kind of contact", type="token" )
700  public static final String SP_TELECOM = "telecom";
701  @SearchParamDefinition(name="address-city", path="RelatedPerson.address.city", description="A city specified in an address", type="string" )
702  public static final String SP_ADDRESSCITY = "address-city";
703  @SearchParamDefinition(name="email", path="RelatedPerson.telecom.where(system='email')", description="A value in an email contact", type="token" )
704  public static final String SP_EMAIL = "email";
705
706}