001package org.hl7.fhir.r4.model.codesystems;
002
003/*-
004 * #%L
005 * org.hl7.fhir.r4
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 Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0
054
055
056import org.hl7.fhir.exceptions.FHIRException;
057
058public enum ResourceStatus {
059
060        /**
061         * The resource was created in error, and should not be treated as valid (note: in many cases, for various data integrity related reasons, the information cannot be removed from the record)
062         */
063        ERROR, 
064        /**
065         * The resource describes an action or plan that is proposed, and not yet approved by the participants
066         */
067        PROPOSED, 
068        /**
069         * The resource describes a course of action that is planned and agreed/approved, but at the time of recording was still future
070         */
071        PLANNED, 
072        /**
073         * The information in the resource is still being prepared and edited
074         */
075        DRAFT, 
076        /**
077         * A fulfiller has been asked to perform this action, but it has not yet occurred
078         */
079        REQUESTED, 
080        /**
081         * The fulfiller has received the request, but not yet agreed to carry out the action
082         */
083        RECEIVED, 
084        /**
085         * The fulfiller chose not to perform the action
086         */
087        DECLINED, 
088        /**
089         * The fulfiller has decided to perform the action, and plans are in train to do this in the future
090         */
091        ACCEPTED, 
092        /**
093         * The pre-conditions for the action are all fulfilled, and it is imminent
094         */
095        ARRIVED, 
096        /**
097         * The resource describes information that is currently valid or a process that is presently occuring
098         */
099        ACTIVE, 
100        /**
101         * The process described/requested in this resource has been halted for some reason
102         */
103        SUSPENDED, 
104        /**
105         * The process described/requested in the resource could not be completed, and no further action is planned
106         */
107        FAILED, 
108        /**
109         * The information in this resource has been replaced by information in another resource
110         */
111        REPLACED, 
112        /**
113         * The process described/requested in the resource has been completed, and no further action is planned
114         */
115        COMPLETE, 
116        /**
117         * The resource describes information that is no longer valid or a process that is stopped occurring
118         */
119        INACTIVE, 
120        /**
121         * The process described/requested in the resource did not complete - usually due to some workflow error, and no further action is planned
122         */
123        ABANDONED, 
124        /**
125         * Authoring system does not know the status
126         */
127        UNKNOWN, 
128        /**
129         * The information in this resource is not yet approved
130         */
131        UNCONFIRMED, 
132        /**
133         * The information in this resource is approved
134         */
135        CONFIRMED, 
136        /**
137         * The issue identified by this resource is no longer of concern
138         */
139        RESOLVED, 
140        /**
141         * This information has been ruled out by testing and evaluation
142         */
143        REFUTED, 
144        /**
145         * Potentially true?
146         */
147        DIFFERENTIAL, 
148        /**
149         * This information is still being assembled
150         */
151        PARTIAL, 
152        /**
153         * not available at this time/location
154         */
155        BUSYUNAVAILABLE, 
156        /**
157         * Free for scheduling
158         */
159        FREE, 
160        /**
161         * Ready to act
162         */
163        ONTARGET, 
164        /**
165         * Ahead of the planned timelines
166         */
167        AHEADOFTARGET, 
168        /**
169         * 
170         */
171        BEHINDTARGET, 
172        /**
173         * Behind the planned timelines
174         */
175        NOTREADY, 
176        /**
177         * The device transducer is disconnected
178         */
179        TRANSDUCDISCON, 
180        /**
181         * The hardware is disconnected
182         */
183        HWDISCON, 
184        /**
185         * added to help the parsers
186         */
187        NULL;
188        public static ResourceStatus fromCode(String codeString) throws FHIRException {
189            if (codeString == null || "".equals(codeString))
190                return null;
191        if ("error".equals(codeString))
192          return ERROR;
193        if ("proposed".equals(codeString))
194          return PROPOSED;
195        if ("planned".equals(codeString))
196          return PLANNED;
197        if ("draft".equals(codeString))
198          return DRAFT;
199        if ("requested".equals(codeString))
200          return REQUESTED;
201        if ("received".equals(codeString))
202          return RECEIVED;
203        if ("declined".equals(codeString))
204          return DECLINED;
205        if ("accepted".equals(codeString))
206          return ACCEPTED;
207        if ("arrived".equals(codeString))
208          return ARRIVED;
209        if ("active".equals(codeString))
210          return ACTIVE;
211        if ("suspended".equals(codeString))
212          return SUSPENDED;
213        if ("failed".equals(codeString))
214          return FAILED;
215        if ("replaced".equals(codeString))
216          return REPLACED;
217        if ("complete".equals(codeString))
218          return COMPLETE;
219        if ("inactive".equals(codeString))
220          return INACTIVE;
221        if ("abandoned".equals(codeString))
222          return ABANDONED;
223        if ("unknown".equals(codeString))
224          return UNKNOWN;
225        if ("unconfirmed".equals(codeString))
226          return UNCONFIRMED;
227        if ("confirmed".equals(codeString))
228          return CONFIRMED;
229        if ("resolved".equals(codeString))
230          return RESOLVED;
231        if ("refuted".equals(codeString))
232          return REFUTED;
233        if ("differential".equals(codeString))
234          return DIFFERENTIAL;
235        if ("partial".equals(codeString))
236          return PARTIAL;
237        if ("busy-unavailable".equals(codeString))
238          return BUSYUNAVAILABLE;
239        if ("free".equals(codeString))
240          return FREE;
241        if ("on-target".equals(codeString))
242          return ONTARGET;
243        if ("ahead-of-target".equals(codeString))
244          return AHEADOFTARGET;
245        if ("behind-target".equals(codeString))
246          return BEHINDTARGET;
247        if ("not-ready".equals(codeString))
248          return NOTREADY;
249        if ("transduc-discon".equals(codeString))
250          return TRANSDUCDISCON;
251        if ("hw-discon".equals(codeString))
252          return HWDISCON;
253        throw new FHIRException("Unknown ResourceStatus code '"+codeString+"'");
254        }
255        public String toCode() {
256          switch (this) {
257            case ERROR: return "error";
258            case PROPOSED: return "proposed";
259            case PLANNED: return "planned";
260            case DRAFT: return "draft";
261            case REQUESTED: return "requested";
262            case RECEIVED: return "received";
263            case DECLINED: return "declined";
264            case ACCEPTED: return "accepted";
265            case ARRIVED: return "arrived";
266            case ACTIVE: return "active";
267            case SUSPENDED: return "suspended";
268            case FAILED: return "failed";
269            case REPLACED: return "replaced";
270            case COMPLETE: return "complete";
271            case INACTIVE: return "inactive";
272            case ABANDONED: return "abandoned";
273            case UNKNOWN: return "unknown";
274            case UNCONFIRMED: return "unconfirmed";
275            case CONFIRMED: return "confirmed";
276            case RESOLVED: return "resolved";
277            case REFUTED: return "refuted";
278            case DIFFERENTIAL: return "differential";
279            case PARTIAL: return "partial";
280            case BUSYUNAVAILABLE: return "busy-unavailable";
281            case FREE: return "free";
282            case ONTARGET: return "on-target";
283            case AHEADOFTARGET: return "ahead-of-target";
284            case BEHINDTARGET: return "behind-target";
285            case NOTREADY: return "not-ready";
286            case TRANSDUCDISCON: return "transduc-discon";
287            case HWDISCON: return "hw-discon";
288            default: return "?";
289          }
290        }
291        public String getSystem() {
292          return "http://hl7.org/fhir/resource-status";
293        }
294        public String getDefinition() {
295          switch (this) {
296            case ERROR: return "The resource was created in error, and should not be treated as valid (note: in many cases, for various data integrity related reasons, the information cannot be removed from the record)";
297            case PROPOSED: return "The resource describes an action or plan that is proposed, and not yet approved by the participants";
298            case PLANNED: return "The resource describes a course of action that is planned and agreed/approved, but at the time of recording was still future";
299            case DRAFT: return "The information in the resource is still being prepared and edited";
300            case REQUESTED: return "A fulfiller has been asked to perform this action, but it has not yet occurred";
301            case RECEIVED: return "The fulfiller has received the request, but not yet agreed to carry out the action";
302            case DECLINED: return "The fulfiller chose not to perform the action";
303            case ACCEPTED: return "The fulfiller has decided to perform the action, and plans are in train to do this in the future";
304            case ARRIVED: return "The pre-conditions for the action are all fulfilled, and it is imminent";
305            case ACTIVE: return "The resource describes information that is currently valid or a process that is presently occuring";
306            case SUSPENDED: return "The process described/requested in this resource has been halted for some reason";
307            case FAILED: return "The process described/requested in the resource could not be completed, and no further action is planned";
308            case REPLACED: return "The information in this resource has been replaced by information in another resource";
309            case COMPLETE: return "The process described/requested in the resource has been completed, and no further action is planned";
310            case INACTIVE: return "The resource describes information that is no longer valid or a process that is stopped occurring";
311            case ABANDONED: return "The process described/requested in the resource did not complete - usually due to some workflow error, and no further action is planned";
312            case UNKNOWN: return "Authoring system does not know the status";
313            case UNCONFIRMED: return "The information in this resource is not yet approved";
314            case CONFIRMED: return "The information in this resource is approved";
315            case RESOLVED: return "The issue identified by this resource is no longer of concern";
316            case REFUTED: return "This information has been ruled out by testing and evaluation";
317            case DIFFERENTIAL: return "Potentially true?";
318            case PARTIAL: return "This information is still being assembled";
319            case BUSYUNAVAILABLE: return "not available at this time/location";
320            case FREE: return "Free for scheduling";
321            case ONTARGET: return "Ready to act";
322            case AHEADOFTARGET: return "Ahead of the planned timelines";
323            case BEHINDTARGET: return "";
324            case NOTREADY: return "Behind the planned timelines";
325            case TRANSDUCDISCON: return "The device transducer is disconnected";
326            case HWDISCON: return "The hardware is disconnected";
327            default: return "?";
328          }
329        }
330        public String getDisplay() {
331          switch (this) {
332            case ERROR: return "error";
333            case PROPOSED: return "proposed";
334            case PLANNED: return "planned";
335            case DRAFT: return "draft";
336            case REQUESTED: return "requested";
337            case RECEIVED: return "received";
338            case DECLINED: return "declined";
339            case ACCEPTED: return "accepted";
340            case ARRIVED: return "arrived";
341            case ACTIVE: return "active";
342            case SUSPENDED: return "suspended";
343            case FAILED: return "failed";
344            case REPLACED: return "replaced";
345            case COMPLETE: return "complete";
346            case INACTIVE: return "inactive";
347            case ABANDONED: return "abandoned";
348            case UNKNOWN: return "unknown";
349            case UNCONFIRMED: return "unconfirmed";
350            case CONFIRMED: return "confirmed";
351            case RESOLVED: return "resolved";
352            case REFUTED: return "refuted";
353            case DIFFERENTIAL: return "differential";
354            case PARTIAL: return "partial";
355            case BUSYUNAVAILABLE: return "busy-unavailable";
356            case FREE: return "free";
357            case ONTARGET: return "on-target";
358            case AHEADOFTARGET: return "ahead-of-target";
359            case BEHINDTARGET: return "behind-target";
360            case NOTREADY: return "not-ready";
361            case TRANSDUCDISCON: return "transduc-discon";
362            case HWDISCON: return "hw-discon";
363            default: return "?";
364          }
365    }
366
367
368}
369