001package org.hl7.fhir.r4.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 Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0
036
037
038import org.hl7.fhir.exceptions.FHIRException;
039
040public enum TaskCode {
041
042        /**
043         * Take what actions are needed to transition the focus resource from 'draft' to 'active' or 'in-progress', as appropriate for the resource type.  This may involve additing additional content, approval, validation, etc.
044         */
045        APPROVE, 
046        /**
047         * Act to perform the actions defined in the focus request.  This might result in a 'more assertive' request (order for a plan or proposal, filler order for a placer order), but is intend to eventually result in events.  The degree of fulfillment requested might be limited by Task.restriction.
048         */
049        FULFILL, 
050        /**
051         * Abort, cancel or withdraw the focal resource, as appropriate for the type of resource.
052         */
053        ABORT, 
054        /**
055         * Replace the focal resource with the specified input resource
056         */
057        REPLACE, 
058        /**
059         * Update the focal resource of the owning system to reflect the content specified as the Task.focus
060         */
061        CHANGE, 
062        /**
063         * Transition the focal resource from 'active' or 'in-progress' to 'suspended'
064         */
065        SUSPEND, 
066        /**
067         * Transition the focal resource from 'suspended' to 'active' or 'in-progress' as appropriate for the resource type.
068         */
069        RESUME, 
070        /**
071         * added to help the parsers
072         */
073        NULL;
074        public static TaskCode fromCode(String codeString) throws FHIRException {
075            if (codeString == null || "".equals(codeString))
076                return null;
077        if ("approve".equals(codeString))
078          return APPROVE;
079        if ("fulfill".equals(codeString))
080          return FULFILL;
081        if ("abort".equals(codeString))
082          return ABORT;
083        if ("replace".equals(codeString))
084          return REPLACE;
085        if ("change".equals(codeString))
086          return CHANGE;
087        if ("suspend".equals(codeString))
088          return SUSPEND;
089        if ("resume".equals(codeString))
090          return RESUME;
091        throw new FHIRException("Unknown TaskCode code '"+codeString+"'");
092        }
093        public String toCode() {
094          switch (this) {
095            case APPROVE: return "approve";
096            case FULFILL: return "fulfill";
097            case ABORT: return "abort";
098            case REPLACE: return "replace";
099            case CHANGE: return "change";
100            case SUSPEND: return "suspend";
101            case RESUME: return "resume";
102            default: return "?";
103          }
104        }
105        public String getSystem() {
106          return "http://hl7.org/fhir/CodeSystem/task-code";
107        }
108        public String getDefinition() {
109          switch (this) {
110            case APPROVE: return "Take what actions are needed to transition the focus resource from 'draft' to 'active' or 'in-progress', as appropriate for the resource type.  This may involve additing additional content, approval, validation, etc.";
111            case FULFILL: return "Act to perform the actions defined in the focus request.  This might result in a 'more assertive' request (order for a plan or proposal, filler order for a placer order), but is intend to eventually result in events.  The degree of fulfillment requested might be limited by Task.restriction.";
112            case ABORT: return "Abort, cancel or withdraw the focal resource, as appropriate for the type of resource.";
113            case REPLACE: return "Replace the focal resource with the specified input resource";
114            case CHANGE: return "Update the focal resource of the owning system to reflect the content specified as the Task.focus";
115            case SUSPEND: return "Transition the focal resource from 'active' or 'in-progress' to 'suspended'";
116            case RESUME: return "Transition the focal resource from 'suspended' to 'active' or 'in-progress' as appropriate for the resource type.";
117            default: return "?";
118          }
119        }
120        public String getDisplay() {
121          switch (this) {
122            case APPROVE: return "Activate/approve the focal resource";
123            case FULFILL: return "Fulfill the focal request";
124            case ABORT: return "Mark the focal resource as no longer active";
125            case REPLACE: return "Replace the focal resource with the input resource";
126            case CHANGE: return "Change the focal resource";
127            case SUSPEND: return "Suspend the focal resource";
128            case RESUME: return "Re-activate the focal resource";
129            default: return "?";
130          }
131    }
132
133
134}