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 Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0
033
034import org.hl7.fhir.exceptions.FHIRException;
035
036public enum GoalAchievement {
037
038  /**
039   * The goal is being sought but has not yet been reached. (Also applies if the
040   * goal was reached in the past but there has been regression and the goal is
041   * again being sought).
042   */
043  INPROGRESS,
044  /**
045   * The goal is being sought, and is progressing.
046   */
047  IMPROVING,
048  /**
049   * The goal is being sought, but is regressing.
050   */
051  WORSENING,
052  /**
053   * The goal is being sought, but the trend is flat.
054   */
055  NOCHANGE,
056  /**
057   * The goal has been met.
058   */
059  ACHIEVED,
060  /**
061   * The goal has been met, but ongoing activity is needed to sustain the goal
062   * objective.
063   */
064  SUSTAINING,
065  /**
066   * The goal has not been met and there might or might not have been progress
067   * towards target.
068   */
069  NOTACHIEVED,
070  /**
071   * The goal has not been met and little to no progress towards target.
072   */
073  NOPROGRESS,
074  /**
075   * The goal is not possible to be met.
076   */
077  NOTATTAINABLE,
078  /**
079   * added to help the parsers
080   */
081  NULL;
082
083  public static GoalAchievement fromCode(String codeString) throws FHIRException {
084    if (codeString == null || "".equals(codeString))
085      return null;
086    if ("in-progress".equals(codeString))
087      return INPROGRESS;
088    if ("improving".equals(codeString))
089      return IMPROVING;
090    if ("worsening".equals(codeString))
091      return WORSENING;
092    if ("no-change".equals(codeString))
093      return NOCHANGE;
094    if ("achieved".equals(codeString))
095      return ACHIEVED;
096    if ("sustaining".equals(codeString))
097      return SUSTAINING;
098    if ("not-achieved".equals(codeString))
099      return NOTACHIEVED;
100    if ("no-progress".equals(codeString))
101      return NOPROGRESS;
102    if ("not-attainable".equals(codeString))
103      return NOTATTAINABLE;
104    throw new FHIRException("Unknown GoalAchievement code '" + codeString + "'");
105  }
106
107  public String toCode() {
108    switch (this) {
109    case INPROGRESS:
110      return "in-progress";
111    case IMPROVING:
112      return "improving";
113    case WORSENING:
114      return "worsening";
115    case NOCHANGE:
116      return "no-change";
117    case ACHIEVED:
118      return "achieved";
119    case SUSTAINING:
120      return "sustaining";
121    case NOTACHIEVED:
122      return "not-achieved";
123    case NOPROGRESS:
124      return "no-progress";
125    case NOTATTAINABLE:
126      return "not-attainable";
127    case NULL:
128      return null;
129    default:
130      return "?";
131    }
132  }
133
134  public String getSystem() {
135    return "http://terminology.hl7.org/CodeSystem/goal-achievement";
136  }
137
138  public String getDefinition() {
139    switch (this) {
140    case INPROGRESS:
141      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).";
142    case IMPROVING:
143      return "The goal is being sought, and is progressing.";
144    case WORSENING:
145      return "The goal is being sought, but is regressing.";
146    case NOCHANGE:
147      return "The goal is being sought, but the trend is flat.";
148    case ACHIEVED:
149      return "The goal has been met.";
150    case SUSTAINING:
151      return "The goal has been met, but ongoing activity is needed to sustain the goal objective.";
152    case NOTACHIEVED:
153      return "The goal has not been met and there might or might not have been progress towards target.";
154    case NOPROGRESS:
155      return "The goal has not been met and little to no progress towards target.";
156    case NOTATTAINABLE:
157      return "The goal is not possible to be met.";
158    case NULL:
159      return null;
160    default:
161      return "?";
162    }
163  }
164
165  public String getDisplay() {
166    switch (this) {
167    case INPROGRESS:
168      return "In Progress";
169    case IMPROVING:
170      return "Improving";
171    case WORSENING:
172      return "Worsening";
173    case NOCHANGE:
174      return "No Change";
175    case ACHIEVED:
176      return "Achieved";
177    case SUSTAINING:
178      return "Sustaining";
179    case NOTACHIEVED:
180      return "Not Achieved";
181    case NOPROGRESS:
182      return "No Progress";
183    case NOTATTAINABLE:
184      return "Not Attainable";
185    case NULL:
186      return null;
187    default:
188      return "?";
189    }
190  }
191
192}