001package org.hl7.fhir.r4.model.codesystems;
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 Sun, May 6, 2018 17:51-0400 for FHIR v3.4.0
033
034
035import org.hl7.fhir.exceptions.FHIRException;
036
037public enum TaskStatus {
038
039        /**
040         * The task is not yet ready to be acted upon.
041         */
042        DRAFT, 
043        /**
044         * The task is ready to be acted upon and action is sought.
045         */
046        REQUESTED, 
047        /**
048         * A potential performer has claimed ownership of the task and is evaluating whether to perform it.
049         */
050        RECEIVED, 
051        /**
052         * The potential performer has agreed to execute the task but has not yet started work.
053         */
054        ACCEPTED, 
055        /**
056         * The potential performer who claimed ownership of the task has decided not to execute it prior to performing any action.
057         */
058        REJECTED, 
059        /**
060         * The task is ready to be performed, but no action has yet been taken.  Used in place of requested/received/accepted/rejected when request assignment and acceptance is a given.
061         */
062        READY, 
063        /**
064         * The task was not completed.
065         */
066        CANCELLED, 
067        /**
068         * The task has been started but is not yet complete.
069         */
070        INPROGRESS, 
071        /**
072         * The task has been started but work has been paused.
073         */
074        ONHOLD, 
075        /**
076         * The task was attempted but could not be completed due to some error.
077         */
078        FAILED, 
079        /**
080         * The task has been completed.
081         */
082        COMPLETED, 
083        /**
084         * The task should never have existed and is retained only because of the possibility it may have used.
085         */
086        ENTEREDINERROR, 
087        /**
088         * added to help the parsers
089         */
090        NULL;
091        public static TaskStatus fromCode(String codeString) throws FHIRException {
092            if (codeString == null || "".equals(codeString))
093                return null;
094        if ("draft".equals(codeString))
095          return DRAFT;
096        if ("requested".equals(codeString))
097          return REQUESTED;
098        if ("received".equals(codeString))
099          return RECEIVED;
100        if ("accepted".equals(codeString))
101          return ACCEPTED;
102        if ("rejected".equals(codeString))
103          return REJECTED;
104        if ("ready".equals(codeString))
105          return READY;
106        if ("cancelled".equals(codeString))
107          return CANCELLED;
108        if ("in-progress".equals(codeString))
109          return INPROGRESS;
110        if ("on-hold".equals(codeString))
111          return ONHOLD;
112        if ("failed".equals(codeString))
113          return FAILED;
114        if ("completed".equals(codeString))
115          return COMPLETED;
116        if ("entered-in-error".equals(codeString))
117          return ENTEREDINERROR;
118        throw new FHIRException("Unknown TaskStatus code '"+codeString+"'");
119        }
120        public String toCode() {
121          switch (this) {
122            case DRAFT: return "draft";
123            case REQUESTED: return "requested";
124            case RECEIVED: return "received";
125            case ACCEPTED: return "accepted";
126            case REJECTED: return "rejected";
127            case READY: return "ready";
128            case CANCELLED: return "cancelled";
129            case INPROGRESS: return "in-progress";
130            case ONHOLD: return "on-hold";
131            case FAILED: return "failed";
132            case COMPLETED: return "completed";
133            case ENTEREDINERROR: return "entered-in-error";
134            default: return "?";
135          }
136        }
137        public String getSystem() {
138          return "http://hl7.org/fhir/task-status";
139        }
140        public String getDefinition() {
141          switch (this) {
142            case DRAFT: return "The task is not yet ready to be acted upon.";
143            case REQUESTED: return "The task is ready to be acted upon and action is sought.";
144            case RECEIVED: return "A potential performer has claimed ownership of the task and is evaluating whether to perform it.";
145            case ACCEPTED: return "The potential performer has agreed to execute the task but has not yet started work.";
146            case REJECTED: return "The potential performer who claimed ownership of the task has decided not to execute it prior to performing any action.";
147            case READY: return "The task is ready to be performed, but no action has yet been taken.  Used in place of requested/received/accepted/rejected when request assignment and acceptance is a given.";
148            case CANCELLED: return "The task was not completed.";
149            case INPROGRESS: return "The task has been started but is not yet complete.";
150            case ONHOLD: return "The task has been started but work has been paused.";
151            case FAILED: return "The task was attempted but could not be completed due to some error.";
152            case COMPLETED: return "The task has been completed.";
153            case ENTEREDINERROR: return "The task should never have existed and is retained only because of the possibility it may have used.";
154            default: return "?";
155          }
156        }
157        public String getDisplay() {
158          switch (this) {
159            case DRAFT: return "Draft";
160            case REQUESTED: return "Requested";
161            case RECEIVED: return "Received";
162            case ACCEPTED: return "Accepted";
163            case REJECTED: return "Rejected";
164            case READY: return "Ready";
165            case CANCELLED: return "Cancelled";
166            case INPROGRESS: return "In Progress";
167            case ONHOLD: return "On Hold";
168            case FAILED: return "Failed";
169            case COMPLETED: return "Completed";
170            case ENTEREDINERROR: return "Entered in Error";
171            default: return "?";
172          }
173    }
174
175
176}
177