001package org.hl7.fhir.dstu3.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 Mon, Jan 16, 2017 12:12-0500 for FHIR v1.9.0
036
037
038import org.hl7.fhir.exceptions.FHIRException;
039
040public enum CommunicationRequestStatus {
041
042        /**
043         * The request has been proposed.
044         */
045        PROPOSED, 
046        /**
047         * The request has been planned.
048         */
049        PLANNED, 
050        /**
051         * The request has been placed.
052         */
053        REQUESTED, 
054        /**
055         * The receiving system has received the request but not yet decided whether it will be performed.
056         */
057        RECEIVED, 
058        /**
059         * The receiving system has accepted the order, but work has not yet commenced.
060         */
061        ACCEPTED, 
062        /**
063         * The work to fulfill the order is happening.
064         */
065        INPROGRESS, 
066        /**
067         * The work has been complete, the report(s) released, and no further work is planned.
068         */
069        COMPLETED, 
070        /**
071         * The request has been held by originating system/user request.
072         */
073        SUSPENDED, 
074        /**
075         * The receiving system has declined to fulfill the request
076         */
077        REJECTED, 
078        /**
079         * The communication was attempted, but due to some procedural error, it could not be completed.
080         */
081        FAILED, 
082        /**
083         * added to help the parsers
084         */
085        NULL;
086        public static CommunicationRequestStatus fromCode(String codeString) throws FHIRException {
087            if (codeString == null || "".equals(codeString))
088                return null;
089        if ("proposed".equals(codeString))
090          return PROPOSED;
091        if ("planned".equals(codeString))
092          return PLANNED;
093        if ("requested".equals(codeString))
094          return REQUESTED;
095        if ("received".equals(codeString))
096          return RECEIVED;
097        if ("accepted".equals(codeString))
098          return ACCEPTED;
099        if ("in-progress".equals(codeString))
100          return INPROGRESS;
101        if ("completed".equals(codeString))
102          return COMPLETED;
103        if ("suspended".equals(codeString))
104          return SUSPENDED;
105        if ("rejected".equals(codeString))
106          return REJECTED;
107        if ("failed".equals(codeString))
108          return FAILED;
109        throw new FHIRException("Unknown CommunicationRequestStatus code '"+codeString+"'");
110        }
111        public String toCode() {
112          switch (this) {
113            case PROPOSED: return "proposed";
114            case PLANNED: return "planned";
115            case REQUESTED: return "requested";
116            case RECEIVED: return "received";
117            case ACCEPTED: return "accepted";
118            case INPROGRESS: return "in-progress";
119            case COMPLETED: return "completed";
120            case SUSPENDED: return "suspended";
121            case REJECTED: return "rejected";
122            case FAILED: return "failed";
123            case NULL: return null;
124            default: return "?";
125          }
126        }
127        public String getSystem() {
128          return "http://hl7.org/fhir/communication-request-status";
129        }
130        public String getDefinition() {
131          switch (this) {
132            case PROPOSED: return "The request has been proposed.";
133            case PLANNED: return "The request has been planned.";
134            case REQUESTED: return "The request has been placed.";
135            case RECEIVED: return "The receiving system has received the request but not yet decided whether it will be performed.";
136            case ACCEPTED: return "The receiving system has accepted the order, but work has not yet commenced.";
137            case INPROGRESS: return "The work to fulfill the order is happening.";
138            case COMPLETED: return "The work has been complete, the report(s) released, and no further work is planned.";
139            case SUSPENDED: return "The request has been held by originating system/user request.";
140            case REJECTED: return "The receiving system has declined to fulfill the request";
141            case FAILED: return "The communication was attempted, but due to some procedural error, it could not be completed.";
142            case NULL: return null;
143            default: return "?";
144          }
145        }
146        public String getDisplay() {
147          switch (this) {
148            case PROPOSED: return "Proposed";
149            case PLANNED: return "Planned";
150            case REQUESTED: return "Requested";
151            case RECEIVED: return "Received";
152            case ACCEPTED: return "Accepted";
153            case INPROGRESS: return "In Progress";
154            case COMPLETED: return "Completed";
155            case SUSPENDED: return "Suspended";
156            case REJECTED: return "Rejected";
157            case FAILED: return "Failed";
158            case NULL: return null;
159            default: return "?";
160          }
161    }
162
163
164}