001package org.hl7.fhir.r4.model.codesystems; 002 003/*- 004 * #%L 005 * org.hl7.fhir.r4 006 * %% 007 * Copyright (C) 2014 - 2019 Health Level 7 008 * %% 009 * Licensed under the Apache License, Version 2.0 (the "License"); 010 * you may not use this file except in compliance with the License. 011 * You may obtain a copy of the License at 012 * 013 * http://www.apache.org/licenses/LICENSE-2.0 014 * 015 * Unless required by applicable law or agreed to in writing, software 016 * distributed under the License is distributed on an "AS IS" BASIS, 017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 018 * See the License for the specific language governing permissions and 019 * limitations under the License. 020 * #L% 021 */ 022 023 024/* 025 Copyright (c) 2011+, HL7, Inc. 026 All rights reserved. 027 028 Redistribution and use in source and binary forms, with or without modification, 029 are permitted provided that the following conditions are met: 030 031 * Redistributions of source code must retain the above copyright notice, this 032 list of conditions and the following disclaimer. 033 * Redistributions in binary form must reproduce the above copyright notice, 034 this list of conditions and the following disclaimer in the documentation 035 and/or other materials provided with the distribution. 036 * Neither the name of HL7 nor the names of its contributors may be used to 037 endorse or promote products derived from this software without specific 038 prior written permission. 039 040 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 041 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 042 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 043 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 044 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 045 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 046 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 047 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 048 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 049 POSSIBILITY OF SUCH DAMAGE. 050 051*/ 052 053// Generated on Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0 054 055 056import org.hl7.fhir.exceptions.FHIRException; 057 058public enum V3HL7UpdateMode { 059 060 /** 061 * Description:The item was (or is to be) added, having not been present immediately before. (If it is already present, this may be treated as an error condition.) 062 */ 063 A, 064 /** 065 * Description:The item was (or is to be) either added or replaced. 066 */ 067 AR, 068 /** 069 * Description:The item was (or is to be) removed (sometimes referred to as deleted). If the item is part of a collection, delete any matching items. 070 */ 071 D, 072 /** 073 * Description:This item is part of the identifying information for this object. 074 */ 075 K, 076 /** 077 * Description:There was (or is to be) no change to the item. This is primarily used when this element has not changed, but other attributes in the instance have changed. 078 */ 079 N, 080 /** 081 * Description:The item existed previously and has (or is to be) revised. (If an item does not already exist, this may be treated as an error condition.) 082 */ 083 R, 084 /** 085 * Description:This item provides enough information to allow a processing system to locate the full applicable record by identifying the object. 086 */ 087 REF, 088 /** 089 * Description:Description:</b>It is not specified whether or what kind of change has occurred to the item, or whether the item is present as a reference or identifying property. 090 */ 091 U, 092 /** 093 * These concepts apply when the element and/or message is updating a set of items. 094 */ 095 _SETUPDATEMODE, 096 /** 097 * Add the message element to the collection of items on the receiving system that correspond to the message element. 098 */ 099 ESA, 100 /** 101 * Change the item on the receiving system that corresponds to this message element; if a matching element does not exist, add a new one created with the values in the message. 102 */ 103 ESAC, 104 /** 105 * Change the item on the receiving system that corresponds to this message element; do not process if a matching element does not exist. 106 */ 107 ESC, 108 /** 109 * Delete the item on the receiving system that corresponds to this message element. 110 */ 111 ESD, 112 /** 113 * Description: AU: If this item exists, update it with these values. If it does not exist, create it with these values. If the item is part of the collection, update each item that matches this item, and if no items match, add a new item to the collection. 114 */ 115 AU, 116 /** 117 * Ignore this role, it is not relevant to the update. 118 */ 119 I, 120 /** 121 * Verify - this message element must match a value already in the receiving systems database in order to process the message. 122 */ 123 V, 124 /** 125 * added to help the parsers 126 */ 127 NULL; 128 public static V3HL7UpdateMode fromCode(String codeString) throws FHIRException { 129 if (codeString == null || "".equals(codeString)) 130 return null; 131 if ("A".equals(codeString)) 132 return A; 133 if ("AR".equals(codeString)) 134 return AR; 135 if ("D".equals(codeString)) 136 return D; 137 if ("K".equals(codeString)) 138 return K; 139 if ("N".equals(codeString)) 140 return N; 141 if ("R".equals(codeString)) 142 return R; 143 if ("REF".equals(codeString)) 144 return REF; 145 if ("U".equals(codeString)) 146 return U; 147 if ("_SetUpdateMode".equals(codeString)) 148 return _SETUPDATEMODE; 149 if ("ESA".equals(codeString)) 150 return ESA; 151 if ("ESAC".equals(codeString)) 152 return ESAC; 153 if ("ESC".equals(codeString)) 154 return ESC; 155 if ("ESD".equals(codeString)) 156 return ESD; 157 if ("AU".equals(codeString)) 158 return AU; 159 if ("I".equals(codeString)) 160 return I; 161 if ("V".equals(codeString)) 162 return V; 163 throw new FHIRException("Unknown V3HL7UpdateMode code '"+codeString+"'"); 164 } 165 public String toCode() { 166 switch (this) { 167 case A: return "A"; 168 case AR: return "AR"; 169 case D: return "D"; 170 case K: return "K"; 171 case N: return "N"; 172 case R: return "R"; 173 case REF: return "REF"; 174 case U: return "U"; 175 case _SETUPDATEMODE: return "_SetUpdateMode"; 176 case ESA: return "ESA"; 177 case ESAC: return "ESAC"; 178 case ESC: return "ESC"; 179 case ESD: return "ESD"; 180 case AU: return "AU"; 181 case I: return "I"; 182 case V: return "V"; 183 default: return "?"; 184 } 185 } 186 public String getSystem() { 187 return "http://terminology.hl7.org/CodeSystem/v3-HL7UpdateMode"; 188 } 189 public String getDefinition() { 190 switch (this) { 191 case A: return "Description:The item was (or is to be) added, having not been present immediately before. (If it is already present, this may be treated as an error condition.)"; 192 case AR: return "Description:The item was (or is to be) either added or replaced."; 193 case D: return "Description:The item was (or is to be) removed (sometimes referred to as deleted). If the item is part of a collection, delete any matching items."; 194 case K: return "Description:This item is part of the identifying information for this object."; 195 case N: return "Description:There was (or is to be) no change to the item. This is primarily used when this element has not changed, but other attributes in the instance have changed."; 196 case R: return "Description:The item existed previously and has (or is to be) revised. (If an item does not already exist, this may be treated as an error condition.)"; 197 case REF: return "Description:This item provides enough information to allow a processing system to locate the full applicable record by identifying the object."; 198 case U: return "Description:Description:</b>It is not specified whether or what kind of change has occurred to the item, or whether the item is present as a reference or identifying property."; 199 case _SETUPDATEMODE: return "These concepts apply when the element and/or message is updating a set of items."; 200 case ESA: return "Add the message element to the collection of items on the receiving system that correspond to the message element."; 201 case ESAC: return "Change the item on the receiving system that corresponds to this message element; if a matching element does not exist, add a new one created with the values in the message."; 202 case ESC: return "Change the item on the receiving system that corresponds to this message element; do not process if a matching element does not exist."; 203 case ESD: return "Delete the item on the receiving system that corresponds to this message element."; 204 case AU: return "Description: AU: If this item exists, update it with these values. If it does not exist, create it with these values. If the item is part of the collection, update each item that matches this item, and if no items match, add a new item to the collection."; 205 case I: return "Ignore this role, it is not relevant to the update."; 206 case V: return "Verify - this message element must match a value already in the receiving systems database in order to process the message."; 207 default: return "?"; 208 } 209 } 210 public String getDisplay() { 211 switch (this) { 212 case A: return "Add"; 213 case AR: return "Add or Replace"; 214 case D: return "Remove"; 215 case K: return "Key"; 216 case N: return "No Change"; 217 case R: return "Replace"; 218 case REF: return "Reference"; 219 case U: return "Unknown"; 220 case _SETUPDATEMODE: return "SetUpdateMode"; 221 case ESA: return "Set Add"; 222 case ESAC: return "Set Add or Change"; 223 case ESC: return "Set Change"; 224 case ESD: return "Set Delete"; 225 case AU: return "Add or Update"; 226 case I: return "Ignore"; 227 case V: return "Verify"; 228 default: return "?"; 229 } 230 } 231 232 233} 234