001package org.hl7.fhir.r5.model.codesystems;
002
003/*
004 * #%L
005 * org.hl7.fhir.r5
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  Copyright (c) 2011+, HL7, Inc.
025  All rights reserved.
026  
027  Redistribution and use in source and binary forms, with or without modification, 
028  are permitted provided that the following conditions are met:
029  
030   * Redistributions of source code must retain the above copyright notice, this 
031     list of conditions and the following disclaimer.
032   * Redistributions in binary form must reproduce the above copyright notice, 
033     this list of conditions and the following disclaimer in the documentation 
034     and/or other materials provided with the distribution.
035   * Neither the name of HL7 nor the names of its contributors may be used to 
036     endorse or promote products derived from this software without specific 
037     prior written permission.
038  
039  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
040  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
041  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
042  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
043  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
044  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
045  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
046  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
047  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
048  POSSIBILITY OF SUCH DAMAGE.
049  
050*/
051
052// Generated on Thu, Oct 17, 2019 09:42+1100 for FHIR v4.1.0
053
054
055import org.hl7.fhir.exceptions.FHIRException;
056
057public enum V3HL7UpdateMode {
058
059        /**
060         * 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.)
061         */
062        A, 
063        /**
064         * Description:The item was (or is to be) either added or replaced.
065         */
066        AR, 
067        /**
068         * 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.
069         */
070        D, 
071        /**
072         * Description:This item is part of the identifying information for this object.
073         */
074        K, 
075        /**
076         * 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.
077         */
078        N, 
079        /**
080         * 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.)
081         */
082        R, 
083        /**
084         * Description:This item provides enough information to allow a processing system to locate the full applicable record by identifying the object.
085         */
086        REF, 
087        /**
088         * 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.
089         */
090        U, 
091        /**
092         * These concepts apply when the element and/or message is updating a set of items.
093         */
094        _SETUPDATEMODE, 
095        /**
096         * Add the message element to the collection of items on the receiving system that correspond to the message element.
097         */
098        ESA, 
099        /**
100         * 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.
101         */
102        ESAC, 
103        /**
104         * Change the item on the receiving system that corresponds to this message element; do not process if a matching element does not exist.
105         */
106        ESC, 
107        /**
108         * Delete the item on the receiving system that corresponds to this message element.
109         */
110        ESD, 
111        /**
112         * 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.
113         */
114        AU, 
115        /**
116         * Ignore this role, it is not relevant to the update.
117         */
118        I, 
119        /**
120         * Verify - this message element must match a value already in the receiving systems database in order to process the message.
121         */
122        V, 
123        /**
124         * added to help the parsers
125         */
126        NULL;
127        public static V3HL7UpdateMode fromCode(String codeString) throws FHIRException {
128            if (codeString == null || "".equals(codeString))
129                return null;
130        if ("A".equals(codeString))
131          return A;
132        if ("AR".equals(codeString))
133          return AR;
134        if ("D".equals(codeString))
135          return D;
136        if ("K".equals(codeString))
137          return K;
138        if ("N".equals(codeString))
139          return N;
140        if ("R".equals(codeString))
141          return R;
142        if ("REF".equals(codeString))
143          return REF;
144        if ("U".equals(codeString))
145          return U;
146        if ("_SetUpdateMode".equals(codeString))
147          return _SETUPDATEMODE;
148        if ("ESA".equals(codeString))
149          return ESA;
150        if ("ESAC".equals(codeString))
151          return ESAC;
152        if ("ESC".equals(codeString))
153          return ESC;
154        if ("ESD".equals(codeString))
155          return ESD;
156        if ("AU".equals(codeString))
157          return AU;
158        if ("I".equals(codeString))
159          return I;
160        if ("V".equals(codeString))
161          return V;
162        throw new FHIRException("Unknown V3HL7UpdateMode code '"+codeString+"'");
163        }
164        public String toCode() {
165          switch (this) {
166            case A: return "A";
167            case AR: return "AR";
168            case D: return "D";
169            case K: return "K";
170            case N: return "N";
171            case R: return "R";
172            case REF: return "REF";
173            case U: return "U";
174            case _SETUPDATEMODE: return "_SetUpdateMode";
175            case ESA: return "ESA";
176            case ESAC: return "ESAC";
177            case ESC: return "ESC";
178            case ESD: return "ESD";
179            case AU: return "AU";
180            case I: return "I";
181            case V: return "V";
182            default: return "?";
183          }
184        }
185        public String getSystem() {
186          return "http://terminology.hl7.org/CodeSystem/v3-HL7UpdateMode";
187        }
188        public String getDefinition() {
189          switch (this) {
190            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.)";
191            case AR: return "Description:The item was (or is to be) either added or replaced.";
192            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.";
193            case K: return "Description:This item is part of the identifying information for this object.";
194            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.";
195            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.)";
196            case REF: return "Description:This item provides enough information to allow a processing system to locate the full applicable record by identifying the object.";
197            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.";
198            case _SETUPDATEMODE: return "These concepts apply when the element and/or message is updating a set of items.";
199            case ESA: return "Add the message element to the collection of items on the receiving system that correspond to the message element.";
200            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.";
201            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.";
202            case ESD: return "Delete the item on the receiving system that corresponds to this message element.";
203            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.";
204            case I: return "Ignore this role, it is not relevant to the update.";
205            case V: return "Verify - this message element must match a value already in the receiving systems database in order to process the message.";
206            default: return "?";
207          }
208        }
209        public String getDisplay() {
210          switch (this) {
211            case A: return "Add";
212            case AR: return "Add or Replace";
213            case D: return "Remove";
214            case K: return "Key";
215            case N: return "No Change";
216            case R: return "Replace";
217            case REF: return "Reference";
218            case U: return "Unknown";
219            case _SETUPDATEMODE: return "SetUpdateMode";
220            case ESA: return "Set Add";
221            case ESAC: return "Set Add or Change";
222            case ESC: return "Set Change";
223            case ESD: return "Set Delete";
224            case AU: return "Add or Update";
225            case I: return "Ignore";
226            case V: return "Verify";
227            default: return "?";
228          }
229    }
230
231
232}
233