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