001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Tue, Dec 28, 2021 07:16+1100 for FHIR v5.0.0-snapshot1
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * Significant health conditions for a person related to the patient relevant in the context of care for the patient.
052 */
053@ResourceDef(name="FamilyMemberHistory", profile="http://hl7.org/fhir/StructureDefinition/FamilyMemberHistory")
054public class FamilyMemberHistory extends DomainResource {
055
056    public enum FamilyHistoryStatus {
057        /**
058         * Some health information is known and captured, but not complete - see notes for details.
059         */
060        PARTIAL, 
061        /**
062         * All available related health information is captured as of the date (and possibly time) when the family member history was taken.
063         */
064        COMPLETED, 
065        /**
066         * This instance should not have been part of this patient's medical record.
067         */
068        ENTEREDINERROR, 
069        /**
070         * Health information for this family member is unavailable/unknown.
071         */
072        HEALTHUNKNOWN, 
073        /**
074         * added to help the parsers with the generic types
075         */
076        NULL;
077        public static FamilyHistoryStatus fromCode(String codeString) throws FHIRException {
078            if (codeString == null || "".equals(codeString))
079                return null;
080        if ("partial".equals(codeString))
081          return PARTIAL;
082        if ("completed".equals(codeString))
083          return COMPLETED;
084        if ("entered-in-error".equals(codeString))
085          return ENTEREDINERROR;
086        if ("health-unknown".equals(codeString))
087          return HEALTHUNKNOWN;
088        if (Configuration.isAcceptInvalidEnums())
089          return null;
090        else
091          throw new FHIRException("Unknown FamilyHistoryStatus code '"+codeString+"'");
092        }
093        public String toCode() {
094          switch (this) {
095            case PARTIAL: return "partial";
096            case COMPLETED: return "completed";
097            case ENTEREDINERROR: return "entered-in-error";
098            case HEALTHUNKNOWN: return "health-unknown";
099            default: return "?";
100          }
101        }
102        public String getSystem() {
103          switch (this) {
104            case PARTIAL: return "http://hl7.org/fhir/history-status";
105            case COMPLETED: return "http://hl7.org/fhir/history-status";
106            case ENTEREDINERROR: return "http://hl7.org/fhir/history-status";
107            case HEALTHUNKNOWN: return "http://hl7.org/fhir/history-status";
108            default: return "?";
109          }
110        }
111        public String getDefinition() {
112          switch (this) {
113            case PARTIAL: return "Some health information is known and captured, but not complete - see notes for details.";
114            case COMPLETED: return "All available related health information is captured as of the date (and possibly time) when the family member history was taken.";
115            case ENTEREDINERROR: return "This instance should not have been part of this patient's medical record.";
116            case HEALTHUNKNOWN: return "Health information for this family member is unavailable/unknown.";
117            default: return "?";
118          }
119        }
120        public String getDisplay() {
121          switch (this) {
122            case PARTIAL: return "Partial";
123            case COMPLETED: return "Completed";
124            case ENTEREDINERROR: return "Entered in Error";
125            case HEALTHUNKNOWN: return "Health Unknown";
126            default: return "?";
127          }
128        }
129    }
130
131  public static class FamilyHistoryStatusEnumFactory implements EnumFactory<FamilyHistoryStatus> {
132    public FamilyHistoryStatus fromCode(String codeString) throws IllegalArgumentException {
133      if (codeString == null || "".equals(codeString))
134            if (codeString == null || "".equals(codeString))
135                return null;
136        if ("partial".equals(codeString))
137          return FamilyHistoryStatus.PARTIAL;
138        if ("completed".equals(codeString))
139          return FamilyHistoryStatus.COMPLETED;
140        if ("entered-in-error".equals(codeString))
141          return FamilyHistoryStatus.ENTEREDINERROR;
142        if ("health-unknown".equals(codeString))
143          return FamilyHistoryStatus.HEALTHUNKNOWN;
144        throw new IllegalArgumentException("Unknown FamilyHistoryStatus code '"+codeString+"'");
145        }
146        public Enumeration<FamilyHistoryStatus> fromType(Base code) throws FHIRException {
147          if (code == null)
148            return null;
149          if (code.isEmpty())
150            return new Enumeration<FamilyHistoryStatus>(this);
151          String codeString = ((PrimitiveType) code).asStringValue();
152          if (codeString == null || "".equals(codeString))
153            return null;
154        if ("partial".equals(codeString))
155          return new Enumeration<FamilyHistoryStatus>(this, FamilyHistoryStatus.PARTIAL);
156        if ("completed".equals(codeString))
157          return new Enumeration<FamilyHistoryStatus>(this, FamilyHistoryStatus.COMPLETED);
158        if ("entered-in-error".equals(codeString))
159          return new Enumeration<FamilyHistoryStatus>(this, FamilyHistoryStatus.ENTEREDINERROR);
160        if ("health-unknown".equals(codeString))
161          return new Enumeration<FamilyHistoryStatus>(this, FamilyHistoryStatus.HEALTHUNKNOWN);
162        throw new FHIRException("Unknown FamilyHistoryStatus code '"+codeString+"'");
163        }
164    public String toCode(FamilyHistoryStatus code) {
165      if (code == FamilyHistoryStatus.PARTIAL)
166        return "partial";
167      if (code == FamilyHistoryStatus.COMPLETED)
168        return "completed";
169      if (code == FamilyHistoryStatus.ENTEREDINERROR)
170        return "entered-in-error";
171      if (code == FamilyHistoryStatus.HEALTHUNKNOWN)
172        return "health-unknown";
173      return "?";
174      }
175    public String toSystem(FamilyHistoryStatus code) {
176      return code.getSystem();
177      }
178    }
179
180    @Block()
181    public static class FamilyMemberHistoryConditionComponent extends BackboneElement implements IBaseBackboneElement {
182        /**
183         * 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.
184         */
185        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
186        @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." )
187        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/condition-code")
188        protected CodeableConcept code;
189
190        /**
191         * Indicates what happened following the condition.  If the condition resulted in death, deceased date is captured on the relation.
192         */
193        @Child(name = "outcome", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
194        @Description(shortDefinition="deceased | permanent disability | etc.", formalDefinition="Indicates what happened following the condition.  If the condition resulted in death, deceased date is captured on the relation." )
195        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/condition-outcome")
196        protected CodeableConcept outcome;
197
198        /**
199         * This condition contributed to the cause of death of the related person. If contributedToDeath is not populated, then it is unknown.
200         */
201        @Child(name = "contributedToDeath", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=false)
202        @Description(shortDefinition="Whether the condition contributed to the cause of death", formalDefinition="This condition contributed to the cause of death of the related person. If contributedToDeath is not populated, then it is unknown." )
203        protected BooleanType contributedToDeath;
204
205        /**
206         * Either the age of onset, range of approximate age or descriptive string can be recorded.  For conditions with multiple occurrences, this describes the first known occurrence.
207         */
208        @Child(name = "onset", type = {Age.class, Range.class, Period.class, StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
209        @Description(shortDefinition="When condition first manifested", formalDefinition="Either the age of onset, range of approximate age or descriptive string can be recorded.  For conditions with multiple occurrences, this describes the first known occurrence." )
210        protected DataType onset;
211
212        /**
213         * An area where general notes can be placed about this specific condition.
214         */
215        @Child(name = "note", type = {Annotation.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
216        @Description(shortDefinition="Extra information about condition", formalDefinition="An area where general notes can be placed about this specific condition." )
217        protected List<Annotation> note;
218
219        private static final long serialVersionUID = -91335661L;
220
221    /**
222     * Constructor
223     */
224      public FamilyMemberHistoryConditionComponent() {
225        super();
226      }
227
228    /**
229     * Constructor
230     */
231      public FamilyMemberHistoryConditionComponent(CodeableConcept code) {
232        super();
233        this.setCode(code);
234      }
235
236        /**
237         * @return {@link #code} (The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system.)
238         */
239        public CodeableConcept getCode() { 
240          if (this.code == null)
241            if (Configuration.errorOnAutoCreate())
242              throw new Error("Attempt to auto-create FamilyMemberHistoryConditionComponent.code");
243            else if (Configuration.doAutoCreate())
244              this.code = new CodeableConcept(); // cc
245          return this.code;
246        }
247
248        public boolean hasCode() { 
249          return this.code != null && !this.code.isEmpty();
250        }
251
252        /**
253         * @param value {@link #code} (The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system.)
254         */
255        public FamilyMemberHistoryConditionComponent setCode(CodeableConcept value) { 
256          this.code = value;
257          return this;
258        }
259
260        /**
261         * @return {@link #outcome} (Indicates what happened following the condition.  If the condition resulted in death, deceased date is captured on the relation.)
262         */
263        public CodeableConcept getOutcome() { 
264          if (this.outcome == null)
265            if (Configuration.errorOnAutoCreate())
266              throw new Error("Attempt to auto-create FamilyMemberHistoryConditionComponent.outcome");
267            else if (Configuration.doAutoCreate())
268              this.outcome = new CodeableConcept(); // cc
269          return this.outcome;
270        }
271
272        public boolean hasOutcome() { 
273          return this.outcome != null && !this.outcome.isEmpty();
274        }
275
276        /**
277         * @param value {@link #outcome} (Indicates what happened following the condition.  If the condition resulted in death, deceased date is captured on the relation.)
278         */
279        public FamilyMemberHistoryConditionComponent setOutcome(CodeableConcept value) { 
280          this.outcome = value;
281          return this;
282        }
283
284        /**
285         * @return {@link #contributedToDeath} (This condition contributed to the cause of death of the related person. If contributedToDeath is not populated, then it is unknown.). This is the underlying object with id, value and extensions. The accessor "getContributedToDeath" gives direct access to the value
286         */
287        public BooleanType getContributedToDeathElement() { 
288          if (this.contributedToDeath == null)
289            if (Configuration.errorOnAutoCreate())
290              throw new Error("Attempt to auto-create FamilyMemberHistoryConditionComponent.contributedToDeath");
291            else if (Configuration.doAutoCreate())
292              this.contributedToDeath = new BooleanType(); // bb
293          return this.contributedToDeath;
294        }
295
296        public boolean hasContributedToDeathElement() { 
297          return this.contributedToDeath != null && !this.contributedToDeath.isEmpty();
298        }
299
300        public boolean hasContributedToDeath() { 
301          return this.contributedToDeath != null && !this.contributedToDeath.isEmpty();
302        }
303
304        /**
305         * @param value {@link #contributedToDeath} (This condition contributed to the cause of death of the related person. If contributedToDeath is not populated, then it is unknown.). This is the underlying object with id, value and extensions. The accessor "getContributedToDeath" gives direct access to the value
306         */
307        public FamilyMemberHistoryConditionComponent setContributedToDeathElement(BooleanType value) { 
308          this.contributedToDeath = value;
309          return this;
310        }
311
312        /**
313         * @return This condition contributed to the cause of death of the related person. If contributedToDeath is not populated, then it is unknown.
314         */
315        public boolean getContributedToDeath() { 
316          return this.contributedToDeath == null || this.contributedToDeath.isEmpty() ? false : this.contributedToDeath.getValue();
317        }
318
319        /**
320         * @param value This condition contributed to the cause of death of the related person. If contributedToDeath is not populated, then it is unknown.
321         */
322        public FamilyMemberHistoryConditionComponent setContributedToDeath(boolean value) { 
323            if (this.contributedToDeath == null)
324              this.contributedToDeath = new BooleanType();
325            this.contributedToDeath.setValue(value);
326          return this;
327        }
328
329        /**
330         * @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.)
331         */
332        public DataType getOnset() { 
333          return this.onset;
334        }
335
336        /**
337         * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded.  For conditions with multiple occurrences, this describes the first known occurrence.)
338         */
339        public Age getOnsetAge() throws FHIRException { 
340          if (this.onset == null)
341            this.onset = new Age();
342          if (!(this.onset instanceof Age))
343            throw new FHIRException("Type mismatch: the type Age was expected, but "+this.onset.getClass().getName()+" was encountered");
344          return (Age) this.onset;
345        }
346
347        public boolean hasOnsetAge() { 
348          return this != null && this.onset instanceof Age;
349        }
350
351        /**
352         * @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.)
353         */
354        public Range getOnsetRange() throws FHIRException { 
355          if (this.onset == null)
356            this.onset = new Range();
357          if (!(this.onset instanceof Range))
358            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.onset.getClass().getName()+" was encountered");
359          return (Range) this.onset;
360        }
361
362        public boolean hasOnsetRange() { 
363          return this != null && this.onset instanceof Range;
364        }
365
366        /**
367         * @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.)
368         */
369        public Period getOnsetPeriod() throws FHIRException { 
370          if (this.onset == null)
371            this.onset = new Period();
372          if (!(this.onset instanceof Period))
373            throw new FHIRException("Type mismatch: the type Period was expected, but "+this.onset.getClass().getName()+" was encountered");
374          return (Period) this.onset;
375        }
376
377        public boolean hasOnsetPeriod() { 
378          return this != null && this.onset instanceof Period;
379        }
380
381        /**
382         * @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.)
383         */
384        public StringType getOnsetStringType() throws FHIRException { 
385          if (this.onset == null)
386            this.onset = new StringType();
387          if (!(this.onset instanceof StringType))
388            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.onset.getClass().getName()+" was encountered");
389          return (StringType) this.onset;
390        }
391
392        public boolean hasOnsetStringType() { 
393          return this != null && this.onset instanceof StringType;
394        }
395
396        public boolean hasOnset() { 
397          return this.onset != null && !this.onset.isEmpty();
398        }
399
400        /**
401         * @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.)
402         */
403        public FamilyMemberHistoryConditionComponent setOnset(DataType value) { 
404          if (value != null && !(value instanceof Age || value instanceof Range || value instanceof Period || value instanceof StringType))
405            throw new Error("Not the right type for FamilyMemberHistory.condition.onset[x]: "+value.fhirType());
406          this.onset = value;
407          return this;
408        }
409
410        /**
411         * @return {@link #note} (An area where general notes can be placed about this specific condition.)
412         */
413        public List<Annotation> getNote() { 
414          if (this.note == null)
415            this.note = new ArrayList<Annotation>();
416          return this.note;
417        }
418
419        /**
420         * @return Returns a reference to <code>this</code> for easy method chaining
421         */
422        public FamilyMemberHistoryConditionComponent setNote(List<Annotation> theNote) { 
423          this.note = theNote;
424          return this;
425        }
426
427        public boolean hasNote() { 
428          if (this.note == null)
429            return false;
430          for (Annotation item : this.note)
431            if (!item.isEmpty())
432              return true;
433          return false;
434        }
435
436        public Annotation addNote() { //3
437          Annotation t = new Annotation();
438          if (this.note == null)
439            this.note = new ArrayList<Annotation>();
440          this.note.add(t);
441          return t;
442        }
443
444        public FamilyMemberHistoryConditionComponent addNote(Annotation t) { //3
445          if (t == null)
446            return this;
447          if (this.note == null)
448            this.note = new ArrayList<Annotation>();
449          this.note.add(t);
450          return this;
451        }
452
453        /**
454         * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
455         */
456        public Annotation getNoteFirstRep() { 
457          if (getNote().isEmpty()) {
458            addNote();
459          }
460          return getNote().get(0);
461        }
462
463        protected void listChildren(List<Property> children) {
464          super.listChildren(children);
465          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));
466          children.add(new Property("outcome", "CodeableConcept", "Indicates what happened following the condition.  If the condition resulted in death, deceased date is captured on the relation.", 0, 1, outcome));
467          children.add(new Property("contributedToDeath", "boolean", "This condition contributed to the cause of death of the related person. If contributedToDeath is not populated, then it is unknown.", 0, 1, contributedToDeath));
468          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));
469          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));
470        }
471
472        @Override
473        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
474          switch (_hash) {
475          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);
476          case -1106507950: /*outcome*/  return new Property("outcome", "CodeableConcept", "Indicates what happened following the condition.  If the condition resulted in death, deceased date is captured on the relation.", 0, 1, outcome);
477          case -363644638: /*contributedToDeath*/  return new Property("contributedToDeath", "boolean", "This condition contributed to the cause of death of the related person. If contributedToDeath is not populated, then it is unknown.", 0, 1, contributedToDeath);
478          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);
479          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);
480          case -1886241828: /*onsetAge*/  return new Property("onset[x]", "Age", "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);
481          case -186664742: /*onsetRange*/  return new Property("onset[x]", "Range", "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);
482          case -1545082428: /*onsetPeriod*/  return new Property("onset[x]", "Period", "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);
483          case -1445342188: /*onsetString*/  return new Property("onset[x]", "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);
484          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);
485          default: return super.getNamedProperty(_hash, _name, _checkValid);
486          }
487
488        }
489
490      @Override
491      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
492        switch (hash) {
493        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
494        case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // CodeableConcept
495        case -363644638: /*contributedToDeath*/ return this.contributedToDeath == null ? new Base[0] : new Base[] {this.contributedToDeath}; // BooleanType
496        case 105901603: /*onset*/ return this.onset == null ? new Base[0] : new Base[] {this.onset}; // DataType
497        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
498        default: return super.getProperty(hash, name, checkValid);
499        }
500
501      }
502
503      @Override
504      public Base setProperty(int hash, String name, Base value) throws FHIRException {
505        switch (hash) {
506        case 3059181: // code
507          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
508          return value;
509        case -1106507950: // outcome
510          this.outcome = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
511          return value;
512        case -363644638: // contributedToDeath
513          this.contributedToDeath = TypeConvertor.castToBoolean(value); // BooleanType
514          return value;
515        case 105901603: // onset
516          this.onset = TypeConvertor.castToType(value); // DataType
517          return value;
518        case 3387378: // note
519          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
520          return value;
521        default: return super.setProperty(hash, name, value);
522        }
523
524      }
525
526      @Override
527      public Base setProperty(String name, Base value) throws FHIRException {
528        if (name.equals("code")) {
529          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
530        } else if (name.equals("outcome")) {
531          this.outcome = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
532        } else if (name.equals("contributedToDeath")) {
533          this.contributedToDeath = TypeConvertor.castToBoolean(value); // BooleanType
534        } else if (name.equals("onset[x]")) {
535          this.onset = TypeConvertor.castToType(value); // DataType
536        } else if (name.equals("note")) {
537          this.getNote().add(TypeConvertor.castToAnnotation(value));
538        } else
539          return super.setProperty(name, value);
540        return value;
541      }
542
543      @Override
544      public Base makeProperty(int hash, String name) throws FHIRException {
545        switch (hash) {
546        case 3059181:  return getCode();
547        case -1106507950:  return getOutcome();
548        case -363644638:  return getContributedToDeathElement();
549        case -1886216323:  return getOnset();
550        case 105901603:  return getOnset();
551        case 3387378:  return addNote(); 
552        default: return super.makeProperty(hash, name);
553        }
554
555      }
556
557      @Override
558      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
559        switch (hash) {
560        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
561        case -1106507950: /*outcome*/ return new String[] {"CodeableConcept"};
562        case -363644638: /*contributedToDeath*/ return new String[] {"boolean"};
563        case 105901603: /*onset*/ return new String[] {"Age", "Range", "Period", "string"};
564        case 3387378: /*note*/ return new String[] {"Annotation"};
565        default: return super.getTypesForProperty(hash, name);
566        }
567
568      }
569
570      @Override
571      public Base addChild(String name) throws FHIRException {
572        if (name.equals("code")) {
573          this.code = new CodeableConcept();
574          return this.code;
575        }
576        else if (name.equals("outcome")) {
577          this.outcome = new CodeableConcept();
578          return this.outcome;
579        }
580        else if (name.equals("contributedToDeath")) {
581          throw new FHIRException("Cannot call addChild on a primitive type FamilyMemberHistory.condition.contributedToDeath");
582        }
583        else if (name.equals("onsetAge")) {
584          this.onset = new Age();
585          return this.onset;
586        }
587        else if (name.equals("onsetRange")) {
588          this.onset = new Range();
589          return this.onset;
590        }
591        else if (name.equals("onsetPeriod")) {
592          this.onset = new Period();
593          return this.onset;
594        }
595        else if (name.equals("onsetString")) {
596          this.onset = new StringType();
597          return this.onset;
598        }
599        else if (name.equals("note")) {
600          return addNote();
601        }
602        else
603          return super.addChild(name);
604      }
605
606      public FamilyMemberHistoryConditionComponent copy() {
607        FamilyMemberHistoryConditionComponent dst = new FamilyMemberHistoryConditionComponent();
608        copyValues(dst);
609        return dst;
610      }
611
612      public void copyValues(FamilyMemberHistoryConditionComponent dst) {
613        super.copyValues(dst);
614        dst.code = code == null ? null : code.copy();
615        dst.outcome = outcome == null ? null : outcome.copy();
616        dst.contributedToDeath = contributedToDeath == null ? null : contributedToDeath.copy();
617        dst.onset = onset == null ? null : onset.copy();
618        if (note != null) {
619          dst.note = new ArrayList<Annotation>();
620          for (Annotation i : note)
621            dst.note.add(i.copy());
622        };
623      }
624
625      @Override
626      public boolean equalsDeep(Base other_) {
627        if (!super.equalsDeep(other_))
628          return false;
629        if (!(other_ instanceof FamilyMemberHistoryConditionComponent))
630          return false;
631        FamilyMemberHistoryConditionComponent o = (FamilyMemberHistoryConditionComponent) other_;
632        return compareDeep(code, o.code, true) && compareDeep(outcome, o.outcome, true) && compareDeep(contributedToDeath, o.contributedToDeath, true)
633           && compareDeep(onset, o.onset, true) && compareDeep(note, o.note, true);
634      }
635
636      @Override
637      public boolean equalsShallow(Base other_) {
638        if (!super.equalsShallow(other_))
639          return false;
640        if (!(other_ instanceof FamilyMemberHistoryConditionComponent))
641          return false;
642        FamilyMemberHistoryConditionComponent o = (FamilyMemberHistoryConditionComponent) other_;
643        return compareValues(contributedToDeath, o.contributedToDeath, true);
644      }
645
646      public boolean isEmpty() {
647        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, outcome, contributedToDeath
648          , onset, note);
649      }
650
651  public String fhirType() {
652    return "FamilyMemberHistory.condition";
653
654  }
655
656  }
657
658    @Block()
659    public static class FamilyMemberHistoryProcedureComponent extends BackboneElement implements IBaseBackboneElement {
660        /**
661         * The actual procedure specified. Could be a coded procedure or a less specific string depending on how much is known about the procedure and the capabilities of the creating system.
662         */
663        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
664        @Description(shortDefinition="Procedures performed on the related person", formalDefinition="The actual procedure specified. Could be a coded procedure or a less specific string depending on how much is known about the procedure and the capabilities of the creating system." )
665        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/procedure-code")
666        protected CodeableConcept code;
667
668        /**
669         * Indicates what happened following the procedure. If the procedure resulted in death, deceased date is captured on the relation.
670         */
671        @Child(name = "outcome", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
672        @Description(shortDefinition="What happened following the procedure", formalDefinition="Indicates what happened following the procedure. If the procedure resulted in death, deceased date is captured on the relation." )
673        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/clinical-findings")
674        protected CodeableConcept outcome;
675
676        /**
677         * This procedure contributed to the cause of death of the related person. If contributedToDeath is not populated, then it is unknown.
678         */
679        @Child(name = "contributedToDeath", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=false)
680        @Description(shortDefinition="Whether the procedure contributed to the cause of death", formalDefinition="This procedure contributed to the cause of death of the related person. If contributedToDeath is not populated, then it is unknown." )
681        protected BooleanType contributedToDeath;
682
683        /**
684         * Estimated or actual date, date-time, period, or age when the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.
685         */
686        @Child(name = "performed", type = {Age.class, Range.class, Period.class, StringType.class, DateTimeType.class}, order=4, min=0, max=1, modifier=false, summary=false)
687        @Description(shortDefinition="When the procedure was performed", formalDefinition="Estimated or actual date, date-time, period, or age when the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured." )
688        protected DataType performed;
689
690        /**
691         * An area where general notes can be placed about this specific procedure.
692         */
693        @Child(name = "note", type = {Annotation.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
694        @Description(shortDefinition="Extra information about the procedure", formalDefinition="An area where general notes can be placed about this specific procedure." )
695        protected List<Annotation> note;
696
697        private static final long serialVersionUID = 281271062L;
698
699    /**
700     * Constructor
701     */
702      public FamilyMemberHistoryProcedureComponent() {
703        super();
704      }
705
706    /**
707     * Constructor
708     */
709      public FamilyMemberHistoryProcedureComponent(CodeableConcept code) {
710        super();
711        this.setCode(code);
712      }
713
714        /**
715         * @return {@link #code} (The actual procedure specified. Could be a coded procedure or a less specific string depending on how much is known about the procedure and the capabilities of the creating system.)
716         */
717        public CodeableConcept getCode() { 
718          if (this.code == null)
719            if (Configuration.errorOnAutoCreate())
720              throw new Error("Attempt to auto-create FamilyMemberHistoryProcedureComponent.code");
721            else if (Configuration.doAutoCreate())
722              this.code = new CodeableConcept(); // cc
723          return this.code;
724        }
725
726        public boolean hasCode() { 
727          return this.code != null && !this.code.isEmpty();
728        }
729
730        /**
731         * @param value {@link #code} (The actual procedure specified. Could be a coded procedure or a less specific string depending on how much is known about the procedure and the capabilities of the creating system.)
732         */
733        public FamilyMemberHistoryProcedureComponent setCode(CodeableConcept value) { 
734          this.code = value;
735          return this;
736        }
737
738        /**
739         * @return {@link #outcome} (Indicates what happened following the procedure. If the procedure resulted in death, deceased date is captured on the relation.)
740         */
741        public CodeableConcept getOutcome() { 
742          if (this.outcome == null)
743            if (Configuration.errorOnAutoCreate())
744              throw new Error("Attempt to auto-create FamilyMemberHistoryProcedureComponent.outcome");
745            else if (Configuration.doAutoCreate())
746              this.outcome = new CodeableConcept(); // cc
747          return this.outcome;
748        }
749
750        public boolean hasOutcome() { 
751          return this.outcome != null && !this.outcome.isEmpty();
752        }
753
754        /**
755         * @param value {@link #outcome} (Indicates what happened following the procedure. If the procedure resulted in death, deceased date is captured on the relation.)
756         */
757        public FamilyMemberHistoryProcedureComponent setOutcome(CodeableConcept value) { 
758          this.outcome = value;
759          return this;
760        }
761
762        /**
763         * @return {@link #contributedToDeath} (This procedure contributed to the cause of death of the related person. If contributedToDeath is not populated, then it is unknown.). This is the underlying object with id, value and extensions. The accessor "getContributedToDeath" gives direct access to the value
764         */
765        public BooleanType getContributedToDeathElement() { 
766          if (this.contributedToDeath == null)
767            if (Configuration.errorOnAutoCreate())
768              throw new Error("Attempt to auto-create FamilyMemberHistoryProcedureComponent.contributedToDeath");
769            else if (Configuration.doAutoCreate())
770              this.contributedToDeath = new BooleanType(); // bb
771          return this.contributedToDeath;
772        }
773
774        public boolean hasContributedToDeathElement() { 
775          return this.contributedToDeath != null && !this.contributedToDeath.isEmpty();
776        }
777
778        public boolean hasContributedToDeath() { 
779          return this.contributedToDeath != null && !this.contributedToDeath.isEmpty();
780        }
781
782        /**
783         * @param value {@link #contributedToDeath} (This procedure contributed to the cause of death of the related person. If contributedToDeath is not populated, then it is unknown.). This is the underlying object with id, value and extensions. The accessor "getContributedToDeath" gives direct access to the value
784         */
785        public FamilyMemberHistoryProcedureComponent setContributedToDeathElement(BooleanType value) { 
786          this.contributedToDeath = value;
787          return this;
788        }
789
790        /**
791         * @return This procedure contributed to the cause of death of the related person. If contributedToDeath is not populated, then it is unknown.
792         */
793        public boolean getContributedToDeath() { 
794          return this.contributedToDeath == null || this.contributedToDeath.isEmpty() ? false : this.contributedToDeath.getValue();
795        }
796
797        /**
798         * @param value This procedure contributed to the cause of death of the related person. If contributedToDeath is not populated, then it is unknown.
799         */
800        public FamilyMemberHistoryProcedureComponent setContributedToDeath(boolean value) { 
801            if (this.contributedToDeath == null)
802              this.contributedToDeath = new BooleanType();
803            this.contributedToDeath.setValue(value);
804          return this;
805        }
806
807        /**
808         * @return {@link #performed} (Estimated or actual date, date-time, period, or age when the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.)
809         */
810        public DataType getPerformed() { 
811          return this.performed;
812        }
813
814        /**
815         * @return {@link #performed} (Estimated or actual date, date-time, period, or age when the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.)
816         */
817        public Age getPerformedAge() throws FHIRException { 
818          if (this.performed == null)
819            this.performed = new Age();
820          if (!(this.performed instanceof Age))
821            throw new FHIRException("Type mismatch: the type Age was expected, but "+this.performed.getClass().getName()+" was encountered");
822          return (Age) this.performed;
823        }
824
825        public boolean hasPerformedAge() { 
826          return this != null && this.performed instanceof Age;
827        }
828
829        /**
830         * @return {@link #performed} (Estimated or actual date, date-time, period, or age when the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.)
831         */
832        public Range getPerformedRange() throws FHIRException { 
833          if (this.performed == null)
834            this.performed = new Range();
835          if (!(this.performed instanceof Range))
836            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.performed.getClass().getName()+" was encountered");
837          return (Range) this.performed;
838        }
839
840        public boolean hasPerformedRange() { 
841          return this != null && this.performed instanceof Range;
842        }
843
844        /**
845         * @return {@link #performed} (Estimated or actual date, date-time, period, or age when the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.)
846         */
847        public Period getPerformedPeriod() throws FHIRException { 
848          if (this.performed == null)
849            this.performed = new Period();
850          if (!(this.performed instanceof Period))
851            throw new FHIRException("Type mismatch: the type Period was expected, but "+this.performed.getClass().getName()+" was encountered");
852          return (Period) this.performed;
853        }
854
855        public boolean hasPerformedPeriod() { 
856          return this != null && this.performed instanceof Period;
857        }
858
859        /**
860         * @return {@link #performed} (Estimated or actual date, date-time, period, or age when the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.)
861         */
862        public StringType getPerformedStringType() throws FHIRException { 
863          if (this.performed == null)
864            this.performed = new StringType();
865          if (!(this.performed instanceof StringType))
866            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.performed.getClass().getName()+" was encountered");
867          return (StringType) this.performed;
868        }
869
870        public boolean hasPerformedStringType() { 
871          return this != null && this.performed instanceof StringType;
872        }
873
874        /**
875         * @return {@link #performed} (Estimated or actual date, date-time, period, or age when the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.)
876         */
877        public DateTimeType getPerformedDateTimeType() throws FHIRException { 
878          if (this.performed == null)
879            this.performed = new DateTimeType();
880          if (!(this.performed instanceof DateTimeType))
881            throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.performed.getClass().getName()+" was encountered");
882          return (DateTimeType) this.performed;
883        }
884
885        public boolean hasPerformedDateTimeType() { 
886          return this != null && this.performed instanceof DateTimeType;
887        }
888
889        public boolean hasPerformed() { 
890          return this.performed != null && !this.performed.isEmpty();
891        }
892
893        /**
894         * @param value {@link #performed} (Estimated or actual date, date-time, period, or age when the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.)
895         */
896        public FamilyMemberHistoryProcedureComponent setPerformed(DataType value) { 
897          if (value != null && !(value instanceof Age || value instanceof Range || value instanceof Period || value instanceof StringType || value instanceof DateTimeType))
898            throw new Error("Not the right type for FamilyMemberHistory.procedure.performed[x]: "+value.fhirType());
899          this.performed = value;
900          return this;
901        }
902
903        /**
904         * @return {@link #note} (An area where general notes can be placed about this specific procedure.)
905         */
906        public List<Annotation> getNote() { 
907          if (this.note == null)
908            this.note = new ArrayList<Annotation>();
909          return this.note;
910        }
911
912        /**
913         * @return Returns a reference to <code>this</code> for easy method chaining
914         */
915        public FamilyMemberHistoryProcedureComponent setNote(List<Annotation> theNote) { 
916          this.note = theNote;
917          return this;
918        }
919
920        public boolean hasNote() { 
921          if (this.note == null)
922            return false;
923          for (Annotation item : this.note)
924            if (!item.isEmpty())
925              return true;
926          return false;
927        }
928
929        public Annotation addNote() { //3
930          Annotation t = new Annotation();
931          if (this.note == null)
932            this.note = new ArrayList<Annotation>();
933          this.note.add(t);
934          return t;
935        }
936
937        public FamilyMemberHistoryProcedureComponent addNote(Annotation t) { //3
938          if (t == null)
939            return this;
940          if (this.note == null)
941            this.note = new ArrayList<Annotation>();
942          this.note.add(t);
943          return this;
944        }
945
946        /**
947         * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
948         */
949        public Annotation getNoteFirstRep() { 
950          if (getNote().isEmpty()) {
951            addNote();
952          }
953          return getNote().get(0);
954        }
955
956        protected void listChildren(List<Property> children) {
957          super.listChildren(children);
958          children.add(new Property("code", "CodeableConcept", "The actual procedure specified. Could be a coded procedure or a less specific string depending on how much is known about the procedure and the capabilities of the creating system.", 0, 1, code));
959          children.add(new Property("outcome", "CodeableConcept", "Indicates what happened following the procedure. If the procedure resulted in death, deceased date is captured on the relation.", 0, 1, outcome));
960          children.add(new Property("contributedToDeath", "boolean", "This procedure contributed to the cause of death of the related person. If contributedToDeath is not populated, then it is unknown.", 0, 1, contributedToDeath));
961          children.add(new Property("performed[x]", "Age|Range|Period|string|dateTime", "Estimated or actual date, date-time, period, or age when the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.", 0, 1, performed));
962          children.add(new Property("note", "Annotation", "An area where general notes can be placed about this specific procedure.", 0, java.lang.Integer.MAX_VALUE, note));
963        }
964
965        @Override
966        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
967          switch (_hash) {
968          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "The actual procedure specified. Could be a coded procedure or a less specific string depending on how much is known about the procedure and the capabilities of the creating system.", 0, 1, code);
969          case -1106507950: /*outcome*/  return new Property("outcome", "CodeableConcept", "Indicates what happened following the procedure. If the procedure resulted in death, deceased date is captured on the relation.", 0, 1, outcome);
970          case -363644638: /*contributedToDeath*/  return new Property("contributedToDeath", "boolean", "This procedure contributed to the cause of death of the related person. If contributedToDeath is not populated, then it is unknown.", 0, 1, contributedToDeath);
971          case 1355984064: /*performed[x]*/  return new Property("performed[x]", "Age|Range|Period|string|dateTime", "Estimated or actual date, date-time, period, or age when the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.", 0, 1, performed);
972          case 481140672: /*performed*/  return new Property("performed[x]", "Age|Range|Period|string|dateTime", "Estimated or actual date, date-time, period, or age when the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.", 0, 1, performed);
973          case 1355958559: /*performedAge*/  return new Property("performed[x]", "Age", "Estimated or actual date, date-time, period, or age when the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.", 0, 1, performed);
974          case 1716617565: /*performedRange*/  return new Property("performed[x]", "Range", "Estimated or actual date, date-time, period, or age when the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.", 0, 1, performed);
975          case 1622094241: /*performedPeriod*/  return new Property("performed[x]", "Period", "Estimated or actual date, date-time, period, or age when the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.", 0, 1, performed);
976          case 1721834481: /*performedString*/  return new Property("performed[x]", "string", "Estimated or actual date, date-time, period, or age when the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.", 0, 1, performed);
977          case 1118270331: /*performedDateTime*/  return new Property("performed[x]", "dateTime", "Estimated or actual date, date-time, period, or age when the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.", 0, 1, performed);
978          case 3387378: /*note*/  return new Property("note", "Annotation", "An area where general notes can be placed about this specific procedure.", 0, java.lang.Integer.MAX_VALUE, note);
979          default: return super.getNamedProperty(_hash, _name, _checkValid);
980          }
981
982        }
983
984      @Override
985      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
986        switch (hash) {
987        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
988        case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // CodeableConcept
989        case -363644638: /*contributedToDeath*/ return this.contributedToDeath == null ? new Base[0] : new Base[] {this.contributedToDeath}; // BooleanType
990        case 481140672: /*performed*/ return this.performed == null ? new Base[0] : new Base[] {this.performed}; // DataType
991        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
992        default: return super.getProperty(hash, name, checkValid);
993        }
994
995      }
996
997      @Override
998      public Base setProperty(int hash, String name, Base value) throws FHIRException {
999        switch (hash) {
1000        case 3059181: // code
1001          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1002          return value;
1003        case -1106507950: // outcome
1004          this.outcome = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1005          return value;
1006        case -363644638: // contributedToDeath
1007          this.contributedToDeath = TypeConvertor.castToBoolean(value); // BooleanType
1008          return value;
1009        case 481140672: // performed
1010          this.performed = TypeConvertor.castToType(value); // DataType
1011          return value;
1012        case 3387378: // note
1013          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
1014          return value;
1015        default: return super.setProperty(hash, name, value);
1016        }
1017
1018      }
1019
1020      @Override
1021      public Base setProperty(String name, Base value) throws FHIRException {
1022        if (name.equals("code")) {
1023          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1024        } else if (name.equals("outcome")) {
1025          this.outcome = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1026        } else if (name.equals("contributedToDeath")) {
1027          this.contributedToDeath = TypeConvertor.castToBoolean(value); // BooleanType
1028        } else if (name.equals("performed[x]")) {
1029          this.performed = TypeConvertor.castToType(value); // DataType
1030        } else if (name.equals("note")) {
1031          this.getNote().add(TypeConvertor.castToAnnotation(value));
1032        } else
1033          return super.setProperty(name, value);
1034        return value;
1035      }
1036
1037      @Override
1038      public Base makeProperty(int hash, String name) throws FHIRException {
1039        switch (hash) {
1040        case 3059181:  return getCode();
1041        case -1106507950:  return getOutcome();
1042        case -363644638:  return getContributedToDeathElement();
1043        case 1355984064:  return getPerformed();
1044        case 481140672:  return getPerformed();
1045        case 3387378:  return addNote(); 
1046        default: return super.makeProperty(hash, name);
1047        }
1048
1049      }
1050
1051      @Override
1052      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1053        switch (hash) {
1054        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
1055        case -1106507950: /*outcome*/ return new String[] {"CodeableConcept"};
1056        case -363644638: /*contributedToDeath*/ return new String[] {"boolean"};
1057        case 481140672: /*performed*/ return new String[] {"Age", "Range", "Period", "string", "dateTime"};
1058        case 3387378: /*note*/ return new String[] {"Annotation"};
1059        default: return super.getTypesForProperty(hash, name);
1060        }
1061
1062      }
1063
1064      @Override
1065      public Base addChild(String name) throws FHIRException {
1066        if (name.equals("code")) {
1067          this.code = new CodeableConcept();
1068          return this.code;
1069        }
1070        else if (name.equals("outcome")) {
1071          this.outcome = new CodeableConcept();
1072          return this.outcome;
1073        }
1074        else if (name.equals("contributedToDeath")) {
1075          throw new FHIRException("Cannot call addChild on a primitive type FamilyMemberHistory.procedure.contributedToDeath");
1076        }
1077        else if (name.equals("performedAge")) {
1078          this.performed = new Age();
1079          return this.performed;
1080        }
1081        else if (name.equals("performedRange")) {
1082          this.performed = new Range();
1083          return this.performed;
1084        }
1085        else if (name.equals("performedPeriod")) {
1086          this.performed = new Period();
1087          return this.performed;
1088        }
1089        else if (name.equals("performedString")) {
1090          this.performed = new StringType();
1091          return this.performed;
1092        }
1093        else if (name.equals("performedDateTime")) {
1094          this.performed = new DateTimeType();
1095          return this.performed;
1096        }
1097        else if (name.equals("note")) {
1098          return addNote();
1099        }
1100        else
1101          return super.addChild(name);
1102      }
1103
1104      public FamilyMemberHistoryProcedureComponent copy() {
1105        FamilyMemberHistoryProcedureComponent dst = new FamilyMemberHistoryProcedureComponent();
1106        copyValues(dst);
1107        return dst;
1108      }
1109
1110      public void copyValues(FamilyMemberHistoryProcedureComponent dst) {
1111        super.copyValues(dst);
1112        dst.code = code == null ? null : code.copy();
1113        dst.outcome = outcome == null ? null : outcome.copy();
1114        dst.contributedToDeath = contributedToDeath == null ? null : contributedToDeath.copy();
1115        dst.performed = performed == null ? null : performed.copy();
1116        if (note != null) {
1117          dst.note = new ArrayList<Annotation>();
1118          for (Annotation i : note)
1119            dst.note.add(i.copy());
1120        };
1121      }
1122
1123      @Override
1124      public boolean equalsDeep(Base other_) {
1125        if (!super.equalsDeep(other_))
1126          return false;
1127        if (!(other_ instanceof FamilyMemberHistoryProcedureComponent))
1128          return false;
1129        FamilyMemberHistoryProcedureComponent o = (FamilyMemberHistoryProcedureComponent) other_;
1130        return compareDeep(code, o.code, true) && compareDeep(outcome, o.outcome, true) && compareDeep(contributedToDeath, o.contributedToDeath, true)
1131           && compareDeep(performed, o.performed, true) && compareDeep(note, o.note, true);
1132      }
1133
1134      @Override
1135      public boolean equalsShallow(Base other_) {
1136        if (!super.equalsShallow(other_))
1137          return false;
1138        if (!(other_ instanceof FamilyMemberHistoryProcedureComponent))
1139          return false;
1140        FamilyMemberHistoryProcedureComponent o = (FamilyMemberHistoryProcedureComponent) other_;
1141        return compareValues(contributedToDeath, o.contributedToDeath, true);
1142      }
1143
1144      public boolean isEmpty() {
1145        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, outcome, contributedToDeath
1146          , performed, note);
1147      }
1148
1149  public String fhirType() {
1150    return "FamilyMemberHistory.procedure";
1151
1152  }
1153
1154  }
1155
1156    /**
1157     * Business identifiers assigned to this family member history by the performer or other systems which remain constant as the resource is updated and propagates from server to server.
1158     */
1159    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1160    @Description(shortDefinition="External Id(s) for this record", formalDefinition="Business identifiers assigned to this family member history by the performer or other systems which remain constant as the resource is updated and propagates from server to server." )
1161    protected List<Identifier> identifier;
1162
1163    /**
1164     * The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory.
1165     */
1166    @Child(name = "instantiatesCanonical", type = {CanonicalType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1167    @Description(shortDefinition="Instantiates FHIR protocol or definition", formalDefinition="The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory." )
1168    protected List<CanonicalType> instantiatesCanonical;
1169
1170    /**
1171     * The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory.
1172     */
1173    @Child(name = "instantiatesUri", type = {UriType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1174    @Description(shortDefinition="Instantiates external protocol or definition", formalDefinition="The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory." )
1175    protected List<UriType> instantiatesUri;
1176
1177    /**
1178     * A code specifying the status of the record of the family history of a specific family member.
1179     */
1180    @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=true)
1181    @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." )
1182    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/history-status")
1183    protected Enumeration<FamilyHistoryStatus> status;
1184
1185    /**
1186     * Describes why the family member's history is not available.
1187     */
1188    @Child(name = "dataAbsentReason", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true)
1189    @Description(shortDefinition="subject-unknown | withheld | unable-to-obtain | deferred", formalDefinition="Describes why the family member's history is not available." )
1190    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/history-absent-reason")
1191    protected CodeableConcept dataAbsentReason;
1192
1193    /**
1194     * The person who this history concerns.
1195     */
1196    @Child(name = "patient", type = {Patient.class}, order=5, min=1, max=1, modifier=false, summary=true)
1197    @Description(shortDefinition="Patient history is about", formalDefinition="The person who this history concerns." )
1198    protected Reference patient;
1199
1200    /**
1201     * The date (and possibly time) when the family member history was recorded or last updated.
1202     */
1203    @Child(name = "date", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true)
1204    @Description(shortDefinition="When history was recorded or last updated", formalDefinition="The date (and possibly time) when the family member history was recorded or last updated." )
1205    protected DateTimeType date;
1206
1207    /**
1208     * This will either be a name or a description; e.g. "Aunt Susan", "my cousin with the red hair".
1209     */
1210    @Child(name = "name", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true)
1211    @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\"." )
1212    protected StringType name;
1213
1214    /**
1215     * The type of relationship this person has to the patient (father, mother, brother etc.).
1216     */
1217    @Child(name = "relationship", type = {CodeableConcept.class}, order=8, min=1, max=1, modifier=false, summary=true)
1218    @Description(shortDefinition="Relationship to the subject", formalDefinition="The type of relationship this person has to the patient (father, mother, brother etc.)." )
1219    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://terminology.hl7.org/ValueSet/v3-FamilyMember")
1220    protected CodeableConcept relationship;
1221
1222    /**
1223     * The birth sex of the family member.
1224     */
1225    @Child(name = "sex", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=true)
1226    @Description(shortDefinition="male | female | other | unknown", formalDefinition="The birth sex of the family member." )
1227    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/administrative-gender")
1228    protected CodeableConcept sex;
1229
1230    /**
1231     * The actual or approximate date of birth of the relative.
1232     */
1233    @Child(name = "born", type = {Period.class, DateType.class, StringType.class}, order=10, min=0, max=1, modifier=false, summary=false)
1234    @Description(shortDefinition="(approximate) date of birth", formalDefinition="The actual or approximate date of birth of the relative." )
1235    protected DataType born;
1236
1237    /**
1238     * The age of the relative at the time the family member history is recorded.
1239     */
1240    @Child(name = "age", type = {Age.class, Range.class, StringType.class}, order=11, min=0, max=1, modifier=false, summary=true)
1241    @Description(shortDefinition="(approximate) age", formalDefinition="The age of the relative at the time the family member history is recorded." )
1242    protected DataType age;
1243
1244    /**
1245     * If true, indicates that the age value specified is an estimated value.
1246     */
1247    @Child(name = "estimatedAge", type = {BooleanType.class}, order=12, min=0, max=1, modifier=false, summary=true)
1248    @Description(shortDefinition="Age is estimated?", formalDefinition="If true, indicates that the age value specified is an estimated value." )
1249    protected BooleanType estimatedAge;
1250
1251    /**
1252     * Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.
1253     */
1254    @Child(name = "deceased", type = {BooleanType.class, Age.class, Range.class, DateType.class, StringType.class}, order=13, min=0, max=1, modifier=false, summary=true)
1255    @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." )
1256    protected DataType deceased;
1257
1258    /**
1259     * Describes why the family member history occurred in coded or textual form, or Indicates a Condition, Observation, AllergyIntolerance, or QuestionnaireResponse that justifies this family member history event.
1260     */
1261    @Child(name = "reason", type = {CodeableReference.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1262    @Description(shortDefinition="Why was family member history performed?", formalDefinition="Describes why the family member history occurred in coded or textual form, or Indicates a Condition, Observation, AllergyIntolerance, or QuestionnaireResponse that justifies this family member history event." )
1263    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/clinical-findings")
1264    protected List<CodeableReference> reason;
1265
1266    /**
1267     * 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.
1268     */
1269    @Child(name = "note", type = {Annotation.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1270    @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." )
1271    protected List<Annotation> note;
1272
1273    /**
1274     * 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.
1275     */
1276    @Child(name = "condition", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1277    @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." )
1278    protected List<FamilyMemberHistoryConditionComponent> condition;
1279
1280    /**
1281     * The significant Procedures (or procedure) that the family member had. This is a repeating section to allow a system to represent more than one procedure per resource, though there is nothing stopping multiple resources - one per procedure.
1282     */
1283    @Child(name = "procedure", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1284    @Description(shortDefinition="Procedures that the related person had", formalDefinition="The significant Procedures (or procedure) that the family member had. This is a repeating section to allow a system to represent more than one procedure per resource, though there is nothing stopping multiple resources - one per procedure." )
1285    protected List<FamilyMemberHistoryProcedureComponent> procedure;
1286
1287    private static final long serialVersionUID = -1281000216L;
1288
1289  /**
1290   * Constructor
1291   */
1292    public FamilyMemberHistory() {
1293      super();
1294    }
1295
1296  /**
1297   * Constructor
1298   */
1299    public FamilyMemberHistory(FamilyHistoryStatus status, Reference patient, CodeableConcept relationship) {
1300      super();
1301      this.setStatus(status);
1302      this.setPatient(patient);
1303      this.setRelationship(relationship);
1304    }
1305
1306    /**
1307     * @return {@link #identifier} (Business identifiers assigned to this family member history by the performer or other systems which remain constant as the resource is updated and propagates from server to server.)
1308     */
1309    public List<Identifier> getIdentifier() { 
1310      if (this.identifier == null)
1311        this.identifier = new ArrayList<Identifier>();
1312      return this.identifier;
1313    }
1314
1315    /**
1316     * @return Returns a reference to <code>this</code> for easy method chaining
1317     */
1318    public FamilyMemberHistory setIdentifier(List<Identifier> theIdentifier) { 
1319      this.identifier = theIdentifier;
1320      return this;
1321    }
1322
1323    public boolean hasIdentifier() { 
1324      if (this.identifier == null)
1325        return false;
1326      for (Identifier item : this.identifier)
1327        if (!item.isEmpty())
1328          return true;
1329      return false;
1330    }
1331
1332    public Identifier addIdentifier() { //3
1333      Identifier t = new Identifier();
1334      if (this.identifier == null)
1335        this.identifier = new ArrayList<Identifier>();
1336      this.identifier.add(t);
1337      return t;
1338    }
1339
1340    public FamilyMemberHistory addIdentifier(Identifier t) { //3
1341      if (t == null)
1342        return this;
1343      if (this.identifier == null)
1344        this.identifier = new ArrayList<Identifier>();
1345      this.identifier.add(t);
1346      return this;
1347    }
1348
1349    /**
1350     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
1351     */
1352    public Identifier getIdentifierFirstRep() { 
1353      if (getIdentifier().isEmpty()) {
1354        addIdentifier();
1355      }
1356      return getIdentifier().get(0);
1357    }
1358
1359    /**
1360     * @return {@link #instantiatesCanonical} (The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory.)
1361     */
1362    public List<CanonicalType> getInstantiatesCanonical() { 
1363      if (this.instantiatesCanonical == null)
1364        this.instantiatesCanonical = new ArrayList<CanonicalType>();
1365      return this.instantiatesCanonical;
1366    }
1367
1368    /**
1369     * @return Returns a reference to <code>this</code> for easy method chaining
1370     */
1371    public FamilyMemberHistory setInstantiatesCanonical(List<CanonicalType> theInstantiatesCanonical) { 
1372      this.instantiatesCanonical = theInstantiatesCanonical;
1373      return this;
1374    }
1375
1376    public boolean hasInstantiatesCanonical() { 
1377      if (this.instantiatesCanonical == null)
1378        return false;
1379      for (CanonicalType item : this.instantiatesCanonical)
1380        if (!item.isEmpty())
1381          return true;
1382      return false;
1383    }
1384
1385    /**
1386     * @return {@link #instantiatesCanonical} (The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory.)
1387     */
1388    public CanonicalType addInstantiatesCanonicalElement() {//2 
1389      CanonicalType t = new CanonicalType();
1390      if (this.instantiatesCanonical == null)
1391        this.instantiatesCanonical = new ArrayList<CanonicalType>();
1392      this.instantiatesCanonical.add(t);
1393      return t;
1394    }
1395
1396    /**
1397     * @param value {@link #instantiatesCanonical} (The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory.)
1398     */
1399    public FamilyMemberHistory addInstantiatesCanonical(String value) { //1
1400      CanonicalType t = new CanonicalType();
1401      t.setValue(value);
1402      if (this.instantiatesCanonical == null)
1403        this.instantiatesCanonical = new ArrayList<CanonicalType>();
1404      this.instantiatesCanonical.add(t);
1405      return this;
1406    }
1407
1408    /**
1409     * @param value {@link #instantiatesCanonical} (The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory.)
1410     */
1411    public boolean hasInstantiatesCanonical(String value) { 
1412      if (this.instantiatesCanonical == null)
1413        return false;
1414      for (CanonicalType v : this.instantiatesCanonical)
1415        if (v.getValue().equals(value)) // canonical
1416          return true;
1417      return false;
1418    }
1419
1420    /**
1421     * @return {@link #instantiatesUri} (The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory.)
1422     */
1423    public List<UriType> getInstantiatesUri() { 
1424      if (this.instantiatesUri == null)
1425        this.instantiatesUri = new ArrayList<UriType>();
1426      return this.instantiatesUri;
1427    }
1428
1429    /**
1430     * @return Returns a reference to <code>this</code> for easy method chaining
1431     */
1432    public FamilyMemberHistory setInstantiatesUri(List<UriType> theInstantiatesUri) { 
1433      this.instantiatesUri = theInstantiatesUri;
1434      return this;
1435    }
1436
1437    public boolean hasInstantiatesUri() { 
1438      if (this.instantiatesUri == null)
1439        return false;
1440      for (UriType item : this.instantiatesUri)
1441        if (!item.isEmpty())
1442          return true;
1443      return false;
1444    }
1445
1446    /**
1447     * @return {@link #instantiatesUri} (The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory.)
1448     */
1449    public UriType addInstantiatesUriElement() {//2 
1450      UriType t = new UriType();
1451      if (this.instantiatesUri == null)
1452        this.instantiatesUri = new ArrayList<UriType>();
1453      this.instantiatesUri.add(t);
1454      return t;
1455    }
1456
1457    /**
1458     * @param value {@link #instantiatesUri} (The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory.)
1459     */
1460    public FamilyMemberHistory addInstantiatesUri(String value) { //1
1461      UriType t = new UriType();
1462      t.setValue(value);
1463      if (this.instantiatesUri == null)
1464        this.instantiatesUri = new ArrayList<UriType>();
1465      this.instantiatesUri.add(t);
1466      return this;
1467    }
1468
1469    /**
1470     * @param value {@link #instantiatesUri} (The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory.)
1471     */
1472    public boolean hasInstantiatesUri(String value) { 
1473      if (this.instantiatesUri == null)
1474        return false;
1475      for (UriType v : this.instantiatesUri)
1476        if (v.getValue().equals(value)) // uri
1477          return true;
1478      return false;
1479    }
1480
1481    /**
1482     * @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
1483     */
1484    public Enumeration<FamilyHistoryStatus> getStatusElement() { 
1485      if (this.status == null)
1486        if (Configuration.errorOnAutoCreate())
1487          throw new Error("Attempt to auto-create FamilyMemberHistory.status");
1488        else if (Configuration.doAutoCreate())
1489          this.status = new Enumeration<FamilyHistoryStatus>(new FamilyHistoryStatusEnumFactory()); // bb
1490      return this.status;
1491    }
1492
1493    public boolean hasStatusElement() { 
1494      return this.status != null && !this.status.isEmpty();
1495    }
1496
1497    public boolean hasStatus() { 
1498      return this.status != null && !this.status.isEmpty();
1499    }
1500
1501    /**
1502     * @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
1503     */
1504    public FamilyMemberHistory setStatusElement(Enumeration<FamilyHistoryStatus> value) { 
1505      this.status = value;
1506      return this;
1507    }
1508
1509    /**
1510     * @return A code specifying the status of the record of the family history of a specific family member.
1511     */
1512    public FamilyHistoryStatus getStatus() { 
1513      return this.status == null ? null : this.status.getValue();
1514    }
1515
1516    /**
1517     * @param value A code specifying the status of the record of the family history of a specific family member.
1518     */
1519    public FamilyMemberHistory setStatus(FamilyHistoryStatus value) { 
1520        if (this.status == null)
1521          this.status = new Enumeration<FamilyHistoryStatus>(new FamilyHistoryStatusEnumFactory());
1522        this.status.setValue(value);
1523      return this;
1524    }
1525
1526    /**
1527     * @return {@link #dataAbsentReason} (Describes why the family member's history is not available.)
1528     */
1529    public CodeableConcept getDataAbsentReason() { 
1530      if (this.dataAbsentReason == null)
1531        if (Configuration.errorOnAutoCreate())
1532          throw new Error("Attempt to auto-create FamilyMemberHistory.dataAbsentReason");
1533        else if (Configuration.doAutoCreate())
1534          this.dataAbsentReason = new CodeableConcept(); // cc
1535      return this.dataAbsentReason;
1536    }
1537
1538    public boolean hasDataAbsentReason() { 
1539      return this.dataAbsentReason != null && !this.dataAbsentReason.isEmpty();
1540    }
1541
1542    /**
1543     * @param value {@link #dataAbsentReason} (Describes why the family member's history is not available.)
1544     */
1545    public FamilyMemberHistory setDataAbsentReason(CodeableConcept value) { 
1546      this.dataAbsentReason = value;
1547      return this;
1548    }
1549
1550    /**
1551     * @return {@link #patient} (The person who this history concerns.)
1552     */
1553    public Reference getPatient() { 
1554      if (this.patient == null)
1555        if (Configuration.errorOnAutoCreate())
1556          throw new Error("Attempt to auto-create FamilyMemberHistory.patient");
1557        else if (Configuration.doAutoCreate())
1558          this.patient = new Reference(); // cc
1559      return this.patient;
1560    }
1561
1562    public boolean hasPatient() { 
1563      return this.patient != null && !this.patient.isEmpty();
1564    }
1565
1566    /**
1567     * @param value {@link #patient} (The person who this history concerns.)
1568     */
1569    public FamilyMemberHistory setPatient(Reference value) { 
1570      this.patient = value;
1571      return this;
1572    }
1573
1574    /**
1575     * @return {@link #date} (The date (and possibly time) when the family member history was recorded or last updated.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
1576     */
1577    public DateTimeType getDateElement() { 
1578      if (this.date == null)
1579        if (Configuration.errorOnAutoCreate())
1580          throw new Error("Attempt to auto-create FamilyMemberHistory.date");
1581        else if (Configuration.doAutoCreate())
1582          this.date = new DateTimeType(); // bb
1583      return this.date;
1584    }
1585
1586    public boolean hasDateElement() { 
1587      return this.date != null && !this.date.isEmpty();
1588    }
1589
1590    public boolean hasDate() { 
1591      return this.date != null && !this.date.isEmpty();
1592    }
1593
1594    /**
1595     * @param value {@link #date} (The date (and possibly time) when the family member history was recorded or last updated.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
1596     */
1597    public FamilyMemberHistory setDateElement(DateTimeType value) { 
1598      this.date = value;
1599      return this;
1600    }
1601
1602    /**
1603     * @return The date (and possibly time) when the family member history was recorded or last updated.
1604     */
1605    public Date getDate() { 
1606      return this.date == null ? null : this.date.getValue();
1607    }
1608
1609    /**
1610     * @param value The date (and possibly time) when the family member history was recorded or last updated.
1611     */
1612    public FamilyMemberHistory setDate(Date value) { 
1613      if (value == null)
1614        this.date = null;
1615      else {
1616        if (this.date == null)
1617          this.date = new DateTimeType();
1618        this.date.setValue(value);
1619      }
1620      return this;
1621    }
1622
1623    /**
1624     * @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
1625     */
1626    public StringType getNameElement() { 
1627      if (this.name == null)
1628        if (Configuration.errorOnAutoCreate())
1629          throw new Error("Attempt to auto-create FamilyMemberHistory.name");
1630        else if (Configuration.doAutoCreate())
1631          this.name = new StringType(); // bb
1632      return this.name;
1633    }
1634
1635    public boolean hasNameElement() { 
1636      return this.name != null && !this.name.isEmpty();
1637    }
1638
1639    public boolean hasName() { 
1640      return this.name != null && !this.name.isEmpty();
1641    }
1642
1643    /**
1644     * @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
1645     */
1646    public FamilyMemberHistory setNameElement(StringType value) { 
1647      this.name = value;
1648      return this;
1649    }
1650
1651    /**
1652     * @return This will either be a name or a description; e.g. "Aunt Susan", "my cousin with the red hair".
1653     */
1654    public String getName() { 
1655      return this.name == null ? null : this.name.getValue();
1656    }
1657
1658    /**
1659     * @param value This will either be a name or a description; e.g. "Aunt Susan", "my cousin with the red hair".
1660     */
1661    public FamilyMemberHistory setName(String value) { 
1662      if (Utilities.noString(value))
1663        this.name = null;
1664      else {
1665        if (this.name == null)
1666          this.name = new StringType();
1667        this.name.setValue(value);
1668      }
1669      return this;
1670    }
1671
1672    /**
1673     * @return {@link #relationship} (The type of relationship this person has to the patient (father, mother, brother etc.).)
1674     */
1675    public CodeableConcept getRelationship() { 
1676      if (this.relationship == null)
1677        if (Configuration.errorOnAutoCreate())
1678          throw new Error("Attempt to auto-create FamilyMemberHistory.relationship");
1679        else if (Configuration.doAutoCreate())
1680          this.relationship = new CodeableConcept(); // cc
1681      return this.relationship;
1682    }
1683
1684    public boolean hasRelationship() { 
1685      return this.relationship != null && !this.relationship.isEmpty();
1686    }
1687
1688    /**
1689     * @param value {@link #relationship} (The type of relationship this person has to the patient (father, mother, brother etc.).)
1690     */
1691    public FamilyMemberHistory setRelationship(CodeableConcept value) { 
1692      this.relationship = value;
1693      return this;
1694    }
1695
1696    /**
1697     * @return {@link #sex} (The birth sex of the family member.)
1698     */
1699    public CodeableConcept getSex() { 
1700      if (this.sex == null)
1701        if (Configuration.errorOnAutoCreate())
1702          throw new Error("Attempt to auto-create FamilyMemberHistory.sex");
1703        else if (Configuration.doAutoCreate())
1704          this.sex = new CodeableConcept(); // cc
1705      return this.sex;
1706    }
1707
1708    public boolean hasSex() { 
1709      return this.sex != null && !this.sex.isEmpty();
1710    }
1711
1712    /**
1713     * @param value {@link #sex} (The birth sex of the family member.)
1714     */
1715    public FamilyMemberHistory setSex(CodeableConcept value) { 
1716      this.sex = value;
1717      return this;
1718    }
1719
1720    /**
1721     * @return {@link #born} (The actual or approximate date of birth of the relative.)
1722     */
1723    public DataType getBorn() { 
1724      return this.born;
1725    }
1726
1727    /**
1728     * @return {@link #born} (The actual or approximate date of birth of the relative.)
1729     */
1730    public Period getBornPeriod() throws FHIRException { 
1731      if (this.born == null)
1732        this.born = new Period();
1733      if (!(this.born instanceof Period))
1734        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.born.getClass().getName()+" was encountered");
1735      return (Period) this.born;
1736    }
1737
1738    public boolean hasBornPeriod() { 
1739      return this != null && this.born instanceof Period;
1740    }
1741
1742    /**
1743     * @return {@link #born} (The actual or approximate date of birth of the relative.)
1744     */
1745    public DateType getBornDateType() throws FHIRException { 
1746      if (this.born == null)
1747        this.born = new DateType();
1748      if (!(this.born instanceof DateType))
1749        throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.born.getClass().getName()+" was encountered");
1750      return (DateType) this.born;
1751    }
1752
1753    public boolean hasBornDateType() { 
1754      return this != null && this.born instanceof DateType;
1755    }
1756
1757    /**
1758     * @return {@link #born} (The actual or approximate date of birth of the relative.)
1759     */
1760    public StringType getBornStringType() throws FHIRException { 
1761      if (this.born == null)
1762        this.born = new StringType();
1763      if (!(this.born instanceof StringType))
1764        throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.born.getClass().getName()+" was encountered");
1765      return (StringType) this.born;
1766    }
1767
1768    public boolean hasBornStringType() { 
1769      return this != null && this.born instanceof StringType;
1770    }
1771
1772    public boolean hasBorn() { 
1773      return this.born != null && !this.born.isEmpty();
1774    }
1775
1776    /**
1777     * @param value {@link #born} (The actual or approximate date of birth of the relative.)
1778     */
1779    public FamilyMemberHistory setBorn(DataType value) { 
1780      if (value != null && !(value instanceof Period || value instanceof DateType || value instanceof StringType))
1781        throw new Error("Not the right type for FamilyMemberHistory.born[x]: "+value.fhirType());
1782      this.born = value;
1783      return this;
1784    }
1785
1786    /**
1787     * @return {@link #age} (The age of the relative at the time the family member history is recorded.)
1788     */
1789    public DataType getAge() { 
1790      return this.age;
1791    }
1792
1793    /**
1794     * @return {@link #age} (The age of the relative at the time the family member history is recorded.)
1795     */
1796    public Age getAgeAge() throws FHIRException { 
1797      if (this.age == null)
1798        this.age = new Age();
1799      if (!(this.age instanceof Age))
1800        throw new FHIRException("Type mismatch: the type Age was expected, but "+this.age.getClass().getName()+" was encountered");
1801      return (Age) this.age;
1802    }
1803
1804    public boolean hasAgeAge() { 
1805      return this != null && this.age instanceof Age;
1806    }
1807
1808    /**
1809     * @return {@link #age} (The age of the relative at the time the family member history is recorded.)
1810     */
1811    public Range getAgeRange() throws FHIRException { 
1812      if (this.age == null)
1813        this.age = new Range();
1814      if (!(this.age instanceof Range))
1815        throw new FHIRException("Type mismatch: the type Range was expected, but "+this.age.getClass().getName()+" was encountered");
1816      return (Range) this.age;
1817    }
1818
1819    public boolean hasAgeRange() { 
1820      return this != null && this.age instanceof Range;
1821    }
1822
1823    /**
1824     * @return {@link #age} (The age of the relative at the time the family member history is recorded.)
1825     */
1826    public StringType getAgeStringType() throws FHIRException { 
1827      if (this.age == null)
1828        this.age = new StringType();
1829      if (!(this.age instanceof StringType))
1830        throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.age.getClass().getName()+" was encountered");
1831      return (StringType) this.age;
1832    }
1833
1834    public boolean hasAgeStringType() { 
1835      return this != null && this.age instanceof StringType;
1836    }
1837
1838    public boolean hasAge() { 
1839      return this.age != null && !this.age.isEmpty();
1840    }
1841
1842    /**
1843     * @param value {@link #age} (The age of the relative at the time the family member history is recorded.)
1844     */
1845    public FamilyMemberHistory setAge(DataType value) { 
1846      if (value != null && !(value instanceof Age || value instanceof Range || value instanceof StringType))
1847        throw new Error("Not the right type for FamilyMemberHistory.age[x]: "+value.fhirType());
1848      this.age = value;
1849      return this;
1850    }
1851
1852    /**
1853     * @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
1854     */
1855    public BooleanType getEstimatedAgeElement() { 
1856      if (this.estimatedAge == null)
1857        if (Configuration.errorOnAutoCreate())
1858          throw new Error("Attempt to auto-create FamilyMemberHistory.estimatedAge");
1859        else if (Configuration.doAutoCreate())
1860          this.estimatedAge = new BooleanType(); // bb
1861      return this.estimatedAge;
1862    }
1863
1864    public boolean hasEstimatedAgeElement() { 
1865      return this.estimatedAge != null && !this.estimatedAge.isEmpty();
1866    }
1867
1868    public boolean hasEstimatedAge() { 
1869      return this.estimatedAge != null && !this.estimatedAge.isEmpty();
1870    }
1871
1872    /**
1873     * @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
1874     */
1875    public FamilyMemberHistory setEstimatedAgeElement(BooleanType value) { 
1876      this.estimatedAge = value;
1877      return this;
1878    }
1879
1880    /**
1881     * @return If true, indicates that the age value specified is an estimated value.
1882     */
1883    public boolean getEstimatedAge() { 
1884      return this.estimatedAge == null || this.estimatedAge.isEmpty() ? false : this.estimatedAge.getValue();
1885    }
1886
1887    /**
1888     * @param value If true, indicates that the age value specified is an estimated value.
1889     */
1890    public FamilyMemberHistory setEstimatedAge(boolean value) { 
1891        if (this.estimatedAge == null)
1892          this.estimatedAge = new BooleanType();
1893        this.estimatedAge.setValue(value);
1894      return this;
1895    }
1896
1897    /**
1898     * @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.)
1899     */
1900    public DataType getDeceased() { 
1901      return this.deceased;
1902    }
1903
1904    /**
1905     * @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.)
1906     */
1907    public BooleanType getDeceasedBooleanType() throws FHIRException { 
1908      if (this.deceased == null)
1909        this.deceased = new BooleanType();
1910      if (!(this.deceased instanceof BooleanType))
1911        throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.deceased.getClass().getName()+" was encountered");
1912      return (BooleanType) this.deceased;
1913    }
1914
1915    public boolean hasDeceasedBooleanType() { 
1916      return this != null && this.deceased instanceof BooleanType;
1917    }
1918
1919    /**
1920     * @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.)
1921     */
1922    public Age getDeceasedAge() throws FHIRException { 
1923      if (this.deceased == null)
1924        this.deceased = new Age();
1925      if (!(this.deceased instanceof Age))
1926        throw new FHIRException("Type mismatch: the type Age was expected, but "+this.deceased.getClass().getName()+" was encountered");
1927      return (Age) this.deceased;
1928    }
1929
1930    public boolean hasDeceasedAge() { 
1931      return this != null && this.deceased instanceof Age;
1932    }
1933
1934    /**
1935     * @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.)
1936     */
1937    public Range getDeceasedRange() throws FHIRException { 
1938      if (this.deceased == null)
1939        this.deceased = new Range();
1940      if (!(this.deceased instanceof Range))
1941        throw new FHIRException("Type mismatch: the type Range was expected, but "+this.deceased.getClass().getName()+" was encountered");
1942      return (Range) this.deceased;
1943    }
1944
1945    public boolean hasDeceasedRange() { 
1946      return this != null && this.deceased instanceof Range;
1947    }
1948
1949    /**
1950     * @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.)
1951     */
1952    public DateType getDeceasedDateType() throws FHIRException { 
1953      if (this.deceased == null)
1954        this.deceased = new DateType();
1955      if (!(this.deceased instanceof DateType))
1956        throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.deceased.getClass().getName()+" was encountered");
1957      return (DateType) this.deceased;
1958    }
1959
1960    public boolean hasDeceasedDateType() { 
1961      return this != null && this.deceased instanceof DateType;
1962    }
1963
1964    /**
1965     * @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.)
1966     */
1967    public StringType getDeceasedStringType() throws FHIRException { 
1968      if (this.deceased == null)
1969        this.deceased = new StringType();
1970      if (!(this.deceased instanceof StringType))
1971        throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.deceased.getClass().getName()+" was encountered");
1972      return (StringType) this.deceased;
1973    }
1974
1975    public boolean hasDeceasedStringType() { 
1976      return this != null && this.deceased instanceof StringType;
1977    }
1978
1979    public boolean hasDeceased() { 
1980      return this.deceased != null && !this.deceased.isEmpty();
1981    }
1982
1983    /**
1984     * @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.)
1985     */
1986    public FamilyMemberHistory setDeceased(DataType value) { 
1987      if (value != null && !(value instanceof BooleanType || value instanceof Age || value instanceof Range || value instanceof DateType || value instanceof StringType))
1988        throw new Error("Not the right type for FamilyMemberHistory.deceased[x]: "+value.fhirType());
1989      this.deceased = value;
1990      return this;
1991    }
1992
1993    /**
1994     * @return {@link #reason} (Describes why the family member history occurred in coded or textual form, or Indicates a Condition, Observation, AllergyIntolerance, or QuestionnaireResponse that justifies this family member history event.)
1995     */
1996    public List<CodeableReference> getReason() { 
1997      if (this.reason == null)
1998        this.reason = new ArrayList<CodeableReference>();
1999      return this.reason;
2000    }
2001
2002    /**
2003     * @return Returns a reference to <code>this</code> for easy method chaining
2004     */
2005    public FamilyMemberHistory setReason(List<CodeableReference> theReason) { 
2006      this.reason = theReason;
2007      return this;
2008    }
2009
2010    public boolean hasReason() { 
2011      if (this.reason == null)
2012        return false;
2013      for (CodeableReference item : this.reason)
2014        if (!item.isEmpty())
2015          return true;
2016      return false;
2017    }
2018
2019    public CodeableReference addReason() { //3
2020      CodeableReference t = new CodeableReference();
2021      if (this.reason == null)
2022        this.reason = new ArrayList<CodeableReference>();
2023      this.reason.add(t);
2024      return t;
2025    }
2026
2027    public FamilyMemberHistory addReason(CodeableReference t) { //3
2028      if (t == null)
2029        return this;
2030      if (this.reason == null)
2031        this.reason = new ArrayList<CodeableReference>();
2032      this.reason.add(t);
2033      return this;
2034    }
2035
2036    /**
2037     * @return The first repetition of repeating field {@link #reason}, creating it if it does not already exist {3}
2038     */
2039    public CodeableReference getReasonFirstRep() { 
2040      if (getReason().isEmpty()) {
2041        addReason();
2042      }
2043      return getReason().get(0);
2044    }
2045
2046    /**
2047     * @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.)
2048     */
2049    public List<Annotation> getNote() { 
2050      if (this.note == null)
2051        this.note = new ArrayList<Annotation>();
2052      return this.note;
2053    }
2054
2055    /**
2056     * @return Returns a reference to <code>this</code> for easy method chaining
2057     */
2058    public FamilyMemberHistory setNote(List<Annotation> theNote) { 
2059      this.note = theNote;
2060      return this;
2061    }
2062
2063    public boolean hasNote() { 
2064      if (this.note == null)
2065        return false;
2066      for (Annotation item : this.note)
2067        if (!item.isEmpty())
2068          return true;
2069      return false;
2070    }
2071
2072    public Annotation addNote() { //3
2073      Annotation t = new Annotation();
2074      if (this.note == null)
2075        this.note = new ArrayList<Annotation>();
2076      this.note.add(t);
2077      return t;
2078    }
2079
2080    public FamilyMemberHistory addNote(Annotation t) { //3
2081      if (t == null)
2082        return this;
2083      if (this.note == null)
2084        this.note = new ArrayList<Annotation>();
2085      this.note.add(t);
2086      return this;
2087    }
2088
2089    /**
2090     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
2091     */
2092    public Annotation getNoteFirstRep() { 
2093      if (getNote().isEmpty()) {
2094        addNote();
2095      }
2096      return getNote().get(0);
2097    }
2098
2099    /**
2100     * @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.)
2101     */
2102    public List<FamilyMemberHistoryConditionComponent> getCondition() { 
2103      if (this.condition == null)
2104        this.condition = new ArrayList<FamilyMemberHistoryConditionComponent>();
2105      return this.condition;
2106    }
2107
2108    /**
2109     * @return Returns a reference to <code>this</code> for easy method chaining
2110     */
2111    public FamilyMemberHistory setCondition(List<FamilyMemberHistoryConditionComponent> theCondition) { 
2112      this.condition = theCondition;
2113      return this;
2114    }
2115
2116    public boolean hasCondition() { 
2117      if (this.condition == null)
2118        return false;
2119      for (FamilyMemberHistoryConditionComponent item : this.condition)
2120        if (!item.isEmpty())
2121          return true;
2122      return false;
2123    }
2124
2125    public FamilyMemberHistoryConditionComponent addCondition() { //3
2126      FamilyMemberHistoryConditionComponent t = new FamilyMemberHistoryConditionComponent();
2127      if (this.condition == null)
2128        this.condition = new ArrayList<FamilyMemberHistoryConditionComponent>();
2129      this.condition.add(t);
2130      return t;
2131    }
2132
2133    public FamilyMemberHistory addCondition(FamilyMemberHistoryConditionComponent t) { //3
2134      if (t == null)
2135        return this;
2136      if (this.condition == null)
2137        this.condition = new ArrayList<FamilyMemberHistoryConditionComponent>();
2138      this.condition.add(t);
2139      return this;
2140    }
2141
2142    /**
2143     * @return The first repetition of repeating field {@link #condition}, creating it if it does not already exist {3}
2144     */
2145    public FamilyMemberHistoryConditionComponent getConditionFirstRep() { 
2146      if (getCondition().isEmpty()) {
2147        addCondition();
2148      }
2149      return getCondition().get(0);
2150    }
2151
2152    /**
2153     * @return {@link #procedure} (The significant Procedures (or procedure) that the family member had. This is a repeating section to allow a system to represent more than one procedure per resource, though there is nothing stopping multiple resources - one per procedure.)
2154     */
2155    public List<FamilyMemberHistoryProcedureComponent> getProcedure() { 
2156      if (this.procedure == null)
2157        this.procedure = new ArrayList<FamilyMemberHistoryProcedureComponent>();
2158      return this.procedure;
2159    }
2160
2161    /**
2162     * @return Returns a reference to <code>this</code> for easy method chaining
2163     */
2164    public FamilyMemberHistory setProcedure(List<FamilyMemberHistoryProcedureComponent> theProcedure) { 
2165      this.procedure = theProcedure;
2166      return this;
2167    }
2168
2169    public boolean hasProcedure() { 
2170      if (this.procedure == null)
2171        return false;
2172      for (FamilyMemberHistoryProcedureComponent item : this.procedure)
2173        if (!item.isEmpty())
2174          return true;
2175      return false;
2176    }
2177
2178    public FamilyMemberHistoryProcedureComponent addProcedure() { //3
2179      FamilyMemberHistoryProcedureComponent t = new FamilyMemberHistoryProcedureComponent();
2180      if (this.procedure == null)
2181        this.procedure = new ArrayList<FamilyMemberHistoryProcedureComponent>();
2182      this.procedure.add(t);
2183      return t;
2184    }
2185
2186    public FamilyMemberHistory addProcedure(FamilyMemberHistoryProcedureComponent t) { //3
2187      if (t == null)
2188        return this;
2189      if (this.procedure == null)
2190        this.procedure = new ArrayList<FamilyMemberHistoryProcedureComponent>();
2191      this.procedure.add(t);
2192      return this;
2193    }
2194
2195    /**
2196     * @return The first repetition of repeating field {@link #procedure}, creating it if it does not already exist {3}
2197     */
2198    public FamilyMemberHistoryProcedureComponent getProcedureFirstRep() { 
2199      if (getProcedure().isEmpty()) {
2200        addProcedure();
2201      }
2202      return getProcedure().get(0);
2203    }
2204
2205      protected void listChildren(List<Property> children) {
2206        super.listChildren(children);
2207        children.add(new Property("identifier", "Identifier", "Business identifiers assigned to this family member history by the performer or other systems which remain constant as the resource is updated and propagates from server to server.", 0, java.lang.Integer.MAX_VALUE, identifier));
2208        children.add(new Property("instantiatesCanonical", "canonical(PlanDefinition|Questionnaire|ActivityDefinition|Measure|OperationDefinition)", "The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory.", 0, java.lang.Integer.MAX_VALUE, instantiatesCanonical));
2209        children.add(new Property("instantiatesUri", "uri", "The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory.", 0, java.lang.Integer.MAX_VALUE, instantiatesUri));
2210        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));
2211        children.add(new Property("dataAbsentReason", "CodeableConcept", "Describes why the family member's history is not available.", 0, 1, dataAbsentReason));
2212        children.add(new Property("patient", "Reference(Patient)", "The person who this history concerns.", 0, 1, patient));
2213        children.add(new Property("date", "dateTime", "The date (and possibly time) when the family member history was recorded or last updated.", 0, 1, date));
2214        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));
2215        children.add(new Property("relationship", "CodeableConcept", "The type of relationship this person has to the patient (father, mother, brother etc.).", 0, 1, relationship));
2216        children.add(new Property("sex", "CodeableConcept", "The birth sex of the family member.", 0, 1, sex));
2217        children.add(new Property("born[x]", "Period|date|string", "The actual or approximate date of birth of the relative.", 0, 1, born));
2218        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));
2219        children.add(new Property("estimatedAge", "boolean", "If true, indicates that the age value specified is an estimated value.", 0, 1, estimatedAge));
2220        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));
2221        children.add(new Property("reason", "CodeableReference(Condition|Observation|AllergyIntolerance|QuestionnaireResponse|DiagnosticReport|DocumentReference)", "Describes why the family member history occurred in coded or textual form, or Indicates a Condition, Observation, AllergyIntolerance, or QuestionnaireResponse that justifies this family member history event.", 0, java.lang.Integer.MAX_VALUE, reason));
2222        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));
2223        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));
2224        children.add(new Property("procedure", "", "The significant Procedures (or procedure) that the family member had. This is a repeating section to allow a system to represent more than one procedure per resource, though there is nothing stopping multiple resources - one per procedure.", 0, java.lang.Integer.MAX_VALUE, procedure));
2225      }
2226
2227      @Override
2228      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2229        switch (_hash) {
2230        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Business identifiers assigned to this family member history by the performer or other systems which remain constant as the resource is updated and propagates from server to server.", 0, java.lang.Integer.MAX_VALUE, identifier);
2231        case 8911915: /*instantiatesCanonical*/  return new Property("instantiatesCanonical", "canonical(PlanDefinition|Questionnaire|ActivityDefinition|Measure|OperationDefinition)", "The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory.", 0, java.lang.Integer.MAX_VALUE, instantiatesCanonical);
2232        case -1926393373: /*instantiatesUri*/  return new Property("instantiatesUri", "uri", "The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory.", 0, java.lang.Integer.MAX_VALUE, instantiatesUri);
2233        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);
2234        case 1034315687: /*dataAbsentReason*/  return new Property("dataAbsentReason", "CodeableConcept", "Describes why the family member's history is not available.", 0, 1, dataAbsentReason);
2235        case -791418107: /*patient*/  return new Property("patient", "Reference(Patient)", "The person who this history concerns.", 0, 1, patient);
2236        case 3076014: /*date*/  return new Property("date", "dateTime", "The date (and possibly time) when the family member history was recorded or last updated.", 0, 1, date);
2237        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);
2238        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);
2239        case 113766: /*sex*/  return new Property("sex", "CodeableConcept", "The birth sex of the family member.", 0, 1, sex);
2240        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);
2241        case 3029833: /*born*/  return new Property("born[x]", "Period|date|string", "The actual or approximate date of birth of the relative.", 0, 1, born);
2242        case 1497711210: /*bornPeriod*/  return new Property("born[x]", "Period", "The actual or approximate date of birth of the relative.", 0, 1, born);
2243        case 2092814999: /*bornDate*/  return new Property("born[x]", "date", "The actual or approximate date of birth of the relative.", 0, 1, born);
2244        case 1597451450: /*bornString*/  return new Property("born[x]", "string", "The actual or approximate date of birth of the relative.", 0, 1, born);
2245        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);
2246        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);
2247        case -1419742336: /*ageAge*/  return new Property("age[x]", "Age", "The age of the relative at the time the family member history is recorded.", 0, 1, age);
2248        case 1442748286: /*ageRange*/  return new Property("age[x]", "Range", "The age of the relative at the time the family member history is recorded.", 0, 1, age);
2249        case 1821821424: /*ageString*/  return new Property("age[x]", "string", "The age of the relative at the time the family member history is recorded.", 0, 1, age);
2250        case 2130167587: /*estimatedAge*/  return new Property("estimatedAge", "boolean", "If true, indicates that the age value specified is an estimated value.", 0, 1, estimatedAge);
2251        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);
2252        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);
2253        case 497463828: /*deceasedBoolean*/  return new Property("deceased[x]", "boolean", "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);
2254        case -1311468309: /*deceasedAge*/  return new Property("deceased[x]", "Age", "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);
2255        case -1880094167: /*deceasedRange*/  return new Property("deceased[x]", "Range", "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);
2256        case -2000727742: /*deceasedDate*/  return new Property("deceased[x]", "date", "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);
2257        case 1892920485: /*deceasedString*/  return new Property("deceased[x]", "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);
2258        case -934964668: /*reason*/  return new Property("reason", "CodeableReference(Condition|Observation|AllergyIntolerance|QuestionnaireResponse|DiagnosticReport|DocumentReference)", "Describes why the family member history occurred in coded or textual form, or Indicates a Condition, Observation, AllergyIntolerance, or QuestionnaireResponse that justifies this family member history event.", 0, java.lang.Integer.MAX_VALUE, reason);
2259        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);
2260        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);
2261        case -1095204141: /*procedure*/  return new Property("procedure", "", "The significant Procedures (or procedure) that the family member had. This is a repeating section to allow a system to represent more than one procedure per resource, though there is nothing stopping multiple resources - one per procedure.", 0, java.lang.Integer.MAX_VALUE, procedure);
2262        default: return super.getNamedProperty(_hash, _name, _checkValid);
2263        }
2264
2265      }
2266
2267      @Override
2268      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2269        switch (hash) {
2270        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2271        case 8911915: /*instantiatesCanonical*/ return this.instantiatesCanonical == null ? new Base[0] : this.instantiatesCanonical.toArray(new Base[this.instantiatesCanonical.size()]); // CanonicalType
2272        case -1926393373: /*instantiatesUri*/ return this.instantiatesUri == null ? new Base[0] : this.instantiatesUri.toArray(new Base[this.instantiatesUri.size()]); // UriType
2273        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<FamilyHistoryStatus>
2274        case 1034315687: /*dataAbsentReason*/ return this.dataAbsentReason == null ? new Base[0] : new Base[] {this.dataAbsentReason}; // CodeableConcept
2275        case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference
2276        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
2277        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
2278        case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // CodeableConcept
2279        case 113766: /*sex*/ return this.sex == null ? new Base[0] : new Base[] {this.sex}; // CodeableConcept
2280        case 3029833: /*born*/ return this.born == null ? new Base[0] : new Base[] {this.born}; // DataType
2281        case 96511: /*age*/ return this.age == null ? new Base[0] : new Base[] {this.age}; // DataType
2282        case 2130167587: /*estimatedAge*/ return this.estimatedAge == null ? new Base[0] : new Base[] {this.estimatedAge}; // BooleanType
2283        case 561497972: /*deceased*/ return this.deceased == null ? new Base[0] : new Base[] {this.deceased}; // DataType
2284        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableReference
2285        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
2286        case -861311717: /*condition*/ return this.condition == null ? new Base[0] : this.condition.toArray(new Base[this.condition.size()]); // FamilyMemberHistoryConditionComponent
2287        case -1095204141: /*procedure*/ return this.procedure == null ? new Base[0] : this.procedure.toArray(new Base[this.procedure.size()]); // FamilyMemberHistoryProcedureComponent
2288        default: return super.getProperty(hash, name, checkValid);
2289        }
2290
2291      }
2292
2293      @Override
2294      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2295        switch (hash) {
2296        case -1618432855: // identifier
2297          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
2298          return value;
2299        case 8911915: // instantiatesCanonical
2300          this.getInstantiatesCanonical().add(TypeConvertor.castToCanonical(value)); // CanonicalType
2301          return value;
2302        case -1926393373: // instantiatesUri
2303          this.getInstantiatesUri().add(TypeConvertor.castToUri(value)); // UriType
2304          return value;
2305        case -892481550: // status
2306          value = new FamilyHistoryStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
2307          this.status = (Enumeration) value; // Enumeration<FamilyHistoryStatus>
2308          return value;
2309        case 1034315687: // dataAbsentReason
2310          this.dataAbsentReason = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2311          return value;
2312        case -791418107: // patient
2313          this.patient = TypeConvertor.castToReference(value); // Reference
2314          return value;
2315        case 3076014: // date
2316          this.date = TypeConvertor.castToDateTime(value); // DateTimeType
2317          return value;
2318        case 3373707: // name
2319          this.name = TypeConvertor.castToString(value); // StringType
2320          return value;
2321        case -261851592: // relationship
2322          this.relationship = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2323          return value;
2324        case 113766: // sex
2325          this.sex = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2326          return value;
2327        case 3029833: // born
2328          this.born = TypeConvertor.castToType(value); // DataType
2329          return value;
2330        case 96511: // age
2331          this.age = TypeConvertor.castToType(value); // DataType
2332          return value;
2333        case 2130167587: // estimatedAge
2334          this.estimatedAge = TypeConvertor.castToBoolean(value); // BooleanType
2335          return value;
2336        case 561497972: // deceased
2337          this.deceased = TypeConvertor.castToType(value); // DataType
2338          return value;
2339        case -934964668: // reason
2340          this.getReason().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference
2341          return value;
2342        case 3387378: // note
2343          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
2344          return value;
2345        case -861311717: // condition
2346          this.getCondition().add((FamilyMemberHistoryConditionComponent) value); // FamilyMemberHistoryConditionComponent
2347          return value;
2348        case -1095204141: // procedure
2349          this.getProcedure().add((FamilyMemberHistoryProcedureComponent) value); // FamilyMemberHistoryProcedureComponent
2350          return value;
2351        default: return super.setProperty(hash, name, value);
2352        }
2353
2354      }
2355
2356      @Override
2357      public Base setProperty(String name, Base value) throws FHIRException {
2358        if (name.equals("identifier")) {
2359          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
2360        } else if (name.equals("instantiatesCanonical")) {
2361          this.getInstantiatesCanonical().add(TypeConvertor.castToCanonical(value));
2362        } else if (name.equals("instantiatesUri")) {
2363          this.getInstantiatesUri().add(TypeConvertor.castToUri(value));
2364        } else if (name.equals("status")) {
2365          value = new FamilyHistoryStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
2366          this.status = (Enumeration) value; // Enumeration<FamilyHistoryStatus>
2367        } else if (name.equals("dataAbsentReason")) {
2368          this.dataAbsentReason = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2369        } else if (name.equals("patient")) {
2370          this.patient = TypeConvertor.castToReference(value); // Reference
2371        } else if (name.equals("date")) {
2372          this.date = TypeConvertor.castToDateTime(value); // DateTimeType
2373        } else if (name.equals("name")) {
2374          this.name = TypeConvertor.castToString(value); // StringType
2375        } else if (name.equals("relationship")) {
2376          this.relationship = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2377        } else if (name.equals("sex")) {
2378          this.sex = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2379        } else if (name.equals("born[x]")) {
2380          this.born = TypeConvertor.castToType(value); // DataType
2381        } else if (name.equals("age[x]")) {
2382          this.age = TypeConvertor.castToType(value); // DataType
2383        } else if (name.equals("estimatedAge")) {
2384          this.estimatedAge = TypeConvertor.castToBoolean(value); // BooleanType
2385        } else if (name.equals("deceased[x]")) {
2386          this.deceased = TypeConvertor.castToType(value); // DataType
2387        } else if (name.equals("reason")) {
2388          this.getReason().add(TypeConvertor.castToCodeableReference(value));
2389        } else if (name.equals("note")) {
2390          this.getNote().add(TypeConvertor.castToAnnotation(value));
2391        } else if (name.equals("condition")) {
2392          this.getCondition().add((FamilyMemberHistoryConditionComponent) value);
2393        } else if (name.equals("procedure")) {
2394          this.getProcedure().add((FamilyMemberHistoryProcedureComponent) value);
2395        } else
2396          return super.setProperty(name, value);
2397        return value;
2398      }
2399
2400      @Override
2401      public Base makeProperty(int hash, String name) throws FHIRException {
2402        switch (hash) {
2403        case -1618432855:  return addIdentifier(); 
2404        case 8911915:  return addInstantiatesCanonicalElement();
2405        case -1926393373:  return addInstantiatesUriElement();
2406        case -892481550:  return getStatusElement();
2407        case 1034315687:  return getDataAbsentReason();
2408        case -791418107:  return getPatient();
2409        case 3076014:  return getDateElement();
2410        case 3373707:  return getNameElement();
2411        case -261851592:  return getRelationship();
2412        case 113766:  return getSex();
2413        case 67532951:  return getBorn();
2414        case 3029833:  return getBorn();
2415        case -1419716831:  return getAge();
2416        case 96511:  return getAge();
2417        case 2130167587:  return getEstimatedAgeElement();
2418        case -1311442804:  return getDeceased();
2419        case 561497972:  return getDeceased();
2420        case -934964668:  return addReason(); 
2421        case 3387378:  return addNote(); 
2422        case -861311717:  return addCondition(); 
2423        case -1095204141:  return addProcedure(); 
2424        default: return super.makeProperty(hash, name);
2425        }
2426
2427      }
2428
2429      @Override
2430      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2431        switch (hash) {
2432        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2433        case 8911915: /*instantiatesCanonical*/ return new String[] {"canonical"};
2434        case -1926393373: /*instantiatesUri*/ return new String[] {"uri"};
2435        case -892481550: /*status*/ return new String[] {"code"};
2436        case 1034315687: /*dataAbsentReason*/ return new String[] {"CodeableConcept"};
2437        case -791418107: /*patient*/ return new String[] {"Reference"};
2438        case 3076014: /*date*/ return new String[] {"dateTime"};
2439        case 3373707: /*name*/ return new String[] {"string"};
2440        case -261851592: /*relationship*/ return new String[] {"CodeableConcept"};
2441        case 113766: /*sex*/ return new String[] {"CodeableConcept"};
2442        case 3029833: /*born*/ return new String[] {"Period", "date", "string"};
2443        case 96511: /*age*/ return new String[] {"Age", "Range", "string"};
2444        case 2130167587: /*estimatedAge*/ return new String[] {"boolean"};
2445        case 561497972: /*deceased*/ return new String[] {"boolean", "Age", "Range", "date", "string"};
2446        case -934964668: /*reason*/ return new String[] {"CodeableReference"};
2447        case 3387378: /*note*/ return new String[] {"Annotation"};
2448        case -861311717: /*condition*/ return new String[] {};
2449        case -1095204141: /*procedure*/ return new String[] {};
2450        default: return super.getTypesForProperty(hash, name);
2451        }
2452
2453      }
2454
2455      @Override
2456      public Base addChild(String name) throws FHIRException {
2457        if (name.equals("identifier")) {
2458          return addIdentifier();
2459        }
2460        else if (name.equals("instantiatesCanonical")) {
2461          throw new FHIRException("Cannot call addChild on a primitive type FamilyMemberHistory.instantiatesCanonical");
2462        }
2463        else if (name.equals("instantiatesUri")) {
2464          throw new FHIRException("Cannot call addChild on a primitive type FamilyMemberHistory.instantiatesUri");
2465        }
2466        else if (name.equals("status")) {
2467          throw new FHIRException("Cannot call addChild on a primitive type FamilyMemberHistory.status");
2468        }
2469        else if (name.equals("dataAbsentReason")) {
2470          this.dataAbsentReason = new CodeableConcept();
2471          return this.dataAbsentReason;
2472        }
2473        else if (name.equals("patient")) {
2474          this.patient = new Reference();
2475          return this.patient;
2476        }
2477        else if (name.equals("date")) {
2478          throw new FHIRException("Cannot call addChild on a primitive type FamilyMemberHistory.date");
2479        }
2480        else if (name.equals("name")) {
2481          throw new FHIRException("Cannot call addChild on a primitive type FamilyMemberHistory.name");
2482        }
2483        else if (name.equals("relationship")) {
2484          this.relationship = new CodeableConcept();
2485          return this.relationship;
2486        }
2487        else if (name.equals("sex")) {
2488          this.sex = new CodeableConcept();
2489          return this.sex;
2490        }
2491        else if (name.equals("bornPeriod")) {
2492          this.born = new Period();
2493          return this.born;
2494        }
2495        else if (name.equals("bornDate")) {
2496          this.born = new DateType();
2497          return this.born;
2498        }
2499        else if (name.equals("bornString")) {
2500          this.born = new StringType();
2501          return this.born;
2502        }
2503        else if (name.equals("ageAge")) {
2504          this.age = new Age();
2505          return this.age;
2506        }
2507        else if (name.equals("ageRange")) {
2508          this.age = new Range();
2509          return this.age;
2510        }
2511        else if (name.equals("ageString")) {
2512          this.age = new StringType();
2513          return this.age;
2514        }
2515        else if (name.equals("estimatedAge")) {
2516          throw new FHIRException("Cannot call addChild on a primitive type FamilyMemberHistory.estimatedAge");
2517        }
2518        else if (name.equals("deceasedBoolean")) {
2519          this.deceased = new BooleanType();
2520          return this.deceased;
2521        }
2522        else if (name.equals("deceasedAge")) {
2523          this.deceased = new Age();
2524          return this.deceased;
2525        }
2526        else if (name.equals("deceasedRange")) {
2527          this.deceased = new Range();
2528          return this.deceased;
2529        }
2530        else if (name.equals("deceasedDate")) {
2531          this.deceased = new DateType();
2532          return this.deceased;
2533        }
2534        else if (name.equals("deceasedString")) {
2535          this.deceased = new StringType();
2536          return this.deceased;
2537        }
2538        else if (name.equals("reason")) {
2539          return addReason();
2540        }
2541        else if (name.equals("note")) {
2542          return addNote();
2543        }
2544        else if (name.equals("condition")) {
2545          return addCondition();
2546        }
2547        else if (name.equals("procedure")) {
2548          return addProcedure();
2549        }
2550        else
2551          return super.addChild(name);
2552      }
2553
2554  public String fhirType() {
2555    return "FamilyMemberHistory";
2556
2557  }
2558
2559      public FamilyMemberHistory copy() {
2560        FamilyMemberHistory dst = new FamilyMemberHistory();
2561        copyValues(dst);
2562        return dst;
2563      }
2564
2565      public void copyValues(FamilyMemberHistory dst) {
2566        super.copyValues(dst);
2567        if (identifier != null) {
2568          dst.identifier = new ArrayList<Identifier>();
2569          for (Identifier i : identifier)
2570            dst.identifier.add(i.copy());
2571        };
2572        if (instantiatesCanonical != null) {
2573          dst.instantiatesCanonical = new ArrayList<CanonicalType>();
2574          for (CanonicalType i : instantiatesCanonical)
2575            dst.instantiatesCanonical.add(i.copy());
2576        };
2577        if (instantiatesUri != null) {
2578          dst.instantiatesUri = new ArrayList<UriType>();
2579          for (UriType i : instantiatesUri)
2580            dst.instantiatesUri.add(i.copy());
2581        };
2582        dst.status = status == null ? null : status.copy();
2583        dst.dataAbsentReason = dataAbsentReason == null ? null : dataAbsentReason.copy();
2584        dst.patient = patient == null ? null : patient.copy();
2585        dst.date = date == null ? null : date.copy();
2586        dst.name = name == null ? null : name.copy();
2587        dst.relationship = relationship == null ? null : relationship.copy();
2588        dst.sex = sex == null ? null : sex.copy();
2589        dst.born = born == null ? null : born.copy();
2590        dst.age = age == null ? null : age.copy();
2591        dst.estimatedAge = estimatedAge == null ? null : estimatedAge.copy();
2592        dst.deceased = deceased == null ? null : deceased.copy();
2593        if (reason != null) {
2594          dst.reason = new ArrayList<CodeableReference>();
2595          for (CodeableReference i : reason)
2596            dst.reason.add(i.copy());
2597        };
2598        if (note != null) {
2599          dst.note = new ArrayList<Annotation>();
2600          for (Annotation i : note)
2601            dst.note.add(i.copy());
2602        };
2603        if (condition != null) {
2604          dst.condition = new ArrayList<FamilyMemberHistoryConditionComponent>();
2605          for (FamilyMemberHistoryConditionComponent i : condition)
2606            dst.condition.add(i.copy());
2607        };
2608        if (procedure != null) {
2609          dst.procedure = new ArrayList<FamilyMemberHistoryProcedureComponent>();
2610          for (FamilyMemberHistoryProcedureComponent i : procedure)
2611            dst.procedure.add(i.copy());
2612        };
2613      }
2614
2615      protected FamilyMemberHistory typedCopy() {
2616        return copy();
2617      }
2618
2619      @Override
2620      public boolean equalsDeep(Base other_) {
2621        if (!super.equalsDeep(other_))
2622          return false;
2623        if (!(other_ instanceof FamilyMemberHistory))
2624          return false;
2625        FamilyMemberHistory o = (FamilyMemberHistory) other_;
2626        return compareDeep(identifier, o.identifier, true) && compareDeep(instantiatesCanonical, o.instantiatesCanonical, true)
2627           && compareDeep(instantiatesUri, o.instantiatesUri, true) && compareDeep(status, o.status, true)
2628           && compareDeep(dataAbsentReason, o.dataAbsentReason, true) && compareDeep(patient, o.patient, true)
2629           && compareDeep(date, o.date, true) && compareDeep(name, o.name, true) && compareDeep(relationship, o.relationship, true)
2630           && compareDeep(sex, o.sex, true) && compareDeep(born, o.born, true) && compareDeep(age, o.age, true)
2631           && compareDeep(estimatedAge, o.estimatedAge, true) && compareDeep(deceased, o.deceased, true) && compareDeep(reason, o.reason, true)
2632           && compareDeep(note, o.note, true) && compareDeep(condition, o.condition, true) && compareDeep(procedure, o.procedure, true)
2633          ;
2634      }
2635
2636      @Override
2637      public boolean equalsShallow(Base other_) {
2638        if (!super.equalsShallow(other_))
2639          return false;
2640        if (!(other_ instanceof FamilyMemberHistory))
2641          return false;
2642        FamilyMemberHistory o = (FamilyMemberHistory) other_;
2643        return compareValues(instantiatesCanonical, o.instantiatesCanonical, true) && compareValues(instantiatesUri, o.instantiatesUri, true)
2644           && compareValues(status, o.status, true) && compareValues(date, o.date, true) && compareValues(name, o.name, true)
2645           && compareValues(estimatedAge, o.estimatedAge, true);
2646      }
2647
2648      public boolean isEmpty() {
2649        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, instantiatesCanonical
2650          , instantiatesUri, status, dataAbsentReason, patient, date, name, relationship
2651          , sex, born, age, estimatedAge, deceased, reason, note, condition, procedure
2652          );
2653      }
2654
2655  @Override
2656  public ResourceType getResourceType() {
2657    return ResourceType.FamilyMemberHistory;
2658   }
2659
2660 /**
2661   * Search parameter: <b>instantiates-canonical</b>
2662   * <p>
2663   * Description: <b>Instantiates FHIR protocol or definition</b><br>
2664   * Type: <b>reference</b><br>
2665   * Path: <b>FamilyMemberHistory.instantiatesCanonical</b><br>
2666   * </p>
2667   */
2668  @SearchParamDefinition(name="instantiates-canonical", path="FamilyMemberHistory.instantiatesCanonical", description="Instantiates FHIR protocol or definition", type="reference", target={ActivityDefinition.class, Measure.class, OperationDefinition.class, PlanDefinition.class, Questionnaire.class } )
2669  public static final String SP_INSTANTIATES_CANONICAL = "instantiates-canonical";
2670 /**
2671   * <b>Fluent Client</b> search parameter constant for <b>instantiates-canonical</b>
2672   * <p>
2673   * Description: <b>Instantiates FHIR protocol or definition</b><br>
2674   * Type: <b>reference</b><br>
2675   * Path: <b>FamilyMemberHistory.instantiatesCanonical</b><br>
2676   * </p>
2677   */
2678  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INSTANTIATES_CANONICAL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INSTANTIATES_CANONICAL);
2679
2680/**
2681   * Constant for fluent queries to be used to add include statements. Specifies
2682   * the path value of "<b>FamilyMemberHistory:instantiates-canonical</b>".
2683   */
2684  public static final ca.uhn.fhir.model.api.Include INCLUDE_INSTANTIATES_CANONICAL = new ca.uhn.fhir.model.api.Include("FamilyMemberHistory:instantiates-canonical").toLocked();
2685
2686 /**
2687   * Search parameter: <b>instantiates-uri</b>
2688   * <p>
2689   * Description: <b>Instantiates external protocol or definition</b><br>
2690   * Type: <b>uri</b><br>
2691   * Path: <b>FamilyMemberHistory.instantiatesUri</b><br>
2692   * </p>
2693   */
2694  @SearchParamDefinition(name="instantiates-uri", path="FamilyMemberHistory.instantiatesUri", description="Instantiates external protocol or definition", type="uri" )
2695  public static final String SP_INSTANTIATES_URI = "instantiates-uri";
2696 /**
2697   * <b>Fluent Client</b> search parameter constant for <b>instantiates-uri</b>
2698   * <p>
2699   * Description: <b>Instantiates external protocol or definition</b><br>
2700   * Type: <b>uri</b><br>
2701   * Path: <b>FamilyMemberHistory.instantiatesUri</b><br>
2702   * </p>
2703   */
2704  public static final ca.uhn.fhir.rest.gclient.UriClientParam INSTANTIATES_URI = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_INSTANTIATES_URI);
2705
2706 /**
2707   * Search parameter: <b>relationship</b>
2708   * <p>
2709   * Description: <b>A search by a relationship type</b><br>
2710   * Type: <b>token</b><br>
2711   * Path: <b>FamilyMemberHistory.relationship</b><br>
2712   * </p>
2713   */
2714  @SearchParamDefinition(name="relationship", path="FamilyMemberHistory.relationship", description="A search by a relationship type", type="token" )
2715  public static final String SP_RELATIONSHIP = "relationship";
2716 /**
2717   * <b>Fluent Client</b> search parameter constant for <b>relationship</b>
2718   * <p>
2719   * Description: <b>A search by a relationship type</b><br>
2720   * Type: <b>token</b><br>
2721   * Path: <b>FamilyMemberHistory.relationship</b><br>
2722   * </p>
2723   */
2724  public static final ca.uhn.fhir.rest.gclient.TokenClientParam RELATIONSHIP = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RELATIONSHIP);
2725
2726 /**
2727   * Search parameter: <b>sex</b>
2728   * <p>
2729   * Description: <b>A search by a sex code of a family member</b><br>
2730   * Type: <b>token</b><br>
2731   * Path: <b>FamilyMemberHistory.sex</b><br>
2732   * </p>
2733   */
2734  @SearchParamDefinition(name="sex", path="FamilyMemberHistory.sex", description="A search by a sex code of a family member", type="token" )
2735  public static final String SP_SEX = "sex";
2736 /**
2737   * <b>Fluent Client</b> search parameter constant for <b>sex</b>
2738   * <p>
2739   * Description: <b>A search by a sex code of a family member</b><br>
2740   * Type: <b>token</b><br>
2741   * Path: <b>FamilyMemberHistory.sex</b><br>
2742   * </p>
2743   */
2744  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SEX = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SEX);
2745
2746 /**
2747   * Search parameter: <b>status</b>
2748   * <p>
2749   * Description: <b>partial | completed | entered-in-error | health-unknown</b><br>
2750   * Type: <b>token</b><br>
2751   * Path: <b>FamilyMemberHistory.status</b><br>
2752   * </p>
2753   */
2754  @SearchParamDefinition(name="status", path="FamilyMemberHistory.status", description="partial | completed | entered-in-error | health-unknown", type="token" )
2755  public static final String SP_STATUS = "status";
2756 /**
2757   * <b>Fluent Client</b> search parameter constant for <b>status</b>
2758   * <p>
2759   * Description: <b>partial | completed | entered-in-error | health-unknown</b><br>
2760   * Type: <b>token</b><br>
2761   * Path: <b>FamilyMemberHistory.status</b><br>
2762   * </p>
2763   */
2764  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
2765
2766 /**
2767   * Search parameter: <b>code</b>
2768   * <p>
2769   * Description: <b>Multiple Resources: 
2770
2771* [AllergyIntolerance](allergyintolerance.html): Code that identifies the allergy or intolerance
2772* [Condition](condition.html): Code for the condition
2773* [DeviceRequest](devicerequest.html): Code for what is being requested/ordered
2774* [DiagnosticReport](diagnosticreport.html): The code for the report, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result
2775* [FamilyMemberHistory](familymemberhistory.html): A search by a condition code
2776* [List](list.html): What the purpose of this list is
2777* [Medication](medication.html): Returns medications for a specific code
2778* [MedicationAdministration](medicationadministration.html): Return administrations of this medication code
2779* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine code
2780* [MedicationRequest](medicationrequest.html): Return prescriptions of this medication code
2781* [MedicationUsage](medicationusage.html): Return statements of this medication code
2782* [Observation](observation.html): The code of the observation type
2783* [Procedure](procedure.html): A code to identify a  procedure
2784* [ServiceRequest](servicerequest.html): What is being requested/ordered
2785</b><br>
2786   * Type: <b>token</b><br>
2787   * Path: <b>AllergyIntolerance.code | AllergyIntolerance.reaction.substance | Condition.code | DeviceRequest.code.concept | DiagnosticReport.code | FamilyMemberHistory.condition.code | List.code | Medication.code | MedicationAdministration.medication.concept | MedicationDispense.medication.concept | MedicationRequest.medication.concept | MedicationUsage.medication.concept | Observation.code | Procedure.code | ServiceRequest.code</b><br>
2788   * </p>
2789   */
2790  @SearchParamDefinition(name="code", path="AllergyIntolerance.code | AllergyIntolerance.reaction.substance | Condition.code | DeviceRequest.code.concept | DiagnosticReport.code | FamilyMemberHistory.condition.code | List.code | Medication.code | MedicationAdministration.medication.concept | MedicationDispense.medication.concept | MedicationRequest.medication.concept | MedicationUsage.medication.concept | Observation.code | Procedure.code | ServiceRequest.code", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): Code that identifies the allergy or intolerance\r\n* [Condition](condition.html): Code for the condition\r\n* [DeviceRequest](devicerequest.html): Code for what is being requested/ordered\r\n* [DiagnosticReport](diagnosticreport.html): The code for the report, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result\r\n* [FamilyMemberHistory](familymemberhistory.html): A search by a condition code\r\n* [List](list.html): What the purpose of this list is\r\n* [Medication](medication.html): Returns medications for a specific code\r\n* [MedicationAdministration](medicationadministration.html): Return administrations of this medication code\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine code\r\n* [MedicationRequest](medicationrequest.html): Return prescriptions of this medication code\r\n* [MedicationUsage](medicationusage.html): Return statements of this medication code\r\n* [Observation](observation.html): The code of the observation type\r\n* [Procedure](procedure.html): A code to identify a  procedure\r\n* [ServiceRequest](servicerequest.html): What is being requested/ordered\r\n", type="token" )
2791  public static final String SP_CODE = "code";
2792 /**
2793   * <b>Fluent Client</b> search parameter constant for <b>code</b>
2794   * <p>
2795   * Description: <b>Multiple Resources: 
2796
2797* [AllergyIntolerance](allergyintolerance.html): Code that identifies the allergy or intolerance
2798* [Condition](condition.html): Code for the condition
2799* [DeviceRequest](devicerequest.html): Code for what is being requested/ordered
2800* [DiagnosticReport](diagnosticreport.html): The code for the report, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result
2801* [FamilyMemberHistory](familymemberhistory.html): A search by a condition code
2802* [List](list.html): What the purpose of this list is
2803* [Medication](medication.html): Returns medications for a specific code
2804* [MedicationAdministration](medicationadministration.html): Return administrations of this medication code
2805* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine code
2806* [MedicationRequest](medicationrequest.html): Return prescriptions of this medication code
2807* [MedicationUsage](medicationusage.html): Return statements of this medication code
2808* [Observation](observation.html): The code of the observation type
2809* [Procedure](procedure.html): A code to identify a  procedure
2810* [ServiceRequest](servicerequest.html): What is being requested/ordered
2811</b><br>
2812   * Type: <b>token</b><br>
2813   * Path: <b>AllergyIntolerance.code | AllergyIntolerance.reaction.substance | Condition.code | DeviceRequest.code.concept | DiagnosticReport.code | FamilyMemberHistory.condition.code | List.code | Medication.code | MedicationAdministration.medication.concept | MedicationDispense.medication.concept | MedicationRequest.medication.concept | MedicationUsage.medication.concept | Observation.code | Procedure.code | ServiceRequest.code</b><br>
2814   * </p>
2815   */
2816  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
2817
2818 /**
2819   * Search parameter: <b>date</b>
2820   * <p>
2821   * Description: <b>Multiple Resources: 
2822
2823* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded
2824* [CarePlan](careplan.html): Time period plan covers
2825* [CareTeam](careteam.html): A date within the coverage time period.
2826* [ClinicalImpression](clinicalimpression.html): When the assessment was documented
2827* [Composition](composition.html): Composition editing time
2828* [Consent](consent.html): When consent was agreed to
2829* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report
2830* [Encounter](encounter.html): A date within the actualPeriod the Encounter lasted
2831* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period
2832* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated
2833* [Flag](flag.html): Time period when flag is active
2834* [Immunization](immunization.html): Vaccination  (non)-Administration Date
2835* [List](list.html): When the list was prepared
2836* [Observation](observation.html): Obtained date/time. If the obtained element is a period, a date that falls in the period
2837* [Procedure](procedure.html): When the procedure occurred or is occurring
2838* [RiskAssessment](riskassessment.html): When was assessment made?
2839* [SupplyRequest](supplyrequest.html): When the request was made
2840</b><br>
2841   * Type: <b>date</b><br>
2842   * Path: <b>AllergyIntolerance.recordedDate | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effective | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence as dateTime) | List.date | Observation.effective | Procedure.occurrence | (RiskAssessment.occurrence as dateTime) | SupplyRequest.authoredOn</b><br>
2843   * </p>
2844   */
2845  @SearchParamDefinition(name="date", path="AllergyIntolerance.recordedDate | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effective | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence as dateTime) | List.date | Observation.effective | Procedure.occurrence | (RiskAssessment.occurrence as dateTime) | SupplyRequest.authoredOn", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded\r\n* [CarePlan](careplan.html): Time period plan covers\r\n* [CareTeam](careteam.html): A date within the coverage time period.\r\n* [ClinicalImpression](clinicalimpression.html): When the assessment was documented\r\n* [Composition](composition.html): Composition editing time\r\n* [Consent](consent.html): When consent was agreed to\r\n* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report\r\n* [Encounter](encounter.html): A date within the actualPeriod the Encounter lasted\r\n* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period\r\n* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated\r\n* [Flag](flag.html): Time period when flag is active\r\n* [Immunization](immunization.html): Vaccination  (non)-Administration Date\r\n* [List](list.html): When the list was prepared\r\n* [Observation](observation.html): Obtained date/time. If the obtained element is a period, a date that falls in the period\r\n* [Procedure](procedure.html): When the procedure occurred or is occurring\r\n* [RiskAssessment](riskassessment.html): When was assessment made?\r\n* [SupplyRequest](supplyrequest.html): When the request was made\r\n", type="date" )
2846  public static final String SP_DATE = "date";
2847 /**
2848   * <b>Fluent Client</b> search parameter constant for <b>date</b>
2849   * <p>
2850   * Description: <b>Multiple Resources: 
2851
2852* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded
2853* [CarePlan](careplan.html): Time period plan covers
2854* [CareTeam](careteam.html): A date within the coverage time period.
2855* [ClinicalImpression](clinicalimpression.html): When the assessment was documented
2856* [Composition](composition.html): Composition editing time
2857* [Consent](consent.html): When consent was agreed to
2858* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report
2859* [Encounter](encounter.html): A date within the actualPeriod the Encounter lasted
2860* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period
2861* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated
2862* [Flag](flag.html): Time period when flag is active
2863* [Immunization](immunization.html): Vaccination  (non)-Administration Date
2864* [List](list.html): When the list was prepared
2865* [Observation](observation.html): Obtained date/time. If the obtained element is a period, a date that falls in the period
2866* [Procedure](procedure.html): When the procedure occurred or is occurring
2867* [RiskAssessment](riskassessment.html): When was assessment made?
2868* [SupplyRequest](supplyrequest.html): When the request was made
2869</b><br>
2870   * Type: <b>date</b><br>
2871   * Path: <b>AllergyIntolerance.recordedDate | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effective | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence as dateTime) | List.date | Observation.effective | Procedure.occurrence | (RiskAssessment.occurrence as dateTime) | SupplyRequest.authoredOn</b><br>
2872   * </p>
2873   */
2874  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
2875
2876 /**
2877   * Search parameter: <b>identifier</b>
2878   * <p>
2879   * Description: <b>Multiple Resources: 
2880
2881* [AllergyIntolerance](allergyintolerance.html): External ids for this item
2882* [CarePlan](careplan.html): External Ids for this plan
2883* [CareTeam](careteam.html): External Ids for this team
2884* [Composition](composition.html): Version-independent identifier for the Composition
2885* [Condition](condition.html): A unique identifier of the condition record
2886* [Consent](consent.html): Identifier for this record (external references)
2887* [DetectedIssue](detectedissue.html): Unique id for the detected issue
2888* [DeviceRequest](devicerequest.html): Business identifier for request/order
2889* [DiagnosticReport](diagnosticreport.html): An identifier for the report
2890* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
2891* [DocumentReference](documentreference.html): Identifier of the attachment binary
2892* [Encounter](encounter.html): Identifier(s) by which this encounter is known
2893* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
2894* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
2895* [Goal](goal.html): External Ids for this goal
2896* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
2897* [Immunization](immunization.html): Business identifier
2898* [List](list.html): Business identifier
2899* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
2900* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
2901* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
2902* [MedicationUsage](medicationusage.html): Return statements with this external identifier
2903* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
2904* [Observation](observation.html): The unique id for a particular observation
2905* [Procedure](procedure.html): A unique identifier for a procedure
2906* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
2907* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
2908* [SupplyDelivery](supplydelivery.html): External identifier
2909* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
2910* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
2911</b><br>
2912   * Type: <b>token</b><br>
2913   * Path: <b>AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.content.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier</b><br>
2914   * </p>
2915   */
2916  @SearchParamDefinition(name="identifier", path="AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.content.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): External ids for this item\r\n* [CarePlan](careplan.html): External Ids for this plan\r\n* [CareTeam](careteam.html): External Ids for this team\r\n* [Composition](composition.html): Version-independent identifier for the Composition\r\n* [Condition](condition.html): A unique identifier of the condition record\r\n* [Consent](consent.html): Identifier for this record (external references)\r\n* [DetectedIssue](detectedissue.html): Unique id for the detected issue\r\n* [DeviceRequest](devicerequest.html): Business identifier for request/order\r\n* [DiagnosticReport](diagnosticreport.html): An identifier for the report\r\n* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents\r\n* [DocumentReference](documentreference.html): Identifier of the attachment binary\r\n* [Encounter](encounter.html): Identifier(s) by which this encounter is known\r\n* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare\r\n* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier\r\n* [Goal](goal.html): External Ids for this goal\r\n* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID\r\n* [Immunization](immunization.html): Business identifier\r\n* [List](list.html): Business identifier\r\n* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier\r\n* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier\r\n* [MedicationUsage](medicationusage.html): Return statements with this external identifier\r\n* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier\r\n* [Observation](observation.html): The unique id for a particular observation\r\n* [Procedure](procedure.html): A unique identifier for a procedure\r\n* [RiskAssessment](riskassessment.html): Unique identifier for the assessment\r\n* [ServiceRequest](servicerequest.html): Identifiers assigned to this order\r\n* [SupplyDelivery](supplydelivery.html): External identifier\r\n* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest\r\n* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier\r\n", type="token" )
2917  public static final String SP_IDENTIFIER = "identifier";
2918 /**
2919   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2920   * <p>
2921   * Description: <b>Multiple Resources: 
2922
2923* [AllergyIntolerance](allergyintolerance.html): External ids for this item
2924* [CarePlan](careplan.html): External Ids for this plan
2925* [CareTeam](careteam.html): External Ids for this team
2926* [Composition](composition.html): Version-independent identifier for the Composition
2927* [Condition](condition.html): A unique identifier of the condition record
2928* [Consent](consent.html): Identifier for this record (external references)
2929* [DetectedIssue](detectedissue.html): Unique id for the detected issue
2930* [DeviceRequest](devicerequest.html): Business identifier for request/order
2931* [DiagnosticReport](diagnosticreport.html): An identifier for the report
2932* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
2933* [DocumentReference](documentreference.html): Identifier of the attachment binary
2934* [Encounter](encounter.html): Identifier(s) by which this encounter is known
2935* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
2936* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
2937* [Goal](goal.html): External Ids for this goal
2938* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
2939* [Immunization](immunization.html): Business identifier
2940* [List](list.html): Business identifier
2941* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
2942* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
2943* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
2944* [MedicationUsage](medicationusage.html): Return statements with this external identifier
2945* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
2946* [Observation](observation.html): The unique id for a particular observation
2947* [Procedure](procedure.html): A unique identifier for a procedure
2948* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
2949* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
2950* [SupplyDelivery](supplydelivery.html): External identifier
2951* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
2952* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
2953</b><br>
2954   * Type: <b>token</b><br>
2955   * Path: <b>AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.content.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier</b><br>
2956   * </p>
2957   */
2958  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2959
2960 /**
2961   * Search parameter: <b>patient</b>
2962   * <p>
2963   * Description: <b>Multiple Resources: 
2964
2965* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
2966* [CarePlan](careplan.html): Who the care plan is for
2967* [CareTeam](careteam.html): Who care team is for
2968* [ClinicalImpression](clinicalimpression.html): Patient assessed
2969* [Composition](composition.html): Who and/or what the composition is about
2970* [Condition](condition.html): Who has the condition?
2971* [Consent](consent.html): Who the consent applies to
2972* [DetectedIssue](detectedissue.html): Associated patient
2973* [DeviceRequest](devicerequest.html): Individual the service is ordered for
2974* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
2975* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
2976* [DocumentManifest](documentmanifest.html): The subject of the set of documents
2977* [DocumentReference](documentreference.html): Who/what is the subject of the document
2978* [Encounter](encounter.html): The patient present at the encounter
2979* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
2980* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
2981* [Flag](flag.html): The identity of a subject to list flags for
2982* [Goal](goal.html): Who this goal is intended for
2983* [ImagingStudy](imagingstudy.html): Who the study is about
2984* [Immunization](immunization.html): The patient for the vaccination record
2985* [List](list.html): If all resources have the same subject
2986* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
2987* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
2988* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
2989* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.
2990* [NutritionOrder](nutritionorder.html): The identity of the person who requires the diet, formula or nutritional supplement
2991* [Observation](observation.html): The subject that the observation is about (if patient)
2992* [Procedure](procedure.html): Search by subject - a patient
2993* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
2994* [ServiceRequest](servicerequest.html): Search by subject - a patient
2995* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
2996* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
2997</b><br>
2998   * Type: <b>reference</b><br>
2999   * Path: <b>AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.patient | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.patient | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | VisionPrescription.patient</b><br>
3000   * </p>
3001   */
3002  @SearchParamDefinition(name="patient", path="AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.patient | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.patient | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | VisionPrescription.patient", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for\r\n* [CarePlan](careplan.html): Who the care plan is for\r\n* [CareTeam](careteam.html): Who care team is for\r\n* [ClinicalImpression](clinicalimpression.html): Patient assessed\r\n* [Composition](composition.html): Who and/or what the composition is about\r\n* [Condition](condition.html): Who has the condition?\r\n* [Consent](consent.html): Who the consent applies to\r\n* [DetectedIssue](detectedissue.html): Associated patient\r\n* [DeviceRequest](devicerequest.html): Individual the service is ordered for\r\n* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device\r\n* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient\r\n* [DocumentManifest](documentmanifest.html): The subject of the set of documents\r\n* [DocumentReference](documentreference.html): Who/what is the subject of the document\r\n* [Encounter](encounter.html): The patient present at the encounter\r\n* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care\r\n* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for\r\n* [Flag](flag.html): The identity of a subject to list flags for\r\n* [Goal](goal.html): Who this goal is intended for\r\n* [ImagingStudy](imagingstudy.html): Who the study is about\r\n* [Immunization](immunization.html): The patient for the vaccination record\r\n* [List](list.html): If all resources have the same subject\r\n* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for\r\n* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for\r\n* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient\r\n* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.\r\n* [NutritionOrder](nutritionorder.html): The identity of the person who requires the diet, formula or nutritional supplement\r\n* [Observation](observation.html): The subject that the observation is about (if patient)\r\n* [Procedure](procedure.html): Search by subject - a patient\r\n* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?\r\n* [ServiceRequest](servicerequest.html): Search by subject - a patient\r\n* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied\r\n* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for\r\n", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient") }, target={Account.class, ActivityDefinition.class, AdministrableProductDefinition.class, AdverseEvent.class, AllergyIntolerance.class, Appointment.class, AppointmentResponse.class, ArtifactAssessment.class, AuditEvent.class, Basic.class, Binary.class, BiologicallyDerivedProduct.class, BodyStructure.class, Bundle.class, CapabilityStatement.class, CapabilityStatement2.class, CarePlan.class, CareTeam.class, ChargeItem.class, ChargeItemDefinition.class, Citation.class, Claim.class, ClaimResponse.class, ClinicalImpression.class, ClinicalUseDefinition.class, ClinicalUseIssue.class, CodeSystem.class, Communication.class, CommunicationRequest.class, CompartmentDefinition.class, Composition.class, ConceptMap.class, ConceptMap2.class, Condition.class, ConditionDefinition.class, Consent.class, Contract.class, Coverage.class, CoverageEligibilityRequest.class, CoverageEligibilityResponse.class, DetectedIssue.class, Device.class, DeviceDefinition.class, DeviceDispense.class, DeviceMetric.class, DeviceRequest.class, DeviceUsage.class, DiagnosticReport.class, DocumentManifest.class, DocumentReference.class, Encounter.class, Endpoint.class, EnrollmentRequest.class, EnrollmentResponse.class, EpisodeOfCare.class, EventDefinition.class, Evidence.class, EvidenceReport.class, EvidenceVariable.class, ExampleScenario.class, ExplanationOfBenefit.class, FamilyMemberHistory.class, Flag.class, Goal.class, GraphDefinition.class, Group.class, GuidanceResponse.class, HealthcareService.class, ImagingSelection.class, ImagingStudy.class, Immunization.class, ImmunizationEvaluation.class, ImmunizationRecommendation.class, ImplementationGuide.class, Ingredient.class, InsurancePlan.class, InventoryReport.class, Invoice.class, Library.class, Linkage.class, ListResource.class, Location.class, ManufacturedItemDefinition.class, Measure.class, MeasureReport.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationUsage.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.class, NutritionIntake.class, NutritionOrder.class, NutritionProduct.class, Observation.class, ObservationDefinition.class, OperationDefinition.class, OperationOutcome.class, Organization.class, OrganizationAffiliation.class, PackagedProductDefinition.class, Patient.class, PaymentNotice.class, PaymentReconciliation.class, Permission.class, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestGroup.class, ResearchStudy.class, ResearchSubject.class, RiskAssessment.class, Schedule.class, SearchParameter.class, ServiceRequest.class, Slot.class, Specimen.class, SpecimenDefinition.class, StructureDefinition.class, StructureMap.class, Subscription.class, SubscriptionStatus.class, SubscriptionTopic.class, Substance.class, SubstanceDefinition.class, SubstanceNucleicAcid.class, SubstancePolymer.class, SubstanceProtein.class, SubstanceReferenceInformation.class, SubstanceSourceMaterial.class, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestReport.class, TestScript.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
3003  public static final String SP_PATIENT = "patient";
3004 /**
3005   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
3006   * <p>
3007   * Description: <b>Multiple Resources: 
3008
3009* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
3010* [CarePlan](careplan.html): Who the care plan is for
3011* [CareTeam](careteam.html): Who care team is for
3012* [ClinicalImpression](clinicalimpression.html): Patient assessed
3013* [Composition](composition.html): Who and/or what the composition is about
3014* [Condition](condition.html): Who has the condition?
3015* [Consent](consent.html): Who the consent applies to
3016* [DetectedIssue](detectedissue.html): Associated patient
3017* [DeviceRequest](devicerequest.html): Individual the service is ordered for
3018* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
3019* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
3020* [DocumentManifest](documentmanifest.html): The subject of the set of documents
3021* [DocumentReference](documentreference.html): Who/what is the subject of the document
3022* [Encounter](encounter.html): The patient present at the encounter
3023* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
3024* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
3025* [Flag](flag.html): The identity of a subject to list flags for
3026* [Goal](goal.html): Who this goal is intended for
3027* [ImagingStudy](imagingstudy.html): Who the study is about
3028* [Immunization](immunization.html): The patient for the vaccination record
3029* [List](list.html): If all resources have the same subject
3030* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
3031* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
3032* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
3033* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.
3034* [NutritionOrder](nutritionorder.html): The identity of the person who requires the diet, formula or nutritional supplement
3035* [Observation](observation.html): The subject that the observation is about (if patient)
3036* [Procedure](procedure.html): Search by subject - a patient
3037* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
3038* [ServiceRequest](servicerequest.html): Search by subject - a patient
3039* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
3040* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
3041</b><br>
3042   * Type: <b>reference</b><br>
3043   * Path: <b>AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.patient | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.patient | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | VisionPrescription.patient</b><br>
3044   * </p>
3045   */
3046  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
3047
3048/**
3049   * Constant for fluent queries to be used to add include statements. Specifies
3050   * the path value of "<b>FamilyMemberHistory:patient</b>".
3051   */
3052  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("FamilyMemberHistory:patient").toLocked();
3053
3054
3055}
3056