001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Sat, Nov 5, 2022 10:47+1100 for FHIR v5.0.0-ballot
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * A physical entity which is the primary unit of operational and/or administrative interest in a study.
052 */
053@ResourceDef(name="ResearchSubject", profile="http://hl7.org/fhir/StructureDefinition/ResearchSubject")
054public class ResearchSubject extends DomainResource {
055
056    @Block()
057    public static class ResearchSubjectProgressComponent extends BackboneElement implements IBaseBackboneElement {
058        /**
059         * Identifies the aspect of the subject's journey that the state refers to.
060         */
061        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
062        @Description(shortDefinition="state | milestone", formalDefinition="Identifies the aspect of the subject's journey that the state refers to." )
063        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-subject-state-type")
064        protected CodeableConcept type;
065
066        /**
067         * The current state of the subject.
068         */
069        @Child(name = "subjectState", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
070        @Description(shortDefinition="candidate | eligible | follow-up | ineligible | not-registered | off-study | on-study | on-study-intervention | on-study-observation | pending-on-study | potential-candidate | screening | withdrawn", formalDefinition="The current state of the subject." )
071        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-subject-state")
072        protected CodeableConcept subjectState;
073
074        /**
075         * The milestones the subject has passed through.
076         */
077        @Child(name = "milestone", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
078        @Description(shortDefinition="SignedUp | Screened | Randomized", formalDefinition="The milestones the subject has passed through." )
079        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-subject-milestone")
080        protected CodeableConcept milestone;
081
082        /**
083         * The reason for the state change.  If coded it should follow the formal subject state model.
084         */
085        @Child(name = "reason", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false)
086        @Description(shortDefinition="State change reason", formalDefinition="The reason for the state change.  If coded it should follow the formal subject state model." )
087        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/state-change-reason")
088        protected CodeableConcept reason;
089
090        /**
091         * The date when the new status started.
092         */
093        @Child(name = "startDate", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=false)
094        @Description(shortDefinition="State change date", formalDefinition="The date when the new status started." )
095        protected DateTimeType startDate;
096
097        /**
098         * The date when the state ended.
099         */
100        @Child(name = "endDate", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=false)
101        @Description(shortDefinition="State change date", formalDefinition="The date when the state ended." )
102        protected DateTimeType endDate;
103
104        private static final long serialVersionUID = -330838916L;
105
106    /**
107     * Constructor
108     */
109      public ResearchSubjectProgressComponent() {
110        super();
111      }
112
113        /**
114         * @return {@link #type} (Identifies the aspect of the subject's journey that the state refers to.)
115         */
116        public CodeableConcept getType() { 
117          if (this.type == null)
118            if (Configuration.errorOnAutoCreate())
119              throw new Error("Attempt to auto-create ResearchSubjectProgressComponent.type");
120            else if (Configuration.doAutoCreate())
121              this.type = new CodeableConcept(); // cc
122          return this.type;
123        }
124
125        public boolean hasType() { 
126          return this.type != null && !this.type.isEmpty();
127        }
128
129        /**
130         * @param value {@link #type} (Identifies the aspect of the subject's journey that the state refers to.)
131         */
132        public ResearchSubjectProgressComponent setType(CodeableConcept value) { 
133          this.type = value;
134          return this;
135        }
136
137        /**
138         * @return {@link #subjectState} (The current state of the subject.)
139         */
140        public CodeableConcept getSubjectState() { 
141          if (this.subjectState == null)
142            if (Configuration.errorOnAutoCreate())
143              throw new Error("Attempt to auto-create ResearchSubjectProgressComponent.subjectState");
144            else if (Configuration.doAutoCreate())
145              this.subjectState = new CodeableConcept(); // cc
146          return this.subjectState;
147        }
148
149        public boolean hasSubjectState() { 
150          return this.subjectState != null && !this.subjectState.isEmpty();
151        }
152
153        /**
154         * @param value {@link #subjectState} (The current state of the subject.)
155         */
156        public ResearchSubjectProgressComponent setSubjectState(CodeableConcept value) { 
157          this.subjectState = value;
158          return this;
159        }
160
161        /**
162         * @return {@link #milestone} (The milestones the subject has passed through.)
163         */
164        public CodeableConcept getMilestone() { 
165          if (this.milestone == null)
166            if (Configuration.errorOnAutoCreate())
167              throw new Error("Attempt to auto-create ResearchSubjectProgressComponent.milestone");
168            else if (Configuration.doAutoCreate())
169              this.milestone = new CodeableConcept(); // cc
170          return this.milestone;
171        }
172
173        public boolean hasMilestone() { 
174          return this.milestone != null && !this.milestone.isEmpty();
175        }
176
177        /**
178         * @param value {@link #milestone} (The milestones the subject has passed through.)
179         */
180        public ResearchSubjectProgressComponent setMilestone(CodeableConcept value) { 
181          this.milestone = value;
182          return this;
183        }
184
185        /**
186         * @return {@link #reason} (The reason for the state change.  If coded it should follow the formal subject state model.)
187         */
188        public CodeableConcept getReason() { 
189          if (this.reason == null)
190            if (Configuration.errorOnAutoCreate())
191              throw new Error("Attempt to auto-create ResearchSubjectProgressComponent.reason");
192            else if (Configuration.doAutoCreate())
193              this.reason = new CodeableConcept(); // cc
194          return this.reason;
195        }
196
197        public boolean hasReason() { 
198          return this.reason != null && !this.reason.isEmpty();
199        }
200
201        /**
202         * @param value {@link #reason} (The reason for the state change.  If coded it should follow the formal subject state model.)
203         */
204        public ResearchSubjectProgressComponent setReason(CodeableConcept value) { 
205          this.reason = value;
206          return this;
207        }
208
209        /**
210         * @return {@link #startDate} (The date when the new status started.). This is the underlying object with id, value and extensions. The accessor "getStartDate" gives direct access to the value
211         */
212        public DateTimeType getStartDateElement() { 
213          if (this.startDate == null)
214            if (Configuration.errorOnAutoCreate())
215              throw new Error("Attempt to auto-create ResearchSubjectProgressComponent.startDate");
216            else if (Configuration.doAutoCreate())
217              this.startDate = new DateTimeType(); // bb
218          return this.startDate;
219        }
220
221        public boolean hasStartDateElement() { 
222          return this.startDate != null && !this.startDate.isEmpty();
223        }
224
225        public boolean hasStartDate() { 
226          return this.startDate != null && !this.startDate.isEmpty();
227        }
228
229        /**
230         * @param value {@link #startDate} (The date when the new status started.). This is the underlying object with id, value and extensions. The accessor "getStartDate" gives direct access to the value
231         */
232        public ResearchSubjectProgressComponent setStartDateElement(DateTimeType value) { 
233          this.startDate = value;
234          return this;
235        }
236
237        /**
238         * @return The date when the new status started.
239         */
240        public Date getStartDate() { 
241          return this.startDate == null ? null : this.startDate.getValue();
242        }
243
244        /**
245         * @param value The date when the new status started.
246         */
247        public ResearchSubjectProgressComponent setStartDate(Date value) { 
248          if (value == null)
249            this.startDate = null;
250          else {
251            if (this.startDate == null)
252              this.startDate = new DateTimeType();
253            this.startDate.setValue(value);
254          }
255          return this;
256        }
257
258        /**
259         * @return {@link #endDate} (The date when the state ended.). This is the underlying object with id, value and extensions. The accessor "getEndDate" gives direct access to the value
260         */
261        public DateTimeType getEndDateElement() { 
262          if (this.endDate == null)
263            if (Configuration.errorOnAutoCreate())
264              throw new Error("Attempt to auto-create ResearchSubjectProgressComponent.endDate");
265            else if (Configuration.doAutoCreate())
266              this.endDate = new DateTimeType(); // bb
267          return this.endDate;
268        }
269
270        public boolean hasEndDateElement() { 
271          return this.endDate != null && !this.endDate.isEmpty();
272        }
273
274        public boolean hasEndDate() { 
275          return this.endDate != null && !this.endDate.isEmpty();
276        }
277
278        /**
279         * @param value {@link #endDate} (The date when the state ended.). This is the underlying object with id, value and extensions. The accessor "getEndDate" gives direct access to the value
280         */
281        public ResearchSubjectProgressComponent setEndDateElement(DateTimeType value) { 
282          this.endDate = value;
283          return this;
284        }
285
286        /**
287         * @return The date when the state ended.
288         */
289        public Date getEndDate() { 
290          return this.endDate == null ? null : this.endDate.getValue();
291        }
292
293        /**
294         * @param value The date when the state ended.
295         */
296        public ResearchSubjectProgressComponent setEndDate(Date value) { 
297          if (value == null)
298            this.endDate = null;
299          else {
300            if (this.endDate == null)
301              this.endDate = new DateTimeType();
302            this.endDate.setValue(value);
303          }
304          return this;
305        }
306
307        protected void listChildren(List<Property> children) {
308          super.listChildren(children);
309          children.add(new Property("type", "CodeableConcept", "Identifies the aspect of the subject's journey that the state refers to.", 0, 1, type));
310          children.add(new Property("subjectState", "CodeableConcept", "The current state of the subject.", 0, 1, subjectState));
311          children.add(new Property("milestone", "CodeableConcept", "The milestones the subject has passed through.", 0, 1, milestone));
312          children.add(new Property("reason", "CodeableConcept", "The reason for the state change.  If coded it should follow the formal subject state model.", 0, 1, reason));
313          children.add(new Property("startDate", "dateTime", "The date when the new status started.", 0, 1, startDate));
314          children.add(new Property("endDate", "dateTime", "The date when the state ended.", 0, 1, endDate));
315        }
316
317        @Override
318        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
319          switch (_hash) {
320          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Identifies the aspect of the subject's journey that the state refers to.", 0, 1, type);
321          case -1520444731: /*subjectState*/  return new Property("subjectState", "CodeableConcept", "The current state of the subject.", 0, 1, subjectState);
322          case -1065084560: /*milestone*/  return new Property("milestone", "CodeableConcept", "The milestones the subject has passed through.", 0, 1, milestone);
323          case -934964668: /*reason*/  return new Property("reason", "CodeableConcept", "The reason for the state change.  If coded it should follow the formal subject state model.", 0, 1, reason);
324          case -2129778896: /*startDate*/  return new Property("startDate", "dateTime", "The date when the new status started.", 0, 1, startDate);
325          case -1607727319: /*endDate*/  return new Property("endDate", "dateTime", "The date when the state ended.", 0, 1, endDate);
326          default: return super.getNamedProperty(_hash, _name, _checkValid);
327          }
328
329        }
330
331      @Override
332      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
333        switch (hash) {
334        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
335        case -1520444731: /*subjectState*/ return this.subjectState == null ? new Base[0] : new Base[] {this.subjectState}; // CodeableConcept
336        case -1065084560: /*milestone*/ return this.milestone == null ? new Base[0] : new Base[] {this.milestone}; // CodeableConcept
337        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // CodeableConcept
338        case -2129778896: /*startDate*/ return this.startDate == null ? new Base[0] : new Base[] {this.startDate}; // DateTimeType
339        case -1607727319: /*endDate*/ return this.endDate == null ? new Base[0] : new Base[] {this.endDate}; // DateTimeType
340        default: return super.getProperty(hash, name, checkValid);
341        }
342
343      }
344
345      @Override
346      public Base setProperty(int hash, String name, Base value) throws FHIRException {
347        switch (hash) {
348        case 3575610: // type
349          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
350          return value;
351        case -1520444731: // subjectState
352          this.subjectState = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
353          return value;
354        case -1065084560: // milestone
355          this.milestone = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
356          return value;
357        case -934964668: // reason
358          this.reason = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
359          return value;
360        case -2129778896: // startDate
361          this.startDate = TypeConvertor.castToDateTime(value); // DateTimeType
362          return value;
363        case -1607727319: // endDate
364          this.endDate = TypeConvertor.castToDateTime(value); // DateTimeType
365          return value;
366        default: return super.setProperty(hash, name, value);
367        }
368
369      }
370
371      @Override
372      public Base setProperty(String name, Base value) throws FHIRException {
373        if (name.equals("type")) {
374          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
375        } else if (name.equals("subjectState")) {
376          this.subjectState = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
377        } else if (name.equals("milestone")) {
378          this.milestone = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
379        } else if (name.equals("reason")) {
380          this.reason = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
381        } else if (name.equals("startDate")) {
382          this.startDate = TypeConvertor.castToDateTime(value); // DateTimeType
383        } else if (name.equals("endDate")) {
384          this.endDate = TypeConvertor.castToDateTime(value); // DateTimeType
385        } else
386          return super.setProperty(name, value);
387        return value;
388      }
389
390      @Override
391      public Base makeProperty(int hash, String name) throws FHIRException {
392        switch (hash) {
393        case 3575610:  return getType();
394        case -1520444731:  return getSubjectState();
395        case -1065084560:  return getMilestone();
396        case -934964668:  return getReason();
397        case -2129778896:  return getStartDateElement();
398        case -1607727319:  return getEndDateElement();
399        default: return super.makeProperty(hash, name);
400        }
401
402      }
403
404      @Override
405      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
406        switch (hash) {
407        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
408        case -1520444731: /*subjectState*/ return new String[] {"CodeableConcept"};
409        case -1065084560: /*milestone*/ return new String[] {"CodeableConcept"};
410        case -934964668: /*reason*/ return new String[] {"CodeableConcept"};
411        case -2129778896: /*startDate*/ return new String[] {"dateTime"};
412        case -1607727319: /*endDate*/ return new String[] {"dateTime"};
413        default: return super.getTypesForProperty(hash, name);
414        }
415
416      }
417
418      @Override
419      public Base addChild(String name) throws FHIRException {
420        if (name.equals("type")) {
421          this.type = new CodeableConcept();
422          return this.type;
423        }
424        else if (name.equals("subjectState")) {
425          this.subjectState = new CodeableConcept();
426          return this.subjectState;
427        }
428        else if (name.equals("milestone")) {
429          this.milestone = new CodeableConcept();
430          return this.milestone;
431        }
432        else if (name.equals("reason")) {
433          this.reason = new CodeableConcept();
434          return this.reason;
435        }
436        else if (name.equals("startDate")) {
437          throw new FHIRException("Cannot call addChild on a primitive type ResearchSubject.progress.startDate");
438        }
439        else if (name.equals("endDate")) {
440          throw new FHIRException("Cannot call addChild on a primitive type ResearchSubject.progress.endDate");
441        }
442        else
443          return super.addChild(name);
444      }
445
446      public ResearchSubjectProgressComponent copy() {
447        ResearchSubjectProgressComponent dst = new ResearchSubjectProgressComponent();
448        copyValues(dst);
449        return dst;
450      }
451
452      public void copyValues(ResearchSubjectProgressComponent dst) {
453        super.copyValues(dst);
454        dst.type = type == null ? null : type.copy();
455        dst.subjectState = subjectState == null ? null : subjectState.copy();
456        dst.milestone = milestone == null ? null : milestone.copy();
457        dst.reason = reason == null ? null : reason.copy();
458        dst.startDate = startDate == null ? null : startDate.copy();
459        dst.endDate = endDate == null ? null : endDate.copy();
460      }
461
462      @Override
463      public boolean equalsDeep(Base other_) {
464        if (!super.equalsDeep(other_))
465          return false;
466        if (!(other_ instanceof ResearchSubjectProgressComponent))
467          return false;
468        ResearchSubjectProgressComponent o = (ResearchSubjectProgressComponent) other_;
469        return compareDeep(type, o.type, true) && compareDeep(subjectState, o.subjectState, true) && compareDeep(milestone, o.milestone, true)
470           && compareDeep(reason, o.reason, true) && compareDeep(startDate, o.startDate, true) && compareDeep(endDate, o.endDate, true)
471          ;
472      }
473
474      @Override
475      public boolean equalsShallow(Base other_) {
476        if (!super.equalsShallow(other_))
477          return false;
478        if (!(other_ instanceof ResearchSubjectProgressComponent))
479          return false;
480        ResearchSubjectProgressComponent o = (ResearchSubjectProgressComponent) other_;
481        return compareValues(startDate, o.startDate, true) && compareValues(endDate, o.endDate, true);
482      }
483
484      public boolean isEmpty() {
485        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, subjectState, milestone
486          , reason, startDate, endDate);
487      }
488
489  public String fhirType() {
490    return "ResearchSubject.progress";
491
492  }
493
494  }
495
496    /**
497     * Identifiers assigned to this research subject for a study.
498     */
499    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
500    @Description(shortDefinition="Business Identifier for research subject in a study", formalDefinition="Identifiers assigned to this research subject for a study." )
501    protected List<Identifier> identifier;
502
503    /**
504     * The publication state of the resource (not of the subject).
505     */
506    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
507    @Description(shortDefinition="draft | active | retired | unknown", formalDefinition="The publication state of the resource (not of the subject)." )
508    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/publication-status")
509    protected Enumeration<PublicationStatus> status;
510
511    /**
512     * The current state (status) of the subject and resons for status change where appropriate.
513     */
514    @Child(name = "progress", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
515    @Description(shortDefinition="Subject status", formalDefinition="The current state (status) of the subject and resons for status change where appropriate." )
516    protected List<ResearchSubjectProgressComponent> progress;
517
518    /**
519     * The dates the subject began and ended their participation in the study.
520     */
521    @Child(name = "period", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=true)
522    @Description(shortDefinition="Start and end of participation", formalDefinition="The dates the subject began and ended their participation in the study." )
523    protected Period period;
524
525    /**
526     * Reference to the study the subject is participating in.
527     */
528    @Child(name = "study", type = {ResearchStudy.class}, order=4, min=1, max=1, modifier=false, summary=true)
529    @Description(shortDefinition="Study subject is part of", formalDefinition="Reference to the study the subject is participating in." )
530    protected Reference study;
531
532    /**
533     * The record of the person, animal or other entity involved in the study.
534     */
535    @Child(name = "subject", type = {Patient.class, Group.class, Specimen.class, Device.class, Medication.class, Substance.class, BiologicallyDerivedProduct.class}, order=5, min=1, max=1, modifier=false, summary=true)
536    @Description(shortDefinition="Who or what is part of study", formalDefinition="The record of the person, animal or other entity involved in the study." )
537    protected Reference subject;
538
539    /**
540     * The name of the arm in the study the subject is expected to follow as part of this study.
541     */
542    @Child(name = "assignedArm", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false)
543    @Description(shortDefinition="What path should be followed", formalDefinition="The name of the arm in the study the subject is expected to follow as part of this study." )
544    protected StringType assignedArm;
545
546    /**
547     * The name of the arm in the study the subject actually followed as part of this study.
548     */
549    @Child(name = "actualArm", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=false)
550    @Description(shortDefinition="What path was followed", formalDefinition="The name of the arm in the study the subject actually followed as part of this study." )
551    protected StringType actualArm;
552
553    /**
554     * A record of the patient's informed agreement to participate in the study.
555     */
556    @Child(name = "consent", type = {Consent.class}, order=8, min=0, max=1, modifier=false, summary=false)
557    @Description(shortDefinition="Agreement to participate in study", formalDefinition="A record of the patient's informed agreement to participate in the study." )
558    protected Reference consent;
559
560    private static final long serialVersionUID = -398870757L;
561
562  /**
563   * Constructor
564   */
565    public ResearchSubject() {
566      super();
567    }
568
569  /**
570   * Constructor
571   */
572    public ResearchSubject(PublicationStatus status, Reference study, Reference subject) {
573      super();
574      this.setStatus(status);
575      this.setStudy(study);
576      this.setSubject(subject);
577    }
578
579    /**
580     * @return {@link #identifier} (Identifiers assigned to this research subject for a study.)
581     */
582    public List<Identifier> getIdentifier() { 
583      if (this.identifier == null)
584        this.identifier = new ArrayList<Identifier>();
585      return this.identifier;
586    }
587
588    /**
589     * @return Returns a reference to <code>this</code> for easy method chaining
590     */
591    public ResearchSubject setIdentifier(List<Identifier> theIdentifier) { 
592      this.identifier = theIdentifier;
593      return this;
594    }
595
596    public boolean hasIdentifier() { 
597      if (this.identifier == null)
598        return false;
599      for (Identifier item : this.identifier)
600        if (!item.isEmpty())
601          return true;
602      return false;
603    }
604
605    public Identifier addIdentifier() { //3
606      Identifier t = new Identifier();
607      if (this.identifier == null)
608        this.identifier = new ArrayList<Identifier>();
609      this.identifier.add(t);
610      return t;
611    }
612
613    public ResearchSubject addIdentifier(Identifier t) { //3
614      if (t == null)
615        return this;
616      if (this.identifier == null)
617        this.identifier = new ArrayList<Identifier>();
618      this.identifier.add(t);
619      return this;
620    }
621
622    /**
623     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
624     */
625    public Identifier getIdentifierFirstRep() { 
626      if (getIdentifier().isEmpty()) {
627        addIdentifier();
628      }
629      return getIdentifier().get(0);
630    }
631
632    /**
633     * @return {@link #status} (The publication state of the resource (not of the subject).). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
634     */
635    public Enumeration<PublicationStatus> getStatusElement() { 
636      if (this.status == null)
637        if (Configuration.errorOnAutoCreate())
638          throw new Error("Attempt to auto-create ResearchSubject.status");
639        else if (Configuration.doAutoCreate())
640          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
641      return this.status;
642    }
643
644    public boolean hasStatusElement() { 
645      return this.status != null && !this.status.isEmpty();
646    }
647
648    public boolean hasStatus() { 
649      return this.status != null && !this.status.isEmpty();
650    }
651
652    /**
653     * @param value {@link #status} (The publication state of the resource (not of the subject).). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
654     */
655    public ResearchSubject setStatusElement(Enumeration<PublicationStatus> value) { 
656      this.status = value;
657      return this;
658    }
659
660    /**
661     * @return The publication state of the resource (not of the subject).
662     */
663    public PublicationStatus getStatus() { 
664      return this.status == null ? null : this.status.getValue();
665    }
666
667    /**
668     * @param value The publication state of the resource (not of the subject).
669     */
670    public ResearchSubject setStatus(PublicationStatus value) { 
671        if (this.status == null)
672          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
673        this.status.setValue(value);
674      return this;
675    }
676
677    /**
678     * @return {@link #progress} (The current state (status) of the subject and resons for status change where appropriate.)
679     */
680    public List<ResearchSubjectProgressComponent> getProgress() { 
681      if (this.progress == null)
682        this.progress = new ArrayList<ResearchSubjectProgressComponent>();
683      return this.progress;
684    }
685
686    /**
687     * @return Returns a reference to <code>this</code> for easy method chaining
688     */
689    public ResearchSubject setProgress(List<ResearchSubjectProgressComponent> theProgress) { 
690      this.progress = theProgress;
691      return this;
692    }
693
694    public boolean hasProgress() { 
695      if (this.progress == null)
696        return false;
697      for (ResearchSubjectProgressComponent item : this.progress)
698        if (!item.isEmpty())
699          return true;
700      return false;
701    }
702
703    public ResearchSubjectProgressComponent addProgress() { //3
704      ResearchSubjectProgressComponent t = new ResearchSubjectProgressComponent();
705      if (this.progress == null)
706        this.progress = new ArrayList<ResearchSubjectProgressComponent>();
707      this.progress.add(t);
708      return t;
709    }
710
711    public ResearchSubject addProgress(ResearchSubjectProgressComponent t) { //3
712      if (t == null)
713        return this;
714      if (this.progress == null)
715        this.progress = new ArrayList<ResearchSubjectProgressComponent>();
716      this.progress.add(t);
717      return this;
718    }
719
720    /**
721     * @return The first repetition of repeating field {@link #progress}, creating it if it does not already exist {3}
722     */
723    public ResearchSubjectProgressComponent getProgressFirstRep() { 
724      if (getProgress().isEmpty()) {
725        addProgress();
726      }
727      return getProgress().get(0);
728    }
729
730    /**
731     * @return {@link #period} (The dates the subject began and ended their participation in the study.)
732     */
733    public Period getPeriod() { 
734      if (this.period == null)
735        if (Configuration.errorOnAutoCreate())
736          throw new Error("Attempt to auto-create ResearchSubject.period");
737        else if (Configuration.doAutoCreate())
738          this.period = new Period(); // cc
739      return this.period;
740    }
741
742    public boolean hasPeriod() { 
743      return this.period != null && !this.period.isEmpty();
744    }
745
746    /**
747     * @param value {@link #period} (The dates the subject began and ended their participation in the study.)
748     */
749    public ResearchSubject setPeriod(Period value) { 
750      this.period = value;
751      return this;
752    }
753
754    /**
755     * @return {@link #study} (Reference to the study the subject is participating in.)
756     */
757    public Reference getStudy() { 
758      if (this.study == null)
759        if (Configuration.errorOnAutoCreate())
760          throw new Error("Attempt to auto-create ResearchSubject.study");
761        else if (Configuration.doAutoCreate())
762          this.study = new Reference(); // cc
763      return this.study;
764    }
765
766    public boolean hasStudy() { 
767      return this.study != null && !this.study.isEmpty();
768    }
769
770    /**
771     * @param value {@link #study} (Reference to the study the subject is participating in.)
772     */
773    public ResearchSubject setStudy(Reference value) { 
774      this.study = value;
775      return this;
776    }
777
778    /**
779     * @return {@link #subject} (The record of the person, animal or other entity involved in the study.)
780     */
781    public Reference getSubject() { 
782      if (this.subject == null)
783        if (Configuration.errorOnAutoCreate())
784          throw new Error("Attempt to auto-create ResearchSubject.subject");
785        else if (Configuration.doAutoCreate())
786          this.subject = new Reference(); // cc
787      return this.subject;
788    }
789
790    public boolean hasSubject() { 
791      return this.subject != null && !this.subject.isEmpty();
792    }
793
794    /**
795     * @param value {@link #subject} (The record of the person, animal or other entity involved in the study.)
796     */
797    public ResearchSubject setSubject(Reference value) { 
798      this.subject = value;
799      return this;
800    }
801
802    /**
803     * @return {@link #assignedArm} (The name of the arm in the study the subject is expected to follow as part of this study.). This is the underlying object with id, value and extensions. The accessor "getAssignedArm" gives direct access to the value
804     */
805    public StringType getAssignedArmElement() { 
806      if (this.assignedArm == null)
807        if (Configuration.errorOnAutoCreate())
808          throw new Error("Attempt to auto-create ResearchSubject.assignedArm");
809        else if (Configuration.doAutoCreate())
810          this.assignedArm = new StringType(); // bb
811      return this.assignedArm;
812    }
813
814    public boolean hasAssignedArmElement() { 
815      return this.assignedArm != null && !this.assignedArm.isEmpty();
816    }
817
818    public boolean hasAssignedArm() { 
819      return this.assignedArm != null && !this.assignedArm.isEmpty();
820    }
821
822    /**
823     * @param value {@link #assignedArm} (The name of the arm in the study the subject is expected to follow as part of this study.). This is the underlying object with id, value and extensions. The accessor "getAssignedArm" gives direct access to the value
824     */
825    public ResearchSubject setAssignedArmElement(StringType value) { 
826      this.assignedArm = value;
827      return this;
828    }
829
830    /**
831     * @return The name of the arm in the study the subject is expected to follow as part of this study.
832     */
833    public String getAssignedArm() { 
834      return this.assignedArm == null ? null : this.assignedArm.getValue();
835    }
836
837    /**
838     * @param value The name of the arm in the study the subject is expected to follow as part of this study.
839     */
840    public ResearchSubject setAssignedArm(String value) { 
841      if (Utilities.noString(value))
842        this.assignedArm = null;
843      else {
844        if (this.assignedArm == null)
845          this.assignedArm = new StringType();
846        this.assignedArm.setValue(value);
847      }
848      return this;
849    }
850
851    /**
852     * @return {@link #actualArm} (The name of the arm in the study the subject actually followed as part of this study.). This is the underlying object with id, value and extensions. The accessor "getActualArm" gives direct access to the value
853     */
854    public StringType getActualArmElement() { 
855      if (this.actualArm == null)
856        if (Configuration.errorOnAutoCreate())
857          throw new Error("Attempt to auto-create ResearchSubject.actualArm");
858        else if (Configuration.doAutoCreate())
859          this.actualArm = new StringType(); // bb
860      return this.actualArm;
861    }
862
863    public boolean hasActualArmElement() { 
864      return this.actualArm != null && !this.actualArm.isEmpty();
865    }
866
867    public boolean hasActualArm() { 
868      return this.actualArm != null && !this.actualArm.isEmpty();
869    }
870
871    /**
872     * @param value {@link #actualArm} (The name of the arm in the study the subject actually followed as part of this study.). This is the underlying object with id, value and extensions. The accessor "getActualArm" gives direct access to the value
873     */
874    public ResearchSubject setActualArmElement(StringType value) { 
875      this.actualArm = value;
876      return this;
877    }
878
879    /**
880     * @return The name of the arm in the study the subject actually followed as part of this study.
881     */
882    public String getActualArm() { 
883      return this.actualArm == null ? null : this.actualArm.getValue();
884    }
885
886    /**
887     * @param value The name of the arm in the study the subject actually followed as part of this study.
888     */
889    public ResearchSubject setActualArm(String value) { 
890      if (Utilities.noString(value))
891        this.actualArm = null;
892      else {
893        if (this.actualArm == null)
894          this.actualArm = new StringType();
895        this.actualArm.setValue(value);
896      }
897      return this;
898    }
899
900    /**
901     * @return {@link #consent} (A record of the patient's informed agreement to participate in the study.)
902     */
903    public Reference getConsent() { 
904      if (this.consent == null)
905        if (Configuration.errorOnAutoCreate())
906          throw new Error("Attempt to auto-create ResearchSubject.consent");
907        else if (Configuration.doAutoCreate())
908          this.consent = new Reference(); // cc
909      return this.consent;
910    }
911
912    public boolean hasConsent() { 
913      return this.consent != null && !this.consent.isEmpty();
914    }
915
916    /**
917     * @param value {@link #consent} (A record of the patient's informed agreement to participate in the study.)
918     */
919    public ResearchSubject setConsent(Reference value) { 
920      this.consent = value;
921      return this;
922    }
923
924      protected void listChildren(List<Property> children) {
925        super.listChildren(children);
926        children.add(new Property("identifier", "Identifier", "Identifiers assigned to this research subject for a study.", 0, java.lang.Integer.MAX_VALUE, identifier));
927        children.add(new Property("status", "code", "The publication state of the resource (not of the subject).", 0, 1, status));
928        children.add(new Property("progress", "", "The current state (status) of the subject and resons for status change where appropriate.", 0, java.lang.Integer.MAX_VALUE, progress));
929        children.add(new Property("period", "Period", "The dates the subject began and ended their participation in the study.", 0, 1, period));
930        children.add(new Property("study", "Reference(ResearchStudy)", "Reference to the study the subject is participating in.", 0, 1, study));
931        children.add(new Property("subject", "Reference(Patient|Group|Specimen|Device|Medication|Substance|BiologicallyDerivedProduct)", "The record of the person, animal or other entity involved in the study.", 0, 1, subject));
932        children.add(new Property("assignedArm", "string", "The name of the arm in the study the subject is expected to follow as part of this study.", 0, 1, assignedArm));
933        children.add(new Property("actualArm", "string", "The name of the arm in the study the subject actually followed as part of this study.", 0, 1, actualArm));
934        children.add(new Property("consent", "Reference(Consent)", "A record of the patient's informed agreement to participate in the study.", 0, 1, consent));
935      }
936
937      @Override
938      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
939        switch (_hash) {
940        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifiers assigned to this research subject for a study.", 0, java.lang.Integer.MAX_VALUE, identifier);
941        case -892481550: /*status*/  return new Property("status", "code", "The publication state of the resource (not of the subject).", 0, 1, status);
942        case -1001078227: /*progress*/  return new Property("progress", "", "The current state (status) of the subject and resons for status change where appropriate.", 0, java.lang.Integer.MAX_VALUE, progress);
943        case -991726143: /*period*/  return new Property("period", "Period", "The dates the subject began and ended their participation in the study.", 0, 1, period);
944        case 109776329: /*study*/  return new Property("study", "Reference(ResearchStudy)", "Reference to the study the subject is participating in.", 0, 1, study);
945        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group|Specimen|Device|Medication|Substance|BiologicallyDerivedProduct)", "The record of the person, animal or other entity involved in the study.", 0, 1, subject);
946        case 1741912494: /*assignedArm*/  return new Property("assignedArm", "string", "The name of the arm in the study the subject is expected to follow as part of this study.", 0, 1, assignedArm);
947        case 528827886: /*actualArm*/  return new Property("actualArm", "string", "The name of the arm in the study the subject actually followed as part of this study.", 0, 1, actualArm);
948        case 951500826: /*consent*/  return new Property("consent", "Reference(Consent)", "A record of the patient's informed agreement to participate in the study.", 0, 1, consent);
949        default: return super.getNamedProperty(_hash, _name, _checkValid);
950        }
951
952      }
953
954      @Override
955      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
956        switch (hash) {
957        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
958        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
959        case -1001078227: /*progress*/ return this.progress == null ? new Base[0] : this.progress.toArray(new Base[this.progress.size()]); // ResearchSubjectProgressComponent
960        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
961        case 109776329: /*study*/ return this.study == null ? new Base[0] : new Base[] {this.study}; // Reference
962        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
963        case 1741912494: /*assignedArm*/ return this.assignedArm == null ? new Base[0] : new Base[] {this.assignedArm}; // StringType
964        case 528827886: /*actualArm*/ return this.actualArm == null ? new Base[0] : new Base[] {this.actualArm}; // StringType
965        case 951500826: /*consent*/ return this.consent == null ? new Base[0] : new Base[] {this.consent}; // Reference
966        default: return super.getProperty(hash, name, checkValid);
967        }
968
969      }
970
971      @Override
972      public Base setProperty(int hash, String name, Base value) throws FHIRException {
973        switch (hash) {
974        case -1618432855: // identifier
975          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
976          return value;
977        case -892481550: // status
978          value = new PublicationStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
979          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
980          return value;
981        case -1001078227: // progress
982          this.getProgress().add((ResearchSubjectProgressComponent) value); // ResearchSubjectProgressComponent
983          return value;
984        case -991726143: // period
985          this.period = TypeConvertor.castToPeriod(value); // Period
986          return value;
987        case 109776329: // study
988          this.study = TypeConvertor.castToReference(value); // Reference
989          return value;
990        case -1867885268: // subject
991          this.subject = TypeConvertor.castToReference(value); // Reference
992          return value;
993        case 1741912494: // assignedArm
994          this.assignedArm = TypeConvertor.castToString(value); // StringType
995          return value;
996        case 528827886: // actualArm
997          this.actualArm = TypeConvertor.castToString(value); // StringType
998          return value;
999        case 951500826: // consent
1000          this.consent = TypeConvertor.castToReference(value); // Reference
1001          return value;
1002        default: return super.setProperty(hash, name, value);
1003        }
1004
1005      }
1006
1007      @Override
1008      public Base setProperty(String name, Base value) throws FHIRException {
1009        if (name.equals("identifier")) {
1010          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
1011        } else if (name.equals("status")) {
1012          value = new PublicationStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
1013          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
1014        } else if (name.equals("progress")) {
1015          this.getProgress().add((ResearchSubjectProgressComponent) value);
1016        } else if (name.equals("period")) {
1017          this.period = TypeConvertor.castToPeriod(value); // Period
1018        } else if (name.equals("study")) {
1019          this.study = TypeConvertor.castToReference(value); // Reference
1020        } else if (name.equals("subject")) {
1021          this.subject = TypeConvertor.castToReference(value); // Reference
1022        } else if (name.equals("assignedArm")) {
1023          this.assignedArm = TypeConvertor.castToString(value); // StringType
1024        } else if (name.equals("actualArm")) {
1025          this.actualArm = TypeConvertor.castToString(value); // StringType
1026        } else if (name.equals("consent")) {
1027          this.consent = TypeConvertor.castToReference(value); // Reference
1028        } else
1029          return super.setProperty(name, value);
1030        return value;
1031      }
1032
1033      @Override
1034      public Base makeProperty(int hash, String name) throws FHIRException {
1035        switch (hash) {
1036        case -1618432855:  return addIdentifier(); 
1037        case -892481550:  return getStatusElement();
1038        case -1001078227:  return addProgress(); 
1039        case -991726143:  return getPeriod();
1040        case 109776329:  return getStudy();
1041        case -1867885268:  return getSubject();
1042        case 1741912494:  return getAssignedArmElement();
1043        case 528827886:  return getActualArmElement();
1044        case 951500826:  return getConsent();
1045        default: return super.makeProperty(hash, name);
1046        }
1047
1048      }
1049
1050      @Override
1051      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1052        switch (hash) {
1053        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1054        case -892481550: /*status*/ return new String[] {"code"};
1055        case -1001078227: /*progress*/ return new String[] {};
1056        case -991726143: /*period*/ return new String[] {"Period"};
1057        case 109776329: /*study*/ return new String[] {"Reference"};
1058        case -1867885268: /*subject*/ return new String[] {"Reference"};
1059        case 1741912494: /*assignedArm*/ return new String[] {"string"};
1060        case 528827886: /*actualArm*/ return new String[] {"string"};
1061        case 951500826: /*consent*/ return new String[] {"Reference"};
1062        default: return super.getTypesForProperty(hash, name);
1063        }
1064
1065      }
1066
1067      @Override
1068      public Base addChild(String name) throws FHIRException {
1069        if (name.equals("identifier")) {
1070          return addIdentifier();
1071        }
1072        else if (name.equals("status")) {
1073          throw new FHIRException("Cannot call addChild on a primitive type ResearchSubject.status");
1074        }
1075        else if (name.equals("progress")) {
1076          return addProgress();
1077        }
1078        else if (name.equals("period")) {
1079          this.period = new Period();
1080          return this.period;
1081        }
1082        else if (name.equals("study")) {
1083          this.study = new Reference();
1084          return this.study;
1085        }
1086        else if (name.equals("subject")) {
1087          this.subject = new Reference();
1088          return this.subject;
1089        }
1090        else if (name.equals("assignedArm")) {
1091          throw new FHIRException("Cannot call addChild on a primitive type ResearchSubject.assignedArm");
1092        }
1093        else if (name.equals("actualArm")) {
1094          throw new FHIRException("Cannot call addChild on a primitive type ResearchSubject.actualArm");
1095        }
1096        else if (name.equals("consent")) {
1097          this.consent = new Reference();
1098          return this.consent;
1099        }
1100        else
1101          return super.addChild(name);
1102      }
1103
1104  public String fhirType() {
1105    return "ResearchSubject";
1106
1107  }
1108
1109      public ResearchSubject copy() {
1110        ResearchSubject dst = new ResearchSubject();
1111        copyValues(dst);
1112        return dst;
1113      }
1114
1115      public void copyValues(ResearchSubject dst) {
1116        super.copyValues(dst);
1117        if (identifier != null) {
1118          dst.identifier = new ArrayList<Identifier>();
1119          for (Identifier i : identifier)
1120            dst.identifier.add(i.copy());
1121        };
1122        dst.status = status == null ? null : status.copy();
1123        if (progress != null) {
1124          dst.progress = new ArrayList<ResearchSubjectProgressComponent>();
1125          for (ResearchSubjectProgressComponent i : progress)
1126            dst.progress.add(i.copy());
1127        };
1128        dst.period = period == null ? null : period.copy();
1129        dst.study = study == null ? null : study.copy();
1130        dst.subject = subject == null ? null : subject.copy();
1131        dst.assignedArm = assignedArm == null ? null : assignedArm.copy();
1132        dst.actualArm = actualArm == null ? null : actualArm.copy();
1133        dst.consent = consent == null ? null : consent.copy();
1134      }
1135
1136      protected ResearchSubject typedCopy() {
1137        return copy();
1138      }
1139
1140      @Override
1141      public boolean equalsDeep(Base other_) {
1142        if (!super.equalsDeep(other_))
1143          return false;
1144        if (!(other_ instanceof ResearchSubject))
1145          return false;
1146        ResearchSubject o = (ResearchSubject) other_;
1147        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(progress, o.progress, true)
1148           && compareDeep(period, o.period, true) && compareDeep(study, o.study, true) && compareDeep(subject, o.subject, true)
1149           && compareDeep(assignedArm, o.assignedArm, true) && compareDeep(actualArm, o.actualArm, true) && compareDeep(consent, o.consent, true)
1150          ;
1151      }
1152
1153      @Override
1154      public boolean equalsShallow(Base other_) {
1155        if (!super.equalsShallow(other_))
1156          return false;
1157        if (!(other_ instanceof ResearchSubject))
1158          return false;
1159        ResearchSubject o = (ResearchSubject) other_;
1160        return compareValues(status, o.status, true) && compareValues(assignedArm, o.assignedArm, true) && compareValues(actualArm, o.actualArm, true)
1161          ;
1162      }
1163
1164      public boolean isEmpty() {
1165        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, progress
1166          , period, study, subject, assignedArm, actualArm, consent);
1167      }
1168
1169  @Override
1170  public ResourceType getResourceType() {
1171    return ResourceType.ResearchSubject;
1172   }
1173
1174 /**
1175   * Search parameter: <b>date</b>
1176   * <p>
1177   * Description: <b>Start and end of participation</b><br>
1178   * Type: <b>date</b><br>
1179   * Path: <b>ResearchSubject.period</b><br>
1180   * </p>
1181   */
1182  @SearchParamDefinition(name="date", path="ResearchSubject.period", description="Start and end of participation", type="date" )
1183  public static final String SP_DATE = "date";
1184 /**
1185   * <b>Fluent Client</b> search parameter constant for <b>date</b>
1186   * <p>
1187   * Description: <b>Start and end of participation</b><br>
1188   * Type: <b>date</b><br>
1189   * Path: <b>ResearchSubject.period</b><br>
1190   * </p>
1191   */
1192  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
1193
1194 /**
1195   * Search parameter: <b>identifier</b>
1196   * <p>
1197   * Description: <b>Business Identifier for research subject in a study</b><br>
1198   * Type: <b>token</b><br>
1199   * Path: <b>ResearchSubject.identifier</b><br>
1200   * </p>
1201   */
1202  @SearchParamDefinition(name="identifier", path="ResearchSubject.identifier", description="Business Identifier for research subject in a study", type="token" )
1203  public static final String SP_IDENTIFIER = "identifier";
1204 /**
1205   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
1206   * <p>
1207   * Description: <b>Business Identifier for research subject in a study</b><br>
1208   * Type: <b>token</b><br>
1209   * Path: <b>ResearchSubject.identifier</b><br>
1210   * </p>
1211   */
1212  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
1213
1214 /**
1215   * Search parameter: <b>patient</b>
1216   * <p>
1217   * Description: <b>Who or what is part of study</b><br>
1218   * Type: <b>reference</b><br>
1219   * Path: <b>ResearchSubject.subject</b><br>
1220   * </p>
1221   */
1222  @SearchParamDefinition(name="patient", path="ResearchSubject.subject", description="Who or what is part of study", type="reference", target={BiologicallyDerivedProduct.class, Device.class, Group.class, Medication.class, Patient.class, Specimen.class, Substance.class } )
1223  public static final String SP_PATIENT = "patient";
1224 /**
1225   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
1226   * <p>
1227   * Description: <b>Who or what is part of study</b><br>
1228   * Type: <b>reference</b><br>
1229   * Path: <b>ResearchSubject.subject</b><br>
1230   * </p>
1231   */
1232  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
1233
1234/**
1235   * Constant for fluent queries to be used to add include statements. Specifies
1236   * the path value of "<b>ResearchSubject:patient</b>".
1237   */
1238  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("ResearchSubject:patient").toLocked();
1239
1240 /**
1241   * Search parameter: <b>status</b>
1242   * <p>
1243   * Description: <b>draft | active | retired | unknown</b><br>
1244   * Type: <b>token</b><br>
1245   * Path: <b>ResearchSubject.status</b><br>
1246   * </p>
1247   */
1248  @SearchParamDefinition(name="status", path="ResearchSubject.status", description="draft | active | retired | unknown", type="token" )
1249  public static final String SP_STATUS = "status";
1250 /**
1251   * <b>Fluent Client</b> search parameter constant for <b>status</b>
1252   * <p>
1253   * Description: <b>draft | active | retired | unknown</b><br>
1254   * Type: <b>token</b><br>
1255   * Path: <b>ResearchSubject.status</b><br>
1256   * </p>
1257   */
1258  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
1259
1260 /**
1261   * Search parameter: <b>study</b>
1262   * <p>
1263   * Description: <b>Study subject is part of</b><br>
1264   * Type: <b>reference</b><br>
1265   * Path: <b>ResearchSubject.study</b><br>
1266   * </p>
1267   */
1268  @SearchParamDefinition(name="study", path="ResearchSubject.study", description="Study subject is part of", type="reference", target={ResearchStudy.class } )
1269  public static final String SP_STUDY = "study";
1270 /**
1271   * <b>Fluent Client</b> search parameter constant for <b>study</b>
1272   * <p>
1273   * Description: <b>Study subject is part of</b><br>
1274   * Type: <b>reference</b><br>
1275   * Path: <b>ResearchSubject.study</b><br>
1276   * </p>
1277   */
1278  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam STUDY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_STUDY);
1279
1280/**
1281   * Constant for fluent queries to be used to add include statements. Specifies
1282   * the path value of "<b>ResearchSubject:study</b>".
1283   */
1284  public static final ca.uhn.fhir.model.api.Include INCLUDE_STUDY = new ca.uhn.fhir.model.api.Include("ResearchSubject:study").toLocked();
1285
1286 /**
1287   * Search parameter: <b>subject</b>
1288   * <p>
1289   * Description: <b>Who or what is part of study</b><br>
1290   * Type: <b>reference</b><br>
1291   * Path: <b>ResearchSubject.subject</b><br>
1292   * </p>
1293   */
1294  @SearchParamDefinition(name="subject", path="ResearchSubject.subject", description="Who or what is part of study", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient") }, target={BiologicallyDerivedProduct.class, Device.class, Group.class, Medication.class, Patient.class, Specimen.class, Substance.class } )
1295  public static final String SP_SUBJECT = "subject";
1296 /**
1297   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
1298   * <p>
1299   * Description: <b>Who or what is part of study</b><br>
1300   * Type: <b>reference</b><br>
1301   * Path: <b>ResearchSubject.subject</b><br>
1302   * </p>
1303   */
1304  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
1305
1306/**
1307   * Constant for fluent queries to be used to add include statements. Specifies
1308   * the path value of "<b>ResearchSubject:subject</b>".
1309   */
1310  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("ResearchSubject:subject").toLocked();
1311
1312 /**
1313   * Search parameter: <b>subject_state</b>
1314   * <p>
1315   * Description: <b>candidate | eligible | follow-up | ineligible | not-registered | off-study | on-study | on-study-intervention | on-study-observation | pending-on-study | potential-candidate | screening | withdrawn</b><br>
1316   * Type: <b>token</b><br>
1317   * Path: <b>ResearchSubject.progress.subjectState</b><br>
1318   * </p>
1319   */
1320  @SearchParamDefinition(name="subject_state", path="ResearchSubject.progress.subjectState", description="candidate | eligible | follow-up | ineligible | not-registered | off-study | on-study | on-study-intervention | on-study-observation | pending-on-study | potential-candidate | screening | withdrawn", type="token" )
1321  public static final String SP_SUBJECTSTATE = "subject_state";
1322 /**
1323   * <b>Fluent Client</b> search parameter constant for <b>subject_state</b>
1324   * <p>
1325   * Description: <b>candidate | eligible | follow-up | ineligible | not-registered | off-study | on-study | on-study-intervention | on-study-observation | pending-on-study | potential-candidate | screening | withdrawn</b><br>
1326   * Type: <b>token</b><br>
1327   * Path: <b>ResearchSubject.progress.subjectState</b><br>
1328   * </p>
1329   */
1330  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SUBJECTSTATE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SUBJECTSTATE);
1331
1332
1333}
1334