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