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.r4.model.EnumFactory;
035
036public class OperationOutcomeEnumFactory implements EnumFactory<OperationOutcome> {
037
038  public OperationOutcome fromCode(String codeString) throws IllegalArgumentException {
039    if (codeString == null || "".equals(codeString))
040      return null;
041    if ("DELETE_MULTIPLE_MATCHES".equals(codeString))
042      return OperationOutcome.DELETEMULTIPLEMATCHES;
043    if ("MSG_AUTH_REQUIRED".equals(codeString))
044      return OperationOutcome.MSGAUTHREQUIRED;
045    if ("MSG_BAD_FORMAT".equals(codeString))
046      return OperationOutcome.MSGBADFORMAT;
047    if ("MSG_BAD_SYNTAX".equals(codeString))
048      return OperationOutcome.MSGBADSYNTAX;
049    if ("MSG_CANT_PARSE_CONTENT".equals(codeString))
050      return OperationOutcome.MSGCANTPARSECONTENT;
051    if ("MSG_CANT_PARSE_ROOT".equals(codeString))
052      return OperationOutcome.MSGCANTPARSEROOT;
053    if ("MSG_CREATED".equals(codeString))
054      return OperationOutcome.MSGCREATED;
055    if ("MSG_DATE_FORMAT".equals(codeString))
056      return OperationOutcome.MSGDATEFORMAT;
057    if ("MSG_DELETED".equals(codeString))
058      return OperationOutcome.MSGDELETED;
059    if ("MSG_DELETED_DONE".equals(codeString))
060      return OperationOutcome.MSGDELETEDDONE;
061    if ("MSG_DELETED_ID".equals(codeString))
062      return OperationOutcome.MSGDELETEDID;
063    if ("MSG_DUPLICATE_ID".equals(codeString))
064      return OperationOutcome.MSGDUPLICATEID;
065    if ("MSG_ERROR_PARSING".equals(codeString))
066      return OperationOutcome.MSGERRORPARSING;
067    if ("MSG_ID_INVALID".equals(codeString))
068      return OperationOutcome.MSGIDINVALID;
069    if ("MSG_ID_TOO_LONG".equals(codeString))
070      return OperationOutcome.MSGIDTOOLONG;
071    if ("MSG_INVALID_ID".equals(codeString))
072      return OperationOutcome.MSGINVALIDID;
073    if ("MSG_JSON_OBJECT".equals(codeString))
074      return OperationOutcome.MSGJSONOBJECT;
075    if ("MSG_LOCAL_FAIL".equals(codeString))
076      return OperationOutcome.MSGLOCALFAIL;
077    if ("MSG_NO_EXIST".equals(codeString))
078      return OperationOutcome.MSGNOEXIST;
079    if ("MSG_NO_MATCH".equals(codeString))
080      return OperationOutcome.MSGNOMATCH;
081    if ("MSG_NO_MODULE".equals(codeString))
082      return OperationOutcome.MSGNOMODULE;
083    if ("MSG_NO_SUMMARY".equals(codeString))
084      return OperationOutcome.MSGNOSUMMARY;
085    if ("MSG_OP_NOT_ALLOWED".equals(codeString))
086      return OperationOutcome.MSGOPNOTALLOWED;
087    if ("MSG_PARAM_CHAINED".equals(codeString))
088      return OperationOutcome.MSGPARAMCHAINED;
089    if ("MSG_PARAM_INVALID".equals(codeString))
090      return OperationOutcome.MSGPARAMINVALID;
091    if ("MSG_PARAM_MODIFIER_INVALID".equals(codeString))
092      return OperationOutcome.MSGPARAMMODIFIERINVALID;
093    if ("MSG_PARAM_NO_REPEAT".equals(codeString))
094      return OperationOutcome.MSGPARAMNOREPEAT;
095    if ("MSG_PARAM_UNKNOWN".equals(codeString))
096      return OperationOutcome.MSGPARAMUNKNOWN;
097    if ("MSG_RESOURCE_EXAMPLE_PROTECTED".equals(codeString))
098      return OperationOutcome.MSGRESOURCEEXAMPLEPROTECTED;
099    if ("MSG_RESOURCE_ID_FAIL".equals(codeString))
100      return OperationOutcome.MSGRESOURCEIDFAIL;
101    if ("MSG_RESOURCE_ID_MISMATCH".equals(codeString))
102      return OperationOutcome.MSGRESOURCEIDMISMATCH;
103    if ("MSG_RESOURCE_ID_MISSING".equals(codeString))
104      return OperationOutcome.MSGRESOURCEIDMISSING;
105    if ("MSG_RESOURCE_NOT_ALLOWED".equals(codeString))
106      return OperationOutcome.MSGRESOURCENOTALLOWED;
107    if ("MSG_RESOURCE_REQUIRED".equals(codeString))
108      return OperationOutcome.MSGRESOURCEREQUIRED;
109    if ("MSG_RESOURCE_TYPE_MISMATCH".equals(codeString))
110      return OperationOutcome.MSGRESOURCETYPEMISMATCH;
111    if ("MSG_SORT_UNKNOWN".equals(codeString))
112      return OperationOutcome.MSGSORTUNKNOWN;
113    if ("MSG_TRANSACTION_DUPLICATE_ID".equals(codeString))
114      return OperationOutcome.MSGTRANSACTIONDUPLICATEID;
115    if ("MSG_TRANSACTION_MISSING_ID".equals(codeString))
116      return OperationOutcome.MSGTRANSACTIONMISSINGID;
117    if ("MSG_UNHANDLED_NODE_TYPE".equals(codeString))
118      return OperationOutcome.MSGUNHANDLEDNODETYPE;
119    if ("MSG_UNKNOWN_CONTENT".equals(codeString))
120      return OperationOutcome.MSGUNKNOWNCONTENT;
121    if ("MSG_UNKNOWN_OPERATION".equals(codeString))
122      return OperationOutcome.MSGUNKNOWNOPERATION;
123    if ("MSG_UNKNOWN_TYPE".equals(codeString))
124      return OperationOutcome.MSGUNKNOWNTYPE;
125    if ("MSG_UPDATED".equals(codeString))
126      return OperationOutcome.MSGUPDATED;
127    if ("MSG_VERSION_AWARE".equals(codeString))
128      return OperationOutcome.MSGVERSIONAWARE;
129    if ("MSG_VERSION_AWARE_CONFLICT".equals(codeString))
130      return OperationOutcome.MSGVERSIONAWARECONFLICT;
131    if ("MSG_VERSION_AWARE_URL".equals(codeString))
132      return OperationOutcome.MSGVERSIONAWAREURL;
133    if ("MSG_WRONG_NS".equals(codeString))
134      return OperationOutcome.MSGWRONGNS;
135    if ("SEARCH_MULTIPLE".equals(codeString))
136      return OperationOutcome.SEARCHMULTIPLE;
137    if ("SEARCH_NONE".equals(codeString))
138      return OperationOutcome.SEARCHNONE;
139    if ("UPDATE_MULTIPLE_MATCHES".equals(codeString))
140      return OperationOutcome.UPDATEMULTIPLEMATCHES;
141    throw new IllegalArgumentException("Unknown OperationOutcome code '" + codeString + "'");
142  }
143
144  public String toCode(OperationOutcome code) {
145       if (code == OperationOutcome.NULL)
146           return null;
147       if (code == OperationOutcome.DELETEMULTIPLEMATCHES)
148      return "DELETE_MULTIPLE_MATCHES";
149    if (code == OperationOutcome.MSGAUTHREQUIRED)
150      return "MSG_AUTH_REQUIRED";
151    if (code == OperationOutcome.MSGBADFORMAT)
152      return "MSG_BAD_FORMAT";
153    if (code == OperationOutcome.MSGBADSYNTAX)
154      return "MSG_BAD_SYNTAX";
155    if (code == OperationOutcome.MSGCANTPARSECONTENT)
156      return "MSG_CANT_PARSE_CONTENT";
157    if (code == OperationOutcome.MSGCANTPARSEROOT)
158      return "MSG_CANT_PARSE_ROOT";
159    if (code == OperationOutcome.MSGCREATED)
160      return "MSG_CREATED";
161    if (code == OperationOutcome.MSGDATEFORMAT)
162      return "MSG_DATE_FORMAT";
163    if (code == OperationOutcome.MSGDELETED)
164      return "MSG_DELETED";
165    if (code == OperationOutcome.MSGDELETEDDONE)
166      return "MSG_DELETED_DONE";
167    if (code == OperationOutcome.MSGDELETEDID)
168      return "MSG_DELETED_ID";
169    if (code == OperationOutcome.MSGDUPLICATEID)
170      return "MSG_DUPLICATE_ID";
171    if (code == OperationOutcome.MSGERRORPARSING)
172      return "MSG_ERROR_PARSING";
173    if (code == OperationOutcome.MSGIDINVALID)
174      return "MSG_ID_INVALID";
175    if (code == OperationOutcome.MSGIDTOOLONG)
176      return "MSG_ID_TOO_LONG";
177    if (code == OperationOutcome.MSGINVALIDID)
178      return "MSG_INVALID_ID";
179    if (code == OperationOutcome.MSGJSONOBJECT)
180      return "MSG_JSON_OBJECT";
181    if (code == OperationOutcome.MSGLOCALFAIL)
182      return "MSG_LOCAL_FAIL";
183    if (code == OperationOutcome.MSGNOEXIST)
184      return "MSG_NO_EXIST";
185    if (code == OperationOutcome.MSGNOMATCH)
186      return "MSG_NO_MATCH";
187    if (code == OperationOutcome.MSGNOMODULE)
188      return "MSG_NO_MODULE";
189    if (code == OperationOutcome.MSGNOSUMMARY)
190      return "MSG_NO_SUMMARY";
191    if (code == OperationOutcome.MSGOPNOTALLOWED)
192      return "MSG_OP_NOT_ALLOWED";
193    if (code == OperationOutcome.MSGPARAMCHAINED)
194      return "MSG_PARAM_CHAINED";
195    if (code == OperationOutcome.MSGPARAMINVALID)
196      return "MSG_PARAM_INVALID";
197    if (code == OperationOutcome.MSGPARAMMODIFIERINVALID)
198      return "MSG_PARAM_MODIFIER_INVALID";
199    if (code == OperationOutcome.MSGPARAMNOREPEAT)
200      return "MSG_PARAM_NO_REPEAT";
201    if (code == OperationOutcome.MSGPARAMUNKNOWN)
202      return "MSG_PARAM_UNKNOWN";
203    if (code == OperationOutcome.MSGRESOURCEEXAMPLEPROTECTED)
204      return "MSG_RESOURCE_EXAMPLE_PROTECTED";
205    if (code == OperationOutcome.MSGRESOURCEIDFAIL)
206      return "MSG_RESOURCE_ID_FAIL";
207    if (code == OperationOutcome.MSGRESOURCEIDMISMATCH)
208      return "MSG_RESOURCE_ID_MISMATCH";
209    if (code == OperationOutcome.MSGRESOURCEIDMISSING)
210      return "MSG_RESOURCE_ID_MISSING";
211    if (code == OperationOutcome.MSGRESOURCENOTALLOWED)
212      return "MSG_RESOURCE_NOT_ALLOWED";
213    if (code == OperationOutcome.MSGRESOURCEREQUIRED)
214      return "MSG_RESOURCE_REQUIRED";
215    if (code == OperationOutcome.MSGRESOURCETYPEMISMATCH)
216      return "MSG_RESOURCE_TYPE_MISMATCH";
217    if (code == OperationOutcome.MSGSORTUNKNOWN)
218      return "MSG_SORT_UNKNOWN";
219    if (code == OperationOutcome.MSGTRANSACTIONDUPLICATEID)
220      return "MSG_TRANSACTION_DUPLICATE_ID";
221    if (code == OperationOutcome.MSGTRANSACTIONMISSINGID)
222      return "MSG_TRANSACTION_MISSING_ID";
223    if (code == OperationOutcome.MSGUNHANDLEDNODETYPE)
224      return "MSG_UNHANDLED_NODE_TYPE";
225    if (code == OperationOutcome.MSGUNKNOWNCONTENT)
226      return "MSG_UNKNOWN_CONTENT";
227    if (code == OperationOutcome.MSGUNKNOWNOPERATION)
228      return "MSG_UNKNOWN_OPERATION";
229    if (code == OperationOutcome.MSGUNKNOWNTYPE)
230      return "MSG_UNKNOWN_TYPE";
231    if (code == OperationOutcome.MSGUPDATED)
232      return "MSG_UPDATED";
233    if (code == OperationOutcome.MSGVERSIONAWARE)
234      return "MSG_VERSION_AWARE";
235    if (code == OperationOutcome.MSGVERSIONAWARECONFLICT)
236      return "MSG_VERSION_AWARE_CONFLICT";
237    if (code == OperationOutcome.MSGVERSIONAWAREURL)
238      return "MSG_VERSION_AWARE_URL";
239    if (code == OperationOutcome.MSGWRONGNS)
240      return "MSG_WRONG_NS";
241    if (code == OperationOutcome.SEARCHMULTIPLE)
242      return "SEARCH_MULTIPLE";
243    if (code == OperationOutcome.SEARCHNONE)
244      return "SEARCH_NONE";
245    if (code == OperationOutcome.UPDATEMULTIPLEMATCHES)
246      return "UPDATE_MULTIPLE_MATCHES";
247    return "?";
248   }
249
250  public String toSystem(OperationOutcome code) {
251    return code.getSystem();
252  }
253
254}