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