
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 GoalRelationshipType { 037 038 /** 039 * Indicates that the target goal is one which must be met before striving for 040 * the current goal. 041 */ 042 PREDECESSOR, 043 /** 044 * Indicates that the target goal is a desired objective once the current goal 045 * is met. 046 */ 047 SUCCESSOR, 048 /** 049 * Indicates that this goal has been replaced by the target goal. 050 */ 051 REPLACEMENT, 052 /** 053 * Indicates that the target goal is considered to be a "piece" of attaining 054 * this goal. 055 */ 056 MILESTONE, 057 /** 058 * Indicates that the relationship is not covered by one of the pre-defined 059 * codes. (An extension may convey more information about the meaning of the 060 * relationship.). 061 */ 062 OTHER, 063 /** 064 * added to help the parsers 065 */ 066 NULL; 067 068 public static GoalRelationshipType fromCode(String codeString) throws FHIRException { 069 if (codeString == null || "".equals(codeString)) 070 return null; 071 if ("predecessor".equals(codeString)) 072 return PREDECESSOR; 073 if ("successor".equals(codeString)) 074 return SUCCESSOR; 075 if ("replacement".equals(codeString)) 076 return REPLACEMENT; 077 if ("milestone".equals(codeString)) 078 return MILESTONE; 079 if ("other".equals(codeString)) 080 return OTHER; 081 throw new FHIRException("Unknown GoalRelationshipType code '" + codeString + "'"); 082 } 083 084 public String toCode() { 085 switch (this) { 086 case PREDECESSOR: 087 return "predecessor"; 088 case SUCCESSOR: 089 return "successor"; 090 case REPLACEMENT: 091 return "replacement"; 092 case MILESTONE: 093 return "milestone"; 094 case OTHER: 095 return "other"; 096 case NULL: 097 return null; 098 default: 099 return "?"; 100 } 101 } 102 103 public String getSystem() { 104 return "http://terminology.hl7.org/CodeSystem/goal-relationship-type"; 105 } 106 107 public String getDefinition() { 108 switch (this) { 109 case PREDECESSOR: 110 return "Indicates that the target goal is one which must be met before striving for the current goal."; 111 case SUCCESSOR: 112 return "Indicates that the target goal is a desired objective once the current goal is met."; 113 case REPLACEMENT: 114 return "Indicates that this goal has been replaced by the target goal."; 115 case MILESTONE: 116 return "Indicates that the target goal is considered to be a \"piece\" of attaining this goal."; 117 case OTHER: 118 return "Indicates that the relationship is not covered by one of the pre-defined codes. (An extension may convey more information about the meaning of the relationship.)."; 119 case NULL: 120 return null; 121 default: 122 return "?"; 123 } 124 } 125 126 public String getDisplay() { 127 switch (this) { 128 case PREDECESSOR: 129 return "Predecessor"; 130 case SUCCESSOR: 131 return "Successor"; 132 case REPLACEMENT: 133 return "Replacement"; 134 case MILESTONE: 135 return "Milestone"; 136 case OTHER: 137 return "Other"; 138 case NULL: 139 return null; 140 default: 141 return "?"; 142 } 143 } 144 145}