001package org.hl7.fhir.r4.model.codesystems; 002 003/* 004 Copyright (c) 2011+, HL7, Inc. 005 All rights reserved. 006 007 Redistribution and use in source and binary forms, with or without modification, 008 are permitted provided that the following conditions are met: 009 010 * Redistributions of source code must retain the above copyright notice, this 011 list of conditions and the following disclaimer. 012 * Redistributions in binary form must reproduce the above copyright notice, 013 this list of conditions and the following disclaimer in the documentation 014 and/or other materials provided with the distribution. 015 * Neither the name of HL7 nor the names of its contributors may be used to 016 endorse or promote products derived from this software without specific 017 prior written permission. 018 019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 020 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 021 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 022 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 023 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 024 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 025 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 026 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 027 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 028 POSSIBILITY OF SUCH DAMAGE. 029 030*/ 031 032// Generated on Thu, Dec 27, 2018 10:06-0500 for FHIR v4.0.0 033 034 035import org.hl7.fhir.exceptions.FHIRException; 036 037public enum GoalAchievement { 038 039 /** 040 * The goal is being sought but has not yet been reached. (Also applies if the goal was reached in the past but there has been regression and the goal is again being sought). 041 */ 042 INPROGRESS, 043 /** 044 * The goal is being sought, and is progressing. 045 */ 046 IMPROVING, 047 /** 048 * The goal is being sought, but is regressing. 049 */ 050 WORSENING, 051 /** 052 * The goal is being sought, but the trend is flat. 053 */ 054 NOCHANGE, 055 /** 056 * The goal has been met. 057 */ 058 ACHIEVED, 059 /** 060 * The goal has been met, but ongoing activity is needed to sustain the goal objective. 061 */ 062 SUSTAINING, 063 /** 064 * The goal has not been met and there might or might not have been progress towards target. 065 */ 066 NOTACHIEVED, 067 /** 068 * The goal has not been met and little to no progress towards target. 069 */ 070 NOPROGRESS, 071 /** 072 * The goal is not possible to be met. 073 */ 074 NOTATTAINABLE, 075 /** 076 * added to help the parsers 077 */ 078 NULL; 079 public static GoalAchievement fromCode(String codeString) throws FHIRException { 080 if (codeString == null || "".equals(codeString)) 081 return null; 082 if ("in-progress".equals(codeString)) 083 return INPROGRESS; 084 if ("improving".equals(codeString)) 085 return IMPROVING; 086 if ("worsening".equals(codeString)) 087 return WORSENING; 088 if ("no-change".equals(codeString)) 089 return NOCHANGE; 090 if ("achieved".equals(codeString)) 091 return ACHIEVED; 092 if ("sustaining".equals(codeString)) 093 return SUSTAINING; 094 if ("not-achieved".equals(codeString)) 095 return NOTACHIEVED; 096 if ("no-progress".equals(codeString)) 097 return NOPROGRESS; 098 if ("not-attainable".equals(codeString)) 099 return NOTATTAINABLE; 100 throw new FHIRException("Unknown GoalAchievement code '"+codeString+"'"); 101 } 102 public String toCode() { 103 switch (this) { 104 case INPROGRESS: return "in-progress"; 105 case IMPROVING: return "improving"; 106 case WORSENING: return "worsening"; 107 case NOCHANGE: return "no-change"; 108 case ACHIEVED: return "achieved"; 109 case SUSTAINING: return "sustaining"; 110 case NOTACHIEVED: return "not-achieved"; 111 case NOPROGRESS: return "no-progress"; 112 case NOTATTAINABLE: return "not-attainable"; 113 default: return "?"; 114 } 115 } 116 public String getSystem() { 117 return "http://terminology.hl7.org/CodeSystem/goal-achievement"; 118 } 119 public String getDefinition() { 120 switch (this) { 121 case INPROGRESS: return "The goal is being sought but has not yet been reached. (Also applies if the goal was reached in the past but there has been regression and the goal is again being sought)."; 122 case IMPROVING: return "The goal is being sought, and is progressing."; 123 case WORSENING: return "The goal is being sought, but is regressing."; 124 case NOCHANGE: return "The goal is being sought, but the trend is flat."; 125 case ACHIEVED: return "The goal has been met."; 126 case SUSTAINING: return "The goal has been met, but ongoing activity is needed to sustain the goal objective."; 127 case NOTACHIEVED: return "The goal has not been met and there might or might not have been progress towards target."; 128 case NOPROGRESS: return "The goal has not been met and little to no progress towards target."; 129 case NOTATTAINABLE: return "The goal is not possible to be met."; 130 default: return "?"; 131 } 132 } 133 public String getDisplay() { 134 switch (this) { 135 case INPROGRESS: return "In Progress"; 136 case IMPROVING: return "Improving"; 137 case WORSENING: return "Worsening"; 138 case NOCHANGE: return "No Change"; 139 case ACHIEVED: return "Achieved"; 140 case SUSTAINING: return "Sustaining"; 141 case NOTACHIEVED: return "Not Achieved"; 142 case NOPROGRESS: return "No Progress"; 143 case NOTATTAINABLE: return "Not Attainable"; 144 default: return "?"; 145 } 146 } 147 148 149} 150