001package org.hl7.fhir.dstu3.model.codesystems;
002
003/*-
004 * #%L
005 * org.hl7.fhir.dstu3
006 * %%
007 * Copyright (C) 2014 - 2019 Health Level 7
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 * 
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 * 
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023
024/*
025  Copyright (c) 2011+, HL7, Inc.
026  All rights reserved.
027  
028  Redistribution and use in source and binary forms, with or without modification, 
029  are permitted provided that the following conditions are met:
030  
031   * Redistributions of source code must retain the above copyright notice, this 
032     list of conditions and the following disclaimer.
033   * Redistributions in binary form must reproduce the above copyright notice, 
034     this list of conditions and the following disclaimer in the documentation 
035     and/or other materials provided with the distribution.
036   * Neither the name of HL7 nor the names of its contributors may be used to 
037     endorse or promote products derived from this software without specific 
038     prior written permission.
039  
040  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
041  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
042  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
043  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
044  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
045  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
046  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
047  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
048  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
049  POSSIBILITY OF SUCH DAMAGE.
050  
051*/
052
053// Generated on Sat, Mar 25, 2017 21:03-0400 for FHIR v3.0.0
054
055
056import org.hl7.fhir.exceptions.FHIRException;
057
058public enum GoalStatus {
059
060        /**
061         * A goal is proposed for this patient
062         */
063        PROPOSED, 
064        /**
065         * A proposed goal was accepted or acknowledged
066         */
067        ACCEPTED, 
068        /**
069         * A goal is planned for this patient
070         */
071        PLANNED, 
072        /**
073         * The goal is being sought but has not yet been reached.  (Also applies if goal was reached in the past but there has been regression and goal is being sought again)
074         */
075        INPROGRESS, 
076        /**
077         * The goal is on schedule for the planned timelines
078         */
079        ONTARGET, 
080        /**
081         * The goal is ahead of the planned timelines
082         */
083        AHEADOFTARGET, 
084        /**
085         * The goal is behind the planned timelines
086         */
087        BEHINDTARGET, 
088        /**
089         * The goal has been met, but ongoing activity is needed to sustain the goal objective
090         */
091        SUSTAINING, 
092        /**
093         * The goal has been met and no further action is needed
094         */
095        ACHIEVED, 
096        /**
097         * The goal remains a long term objective but is no longer being actively pursued for a temporary period of time.
098         */
099        ONHOLD, 
100        /**
101         * The previously accepted goal is no longer being sought
102         */
103        CANCELLED, 
104        /**
105         * The goal was entered in error and voided.
106         */
107        ENTEREDINERROR, 
108        /**
109         * A proposed goal was rejected
110         */
111        REJECTED, 
112        /**
113         * added to help the parsers
114         */
115        NULL;
116        public static GoalStatus fromCode(String codeString) throws FHIRException {
117            if (codeString == null || "".equals(codeString))
118                return null;
119        if ("proposed".equals(codeString))
120          return PROPOSED;
121        if ("accepted".equals(codeString))
122          return ACCEPTED;
123        if ("planned".equals(codeString))
124          return PLANNED;
125        if ("in-progress".equals(codeString))
126          return INPROGRESS;
127        if ("on-target".equals(codeString))
128          return ONTARGET;
129        if ("ahead-of-target".equals(codeString))
130          return AHEADOFTARGET;
131        if ("behind-target".equals(codeString))
132          return BEHINDTARGET;
133        if ("sustaining".equals(codeString))
134          return SUSTAINING;
135        if ("achieved".equals(codeString))
136          return ACHIEVED;
137        if ("on-hold".equals(codeString))
138          return ONHOLD;
139        if ("cancelled".equals(codeString))
140          return CANCELLED;
141        if ("entered-in-error".equals(codeString))
142          return ENTEREDINERROR;
143        if ("rejected".equals(codeString))
144          return REJECTED;
145        throw new FHIRException("Unknown GoalStatus code '"+codeString+"'");
146        }
147        public String toCode() {
148          switch (this) {
149            case PROPOSED: return "proposed";
150            case ACCEPTED: return "accepted";
151            case PLANNED: return "planned";
152            case INPROGRESS: return "in-progress";
153            case ONTARGET: return "on-target";
154            case AHEADOFTARGET: return "ahead-of-target";
155            case BEHINDTARGET: return "behind-target";
156            case SUSTAINING: return "sustaining";
157            case ACHIEVED: return "achieved";
158            case ONHOLD: return "on-hold";
159            case CANCELLED: return "cancelled";
160            case ENTEREDINERROR: return "entered-in-error";
161            case REJECTED: return "rejected";
162            default: return "?";
163          }
164        }
165        public String getSystem() {
166          return "http://hl7.org/fhir/goal-status";
167        }
168        public String getDefinition() {
169          switch (this) {
170            case PROPOSED: return "A goal is proposed for this patient";
171            case ACCEPTED: return "A proposed goal was accepted or acknowledged";
172            case PLANNED: return "A goal is planned for this patient";
173            case INPROGRESS: return "The goal is being sought but has not yet been reached.  (Also applies if goal was reached in the past but there has been regression and goal is being sought again)";
174            case ONTARGET: return "The goal is on schedule for the planned timelines";
175            case AHEADOFTARGET: return "The goal is ahead of the planned timelines";
176            case BEHINDTARGET: return "The goal is behind the planned timelines";
177            case SUSTAINING: return "The goal has been met, but ongoing activity is needed to sustain the goal objective";
178            case ACHIEVED: return "The goal has been met and no further action is needed";
179            case ONHOLD: return "The goal remains a long term objective but is no longer being actively pursued for a temporary period of time.";
180            case CANCELLED: return "The previously accepted goal is no longer being sought";
181            case ENTEREDINERROR: return "The goal was entered in error and voided.";
182            case REJECTED: return "A proposed goal was rejected";
183            default: return "?";
184          }
185        }
186        public String getDisplay() {
187          switch (this) {
188            case PROPOSED: return "Proposed";
189            case ACCEPTED: return "Accepted";
190            case PLANNED: return "Planned";
191            case INPROGRESS: return "In Progress";
192            case ONTARGET: return "On Target";
193            case AHEADOFTARGET: return "Ahead of Target";
194            case BEHINDTARGET: return "Behind Target";
195            case SUSTAINING: return "Sustaining";
196            case ACHIEVED: return "Achieved";
197            case ONHOLD: return "On Hold";
198            case CANCELLED: return "Cancelled";
199            case ENTEREDINERROR: return "Entered In Error";
200            case REJECTED: return "Rejected";
201            default: return "?";
202          }
203    }
204
205
206}
207