001package org.hl7.fhir.dstu3.model;
002
003
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034// Generated on Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.x
035import java.util.ArrayList;
036import java.util.Date;
037import java.util.List;
038
039import org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender;
040import org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGenderEnumFactory;
041import org.hl7.fhir.exceptions.FHIRException;
042import org.hl7.fhir.exceptions.FHIRFormatError;
043import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
044import org.hl7.fhir.utilities.Utilities;
045
046import ca.uhn.fhir.model.api.annotation.Block;
047import ca.uhn.fhir.model.api.annotation.Child;
048import ca.uhn.fhir.model.api.annotation.Description;
049import ca.uhn.fhir.model.api.annotation.ResourceDef;
050import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
051/**
052 * Significant health events and conditions for a person related to the patient relevant in the context of care for the patient.
053 */
054@ResourceDef(name="FamilyMemberHistory", profile="http://hl7.org/fhir/Profile/FamilyMemberHistory")
055public class FamilyMemberHistory extends DomainResource {
056
057    public enum FamilyHistoryStatus {
058        /**
059         * Some health information is known and captured, but not complete - see notes for details.
060         */
061        PARTIAL, 
062        /**
063         * All available related health information is captured as of the date (and possibly time) when the family member history was taken.
064         */
065        COMPLETED, 
066        /**
067         * This instance should not have been part of this patient's medical record.
068         */
069        ENTEREDINERROR, 
070        /**
071         * Health information for this individual is unavailable/unknown.
072         */
073        HEALTHUNKNOWN, 
074        /**
075         * added to help the parsers with the generic types
076         */
077        NULL;
078        public static FamilyHistoryStatus fromCode(String codeString) throws FHIRException {
079            if (codeString == null || "".equals(codeString))
080                return null;
081        if ("partial".equals(codeString))
082          return PARTIAL;
083        if ("completed".equals(codeString))
084          return COMPLETED;
085        if ("entered-in-error".equals(codeString))
086          return ENTEREDINERROR;
087        if ("health-unknown".equals(codeString))
088          return HEALTHUNKNOWN;
089        if (Configuration.isAcceptInvalidEnums())
090          return null;
091        else
092          throw new FHIRException("Unknown FamilyHistoryStatus code '"+codeString+"'");
093        }
094        public String toCode() {
095          switch (this) {
096            case PARTIAL: return "partial";
097            case COMPLETED: return "completed";
098            case ENTEREDINERROR: return "entered-in-error";
099            case HEALTHUNKNOWN: return "health-unknown";
100            case NULL: return null;
101            default: return "?";
102          }
103        }
104        public String getSystem() {
105          switch (this) {
106            case PARTIAL: return "http://hl7.org/fhir/history-status";
107            case COMPLETED: return "http://hl7.org/fhir/history-status";
108            case ENTEREDINERROR: return "http://hl7.org/fhir/history-status";
109            case HEALTHUNKNOWN: return "http://hl7.org/fhir/history-status";
110            case NULL: return null;
111            default: return "?";
112          }
113        }
114        public String getDefinition() {
115          switch (this) {
116            case PARTIAL: return "Some health information is known and captured, but not complete - see notes for details.";
117            case COMPLETED: return "All available related health information is captured as of the date (and possibly time) when the family member history was taken.";
118            case ENTEREDINERROR: return "This instance should not have been part of this patient's medical record.";
119            case HEALTHUNKNOWN: return "Health information for this individual is unavailable/unknown.";
120            case NULL: return null;
121            default: return "?";
122          }
123        }
124        public String getDisplay() {
125          switch (this) {
126            case PARTIAL: return "Partial";
127            case COMPLETED: return "Completed";
128            case ENTEREDINERROR: return "Entered in error";
129            case HEALTHUNKNOWN: return "Health unknown";
130            case NULL: return null;
131            default: return "?";
132          }
133        }
134    }
135
136  public static class FamilyHistoryStatusEnumFactory implements EnumFactory<FamilyHistoryStatus> {
137    public FamilyHistoryStatus fromCode(String codeString) throws IllegalArgumentException {
138      if (codeString == null || "".equals(codeString))
139            if (codeString == null || "".equals(codeString))
140                return null;
141        if ("partial".equals(codeString))
142          return FamilyHistoryStatus.PARTIAL;
143        if ("completed".equals(codeString))
144          return FamilyHistoryStatus.COMPLETED;
145        if ("entered-in-error".equals(codeString))
146          return FamilyHistoryStatus.ENTEREDINERROR;
147        if ("health-unknown".equals(codeString))
148          return FamilyHistoryStatus.HEALTHUNKNOWN;
149        throw new IllegalArgumentException("Unknown FamilyHistoryStatus code '"+codeString+"'");
150        }
151        public Enumeration<FamilyHistoryStatus> fromType(PrimitiveType<?> code) throws FHIRException {
152          if (code == null)
153            return null;
154          if (code.isEmpty())
155            return new Enumeration<FamilyHistoryStatus>(this);
156          String codeString = code.asStringValue();
157          if (codeString == null || "".equals(codeString))
158            return null;
159        if ("partial".equals(codeString))
160          return new Enumeration<FamilyHistoryStatus>(this, FamilyHistoryStatus.PARTIAL);
161        if ("completed".equals(codeString))
162          return new Enumeration<FamilyHistoryStatus>(this, FamilyHistoryStatus.COMPLETED);
163        if ("entered-in-error".equals(codeString))
164          return new Enumeration<FamilyHistoryStatus>(this, FamilyHistoryStatus.ENTEREDINERROR);
165        if ("health-unknown".equals(codeString))
166          return new Enumeration<FamilyHistoryStatus>(this, FamilyHistoryStatus.HEALTHUNKNOWN);
167        throw new FHIRException("Unknown FamilyHistoryStatus code '"+codeString+"'");
168        }
169    public String toCode(FamilyHistoryStatus code) {
170       if (code == FamilyHistoryStatus.NULL)
171           return null;
172       if (code == FamilyHistoryStatus.PARTIAL)
173        return "partial";
174      if (code == FamilyHistoryStatus.COMPLETED)
175        return "completed";
176      if (code == FamilyHistoryStatus.ENTEREDINERROR)
177        return "entered-in-error";
178      if (code == FamilyHistoryStatus.HEALTHUNKNOWN)
179        return "health-unknown";
180      return "?";
181   }
182    public String toSystem(FamilyHistoryStatus code) {
183      return code.getSystem();
184      }
185    }
186
187    @Block()
188    public static class FamilyMemberHistoryConditionComponent extends BackboneElement implements IBaseBackboneElement {
189        /**
190         * The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system.
191         */
192        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
193        @Description(shortDefinition="Condition suffered by relation", formalDefinition="The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system." )
194        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/condition-code")
195        protected CodeableConcept code;
196
197        /**
198         * Indicates what happened as a result of this condition.  If the condition resulted in death, deceased date is captured on the relation.
199         */
200        @Child(name = "outcome", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
201        @Description(shortDefinition="deceased | permanent disability | etc.", formalDefinition="Indicates what happened as a result of this condition.  If the condition resulted in death, deceased date is captured on the relation." )
202        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/condition-outcome")
203        protected CodeableConcept outcome;
204
205        /**
206         * Either the age of onset, range of approximate age or descriptive string can be recorded.  For conditions with multiple occurrences, this describes the first known occurrence.
207         */
208        @Child(name = "onset", type = {Age.class, Range.class, Period.class, StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
209        @Description(shortDefinition="When condition first manifested", formalDefinition="Either the age of onset, range of approximate age or descriptive string can be recorded.  For conditions with multiple occurrences, this describes the first known occurrence." )
210        protected Type onset;
211
212        /**
213         * An area where general notes can be placed about this specific condition.
214         */
215        @Child(name = "note", type = {Annotation.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
216        @Description(shortDefinition="Extra information about condition", formalDefinition="An area where general notes can be placed about this specific condition." )
217        protected List<Annotation> note;
218
219        private static final long serialVersionUID = 598309281L;
220
221    /**
222     * Constructor
223     */
224      public FamilyMemberHistoryConditionComponent() {
225        super();
226      }
227
228    /**
229     * Constructor
230     */
231      public FamilyMemberHistoryConditionComponent(CodeableConcept code) {
232        super();
233        this.code = code;
234      }
235
236        /**
237         * @return {@link #code} (The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system.)
238         */
239        public CodeableConcept getCode() { 
240          if (this.code == null)
241            if (Configuration.errorOnAutoCreate())
242              throw new Error("Attempt to auto-create FamilyMemberHistoryConditionComponent.code");
243            else if (Configuration.doAutoCreate())
244              this.code = new CodeableConcept(); // cc
245          return this.code;
246        }
247
248        public boolean hasCode() { 
249          return this.code != null && !this.code.isEmpty();
250        }
251
252        /**
253         * @param value {@link #code} (The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system.)
254         */
255        public FamilyMemberHistoryConditionComponent setCode(CodeableConcept value)  { 
256          this.code = value;
257          return this;
258        }
259
260        /**
261         * @return {@link #outcome} (Indicates what happened as a result of this condition.  If the condition resulted in death, deceased date is captured on the relation.)
262         */
263        public CodeableConcept getOutcome() { 
264          if (this.outcome == null)
265            if (Configuration.errorOnAutoCreate())
266              throw new Error("Attempt to auto-create FamilyMemberHistoryConditionComponent.outcome");
267            else if (Configuration.doAutoCreate())
268              this.outcome = new CodeableConcept(); // cc
269          return this.outcome;
270        }
271
272        public boolean hasOutcome() { 
273          return this.outcome != null && !this.outcome.isEmpty();
274        }
275
276        /**
277         * @param value {@link #outcome} (Indicates what happened as a result of this condition.  If the condition resulted in death, deceased date is captured on the relation.)
278         */
279        public FamilyMemberHistoryConditionComponent setOutcome(CodeableConcept value)  { 
280          this.outcome = value;
281          return this;
282        }
283
284        /**
285         * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded.  For conditions with multiple occurrences, this describes the first known occurrence.)
286         */
287        public Type getOnset() { 
288          return this.onset;
289        }
290
291        /**
292         * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded.  For conditions with multiple occurrences, this describes the first known occurrence.)
293         */
294        public Age getOnsetAge() throws FHIRException { 
295          if (this.onset == null)
296            return null;
297          if (!(this.onset instanceof Age))
298            throw new FHIRException("Type mismatch: the type Age was expected, but "+this.onset.getClass().getName()+" was encountered");
299          return (Age) this.onset;
300        }
301
302        public boolean hasOnsetAge() {
303            return this.onset instanceof Age;
304        }
305
306        /**
307         * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded.  For conditions with multiple occurrences, this describes the first known occurrence.)
308         */
309        public Range getOnsetRange() throws FHIRException { 
310          if (this.onset == null)
311            return null;
312          if (!(this.onset instanceof Range))
313            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.onset.getClass().getName()+" was encountered");
314          return (Range) this.onset;
315        }
316
317        public boolean hasOnsetRange() {
318            return this.onset instanceof Range;
319        }
320
321        /**
322         * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded.  For conditions with multiple occurrences, this describes the first known occurrence.)
323         */
324        public Period getOnsetPeriod() throws FHIRException { 
325          if (this.onset == null)
326            return null;
327          if (!(this.onset instanceof Period))
328            throw new FHIRException("Type mismatch: the type Period was expected, but "+this.onset.getClass().getName()+" was encountered");
329          return (Period) this.onset;
330        }
331
332        public boolean hasOnsetPeriod() {
333            return this.onset instanceof Period;
334        }
335
336        /**
337         * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded.  For conditions with multiple occurrences, this describes the first known occurrence.)
338         */
339        public StringType getOnsetStringType() throws FHIRException { 
340          if (this.onset == null)
341            return null;
342          if (!(this.onset instanceof StringType))
343            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.onset.getClass().getName()+" was encountered");
344          return (StringType) this.onset;
345        }
346
347        public boolean hasOnsetStringType() {
348            return this.onset instanceof StringType;
349        }
350
351        public boolean hasOnset() { 
352          return this.onset != null && !this.onset.isEmpty();
353        }
354
355        /**
356         * @param value {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded.  For conditions with multiple occurrences, this describes the first known occurrence.)
357         */
358        public FamilyMemberHistoryConditionComponent setOnset(Type value) throws FHIRFormatError { 
359          if (value != null && !(value instanceof Age || value instanceof Range || value instanceof Period || value instanceof StringType))
360            throw new FHIRFormatError("Not the right type for FamilyMemberHistory.condition.onset[x]: "+value.fhirType());
361          this.onset = value;
362          return this;
363        }
364
365        /**
366         * @return {@link #note} (An area where general notes can be placed about this specific condition.)
367         */
368        public List<Annotation> getNote() { 
369          if (this.note == null)
370            this.note = new ArrayList<Annotation>();
371          return this.note;
372        }
373
374        /**
375         * @return Returns a reference to <code>this</code> for easy method chaining
376         */
377        public FamilyMemberHistoryConditionComponent setNote(List<Annotation> theNote) { 
378          this.note = theNote;
379          return this;
380        }
381
382        public boolean hasNote() { 
383          if (this.note == null)
384            return false;
385          for (Annotation item : this.note)
386            if (!item.isEmpty())
387              return true;
388          return false;
389        }
390
391        public Annotation addNote() { //3
392          Annotation t = new Annotation();
393          if (this.note == null)
394            this.note = new ArrayList<Annotation>();
395          this.note.add(t);
396          return t;
397        }
398
399        public FamilyMemberHistoryConditionComponent addNote(Annotation t) { //3
400          if (t == null)
401            return this;
402          if (this.note == null)
403            this.note = new ArrayList<Annotation>();
404          this.note.add(t);
405          return this;
406        }
407
408        /**
409         * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist
410         */
411        public Annotation getNoteFirstRep() { 
412          if (getNote().isEmpty()) {
413            addNote();
414          }
415          return getNote().get(0);
416        }
417
418        protected void listChildren(List<Property> children) {
419          super.listChildren(children);
420          children.add(new Property("code", "CodeableConcept", "The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system.", 0, 1, code));
421          children.add(new Property("outcome", "CodeableConcept", "Indicates what happened as a result of this condition.  If the condition resulted in death, deceased date is captured on the relation.", 0, 1, outcome));
422          children.add(new Property("onset[x]", "Age|Range|Period|string", "Either the age of onset, range of approximate age or descriptive string can be recorded.  For conditions with multiple occurrences, this describes the first known occurrence.", 0, 1, onset));
423          children.add(new Property("note", "Annotation", "An area where general notes can be placed about this specific condition.", 0, java.lang.Integer.MAX_VALUE, note));
424        }
425
426        @Override
427        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
428          switch (_hash) {
429          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system.", 0, 1, code);
430          case -1106507950: /*outcome*/  return new Property("outcome", "CodeableConcept", "Indicates what happened as a result of this condition.  If the condition resulted in death, deceased date is captured on the relation.", 0, 1, outcome);
431          case -1886216323: /*onset[x]*/  return new Property("onset[x]", "Age|Range|Period|string", "Either the age of onset, range of approximate age or descriptive string can be recorded.  For conditions with multiple occurrences, this describes the first known occurrence.", 0, 1, onset);
432          case 105901603: /*onset*/  return new Property("onset[x]", "Age|Range|Period|string", "Either the age of onset, range of approximate age or descriptive string can be recorded.  For conditions with multiple occurrences, this describes the first known occurrence.", 0, 1, onset);
433          case -1886241828: /*onsetAge*/  return new Property("onset[x]", "Age|Range|Period|string", "Either the age of onset, range of approximate age or descriptive string can be recorded.  For conditions with multiple occurrences, this describes the first known occurrence.", 0, 1, onset);
434          case -186664742: /*onsetRange*/  return new Property("onset[x]", "Age|Range|Period|string", "Either the age of onset, range of approximate age or descriptive string can be recorded.  For conditions with multiple occurrences, this describes the first known occurrence.", 0, 1, onset);
435          case -1545082428: /*onsetPeriod*/  return new Property("onset[x]", "Age|Range|Period|string", "Either the age of onset, range of approximate age or descriptive string can be recorded.  For conditions with multiple occurrences, this describes the first known occurrence.", 0, 1, onset);
436          case -1445342188: /*onsetString*/  return new Property("onset[x]", "Age|Range|Period|string", "Either the age of onset, range of approximate age or descriptive string can be recorded.  For conditions with multiple occurrences, this describes the first known occurrence.", 0, 1, onset);
437          case 3387378: /*note*/  return new Property("note", "Annotation", "An area where general notes can be placed about this specific condition.", 0, java.lang.Integer.MAX_VALUE, note);
438          default: return super.getNamedProperty(_hash, _name, _checkValid);
439          }
440
441        }
442
443      @Override
444      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
445        switch (hash) {
446        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
447        case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // CodeableConcept
448        case 105901603: /*onset*/ return this.onset == null ? new Base[0] : new Base[] {this.onset}; // Type
449        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
450        default: return super.getProperty(hash, name, checkValid);
451        }
452
453      }
454
455      @Override
456      public Base setProperty(int hash, String name, Base value) throws FHIRException {
457        switch (hash) {
458        case 3059181: // code
459          this.code = castToCodeableConcept(value); // CodeableConcept
460          return value;
461        case -1106507950: // outcome
462          this.outcome = castToCodeableConcept(value); // CodeableConcept
463          return value;
464        case 105901603: // onset
465          this.onset = castToType(value); // Type
466          return value;
467        case 3387378: // note
468          this.getNote().add(castToAnnotation(value)); // Annotation
469          return value;
470        default: return super.setProperty(hash, name, value);
471        }
472
473      }
474
475      @Override
476      public Base setProperty(String name, Base value) throws FHIRException {
477        if (name.equals("code")) {
478          this.code = castToCodeableConcept(value); // CodeableConcept
479        } else if (name.equals("outcome")) {
480          this.outcome = castToCodeableConcept(value); // CodeableConcept
481        } else if (name.equals("onset[x]")) {
482          this.onset = castToType(value); // Type
483        } else if (name.equals("note")) {
484          this.getNote().add(castToAnnotation(value));
485        } else
486          return super.setProperty(name, value);
487        return value;
488      }
489
490      @Override
491      public Base makeProperty(int hash, String name) throws FHIRException {
492        switch (hash) {
493        case 3059181:  return getCode(); 
494        case -1106507950:  return getOutcome(); 
495        case -1886216323:  return getOnset(); 
496        case 105901603:  return getOnset(); 
497        case 3387378:  return addNote(); 
498        default: return super.makeProperty(hash, name);
499        }
500
501      }
502
503      @Override
504      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
505        switch (hash) {
506        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
507        case -1106507950: /*outcome*/ return new String[] {"CodeableConcept"};
508        case 105901603: /*onset*/ return new String[] {"Age", "Range", "Period", "string"};
509        case 3387378: /*note*/ return new String[] {"Annotation"};
510        default: return super.getTypesForProperty(hash, name);
511        }
512
513      }
514
515      @Override
516      public Base addChild(String name) throws FHIRException {
517        if (name.equals("code")) {
518          this.code = new CodeableConcept();
519          return this.code;
520        }
521        else if (name.equals("outcome")) {
522          this.outcome = new CodeableConcept();
523          return this.outcome;
524        }
525        else if (name.equals("onsetAge")) {
526          this.onset = new Age();
527          return this.onset;
528        }
529        else if (name.equals("onsetRange")) {
530          this.onset = new Range();
531          return this.onset;
532        }
533        else if (name.equals("onsetPeriod")) {
534          this.onset = new Period();
535          return this.onset;
536        }
537        else if (name.equals("onsetString")) {
538          this.onset = new StringType();
539          return this.onset;
540        }
541        else if (name.equals("note")) {
542          return addNote();
543        }
544        else
545          return super.addChild(name);
546      }
547
548      public FamilyMemberHistoryConditionComponent copy() {
549        FamilyMemberHistoryConditionComponent dst = new FamilyMemberHistoryConditionComponent();
550        copyValues(dst);
551        dst.code = code == null ? null : code.copy();
552        dst.outcome = outcome == null ? null : outcome.copy();
553        dst.onset = onset == null ? null : onset.copy();
554        if (note != null) {
555          dst.note = new ArrayList<Annotation>();
556          for (Annotation i : note)
557            dst.note.add(i.copy());
558        };
559        return dst;
560      }
561
562      @Override
563      public boolean equalsDeep(Base other_) {
564        if (!super.equalsDeep(other_))
565          return false;
566        if (!(other_ instanceof FamilyMemberHistoryConditionComponent))
567          return false;
568        FamilyMemberHistoryConditionComponent o = (FamilyMemberHistoryConditionComponent) other_;
569        return compareDeep(code, o.code, true) && compareDeep(outcome, o.outcome, true) && compareDeep(onset, o.onset, true)
570           && compareDeep(note, o.note, true);
571      }
572
573      @Override
574      public boolean equalsShallow(Base other_) {
575        if (!super.equalsShallow(other_))
576          return false;
577        if (!(other_ instanceof FamilyMemberHistoryConditionComponent))
578          return false;
579        FamilyMemberHistoryConditionComponent o = (FamilyMemberHistoryConditionComponent) other_;
580        return true;
581      }
582
583      public boolean isEmpty() {
584        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, outcome, onset, note
585          );
586      }
587
588  public String fhirType() {
589    return "FamilyMemberHistory.condition";
590
591  }
592
593  }
594
595    /**
596     * This records identifiers associated with this family member history record that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).
597     */
598    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
599    @Description(shortDefinition="External Id(s) for this record", formalDefinition="This records identifiers associated with this family member history record that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." )
600    protected List<Identifier> identifier;
601
602    /**
603     * A protocol or questionnaire that was adhered to in whole or in part by this event.
604     */
605    @Child(name = "definition", type = {PlanDefinition.class, Questionnaire.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
606    @Description(shortDefinition="Instantiates protocol or definition", formalDefinition="A protocol or questionnaire that was adhered to in whole or in part by this event." )
607    protected List<Reference> definition;
608    /**
609     * The actual objects that are the target of the reference (A protocol or questionnaire that was adhered to in whole or in part by this event.)
610     */
611    protected List<Resource> definitionTarget;
612
613
614    /**
615     * A code specifying the status of the record of the family history of a specific family member.
616     */
617    @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true)
618    @Description(shortDefinition="partial | completed | entered-in-error | health-unknown", formalDefinition="A code specifying the status of the record of the family history of a specific family member." )
619    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/history-status")
620    protected Enumeration<FamilyHistoryStatus> status;
621
622    /**
623     * If true, indicates the taking of an individual family member's history did not occur. The notDone element should not be used to document negated conditions, such as a family member that did not have a condition.
624     */
625    @Child(name = "notDone", type = {BooleanType.class}, order=3, min=0, max=1, modifier=true, summary=true)
626    @Description(shortDefinition="The taking of a family member's history did not occur", formalDefinition="If true, indicates the taking of an individual family member's history did not occur. The notDone element should not be used to document negated conditions, such as a family member that did not have a condition." )
627    protected BooleanType notDone;
628
629    /**
630     * Describes why the family member's history is absent.
631     */
632    @Child(name = "notDoneReason", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true)
633    @Description(shortDefinition="subject-unknown | withheld | unable-to-obtain | deferred", formalDefinition="Describes why the family member's history is absent." )
634    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/history-not-done-reason")
635    protected CodeableConcept notDoneReason;
636
637    /**
638     * The person who this history concerns.
639     */
640    @Child(name = "patient", type = {Patient.class}, order=5, min=1, max=1, modifier=false, summary=true)
641    @Description(shortDefinition="Patient history is about", formalDefinition="The person who this history concerns." )
642    protected Reference patient;
643
644    /**
645     * The actual object that is the target of the reference (The person who this history concerns.)
646     */
647    protected Patient patientTarget;
648
649    /**
650     * The date (and possibly time) when the family member history was taken.
651     */
652    @Child(name = "date", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true)
653    @Description(shortDefinition="When history was captured/updated", formalDefinition="The date (and possibly time) when the family member history was taken." )
654    protected DateTimeType date;
655
656    /**
657     * This will either be a name or a description; e.g. "Aunt Susan", "my cousin with the red hair".
658     */
659    @Child(name = "name", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true)
660    @Description(shortDefinition="The family member described", formalDefinition="This will either be a name or a description; e.g. \"Aunt Susan\", \"my cousin with the red hair\"." )
661    protected StringType name;
662
663    /**
664     * The type of relationship this person has to the patient (father, mother, brother etc.).
665     */
666    @Child(name = "relationship", type = {CodeableConcept.class}, order=8, min=1, max=1, modifier=false, summary=true)
667    @Description(shortDefinition="Relationship to the subject", formalDefinition="The type of relationship this person has to the patient (father, mother, brother etc.)." )
668    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/v3-FamilyMember")
669    protected CodeableConcept relationship;
670
671    /**
672     * Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes.
673     */
674    @Child(name = "gender", type = {CodeType.class}, order=9, min=0, max=1, modifier=false, summary=true)
675    @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes." )
676    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/administrative-gender")
677    protected Enumeration<AdministrativeGender> gender;
678
679    /**
680     * The actual or approximate date of birth of the relative.
681     */
682    @Child(name = "born", type = {Period.class, DateType.class, StringType.class}, order=10, min=0, max=1, modifier=false, summary=false)
683    @Description(shortDefinition="(approximate) date of birth", formalDefinition="The actual or approximate date of birth of the relative." )
684    protected Type born;
685
686    /**
687     * The age of the relative at the time the family member history is recorded.
688     */
689    @Child(name = "age", type = {Age.class, Range.class, StringType.class}, order=11, min=0, max=1, modifier=false, summary=true)
690    @Description(shortDefinition="(approximate) age", formalDefinition="The age of the relative at the time the family member history is recorded." )
691    protected Type age;
692
693    /**
694     * If true, indicates that the age value specified is an estimated value.
695     */
696    @Child(name = "estimatedAge", type = {BooleanType.class}, order=12, min=0, max=1, modifier=true, summary=true)
697    @Description(shortDefinition="Age is estimated?", formalDefinition="If true, indicates that the age value specified is an estimated value." )
698    protected BooleanType estimatedAge;
699
700    /**
701     * Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.
702     */
703    @Child(name = "deceased", type = {BooleanType.class, Age.class, Range.class, DateType.class, StringType.class}, order=13, min=0, max=1, modifier=false, summary=true)
704    @Description(shortDefinition="Dead? How old/when?", formalDefinition="Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record." )
705    protected Type deceased;
706
707    /**
708     * Describes why the family member history occurred in coded or textual form.
709     */
710    @Child(name = "reasonCode", type = {CodeableConcept.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
711    @Description(shortDefinition="Why was family member history performed?", formalDefinition="Describes why the family member history occurred in coded or textual form." )
712    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/clinical-findings")
713    protected List<CodeableConcept> reasonCode;
714
715    /**
716     * Indicates a Condition, Observation, AllergyIntolerance, or QuestionnaireResponse that justifies this family member history event.
717     */
718    @Child(name = "reasonReference", type = {Condition.class, Observation.class, AllergyIntolerance.class, QuestionnaireResponse.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
719    @Description(shortDefinition="Why was family member history performed?", formalDefinition="Indicates a Condition, Observation, AllergyIntolerance, or QuestionnaireResponse that justifies this family member history event." )
720    protected List<Reference> reasonReference;
721    /**
722     * The actual objects that are the target of the reference (Indicates a Condition, Observation, AllergyIntolerance, or QuestionnaireResponse that justifies this family member history event.)
723     */
724    protected List<Resource> reasonReferenceTarget;
725
726
727    /**
728     * This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible.
729     */
730    @Child(name = "note", type = {Annotation.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
731    @Description(shortDefinition="General note about related person", formalDefinition="This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible." )
732    protected List<Annotation> note;
733
734    /**
735     * The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition.
736     */
737    @Child(name = "condition", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
738    @Description(shortDefinition="Condition that the related person had", formalDefinition="The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition." )
739    protected List<FamilyMemberHistoryConditionComponent> condition;
740
741    private static final long serialVersionUID = 388742645L;
742
743  /**
744   * Constructor
745   */
746    public FamilyMemberHistory() {
747      super();
748    }
749
750  /**
751   * Constructor
752   */
753    public FamilyMemberHistory(Enumeration<FamilyHistoryStatus> status, Reference patient, CodeableConcept relationship) {
754      super();
755      this.status = status;
756      this.patient = patient;
757      this.relationship = relationship;
758    }
759
760    /**
761     * @return {@link #identifier} (This records identifiers associated with this family member history record that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).)
762     */
763    public List<Identifier> getIdentifier() { 
764      if (this.identifier == null)
765        this.identifier = new ArrayList<Identifier>();
766      return this.identifier;
767    }
768
769    /**
770     * @return Returns a reference to <code>this</code> for easy method chaining
771     */
772    public FamilyMemberHistory setIdentifier(List<Identifier> theIdentifier) { 
773      this.identifier = theIdentifier;
774      return this;
775    }
776
777    public boolean hasIdentifier() { 
778      if (this.identifier == null)
779        return false;
780      for (Identifier item : this.identifier)
781        if (!item.isEmpty())
782          return true;
783      return false;
784    }
785
786    public Identifier addIdentifier() { //3
787      Identifier t = new Identifier();
788      if (this.identifier == null)
789        this.identifier = new ArrayList<Identifier>();
790      this.identifier.add(t);
791      return t;
792    }
793
794    public FamilyMemberHistory addIdentifier(Identifier t) { //3
795      if (t == null)
796        return this;
797      if (this.identifier == null)
798        this.identifier = new ArrayList<Identifier>();
799      this.identifier.add(t);
800      return this;
801    }
802
803    /**
804     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
805     */
806    public Identifier getIdentifierFirstRep() { 
807      if (getIdentifier().isEmpty()) {
808        addIdentifier();
809      }
810      return getIdentifier().get(0);
811    }
812
813    /**
814     * @return {@link #definition} (A protocol or questionnaire that was adhered to in whole or in part by this event.)
815     */
816    public List<Reference> getDefinition() { 
817      if (this.definition == null)
818        this.definition = new ArrayList<Reference>();
819      return this.definition;
820    }
821
822    /**
823     * @return Returns a reference to <code>this</code> for easy method chaining
824     */
825    public FamilyMemberHistory setDefinition(List<Reference> theDefinition) { 
826      this.definition = theDefinition;
827      return this;
828    }
829
830    public boolean hasDefinition() { 
831      if (this.definition == null)
832        return false;
833      for (Reference item : this.definition)
834        if (!item.isEmpty())
835          return true;
836      return false;
837    }
838
839    public Reference addDefinition() { //3
840      Reference t = new Reference();
841      if (this.definition == null)
842        this.definition = new ArrayList<Reference>();
843      this.definition.add(t);
844      return t;
845    }
846
847    public FamilyMemberHistory addDefinition(Reference t) { //3
848      if (t == null)
849        return this;
850      if (this.definition == null)
851        this.definition = new ArrayList<Reference>();
852      this.definition.add(t);
853      return this;
854    }
855
856    /**
857     * @return The first repetition of repeating field {@link #definition}, creating it if it does not already exist
858     */
859    public Reference getDefinitionFirstRep() { 
860      if (getDefinition().isEmpty()) {
861        addDefinition();
862      }
863      return getDefinition().get(0);
864    }
865
866    /**
867     * @return {@link #status} (A code specifying the status of the record of the family history of a specific family member.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
868     */
869    public Enumeration<FamilyHistoryStatus> getStatusElement() { 
870      if (this.status == null)
871        if (Configuration.errorOnAutoCreate())
872          throw new Error("Attempt to auto-create FamilyMemberHistory.status");
873        else if (Configuration.doAutoCreate())
874          this.status = new Enumeration<FamilyHistoryStatus>(new FamilyHistoryStatusEnumFactory()); // bb
875      return this.status;
876    }
877
878    public boolean hasStatusElement() { 
879      return this.status != null && !this.status.isEmpty();
880    }
881
882    public boolean hasStatus() { 
883      return this.status != null && !this.status.isEmpty();
884    }
885
886    /**
887     * @param value {@link #status} (A code specifying the status of the record of the family history of a specific family member.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
888     */
889    public FamilyMemberHistory setStatusElement(Enumeration<FamilyHistoryStatus> value) { 
890      this.status = value;
891      return this;
892    }
893
894    /**
895     * @return A code specifying the status of the record of the family history of a specific family member.
896     */
897    public FamilyHistoryStatus getStatus() { 
898      return this.status == null ? null : this.status.getValue();
899    }
900
901    /**
902     * @param value A code specifying the status of the record of the family history of a specific family member.
903     */
904    public FamilyMemberHistory setStatus(FamilyHistoryStatus value) { 
905        if (this.status == null)
906          this.status = new Enumeration<FamilyHistoryStatus>(new FamilyHistoryStatusEnumFactory());
907        this.status.setValue(value);
908      return this;
909    }
910
911    /**
912     * @return {@link #notDone} (If true, indicates the taking of an individual family member's history did not occur. The notDone element should not be used to document negated conditions, such as a family member that did not have a condition.). This is the underlying object with id, value and extensions. The accessor "getNotDone" gives direct access to the value
913     */
914    public BooleanType getNotDoneElement() { 
915      if (this.notDone == null)
916        if (Configuration.errorOnAutoCreate())
917          throw new Error("Attempt to auto-create FamilyMemberHistory.notDone");
918        else if (Configuration.doAutoCreate())
919          this.notDone = new BooleanType(); // bb
920      return this.notDone;
921    }
922
923    public boolean hasNotDoneElement() { 
924      return this.notDone != null && !this.notDone.isEmpty();
925    }
926
927    public boolean hasNotDone() { 
928      return this.notDone != null && !this.notDone.isEmpty();
929    }
930
931    /**
932     * @param value {@link #notDone} (If true, indicates the taking of an individual family member's history did not occur. The notDone element should not be used to document negated conditions, such as a family member that did not have a condition.). This is the underlying object with id, value and extensions. The accessor "getNotDone" gives direct access to the value
933     */
934    public FamilyMemberHistory setNotDoneElement(BooleanType value) { 
935      this.notDone = value;
936      return this;
937    }
938
939    /**
940     * @return If true, indicates the taking of an individual family member's history did not occur. The notDone element should not be used to document negated conditions, such as a family member that did not have a condition.
941     */
942    public boolean getNotDone() { 
943      return this.notDone == null || this.notDone.isEmpty() ? false : this.notDone.getValue();
944    }
945
946    /**
947     * @param value If true, indicates the taking of an individual family member's history did not occur. The notDone element should not be used to document negated conditions, such as a family member that did not have a condition.
948     */
949    public FamilyMemberHistory setNotDone(boolean value) { 
950        if (this.notDone == null)
951          this.notDone = new BooleanType();
952        this.notDone.setValue(value);
953      return this;
954    }
955
956    /**
957     * @return {@link #notDoneReason} (Describes why the family member's history is absent.)
958     */
959    public CodeableConcept getNotDoneReason() { 
960      if (this.notDoneReason == null)
961        if (Configuration.errorOnAutoCreate())
962          throw new Error("Attempt to auto-create FamilyMemberHistory.notDoneReason");
963        else if (Configuration.doAutoCreate())
964          this.notDoneReason = new CodeableConcept(); // cc
965      return this.notDoneReason;
966    }
967
968    public boolean hasNotDoneReason() { 
969      return this.notDoneReason != null && !this.notDoneReason.isEmpty();
970    }
971
972    /**
973     * @param value {@link #notDoneReason} (Describes why the family member's history is absent.)
974     */
975    public FamilyMemberHistory setNotDoneReason(CodeableConcept value)  { 
976      this.notDoneReason = value;
977      return this;
978    }
979
980    /**
981     * @return {@link #patient} (The person who this history concerns.)
982     */
983    public Reference getPatient() { 
984      if (this.patient == null)
985        if (Configuration.errorOnAutoCreate())
986          throw new Error("Attempt to auto-create FamilyMemberHistory.patient");
987        else if (Configuration.doAutoCreate())
988          this.patient = new Reference(); // cc
989      return this.patient;
990    }
991
992    public boolean hasPatient() { 
993      return this.patient != null && !this.patient.isEmpty();
994    }
995
996    /**
997     * @param value {@link #patient} (The person who this history concerns.)
998     */
999    public FamilyMemberHistory setPatient(Reference value)  { 
1000      this.patient = value;
1001      return this;
1002    }
1003
1004    /**
1005     * @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 person who this history concerns.)
1006     */
1007    public Patient getPatientTarget() { 
1008      if (this.patientTarget == null)
1009        if (Configuration.errorOnAutoCreate())
1010          throw new Error("Attempt to auto-create FamilyMemberHistory.patient");
1011        else if (Configuration.doAutoCreate())
1012          this.patientTarget = new Patient(); // aa
1013      return this.patientTarget;
1014    }
1015
1016    /**
1017     * @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 person who this history concerns.)
1018     */
1019    public FamilyMemberHistory setPatientTarget(Patient value) { 
1020      this.patientTarget = value;
1021      return this;
1022    }
1023
1024    /**
1025     * @return {@link #date} (The date (and possibly time) when the family member history was taken.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
1026     */
1027    public DateTimeType getDateElement() { 
1028      if (this.date == null)
1029        if (Configuration.errorOnAutoCreate())
1030          throw new Error("Attempt to auto-create FamilyMemberHistory.date");
1031        else if (Configuration.doAutoCreate())
1032          this.date = new DateTimeType(); // bb
1033      return this.date;
1034    }
1035
1036    public boolean hasDateElement() { 
1037      return this.date != null && !this.date.isEmpty();
1038    }
1039
1040    public boolean hasDate() { 
1041      return this.date != null && !this.date.isEmpty();
1042    }
1043
1044    /**
1045     * @param value {@link #date} (The date (and possibly time) when the family member history was taken.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
1046     */
1047    public FamilyMemberHistory setDateElement(DateTimeType value) { 
1048      this.date = value;
1049      return this;
1050    }
1051
1052    /**
1053     * @return The date (and possibly time) when the family member history was taken.
1054     */
1055    public Date getDate() { 
1056      return this.date == null ? null : this.date.getValue();
1057    }
1058
1059    /**
1060     * @param value The date (and possibly time) when the family member history was taken.
1061     */
1062    public FamilyMemberHistory setDate(Date value) { 
1063      if (value == null)
1064        this.date = null;
1065      else {
1066        if (this.date == null)
1067          this.date = new DateTimeType();
1068        this.date.setValue(value);
1069      }
1070      return this;
1071    }
1072
1073    /**
1074     * @return {@link #name} (This will either be a name or a description; e.g. "Aunt Susan", "my cousin with the red hair".). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1075     */
1076    public StringType getNameElement() { 
1077      if (this.name == null)
1078        if (Configuration.errorOnAutoCreate())
1079          throw new Error("Attempt to auto-create FamilyMemberHistory.name");
1080        else if (Configuration.doAutoCreate())
1081          this.name = new StringType(); // bb
1082      return this.name;
1083    }
1084
1085    public boolean hasNameElement() { 
1086      return this.name != null && !this.name.isEmpty();
1087    }
1088
1089    public boolean hasName() { 
1090      return this.name != null && !this.name.isEmpty();
1091    }
1092
1093    /**
1094     * @param value {@link #name} (This will either be a name or a description; e.g. "Aunt Susan", "my cousin with the red hair".). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1095     */
1096    public FamilyMemberHistory setNameElement(StringType value) { 
1097      this.name = value;
1098      return this;
1099    }
1100
1101    /**
1102     * @return This will either be a name or a description; e.g. "Aunt Susan", "my cousin with the red hair".
1103     */
1104    public String getName() { 
1105      return this.name == null ? null : this.name.getValue();
1106    }
1107
1108    /**
1109     * @param value This will either be a name or a description; e.g. "Aunt Susan", "my cousin with the red hair".
1110     */
1111    public FamilyMemberHistory setName(String value) { 
1112      if (Utilities.noString(value))
1113        this.name = null;
1114      else {
1115        if (this.name == null)
1116          this.name = new StringType();
1117        this.name.setValue(value);
1118      }
1119      return this;
1120    }
1121
1122    /**
1123     * @return {@link #relationship} (The type of relationship this person has to the patient (father, mother, brother etc.).)
1124     */
1125    public CodeableConcept getRelationship() { 
1126      if (this.relationship == null)
1127        if (Configuration.errorOnAutoCreate())
1128          throw new Error("Attempt to auto-create FamilyMemberHistory.relationship");
1129        else if (Configuration.doAutoCreate())
1130          this.relationship = new CodeableConcept(); // cc
1131      return this.relationship;
1132    }
1133
1134    public boolean hasRelationship() { 
1135      return this.relationship != null && !this.relationship.isEmpty();
1136    }
1137
1138    /**
1139     * @param value {@link #relationship} (The type of relationship this person has to the patient (father, mother, brother etc.).)
1140     */
1141    public FamilyMemberHistory setRelationship(CodeableConcept value)  { 
1142      this.relationship = value;
1143      return this;
1144    }
1145
1146    /**
1147     * @return {@link #gender} (Administrative Gender - the gender that the relative 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
1148     */
1149    public Enumeration<AdministrativeGender> getGenderElement() { 
1150      if (this.gender == null)
1151        if (Configuration.errorOnAutoCreate())
1152          throw new Error("Attempt to auto-create FamilyMemberHistory.gender");
1153        else if (Configuration.doAutoCreate())
1154          this.gender = new Enumeration<AdministrativeGender>(new AdministrativeGenderEnumFactory()); // bb
1155      return this.gender;
1156    }
1157
1158    public boolean hasGenderElement() { 
1159      return this.gender != null && !this.gender.isEmpty();
1160    }
1161
1162    public boolean hasGender() { 
1163      return this.gender != null && !this.gender.isEmpty();
1164    }
1165
1166    /**
1167     * @param value {@link #gender} (Administrative Gender - the gender that the relative 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
1168     */
1169    public FamilyMemberHistory setGenderElement(Enumeration<AdministrativeGender> value) { 
1170      this.gender = value;
1171      return this;
1172    }
1173
1174    /**
1175     * @return Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes.
1176     */
1177    public AdministrativeGender getGender() { 
1178      return this.gender == null ? null : this.gender.getValue();
1179    }
1180
1181    /**
1182     * @param value Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes.
1183     */
1184    public FamilyMemberHistory setGender(AdministrativeGender value) { 
1185      if (value == null)
1186        this.gender = null;
1187      else {
1188        if (this.gender == null)
1189          this.gender = new Enumeration<AdministrativeGender>(new AdministrativeGenderEnumFactory());
1190        this.gender.setValue(value);
1191      }
1192      return this;
1193    }
1194
1195    /**
1196     * @return {@link #born} (The actual or approximate date of birth of the relative.)
1197     */
1198    public Type getBorn() { 
1199      return this.born;
1200    }
1201
1202    /**
1203     * @return {@link #born} (The actual or approximate date of birth of the relative.)
1204     */
1205    public Period getBornPeriod() throws FHIRException { 
1206      if (this.born == null)
1207        return null;
1208      if (!(this.born instanceof Period))
1209        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.born.getClass().getName()+" was encountered");
1210      return (Period) this.born;
1211    }
1212
1213    public boolean hasBornPeriod() {
1214        return this.born instanceof Period;
1215    }
1216
1217    /**
1218     * @return {@link #born} (The actual or approximate date of birth of the relative.)
1219     */
1220    public DateType getBornDateType() throws FHIRException { 
1221      if (this.born == null)
1222        return null;
1223      if (!(this.born instanceof DateType))
1224        throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.born.getClass().getName()+" was encountered");
1225      return (DateType) this.born;
1226    }
1227
1228    public boolean hasBornDateType() {
1229        return this.born instanceof DateType;
1230    }
1231
1232    /**
1233     * @return {@link #born} (The actual or approximate date of birth of the relative.)
1234     */
1235    public StringType getBornStringType() throws FHIRException { 
1236      if (this.born == null)
1237        return null;
1238      if (!(this.born instanceof StringType))
1239        throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.born.getClass().getName()+" was encountered");
1240      return (StringType) this.born;
1241    }
1242
1243    public boolean hasBornStringType() {
1244        return this.born instanceof StringType;
1245    }
1246
1247    public boolean hasBorn() { 
1248      return this.born != null && !this.born.isEmpty();
1249    }
1250
1251    /**
1252     * @param value {@link #born} (The actual or approximate date of birth of the relative.)
1253     */
1254    public FamilyMemberHistory setBorn(Type value) throws FHIRFormatError { 
1255      if (value != null && !(value instanceof Period || value instanceof DateType || value instanceof StringType))
1256        throw new FHIRFormatError("Not the right type for FamilyMemberHistory.born[x]: "+value.fhirType());
1257      this.born = value;
1258      return this;
1259    }
1260
1261    /**
1262     * @return {@link #age} (The age of the relative at the time the family member history is recorded.)
1263     */
1264    public Type getAge() { 
1265      return this.age;
1266    }
1267
1268    /**
1269     * @return {@link #age} (The age of the relative at the time the family member history is recorded.)
1270     */
1271    public Age getAgeAge() throws FHIRException { 
1272      if (this.age == null)
1273        return null;
1274      if (!(this.age instanceof Age))
1275        throw new FHIRException("Type mismatch: the type Age was expected, but "+this.age.getClass().getName()+" was encountered");
1276      return (Age) this.age;
1277    }
1278
1279    public boolean hasAgeAge() {
1280        return this.age instanceof Age;
1281    }
1282
1283    /**
1284     * @return {@link #age} (The age of the relative at the time the family member history is recorded.)
1285     */
1286    public Range getAgeRange() throws FHIRException { 
1287      if (this.age == null)
1288        return null;
1289      if (!(this.age instanceof Range))
1290        throw new FHIRException("Type mismatch: the type Range was expected, but "+this.age.getClass().getName()+" was encountered");
1291      return (Range) this.age;
1292    }
1293
1294    public boolean hasAgeRange() {
1295        return this.age instanceof Range;
1296    }
1297
1298    /**
1299     * @return {@link #age} (The age of the relative at the time the family member history is recorded.)
1300     */
1301    public StringType getAgeStringType() throws FHIRException { 
1302      if (this.age == null)
1303        return null;
1304      if (!(this.age instanceof StringType))
1305        throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.age.getClass().getName()+" was encountered");
1306      return (StringType) this.age;
1307    }
1308
1309    public boolean hasAgeStringType() {
1310        return this.age instanceof StringType;
1311    }
1312
1313    public boolean hasAge() { 
1314      return this.age != null && !this.age.isEmpty();
1315    }
1316
1317    /**
1318     * @param value {@link #age} (The age of the relative at the time the family member history is recorded.)
1319     */
1320    public FamilyMemberHistory setAge(Type value) throws FHIRFormatError { 
1321      if (value != null && !(value instanceof Age || value instanceof Range || value instanceof StringType))
1322        throw new FHIRFormatError("Not the right type for FamilyMemberHistory.age[x]: "+value.fhirType());
1323      this.age = value;
1324      return this;
1325    }
1326
1327    /**
1328     * @return {@link #estimatedAge} (If true, indicates that the age value specified is an estimated value.). This is the underlying object with id, value and extensions. The accessor "getEstimatedAge" gives direct access to the value
1329     */
1330    public BooleanType getEstimatedAgeElement() { 
1331      if (this.estimatedAge == null)
1332        if (Configuration.errorOnAutoCreate())
1333          throw new Error("Attempt to auto-create FamilyMemberHistory.estimatedAge");
1334        else if (Configuration.doAutoCreate())
1335          this.estimatedAge = new BooleanType(); // bb
1336      return this.estimatedAge;
1337    }
1338
1339    public boolean hasEstimatedAgeElement() { 
1340      return this.estimatedAge != null && !this.estimatedAge.isEmpty();
1341    }
1342
1343    public boolean hasEstimatedAge() { 
1344      return this.estimatedAge != null && !this.estimatedAge.isEmpty();
1345    }
1346
1347    /**
1348     * @param value {@link #estimatedAge} (If true, indicates that the age value specified is an estimated value.). This is the underlying object with id, value and extensions. The accessor "getEstimatedAge" gives direct access to the value
1349     */
1350    public FamilyMemberHistory setEstimatedAgeElement(BooleanType value) { 
1351      this.estimatedAge = value;
1352      return this;
1353    }
1354
1355    /**
1356     * @return If true, indicates that the age value specified is an estimated value.
1357     */
1358    public boolean getEstimatedAge() { 
1359      return this.estimatedAge == null || this.estimatedAge.isEmpty() ? false : this.estimatedAge.getValue();
1360    }
1361
1362    /**
1363     * @param value If true, indicates that the age value specified is an estimated value.
1364     */
1365    public FamilyMemberHistory setEstimatedAge(boolean value) { 
1366        if (this.estimatedAge == null)
1367          this.estimatedAge = new BooleanType();
1368        this.estimatedAge.setValue(value);
1369      return this;
1370    }
1371
1372    /**
1373     * @return {@link #deceased} (Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.)
1374     */
1375    public Type getDeceased() { 
1376      return this.deceased;
1377    }
1378
1379    /**
1380     * @return {@link #deceased} (Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.)
1381     */
1382    public BooleanType getDeceasedBooleanType() throws FHIRException { 
1383      if (this.deceased == null)
1384        return null;
1385      if (!(this.deceased instanceof BooleanType))
1386        throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.deceased.getClass().getName()+" was encountered");
1387      return (BooleanType) this.deceased;
1388    }
1389
1390    public boolean hasDeceasedBooleanType() {
1391        return this.deceased instanceof BooleanType;
1392    }
1393
1394    /**
1395     * @return {@link #deceased} (Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.)
1396     */
1397    public Age getDeceasedAge() throws FHIRException { 
1398      if (this.deceased == null)
1399        return null;
1400      if (!(this.deceased instanceof Age))
1401        throw new FHIRException("Type mismatch: the type Age was expected, but "+this.deceased.getClass().getName()+" was encountered");
1402      return (Age) this.deceased;
1403    }
1404
1405    public boolean hasDeceasedAge() {
1406        return this.deceased instanceof Age;
1407    }
1408
1409    /**
1410     * @return {@link #deceased} (Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.)
1411     */
1412    public Range getDeceasedRange() throws FHIRException { 
1413      if (this.deceased == null)
1414        return null;
1415      if (!(this.deceased instanceof Range))
1416        throw new FHIRException("Type mismatch: the type Range was expected, but "+this.deceased.getClass().getName()+" was encountered");
1417      return (Range) this.deceased;
1418    }
1419
1420    public boolean hasDeceasedRange() {
1421        return this.deceased instanceof Range;
1422    }
1423
1424    /**
1425     * @return {@link #deceased} (Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.)
1426     */
1427    public DateType getDeceasedDateType() throws FHIRException { 
1428      if (this.deceased == null)
1429        return null;
1430      if (!(this.deceased instanceof DateType))
1431        throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.deceased.getClass().getName()+" was encountered");
1432      return (DateType) this.deceased;
1433    }
1434
1435    public boolean hasDeceasedDateType() {
1436        return this.deceased instanceof DateType;
1437    }
1438
1439    /**
1440     * @return {@link #deceased} (Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.)
1441     */
1442    public StringType getDeceasedStringType() throws FHIRException { 
1443      if (this.deceased == null)
1444        return null;
1445      if (!(this.deceased instanceof StringType))
1446        throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.deceased.getClass().getName()+" was encountered");
1447      return (StringType) this.deceased;
1448    }
1449
1450    public boolean hasDeceasedStringType() {
1451        return this.deceased instanceof StringType;
1452    }
1453
1454    public boolean hasDeceased() { 
1455      return this.deceased != null && !this.deceased.isEmpty();
1456    }
1457
1458    /**
1459     * @param value {@link #deceased} (Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.)
1460     */
1461    public FamilyMemberHistory setDeceased(Type value) throws FHIRFormatError { 
1462      if (value != null && !(value instanceof BooleanType || value instanceof Age || value instanceof Range || value instanceof DateType || value instanceof StringType))
1463        throw new FHIRFormatError("Not the right type for FamilyMemberHistory.deceased[x]: "+value.fhirType());
1464      this.deceased = value;
1465      return this;
1466    }
1467
1468    /**
1469     * @return {@link #reasonCode} (Describes why the family member history occurred in coded or textual form.)
1470     */
1471    public List<CodeableConcept> getReasonCode() { 
1472      if (this.reasonCode == null)
1473        this.reasonCode = new ArrayList<CodeableConcept>();
1474      return this.reasonCode;
1475    }
1476
1477    /**
1478     * @return Returns a reference to <code>this</code> for easy method chaining
1479     */
1480    public FamilyMemberHistory setReasonCode(List<CodeableConcept> theReasonCode) { 
1481      this.reasonCode = theReasonCode;
1482      return this;
1483    }
1484
1485    public boolean hasReasonCode() { 
1486      if (this.reasonCode == null)
1487        return false;
1488      for (CodeableConcept item : this.reasonCode)
1489        if (!item.isEmpty())
1490          return true;
1491      return false;
1492    }
1493
1494    public CodeableConcept addReasonCode() { //3
1495      CodeableConcept t = new CodeableConcept();
1496      if (this.reasonCode == null)
1497        this.reasonCode = new ArrayList<CodeableConcept>();
1498      this.reasonCode.add(t);
1499      return t;
1500    }
1501
1502    public FamilyMemberHistory addReasonCode(CodeableConcept t) { //3
1503      if (t == null)
1504        return this;
1505      if (this.reasonCode == null)
1506        this.reasonCode = new ArrayList<CodeableConcept>();
1507      this.reasonCode.add(t);
1508      return this;
1509    }
1510
1511    /**
1512     * @return The first repetition of repeating field {@link #reasonCode}, creating it if it does not already exist
1513     */
1514    public CodeableConcept getReasonCodeFirstRep() { 
1515      if (getReasonCode().isEmpty()) {
1516        addReasonCode();
1517      }
1518      return getReasonCode().get(0);
1519    }
1520
1521    /**
1522     * @return {@link #reasonReference} (Indicates a Condition, Observation, AllergyIntolerance, or QuestionnaireResponse that justifies this family member history event.)
1523     */
1524    public List<Reference> getReasonReference() { 
1525      if (this.reasonReference == null)
1526        this.reasonReference = new ArrayList<Reference>();
1527      return this.reasonReference;
1528    }
1529
1530    /**
1531     * @return Returns a reference to <code>this</code> for easy method chaining
1532     */
1533    public FamilyMemberHistory setReasonReference(List<Reference> theReasonReference) { 
1534      this.reasonReference = theReasonReference;
1535      return this;
1536    }
1537
1538    public boolean hasReasonReference() { 
1539      if (this.reasonReference == null)
1540        return false;
1541      for (Reference item : this.reasonReference)
1542        if (!item.isEmpty())
1543          return true;
1544      return false;
1545    }
1546
1547    public Reference addReasonReference() { //3
1548      Reference t = new Reference();
1549      if (this.reasonReference == null)
1550        this.reasonReference = new ArrayList<Reference>();
1551      this.reasonReference.add(t);
1552      return t;
1553    }
1554
1555    public FamilyMemberHistory addReasonReference(Reference t) { //3
1556      if (t == null)
1557        return this;
1558      if (this.reasonReference == null)
1559        this.reasonReference = new ArrayList<Reference>();
1560      this.reasonReference.add(t);
1561      return this;
1562    }
1563
1564    /**
1565     * @return The first repetition of repeating field {@link #reasonReference}, creating it if it does not already exist
1566     */
1567    public Reference getReasonReferenceFirstRep() { 
1568      if (getReasonReference().isEmpty()) {
1569        addReasonReference();
1570      }
1571      return getReasonReference().get(0);
1572    }
1573
1574    /**
1575     * @return {@link #note} (This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible.)
1576     */
1577    public List<Annotation> getNote() { 
1578      if (this.note == null)
1579        this.note = new ArrayList<Annotation>();
1580      return this.note;
1581    }
1582
1583    /**
1584     * @return Returns a reference to <code>this</code> for easy method chaining
1585     */
1586    public FamilyMemberHistory setNote(List<Annotation> theNote) { 
1587      this.note = theNote;
1588      return this;
1589    }
1590
1591    public boolean hasNote() { 
1592      if (this.note == null)
1593        return false;
1594      for (Annotation item : this.note)
1595        if (!item.isEmpty())
1596          return true;
1597      return false;
1598    }
1599
1600    public Annotation addNote() { //3
1601      Annotation t = new Annotation();
1602      if (this.note == null)
1603        this.note = new ArrayList<Annotation>();
1604      this.note.add(t);
1605      return t;
1606    }
1607
1608    public FamilyMemberHistory addNote(Annotation t) { //3
1609      if (t == null)
1610        return this;
1611      if (this.note == null)
1612        this.note = new ArrayList<Annotation>();
1613      this.note.add(t);
1614      return this;
1615    }
1616
1617    /**
1618     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist
1619     */
1620    public Annotation getNoteFirstRep() { 
1621      if (getNote().isEmpty()) {
1622        addNote();
1623      }
1624      return getNote().get(0);
1625    }
1626
1627    /**
1628     * @return {@link #condition} (The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition.)
1629     */
1630    public List<FamilyMemberHistoryConditionComponent> getCondition() { 
1631      if (this.condition == null)
1632        this.condition = new ArrayList<FamilyMemberHistoryConditionComponent>();
1633      return this.condition;
1634    }
1635
1636    /**
1637     * @return Returns a reference to <code>this</code> for easy method chaining
1638     */
1639    public FamilyMemberHistory setCondition(List<FamilyMemberHistoryConditionComponent> theCondition) { 
1640      this.condition = theCondition;
1641      return this;
1642    }
1643
1644    public boolean hasCondition() { 
1645      if (this.condition == null)
1646        return false;
1647      for (FamilyMemberHistoryConditionComponent item : this.condition)
1648        if (!item.isEmpty())
1649          return true;
1650      return false;
1651    }
1652
1653    public FamilyMemberHistoryConditionComponent addCondition() { //3
1654      FamilyMemberHistoryConditionComponent t = new FamilyMemberHistoryConditionComponent();
1655      if (this.condition == null)
1656        this.condition = new ArrayList<FamilyMemberHistoryConditionComponent>();
1657      this.condition.add(t);
1658      return t;
1659    }
1660
1661    public FamilyMemberHistory addCondition(FamilyMemberHistoryConditionComponent t) { //3
1662      if (t == null)
1663        return this;
1664      if (this.condition == null)
1665        this.condition = new ArrayList<FamilyMemberHistoryConditionComponent>();
1666      this.condition.add(t);
1667      return this;
1668    }
1669
1670    /**
1671     * @return The first repetition of repeating field {@link #condition}, creating it if it does not already exist
1672     */
1673    public FamilyMemberHistoryConditionComponent getConditionFirstRep() { 
1674      if (getCondition().isEmpty()) {
1675        addCondition();
1676      }
1677      return getCondition().get(0);
1678    }
1679
1680      protected void listChildren(List<Property> children) {
1681        super.listChildren(children);
1682        children.add(new Property("identifier", "Identifier", "This records identifiers associated with this family member history record that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier));
1683        children.add(new Property("definition", "Reference(PlanDefinition|Questionnaire)", "A protocol or questionnaire that was adhered to in whole or in part by this event.", 0, java.lang.Integer.MAX_VALUE, definition));
1684        children.add(new Property("status", "code", "A code specifying the status of the record of the family history of a specific family member.", 0, 1, status));
1685        children.add(new Property("notDone", "boolean", "If true, indicates the taking of an individual family member's history did not occur. The notDone element should not be used to document negated conditions, such as a family member that did not have a condition.", 0, 1, notDone));
1686        children.add(new Property("notDoneReason", "CodeableConcept", "Describes why the family member's history is absent.", 0, 1, notDoneReason));
1687        children.add(new Property("patient", "Reference(Patient)", "The person who this history concerns.", 0, 1, patient));
1688        children.add(new Property("date", "dateTime", "The date (and possibly time) when the family member history was taken.", 0, 1, date));
1689        children.add(new Property("name", "string", "This will either be a name or a description; e.g. \"Aunt Susan\", \"my cousin with the red hair\".", 0, 1, name));
1690        children.add(new Property("relationship", "CodeableConcept", "The type of relationship this person has to the patient (father, mother, brother etc.).", 0, 1, relationship));
1691        children.add(new Property("gender", "code", "Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes.", 0, 1, gender));
1692        children.add(new Property("born[x]", "Period|date|string", "The actual or approximate date of birth of the relative.", 0, 1, born));
1693        children.add(new Property("age[x]", "Age|Range|string", "The age of the relative at the time the family member history is recorded.", 0, 1, age));
1694        children.add(new Property("estimatedAge", "boolean", "If true, indicates that the age value specified is an estimated value.", 0, 1, estimatedAge));
1695        children.add(new Property("deceased[x]", "boolean|Age|Range|date|string", "Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.", 0, 1, deceased));
1696        children.add(new Property("reasonCode", "CodeableConcept", "Describes why the family member history occurred in coded or textual form.", 0, java.lang.Integer.MAX_VALUE, reasonCode));
1697        children.add(new Property("reasonReference", "Reference(Condition|Observation|AllergyIntolerance|QuestionnaireResponse)", "Indicates a Condition, Observation, AllergyIntolerance, or QuestionnaireResponse that justifies this family member history event.", 0, java.lang.Integer.MAX_VALUE, reasonReference));
1698        children.add(new Property("note", "Annotation", "This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible.", 0, java.lang.Integer.MAX_VALUE, note));
1699        children.add(new Property("condition", "", "The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition.", 0, java.lang.Integer.MAX_VALUE, condition));
1700      }
1701
1702      @Override
1703      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1704        switch (_hash) {
1705        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "This records identifiers associated with this family member history record that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier);
1706        case -1014418093: /*definition*/  return new Property("definition", "Reference(PlanDefinition|Questionnaire)", "A protocol or questionnaire that was adhered to in whole or in part by this event.", 0, java.lang.Integer.MAX_VALUE, definition);
1707        case -892481550: /*status*/  return new Property("status", "code", "A code specifying the status of the record of the family history of a specific family member.", 0, 1, status);
1708        case 2128257269: /*notDone*/  return new Property("notDone", "boolean", "If true, indicates the taking of an individual family member's history did not occur. The notDone element should not be used to document negated conditions, such as a family member that did not have a condition.", 0, 1, notDone);
1709        case -1973169255: /*notDoneReason*/  return new Property("notDoneReason", "CodeableConcept", "Describes why the family member's history is absent.", 0, 1, notDoneReason);
1710        case -791418107: /*patient*/  return new Property("patient", "Reference(Patient)", "The person who this history concerns.", 0, 1, patient);
1711        case 3076014: /*date*/  return new Property("date", "dateTime", "The date (and possibly time) when the family member history was taken.", 0, 1, date);
1712        case 3373707: /*name*/  return new Property("name", "string", "This will either be a name or a description; e.g. \"Aunt Susan\", \"my cousin with the red hair\".", 0, 1, name);
1713        case -261851592: /*relationship*/  return new Property("relationship", "CodeableConcept", "The type of relationship this person has to the patient (father, mother, brother etc.).", 0, 1, relationship);
1714        case -1249512767: /*gender*/  return new Property("gender", "code", "Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes.", 0, 1, gender);
1715        case 67532951: /*born[x]*/  return new Property("born[x]", "Period|date|string", "The actual or approximate date of birth of the relative.", 0, 1, born);
1716        case 3029833: /*born*/  return new Property("born[x]", "Period|date|string", "The actual or approximate date of birth of the relative.", 0, 1, born);
1717        case 1497711210: /*bornPeriod*/  return new Property("born[x]", "Period|date|string", "The actual or approximate date of birth of the relative.", 0, 1, born);
1718        case 2092814999: /*bornDate*/  return new Property("born[x]", "Period|date|string", "The actual or approximate date of birth of the relative.", 0, 1, born);
1719        case 1597451450: /*bornString*/  return new Property("born[x]", "Period|date|string", "The actual or approximate date of birth of the relative.", 0, 1, born);
1720        case -1419716831: /*age[x]*/  return new Property("age[x]", "Age|Range|string", "The age of the relative at the time the family member history is recorded.", 0, 1, age);
1721        case 96511: /*age*/  return new Property("age[x]", "Age|Range|string", "The age of the relative at the time the family member history is recorded.", 0, 1, age);
1722        case -1419742336: /*ageAge*/  return new Property("age[x]", "Age|Range|string", "The age of the relative at the time the family member history is recorded.", 0, 1, age);
1723        case 1442748286: /*ageRange*/  return new Property("age[x]", "Age|Range|string", "The age of the relative at the time the family member history is recorded.", 0, 1, age);
1724        case 1821821424: /*ageString*/  return new Property("age[x]", "Age|Range|string", "The age of the relative at the time the family member history is recorded.", 0, 1, age);
1725        case 2130167587: /*estimatedAge*/  return new Property("estimatedAge", "boolean", "If true, indicates that the age value specified is an estimated value.", 0, 1, estimatedAge);
1726        case -1311442804: /*deceased[x]*/  return new Property("deceased[x]", "boolean|Age|Range|date|string", "Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.", 0, 1, deceased);
1727        case 561497972: /*deceased*/  return new Property("deceased[x]", "boolean|Age|Range|date|string", "Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.", 0, 1, deceased);
1728        case 497463828: /*deceasedBoolean*/  return new Property("deceased[x]", "boolean|Age|Range|date|string", "Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.", 0, 1, deceased);
1729        case -1311468309: /*deceasedAge*/  return new Property("deceased[x]", "boolean|Age|Range|date|string", "Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.", 0, 1, deceased);
1730        case -1880094167: /*deceasedRange*/  return new Property("deceased[x]", "boolean|Age|Range|date|string", "Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.", 0, 1, deceased);
1731        case -2000727742: /*deceasedDate*/  return new Property("deceased[x]", "boolean|Age|Range|date|string", "Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.", 0, 1, deceased);
1732        case 1892920485: /*deceasedString*/  return new Property("deceased[x]", "boolean|Age|Range|date|string", "Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.", 0, 1, deceased);
1733        case 722137681: /*reasonCode*/  return new Property("reasonCode", "CodeableConcept", "Describes why the family member history occurred in coded or textual form.", 0, java.lang.Integer.MAX_VALUE, reasonCode);
1734        case -1146218137: /*reasonReference*/  return new Property("reasonReference", "Reference(Condition|Observation|AllergyIntolerance|QuestionnaireResponse)", "Indicates a Condition, Observation, AllergyIntolerance, or QuestionnaireResponse that justifies this family member history event.", 0, java.lang.Integer.MAX_VALUE, reasonReference);
1735        case 3387378: /*note*/  return new Property("note", "Annotation", "This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible.", 0, java.lang.Integer.MAX_VALUE, note);
1736        case -861311717: /*condition*/  return new Property("condition", "", "The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition.", 0, java.lang.Integer.MAX_VALUE, condition);
1737        default: return super.getNamedProperty(_hash, _name, _checkValid);
1738        }
1739
1740      }
1741
1742      @Override
1743      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1744        switch (hash) {
1745        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1746        case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : this.definition.toArray(new Base[this.definition.size()]); // Reference
1747        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<FamilyHistoryStatus>
1748        case 2128257269: /*notDone*/ return this.notDone == null ? new Base[0] : new Base[] {this.notDone}; // BooleanType
1749        case -1973169255: /*notDoneReason*/ return this.notDoneReason == null ? new Base[0] : new Base[] {this.notDoneReason}; // CodeableConcept
1750        case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference
1751        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
1752        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
1753        case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // CodeableConcept
1754        case -1249512767: /*gender*/ return this.gender == null ? new Base[0] : new Base[] {this.gender}; // Enumeration<AdministrativeGender>
1755        case 3029833: /*born*/ return this.born == null ? new Base[0] : new Base[] {this.born}; // Type
1756        case 96511: /*age*/ return this.age == null ? new Base[0] : new Base[] {this.age}; // Type
1757        case 2130167587: /*estimatedAge*/ return this.estimatedAge == null ? new Base[0] : new Base[] {this.estimatedAge}; // BooleanType
1758        case 561497972: /*deceased*/ return this.deceased == null ? new Base[0] : new Base[] {this.deceased}; // Type
1759        case 722137681: /*reasonCode*/ return this.reasonCode == null ? new Base[0] : this.reasonCode.toArray(new Base[this.reasonCode.size()]); // CodeableConcept
1760        case -1146218137: /*reasonReference*/ return this.reasonReference == null ? new Base[0] : this.reasonReference.toArray(new Base[this.reasonReference.size()]); // Reference
1761        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
1762        case -861311717: /*condition*/ return this.condition == null ? new Base[0] : this.condition.toArray(new Base[this.condition.size()]); // FamilyMemberHistoryConditionComponent
1763        default: return super.getProperty(hash, name, checkValid);
1764        }
1765
1766      }
1767
1768      @Override
1769      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1770        switch (hash) {
1771        case -1618432855: // identifier
1772          this.getIdentifier().add(castToIdentifier(value)); // Identifier
1773          return value;
1774        case -1014418093: // definition
1775          this.getDefinition().add(castToReference(value)); // Reference
1776          return value;
1777        case -892481550: // status
1778          value = new FamilyHistoryStatusEnumFactory().fromType(castToCode(value));
1779          this.status = (Enumeration) value; // Enumeration<FamilyHistoryStatus>
1780          return value;
1781        case 2128257269: // notDone
1782          this.notDone = castToBoolean(value); // BooleanType
1783          return value;
1784        case -1973169255: // notDoneReason
1785          this.notDoneReason = castToCodeableConcept(value); // CodeableConcept
1786          return value;
1787        case -791418107: // patient
1788          this.patient = castToReference(value); // Reference
1789          return value;
1790        case 3076014: // date
1791          this.date = castToDateTime(value); // DateTimeType
1792          return value;
1793        case 3373707: // name
1794          this.name = castToString(value); // StringType
1795          return value;
1796        case -261851592: // relationship
1797          this.relationship = castToCodeableConcept(value); // CodeableConcept
1798          return value;
1799        case -1249512767: // gender
1800          value = new AdministrativeGenderEnumFactory().fromType(castToCode(value));
1801          this.gender = (Enumeration) value; // Enumeration<AdministrativeGender>
1802          return value;
1803        case 3029833: // born
1804          this.born = castToType(value); // Type
1805          return value;
1806        case 96511: // age
1807          this.age = castToType(value); // Type
1808          return value;
1809        case 2130167587: // estimatedAge
1810          this.estimatedAge = castToBoolean(value); // BooleanType
1811          return value;
1812        case 561497972: // deceased
1813          this.deceased = castToType(value); // Type
1814          return value;
1815        case 722137681: // reasonCode
1816          this.getReasonCode().add(castToCodeableConcept(value)); // CodeableConcept
1817          return value;
1818        case -1146218137: // reasonReference
1819          this.getReasonReference().add(castToReference(value)); // Reference
1820          return value;
1821        case 3387378: // note
1822          this.getNote().add(castToAnnotation(value)); // Annotation
1823          return value;
1824        case -861311717: // condition
1825          this.getCondition().add((FamilyMemberHistoryConditionComponent) value); // FamilyMemberHistoryConditionComponent
1826          return value;
1827        default: return super.setProperty(hash, name, value);
1828        }
1829
1830      }
1831
1832      @Override
1833      public Base setProperty(String name, Base value) throws FHIRException {
1834        if (name.equals("identifier")) {
1835          this.getIdentifier().add(castToIdentifier(value));
1836        } else if (name.equals("definition")) {
1837          this.getDefinition().add(castToReference(value));
1838        } else if (name.equals("status")) {
1839          value = new FamilyHistoryStatusEnumFactory().fromType(castToCode(value));
1840          this.status = (Enumeration) value; // Enumeration<FamilyHistoryStatus>
1841        } else if (name.equals("notDone")) {
1842          this.notDone = castToBoolean(value); // BooleanType
1843        } else if (name.equals("notDoneReason")) {
1844          this.notDoneReason = castToCodeableConcept(value); // CodeableConcept
1845        } else if (name.equals("patient")) {
1846          this.patient = castToReference(value); // Reference
1847        } else if (name.equals("date")) {
1848          this.date = castToDateTime(value); // DateTimeType
1849        } else if (name.equals("name")) {
1850          this.name = castToString(value); // StringType
1851        } else if (name.equals("relationship")) {
1852          this.relationship = castToCodeableConcept(value); // CodeableConcept
1853        } else if (name.equals("gender")) {
1854          value = new AdministrativeGenderEnumFactory().fromType(castToCode(value));
1855          this.gender = (Enumeration) value; // Enumeration<AdministrativeGender>
1856        } else if (name.equals("born[x]")) {
1857          this.born = castToType(value); // Type
1858        } else if (name.equals("age[x]")) {
1859          this.age = castToType(value); // Type
1860        } else if (name.equals("estimatedAge")) {
1861          this.estimatedAge = castToBoolean(value); // BooleanType
1862        } else if (name.equals("deceased[x]")) {
1863          this.deceased = castToType(value); // Type
1864        } else if (name.equals("reasonCode")) {
1865          this.getReasonCode().add(castToCodeableConcept(value));
1866        } else if (name.equals("reasonReference")) {
1867          this.getReasonReference().add(castToReference(value));
1868        } else if (name.equals("note")) {
1869          this.getNote().add(castToAnnotation(value));
1870        } else if (name.equals("condition")) {
1871          this.getCondition().add((FamilyMemberHistoryConditionComponent) value);
1872        } else
1873          return super.setProperty(name, value);
1874        return value;
1875      }
1876
1877      @Override
1878      public Base makeProperty(int hash, String name) throws FHIRException {
1879        switch (hash) {
1880        case -1618432855:  return addIdentifier(); 
1881        case -1014418093:  return addDefinition(); 
1882        case -892481550:  return getStatusElement();
1883        case 2128257269:  return getNotDoneElement();
1884        case -1973169255:  return getNotDoneReason(); 
1885        case -791418107:  return getPatient(); 
1886        case 3076014:  return getDateElement();
1887        case 3373707:  return getNameElement();
1888        case -261851592:  return getRelationship(); 
1889        case -1249512767:  return getGenderElement();
1890        case 67532951:  return getBorn(); 
1891        case 3029833:  return getBorn(); 
1892        case -1419716831:  return getAge(); 
1893        case 96511:  return getAge(); 
1894        case 2130167587:  return getEstimatedAgeElement();
1895        case -1311442804:  return getDeceased(); 
1896        case 561497972:  return getDeceased(); 
1897        case 722137681:  return addReasonCode(); 
1898        case -1146218137:  return addReasonReference(); 
1899        case 3387378:  return addNote(); 
1900        case -861311717:  return addCondition(); 
1901        default: return super.makeProperty(hash, name);
1902        }
1903
1904      }
1905
1906      @Override
1907      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1908        switch (hash) {
1909        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1910        case -1014418093: /*definition*/ return new String[] {"Reference"};
1911        case -892481550: /*status*/ return new String[] {"code"};
1912        case 2128257269: /*notDone*/ return new String[] {"boolean"};
1913        case -1973169255: /*notDoneReason*/ return new String[] {"CodeableConcept"};
1914        case -791418107: /*patient*/ return new String[] {"Reference"};
1915        case 3076014: /*date*/ return new String[] {"dateTime"};
1916        case 3373707: /*name*/ return new String[] {"string"};
1917        case -261851592: /*relationship*/ return new String[] {"CodeableConcept"};
1918        case -1249512767: /*gender*/ return new String[] {"code"};
1919        case 3029833: /*born*/ return new String[] {"Period", "date", "string"};
1920        case 96511: /*age*/ return new String[] {"Age", "Range", "string"};
1921        case 2130167587: /*estimatedAge*/ return new String[] {"boolean"};
1922        case 561497972: /*deceased*/ return new String[] {"boolean", "Age", "Range", "date", "string"};
1923        case 722137681: /*reasonCode*/ return new String[] {"CodeableConcept"};
1924        case -1146218137: /*reasonReference*/ return new String[] {"Reference"};
1925        case 3387378: /*note*/ return new String[] {"Annotation"};
1926        case -861311717: /*condition*/ return new String[] {};
1927        default: return super.getTypesForProperty(hash, name);
1928        }
1929
1930      }
1931
1932      @Override
1933      public Base addChild(String name) throws FHIRException {
1934        if (name.equals("identifier")) {
1935          return addIdentifier();
1936        }
1937        else if (name.equals("definition")) {
1938          return addDefinition();
1939        }
1940        else if (name.equals("status")) {
1941          throw new FHIRException("Cannot call addChild on a singleton property FamilyMemberHistory.status");
1942        }
1943        else if (name.equals("notDone")) {
1944          throw new FHIRException("Cannot call addChild on a singleton property FamilyMemberHistory.notDone");
1945        }
1946        else if (name.equals("notDoneReason")) {
1947          this.notDoneReason = new CodeableConcept();
1948          return this.notDoneReason;
1949        }
1950        else if (name.equals("patient")) {
1951          this.patient = new Reference();
1952          return this.patient;
1953        }
1954        else if (name.equals("date")) {
1955          throw new FHIRException("Cannot call addChild on a singleton property FamilyMemberHistory.date");
1956        }
1957        else if (name.equals("name")) {
1958          throw new FHIRException("Cannot call addChild on a singleton property FamilyMemberHistory.name");
1959        }
1960        else if (name.equals("relationship")) {
1961          this.relationship = new CodeableConcept();
1962          return this.relationship;
1963        }
1964        else if (name.equals("gender")) {
1965          throw new FHIRException("Cannot call addChild on a singleton property FamilyMemberHistory.gender");
1966        }
1967        else if (name.equals("bornPeriod")) {
1968          this.born = new Period();
1969          return this.born;
1970        }
1971        else if (name.equals("bornDate")) {
1972          this.born = new DateType();
1973          return this.born;
1974        }
1975        else if (name.equals("bornString")) {
1976          this.born = new StringType();
1977          return this.born;
1978        }
1979        else if (name.equals("ageAge")) {
1980          this.age = new Age();
1981          return this.age;
1982        }
1983        else if (name.equals("ageRange")) {
1984          this.age = new Range();
1985          return this.age;
1986        }
1987        else if (name.equals("ageString")) {
1988          this.age = new StringType();
1989          return this.age;
1990        }
1991        else if (name.equals("estimatedAge")) {
1992          throw new FHIRException("Cannot call addChild on a singleton property FamilyMemberHistory.estimatedAge");
1993        }
1994        else if (name.equals("deceasedBoolean")) {
1995          this.deceased = new BooleanType();
1996          return this.deceased;
1997        }
1998        else if (name.equals("deceasedAge")) {
1999          this.deceased = new Age();
2000          return this.deceased;
2001        }
2002        else if (name.equals("deceasedRange")) {
2003          this.deceased = new Range();
2004          return this.deceased;
2005        }
2006        else if (name.equals("deceasedDate")) {
2007          this.deceased = new DateType();
2008          return this.deceased;
2009        }
2010        else if (name.equals("deceasedString")) {
2011          this.deceased = new StringType();
2012          return this.deceased;
2013        }
2014        else if (name.equals("reasonCode")) {
2015          return addReasonCode();
2016        }
2017        else if (name.equals("reasonReference")) {
2018          return addReasonReference();
2019        }
2020        else if (name.equals("note")) {
2021          return addNote();
2022        }
2023        else if (name.equals("condition")) {
2024          return addCondition();
2025        }
2026        else
2027          return super.addChild(name);
2028      }
2029
2030  public String fhirType() {
2031    return "FamilyMemberHistory";
2032
2033  }
2034
2035      public FamilyMemberHistory copy() {
2036        FamilyMemberHistory dst = new FamilyMemberHistory();
2037        copyValues(dst);
2038        if (identifier != null) {
2039          dst.identifier = new ArrayList<Identifier>();
2040          for (Identifier i : identifier)
2041            dst.identifier.add(i.copy());
2042        };
2043        if (definition != null) {
2044          dst.definition = new ArrayList<Reference>();
2045          for (Reference i : definition)
2046            dst.definition.add(i.copy());
2047        };
2048        dst.status = status == null ? null : status.copy();
2049        dst.notDone = notDone == null ? null : notDone.copy();
2050        dst.notDoneReason = notDoneReason == null ? null : notDoneReason.copy();
2051        dst.patient = patient == null ? null : patient.copy();
2052        dst.date = date == null ? null : date.copy();
2053        dst.name = name == null ? null : name.copy();
2054        dst.relationship = relationship == null ? null : relationship.copy();
2055        dst.gender = gender == null ? null : gender.copy();
2056        dst.born = born == null ? null : born.copy();
2057        dst.age = age == null ? null : age.copy();
2058        dst.estimatedAge = estimatedAge == null ? null : estimatedAge.copy();
2059        dst.deceased = deceased == null ? null : deceased.copy();
2060        if (reasonCode != null) {
2061          dst.reasonCode = new ArrayList<CodeableConcept>();
2062          for (CodeableConcept i : reasonCode)
2063            dst.reasonCode.add(i.copy());
2064        };
2065        if (reasonReference != null) {
2066          dst.reasonReference = new ArrayList<Reference>();
2067          for (Reference i : reasonReference)
2068            dst.reasonReference.add(i.copy());
2069        };
2070        if (note != null) {
2071          dst.note = new ArrayList<Annotation>();
2072          for (Annotation i : note)
2073            dst.note.add(i.copy());
2074        };
2075        if (condition != null) {
2076          dst.condition = new ArrayList<FamilyMemberHistoryConditionComponent>();
2077          for (FamilyMemberHistoryConditionComponent i : condition)
2078            dst.condition.add(i.copy());
2079        };
2080        return dst;
2081      }
2082
2083      protected FamilyMemberHistory typedCopy() {
2084        return copy();
2085      }
2086
2087      @Override
2088      public boolean equalsDeep(Base other_) {
2089        if (!super.equalsDeep(other_))
2090          return false;
2091        if (!(other_ instanceof FamilyMemberHistory))
2092          return false;
2093        FamilyMemberHistory o = (FamilyMemberHistory) other_;
2094        return compareDeep(identifier, o.identifier, true) && compareDeep(definition, o.definition, true)
2095           && compareDeep(status, o.status, true) && compareDeep(notDone, o.notDone, true) && compareDeep(notDoneReason, o.notDoneReason, true)
2096           && compareDeep(patient, o.patient, true) && compareDeep(date, o.date, true) && compareDeep(name, o.name, true)
2097           && compareDeep(relationship, o.relationship, true) && compareDeep(gender, o.gender, true) && compareDeep(born, o.born, true)
2098           && compareDeep(age, o.age, true) && compareDeep(estimatedAge, o.estimatedAge, true) && compareDeep(deceased, o.deceased, true)
2099           && compareDeep(reasonCode, o.reasonCode, true) && compareDeep(reasonReference, o.reasonReference, true)
2100           && compareDeep(note, o.note, true) && compareDeep(condition, o.condition, true);
2101      }
2102
2103      @Override
2104      public boolean equalsShallow(Base other_) {
2105        if (!super.equalsShallow(other_))
2106          return false;
2107        if (!(other_ instanceof FamilyMemberHistory))
2108          return false;
2109        FamilyMemberHistory o = (FamilyMemberHistory) other_;
2110        return compareValues(status, o.status, true) && compareValues(notDone, o.notDone, true) && compareValues(date, o.date, true)
2111           && compareValues(name, o.name, true) && compareValues(gender, o.gender, true) && compareValues(estimatedAge, o.estimatedAge, true)
2112          ;
2113      }
2114
2115      public boolean isEmpty() {
2116        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, definition, status
2117          , notDone, notDoneReason, patient, date, name, relationship, gender, born, age
2118          , estimatedAge, deceased, reasonCode, reasonReference, note, condition);
2119      }
2120
2121  @Override
2122  public ResourceType getResourceType() {
2123    return ResourceType.FamilyMemberHistory;
2124   }
2125
2126 /**
2127   * Search parameter: <b>date</b>
2128   * <p>
2129   * Description: <b>When history was captured/updated</b><br>
2130   * Type: <b>date</b><br>
2131   * Path: <b>FamilyMemberHistory.date</b><br>
2132   * </p>
2133   */
2134  @SearchParamDefinition(name="date", path="FamilyMemberHistory.date", description="When history was captured/updated", type="date" )
2135  public static final String SP_DATE = "date";
2136 /**
2137   * <b>Fluent Client</b> search parameter constant for <b>date</b>
2138   * <p>
2139   * Description: <b>When history was captured/updated</b><br>
2140   * Type: <b>date</b><br>
2141   * Path: <b>FamilyMemberHistory.date</b><br>
2142   * </p>
2143   */
2144  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
2145
2146 /**
2147   * Search parameter: <b>identifier</b>
2148   * <p>
2149   * Description: <b>A search by a record identifier</b><br>
2150   * Type: <b>token</b><br>
2151   * Path: <b>FamilyMemberHistory.identifier</b><br>
2152   * </p>
2153   */
2154  @SearchParamDefinition(name="identifier", path="FamilyMemberHistory.identifier", description="A search by a record identifier", type="token" )
2155  public static final String SP_IDENTIFIER = "identifier";
2156 /**
2157   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2158   * <p>
2159   * Description: <b>A search by a record identifier</b><br>
2160   * Type: <b>token</b><br>
2161   * Path: <b>FamilyMemberHistory.identifier</b><br>
2162   * </p>
2163   */
2164  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2165
2166 /**
2167   * Search parameter: <b>code</b>
2168   * <p>
2169   * Description: <b>A search by a condition code</b><br>
2170   * Type: <b>token</b><br>
2171   * Path: <b>FamilyMemberHistory.condition.code</b><br>
2172   * </p>
2173   */
2174  @SearchParamDefinition(name="code", path="FamilyMemberHistory.condition.code", description="A search by a condition code", type="token" )
2175  public static final String SP_CODE = "code";
2176 /**
2177   * <b>Fluent Client</b> search parameter constant for <b>code</b>
2178   * <p>
2179   * Description: <b>A search by a condition code</b><br>
2180   * Type: <b>token</b><br>
2181   * Path: <b>FamilyMemberHistory.condition.code</b><br>
2182   * </p>
2183   */
2184  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
2185
2186 /**
2187   * Search parameter: <b>gender</b>
2188   * <p>
2189   * Description: <b>A search by a gender code of a family member</b><br>
2190   * Type: <b>token</b><br>
2191   * Path: <b>FamilyMemberHistory.gender</b><br>
2192   * </p>
2193   */
2194  @SearchParamDefinition(name="gender", path="FamilyMemberHistory.gender", description="A search by a gender code of a family member", type="token" )
2195  public static final String SP_GENDER = "gender";
2196 /**
2197   * <b>Fluent Client</b> search parameter constant for <b>gender</b>
2198   * <p>
2199   * Description: <b>A search by a gender code of a family member</b><br>
2200   * Type: <b>token</b><br>
2201   * Path: <b>FamilyMemberHistory.gender</b><br>
2202   * </p>
2203   */
2204  public static final ca.uhn.fhir.rest.gclient.TokenClientParam GENDER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_GENDER);
2205
2206 /**
2207   * Search parameter: <b>patient</b>
2208   * <p>
2209   * Description: <b>The identity of a subject to list family member history items for</b><br>
2210   * Type: <b>reference</b><br>
2211   * Path: <b>FamilyMemberHistory.patient</b><br>
2212   * </p>
2213   */
2214  @SearchParamDefinition(name="patient", path="FamilyMemberHistory.patient", description="The identity of a subject to list family member history items for", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Patient.class } )
2215  public static final String SP_PATIENT = "patient";
2216 /**
2217   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2218   * <p>
2219   * Description: <b>The identity of a subject to list family member history items for</b><br>
2220   * Type: <b>reference</b><br>
2221   * Path: <b>FamilyMemberHistory.patient</b><br>
2222   * </p>
2223   */
2224  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
2225
2226/**
2227   * Constant for fluent queries to be used to add include statements. Specifies
2228   * the path value of "<b>FamilyMemberHistory:patient</b>".
2229   */
2230  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("FamilyMemberHistory:patient").toLocked();
2231
2232 /**
2233   * Search parameter: <b>definition</b>
2234   * <p>
2235   * Description: <b>Instantiates protocol or definition</b><br>
2236   * Type: <b>reference</b><br>
2237   * Path: <b>FamilyMemberHistory.definition</b><br>
2238   * </p>
2239   */
2240  @SearchParamDefinition(name="definition", path="FamilyMemberHistory.definition", description="Instantiates protocol or definition", type="reference", target={PlanDefinition.class, Questionnaire.class } )
2241  public static final String SP_DEFINITION = "definition";
2242 /**
2243   * <b>Fluent Client</b> search parameter constant for <b>definition</b>
2244   * <p>
2245   * Description: <b>Instantiates protocol or definition</b><br>
2246   * Type: <b>reference</b><br>
2247   * Path: <b>FamilyMemberHistory.definition</b><br>
2248   * </p>
2249   */
2250  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEFINITION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DEFINITION);
2251
2252/**
2253   * Constant for fluent queries to be used to add include statements. Specifies
2254   * the path value of "<b>FamilyMemberHistory:definition</b>".
2255   */
2256  public static final ca.uhn.fhir.model.api.Include INCLUDE_DEFINITION = new ca.uhn.fhir.model.api.Include("FamilyMemberHistory:definition").toLocked();
2257
2258 /**
2259   * Search parameter: <b>relationship</b>
2260   * <p>
2261   * Description: <b>A search by a relationship type</b><br>
2262   * Type: <b>token</b><br>
2263   * Path: <b>FamilyMemberHistory.relationship</b><br>
2264   * </p>
2265   */
2266  @SearchParamDefinition(name="relationship", path="FamilyMemberHistory.relationship", description="A search by a relationship type", type="token" )
2267  public static final String SP_RELATIONSHIP = "relationship";
2268 /**
2269   * <b>Fluent Client</b> search parameter constant for <b>relationship</b>
2270   * <p>
2271   * Description: <b>A search by a relationship type</b><br>
2272   * Type: <b>token</b><br>
2273   * Path: <b>FamilyMemberHistory.relationship</b><br>
2274   * </p>
2275   */
2276  public static final ca.uhn.fhir.rest.gclient.TokenClientParam RELATIONSHIP = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RELATIONSHIP);
2277
2278 /**
2279   * Search parameter: <b>status</b>
2280   * <p>
2281   * Description: <b>partial | completed | entered-in-error | health-unknown</b><br>
2282   * Type: <b>token</b><br>
2283   * Path: <b>FamilyMemberHistory.status</b><br>
2284   * </p>
2285   */
2286  @SearchParamDefinition(name="status", path="FamilyMemberHistory.status", description="partial | completed | entered-in-error | health-unknown", type="token" )
2287  public static final String SP_STATUS = "status";
2288 /**
2289   * <b>Fluent Client</b> search parameter constant for <b>status</b>
2290   * <p>
2291   * Description: <b>partial | completed | entered-in-error | health-unknown</b><br>
2292   * Type: <b>token</b><br>
2293   * Path: <b>FamilyMemberHistory.status</b><br>
2294   * </p>
2295   */
2296  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
2297
2298
2299}