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