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