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