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