001package org.hl7.fhir.r4.model.codesystems;
002
003
004
005
006/*
007  Copyright (c) 2011+, HL7, Inc.
008  All rights reserved.
009  
010  Redistribution and use in source and binary forms, with or without modification, 
011  are permitted provided that the following conditions are met:
012  
013   * Redistributions of source code must retain the above copyright notice, this 
014     list of conditions and the following disclaimer.
015   * Redistributions in binary form must reproduce the above copyright notice, 
016     this list of conditions and the following disclaimer in the documentation 
017     and/or other materials provided with the distribution.
018   * Neither the name of HL7 nor the names of its contributors may be used to 
019     endorse or promote products derived from this software without specific 
020     prior written permission.
021  
022  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
023  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
024  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
025  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
026  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
027  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
028  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
029  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
030  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
031  POSSIBILITY OF SUCH DAMAGE.
032  
033*/
034
035// Generated on Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0
036
037
038import org.hl7.fhir.exceptions.FHIRException;
039
040public enum ResearchSubjectStatus {
041
042        /**
043         * An identified person that can be considered for inclusion in a study.
044         */
045        CANDIDATE, 
046        /**
047         * A person that has met the eligibility criteria for inclusion in a study.
048         */
049        ELIGIBLE, 
050        /**
051         * 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.
052         */
053        FOLLOWUP, 
054        /**
055         * A person who did not meet one or more criteria required for participation in a study is considered to have failed screening or
056is ineligible for the study.
057         */
058        INELIGIBLE, 
059        /**
060         * A person for whom registration was not completed.
061         */
062        NOTREGISTERED, 
063        /**
064         * A person that has ended their participation on a study either because their treatment/observation is complete or through not
065responding, withdrawal, non-compliance and/or adverse event.
066         */
067        OFFSTUDY, 
068        /**
069         * A person that is enrolled or registered on a study.
070         */
071        ONSTUDY, 
072        /**
073         * The person is receiving the treatment or participating in an activity (e.g. yoga, diet, etc.) that the study is evaluating.
074         */
075        ONSTUDYINTERVENTION, 
076        /**
077         * 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".
078         */
079        ONSTUDYOBSERVATION, 
080        /**
081         * A person is pre-registered for a study.
082         */
083        PENDINGONSTUDY, 
084        /**
085         * A person that is potentially eligible for participation in the study.
086         */
087        POTENTIALCANDIDATE, 
088        /**
089         * A person who is being evaluated for eligibility for a study.
090         */
091        SCREENING, 
092        /**
093         * The person has withdrawn their participation in the study before registration.
094         */
095        WITHDRAWN, 
096        /**
097         * added to help the parsers
098         */
099        NULL;
100        public static ResearchSubjectStatus fromCode(String codeString) throws FHIRException {
101            if (codeString == null || "".equals(codeString))
102                return null;
103        if ("candidate".equals(codeString))
104          return CANDIDATE;
105        if ("eligible".equals(codeString))
106          return ELIGIBLE;
107        if ("follow-up".equals(codeString))
108          return FOLLOWUP;
109        if ("ineligible".equals(codeString))
110          return INELIGIBLE;
111        if ("not-registered".equals(codeString))
112          return NOTREGISTERED;
113        if ("off-study".equals(codeString))
114          return OFFSTUDY;
115        if ("on-study".equals(codeString))
116          return ONSTUDY;
117        if ("on-study-intervention".equals(codeString))
118          return ONSTUDYINTERVENTION;
119        if ("on-study-observation".equals(codeString))
120          return ONSTUDYOBSERVATION;
121        if ("pending-on-study".equals(codeString))
122          return PENDINGONSTUDY;
123        if ("potential-candidate".equals(codeString))
124          return POTENTIALCANDIDATE;
125        if ("screening".equals(codeString))
126          return SCREENING;
127        if ("withdrawn".equals(codeString))
128          return WITHDRAWN;
129        throw new FHIRException("Unknown ResearchSubjectStatus code '"+codeString+"'");
130        }
131        public String toCode() {
132          switch (this) {
133            case CANDIDATE: return "candidate";
134            case ELIGIBLE: return "eligible";
135            case FOLLOWUP: return "follow-up";
136            case INELIGIBLE: return "ineligible";
137            case NOTREGISTERED: return "not-registered";
138            case OFFSTUDY: return "off-study";
139            case ONSTUDY: return "on-study";
140            case ONSTUDYINTERVENTION: return "on-study-intervention";
141            case ONSTUDYOBSERVATION: return "on-study-observation";
142            case PENDINGONSTUDY: return "pending-on-study";
143            case POTENTIALCANDIDATE: return "potential-candidate";
144            case SCREENING: return "screening";
145            case WITHDRAWN: return "withdrawn";
146            case NULL: return null;
147            default: return "?";
148          }
149        }
150        public String getSystem() {
151          return "http://hl7.org/fhir/research-subject-status";
152        }
153        public String getDefinition() {
154          switch (this) {
155            case CANDIDATE: return "An identified person that can be considered for inclusion in a study.";
156            case ELIGIBLE: return "A person that has met the eligibility criteria for inclusion in a study.";
157            case FOLLOWUP: 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.";
158            case INELIGIBLE: 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.";
159            case NOTREGISTERED: return "A person for whom registration was not completed.";
160            case OFFSTUDY: 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.";
161            case ONSTUDY: return "A person that is enrolled or registered on a study.";
162            case ONSTUDYINTERVENTION: return "The person is receiving the treatment or participating in an activity (e.g. yoga, diet, etc.) that the study is evaluating.";
163            case ONSTUDYOBSERVATION: 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\".";
164            case PENDINGONSTUDY: return "A person is pre-registered for a study.";
165            case POTENTIALCANDIDATE: return "A person that is potentially eligible for participation in the study.";
166            case SCREENING: return "A person who is being evaluated for eligibility for a study.";
167            case WITHDRAWN: return "The person has withdrawn their participation in the study before registration.";
168            case NULL: return null;
169            default: return "?";
170          }
171        }
172        public String getDisplay() {
173          switch (this) {
174            case CANDIDATE: return "Candidate";
175            case ELIGIBLE: return "Eligible";
176            case FOLLOWUP: return "Follow-up";
177            case INELIGIBLE: return "Ineligible";
178            case NOTREGISTERED: return "Not Registered";
179            case OFFSTUDY: return "Off-study";
180            case ONSTUDY: return "On-study";
181            case ONSTUDYINTERVENTION: return "On-study-intervention";
182            case ONSTUDYOBSERVATION: return "On-study-observation";
183            case PENDINGONSTUDY: return "Pending on-study";
184            case POTENTIALCANDIDATE: return "Potential Candidate";
185            case SCREENING: return "Screening";
186            case WITHDRAWN: return "Withdrawn";
187            case NULL: return null;
188            default: return "?";
189          }
190    }
191
192
193}