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            case NULL: return null;
103            default: return "?";
104          }
105        }
106        public String getSystem() {
107          return "http://hl7.org/fhir/CodeSystem/task-code";
108        }
109        public String getDefinition() {
110          switch (this) {
111            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.";
112            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.";
113            case ABORT: return "Abort, cancel or withdraw the focal resource, as appropriate for the type of resource.";
114            case REPLACE: return "Replace the focal resource with the specified input resource";
115            case CHANGE: return "Update the focal resource of the owning system to reflect the content specified as the Task.focus";
116            case SUSPEND: return "Transition the focal resource from 'active' or 'in-progress' to 'suspended'";
117            case RESUME: return "Transition the focal resource from 'suspended' to 'active' or 'in-progress' as appropriate for the resource type.";
118            case NULL: return null;
119            default: return "?";
120          }
121        }
122        public String getDisplay() {
123          switch (this) {
124            case APPROVE: return "Activate/approve the focal resource";
125            case FULFILL: return "Fulfill the focal request";
126            case ABORT: return "Mark the focal resource as no longer active";
127            case REPLACE: return "Replace the focal resource with the input resource";
128            case CHANGE: return "Change the focal resource";
129            case SUSPEND: return "Suspend the focal resource";
130            case RESUME: return "Re-activate the focal resource";
131            case NULL: return null;
132            default: return "?";
133          }
134    }
135
136
137}