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 DiagnosticOrderStatus {
041
042        /**
043         * The request has been proposed.
044         */
045        PROPOSED, 
046        /**
047         * The request is in preliminary form prior to being sent.
048         */
049        DRAFT, 
050        /**
051         * The request has been planned.
052         */
053        PLANNED, 
054        /**
055         * The request has been placed.
056         */
057        REQUESTED, 
058        /**
059         * The receiving system has received the order, but not yet decided whether it will be performed.
060         */
061        RECEIVED, 
062        /**
063         * The receiving system has accepted the order, but work has not yet commenced.
064         */
065        ACCEPTED, 
066        /**
067         * The work to fulfill the order is happening.
068         */
069        INPROGRESS, 
070        /**
071         * The work is complete, and the outcomes are being reviewed for approval.
072         */
073        REVIEW, 
074        /**
075         * The work has been completed, the report(s) released, and no further work is planned.
076         */
077        COMPLETED, 
078        /**
079         * The request has been withdrawn.
080         */
081        CANCELLED, 
082        /**
083         * The request has been held by originating system/user request.
084         */
085        SUSPENDED, 
086        /**
087         * The receiving system has declined to fulfill the request.
088         */
089        REJECTED, 
090        /**
091         * The diagnostic investigation was attempted, but due to some procedural error, it could not be completed.
092         */
093        FAILED, 
094        /**
095         * The request was entered in error and voided.
096         */
097        ENTEREDINERROR, 
098        /**
099         * added to help the parsers
100         */
101        NULL;
102        public static DiagnosticOrderStatus fromCode(String codeString) throws FHIRException {
103            if (codeString == null || "".equals(codeString))
104                return null;
105        if ("proposed".equals(codeString))
106          return PROPOSED;
107        if ("draft".equals(codeString))
108          return DRAFT;
109        if ("planned".equals(codeString))
110          return PLANNED;
111        if ("requested".equals(codeString))
112          return REQUESTED;
113        if ("received".equals(codeString))
114          return RECEIVED;
115        if ("accepted".equals(codeString))
116          return ACCEPTED;
117        if ("in-progress".equals(codeString))
118          return INPROGRESS;
119        if ("review".equals(codeString))
120          return REVIEW;
121        if ("completed".equals(codeString))
122          return COMPLETED;
123        if ("cancelled".equals(codeString))
124          return CANCELLED;
125        if ("suspended".equals(codeString))
126          return SUSPENDED;
127        if ("rejected".equals(codeString))
128          return REJECTED;
129        if ("failed".equals(codeString))
130          return FAILED;
131        if ("entered-in-error".equals(codeString))
132          return ENTEREDINERROR;
133        throw new FHIRException("Unknown DiagnosticOrderStatus code '"+codeString+"'");
134        }
135        public String toCode() {
136          switch (this) {
137            case PROPOSED: return "proposed";
138            case DRAFT: return "draft";
139            case PLANNED: return "planned";
140            case REQUESTED: return "requested";
141            case RECEIVED: return "received";
142            case ACCEPTED: return "accepted";
143            case INPROGRESS: return "in-progress";
144            case REVIEW: return "review";
145            case COMPLETED: return "completed";
146            case CANCELLED: return "cancelled";
147            case SUSPENDED: return "suspended";
148            case REJECTED: return "rejected";
149            case FAILED: return "failed";
150            case ENTEREDINERROR: return "entered-in-error";
151            case NULL: return null;
152            default: return "?";
153          }
154        }
155        public String getSystem() {
156          return "http://hl7.org/fhir/diagnostic-order-status";
157        }
158        public String getDefinition() {
159          switch (this) {
160            case PROPOSED: return "The request has been proposed.";
161            case DRAFT: return "The request is in preliminary form prior to being sent.";
162            case PLANNED: return "The request has been planned.";
163            case REQUESTED: return "The request has been placed.";
164            case RECEIVED: return "The receiving system has received the order, but not yet decided whether it will be performed.";
165            case ACCEPTED: return "The receiving system has accepted the order, but work has not yet commenced.";
166            case INPROGRESS: return "The work to fulfill the order is happening.";
167            case REVIEW: return "The work is complete, and the outcomes are being reviewed for approval.";
168            case COMPLETED: return "The work has been completed, the report(s) released, and no further work is planned.";
169            case CANCELLED: return "The request has been withdrawn.";
170            case SUSPENDED: return "The request has been held by originating system/user request.";
171            case REJECTED: return "The receiving system has declined to fulfill the request.";
172            case FAILED: return "The diagnostic investigation was attempted, but due to some procedural error, it could not be completed.";
173            case ENTEREDINERROR: return "The request was entered in error and voided.";
174            case NULL: return null;
175            default: return "?";
176          }
177        }
178        public String getDisplay() {
179          switch (this) {
180            case PROPOSED: return "Proposed";
181            case DRAFT: return "Draft";
182            case PLANNED: return "Planned";
183            case REQUESTED: return "Requested";
184            case RECEIVED: return "Received";
185            case ACCEPTED: return "Accepted";
186            case INPROGRESS: return "In-Progress";
187            case REVIEW: return "Review";
188            case COMPLETED: return "Completed";
189            case CANCELLED: return "Cancelled";
190            case SUSPENDED: return "Suspended";
191            case REJECTED: return "Rejected";
192            case FAILED: return "Failed";
193            case ENTEREDINERROR: return "Entered in Error";
194            case NULL: return null;
195            default: return "?";
196          }
197    }
198
199
200}