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, Sep 13, 2018 09:04-0400 for FHIR v3.5.0 033 034 035import org.hl7.fhir.exceptions.FHIRException; 036 037public enum V3HL7UpdateMode { 038 039 /** 040 * 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.) 041 */ 042 A, 043 /** 044 * Description:The item was (or is to be) either added or replaced. 045 */ 046 AR, 047 /** 048 * 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. 049 */ 050 D, 051 /** 052 * Description:This item is part of the identifying information for this object. 053 */ 054 K, 055 /** 056 * 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. 057 */ 058 N, 059 /** 060 * 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.) 061 */ 062 R, 063 /** 064 * Description:This item provides enough information to allow a processing system to locate the full applicable record by identifying the object. 065 */ 066 REF, 067 /** 068 * 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. 069 */ 070 U, 071 /** 072 * These concepts apply when the element and/or message is updating a set of items. 073 */ 074 _SETUPDATEMODE, 075 /** 076 * Add the message element to the collection of items on the receiving system that correspond to the message element. 077 */ 078 ESA, 079 /** 080 * 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. 081 */ 082 ESAC, 083 /** 084 * Change the item on the receiving system that corresponds to this message element; do not process if a matching element does not exist. 085 */ 086 ESC, 087 /** 088 * Delete the item on the receiving system that corresponds to this message element. 089 */ 090 ESD, 091 /** 092 * 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. 093 */ 094 AU, 095 /** 096 * Ignore this role, it is not relevant to the update. 097 */ 098 I, 099 /** 100 * Verify - this message element must match a value already in the receiving systems database in order to process the message. 101 */ 102 V, 103 /** 104 * added to help the parsers 105 */ 106 NULL; 107 public static V3HL7UpdateMode fromCode(String codeString) throws FHIRException { 108 if (codeString == null || "".equals(codeString)) 109 return null; 110 if ("A".equals(codeString)) 111 return A; 112 if ("AR".equals(codeString)) 113 return AR; 114 if ("D".equals(codeString)) 115 return D; 116 if ("K".equals(codeString)) 117 return K; 118 if ("N".equals(codeString)) 119 return N; 120 if ("R".equals(codeString)) 121 return R; 122 if ("REF".equals(codeString)) 123 return REF; 124 if ("U".equals(codeString)) 125 return U; 126 if ("_SetUpdateMode".equals(codeString)) 127 return _SETUPDATEMODE; 128 if ("ESA".equals(codeString)) 129 return ESA; 130 if ("ESAC".equals(codeString)) 131 return ESAC; 132 if ("ESC".equals(codeString)) 133 return ESC; 134 if ("ESD".equals(codeString)) 135 return ESD; 136 if ("AU".equals(codeString)) 137 return AU; 138 if ("I".equals(codeString)) 139 return I; 140 if ("V".equals(codeString)) 141 return V; 142 throw new FHIRException("Unknown V3HL7UpdateMode code '"+codeString+"'"); 143 } 144 public String toCode() { 145 switch (this) { 146 case A: return "A"; 147 case AR: return "AR"; 148 case D: return "D"; 149 case K: return "K"; 150 case N: return "N"; 151 case R: return "R"; 152 case REF: return "REF"; 153 case U: return "U"; 154 case _SETUPDATEMODE: return "_SetUpdateMode"; 155 case ESA: return "ESA"; 156 case ESAC: return "ESAC"; 157 case ESC: return "ESC"; 158 case ESD: return "ESD"; 159 case AU: return "AU"; 160 case I: return "I"; 161 case V: return "V"; 162 default: return "?"; 163 } 164 } 165 public String getSystem() { 166 return "http://terminology.hl7.org/CodeSystem/v3-HL7UpdateMode"; 167 } 168 public String getDefinition() { 169 switch (this) { 170 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.)"; 171 case AR: return "Description:The item was (or is to be) either added or replaced."; 172 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."; 173 case K: return "Description:This item is part of the identifying information for this object."; 174 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."; 175 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.)"; 176 case REF: return "Description:This item provides enough information to allow a processing system to locate the full applicable record by identifying the object."; 177 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."; 178 case _SETUPDATEMODE: return "These concepts apply when the element and/or message is updating a set of items."; 179 case ESA: return "Add the message element to the collection of items on the receiving system that correspond to the message element."; 180 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."; 181 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."; 182 case ESD: return "Delete the item on the receiving system that corresponds to this message element."; 183 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."; 184 case I: return "Ignore this role, it is not relevant to the update."; 185 case V: return "Verify - this message element must match a value already in the receiving systems database in order to process the message."; 186 default: return "?"; 187 } 188 } 189 public String getDisplay() { 190 switch (this) { 191 case A: return "Add"; 192 case AR: return "Add or Replace"; 193 case D: return "Remove"; 194 case K: return "Key"; 195 case N: return "No Change"; 196 case R: return "Replace"; 197 case REF: return "Reference"; 198 case U: return "Unknown"; 199 case _SETUPDATEMODE: return "SetUpdateMode"; 200 case ESA: return "Set Add"; 201 case ESAC: return "Set Add or Change"; 202 case ESC: return "Set Change"; 203 case ESD: return "Set Delete"; 204 case AU: return "Add or Update"; 205 case I: return "Ignore"; 206 case V: return "Verify"; 207 default: return "?"; 208 } 209 } 210 211 212} 213