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.r4.model.EnumFactory;
057
058public class AppointmentCancellationReasonEnumFactory implements EnumFactory<AppointmentCancellationReason> {
059
060  public AppointmentCancellationReason fromCode(String codeString) throws IllegalArgumentException {
061    if (codeString == null || "".equals(codeString))
062      return null;
063    if ("pat".equals(codeString))
064      return AppointmentCancellationReason.PAT;
065    if ("pat-crs".equals(codeString))
066      return AppointmentCancellationReason.PATCRS;
067    if ("pat-cpp".equals(codeString))
068      return AppointmentCancellationReason.PATCPP;
069    if ("pat-dec".equals(codeString))
070      return AppointmentCancellationReason.PATDEC;
071    if ("pat-fb".equals(codeString))
072      return AppointmentCancellationReason.PATFB;
073    if ("pat-lt".equals(codeString))
074      return AppointmentCancellationReason.PATLT;
075    if ("pat-mt".equals(codeString))
076      return AppointmentCancellationReason.PATMT;
077    if ("pat-mv".equals(codeString))
078      return AppointmentCancellationReason.PATMV;
079    if ("pat-preg".equals(codeString))
080      return AppointmentCancellationReason.PATPREG;
081    if ("pat-swl".equals(codeString))
082      return AppointmentCancellationReason.PATSWL;
083    if ("pat-ucp".equals(codeString))
084      return AppointmentCancellationReason.PATUCP;
085    if ("prov".equals(codeString))
086      return AppointmentCancellationReason.PROV;
087    if ("prov-pers".equals(codeString))
088      return AppointmentCancellationReason.PROVPERS;
089    if ("prov-dch".equals(codeString))
090      return AppointmentCancellationReason.PROVDCH;
091    if ("prov-edu".equals(codeString))
092      return AppointmentCancellationReason.PROVEDU;
093    if ("prov-hosp".equals(codeString))
094      return AppointmentCancellationReason.PROVHOSP;
095    if ("prov-labs".equals(codeString))
096      return AppointmentCancellationReason.PROVLABS;
097    if ("prov-mri".equals(codeString))
098      return AppointmentCancellationReason.PROVMRI;
099    if ("prov-onc".equals(codeString))
100      return AppointmentCancellationReason.PROVONC;
101    if ("maint".equals(codeString))
102      return AppointmentCancellationReason.MAINT;
103    if ("meds-inc".equals(codeString))
104      return AppointmentCancellationReason.MEDSINC;
105    if ("other".equals(codeString))
106      return AppointmentCancellationReason.OTHER;
107    if ("oth-cms".equals(codeString))
108      return AppointmentCancellationReason.OTHCMS;
109    if ("oth-err".equals(codeString))
110      return AppointmentCancellationReason.OTHERR;
111    if ("oth-fin".equals(codeString))
112      return AppointmentCancellationReason.OTHFIN;
113    if ("oth-iv".equals(codeString))
114      return AppointmentCancellationReason.OTHIV;
115    if ("oth-int".equals(codeString))
116      return AppointmentCancellationReason.OTHINT;
117    if ("oth-mu".equals(codeString))
118      return AppointmentCancellationReason.OTHMU;
119    if ("oth-room".equals(codeString))
120      return AppointmentCancellationReason.OTHROOM;
121    if ("oth-oerr".equals(codeString))
122      return AppointmentCancellationReason.OTHOERR;
123    if ("oth-swie".equals(codeString))
124      return AppointmentCancellationReason.OTHSWIE;
125    if ("oth-weath".equals(codeString))
126      return AppointmentCancellationReason.OTHWEATH;
127    throw new IllegalArgumentException("Unknown AppointmentCancellationReason code '"+codeString+"'");
128  }
129
130  public String toCode(AppointmentCancellationReason code) {
131    if (code == AppointmentCancellationReason.PAT)
132      return "pat";
133    if (code == AppointmentCancellationReason.PATCRS)
134      return "pat-crs";
135    if (code == AppointmentCancellationReason.PATCPP)
136      return "pat-cpp";
137    if (code == AppointmentCancellationReason.PATDEC)
138      return "pat-dec";
139    if (code == AppointmentCancellationReason.PATFB)
140      return "pat-fb";
141    if (code == AppointmentCancellationReason.PATLT)
142      return "pat-lt";
143    if (code == AppointmentCancellationReason.PATMT)
144      return "pat-mt";
145    if (code == AppointmentCancellationReason.PATMV)
146      return "pat-mv";
147    if (code == AppointmentCancellationReason.PATPREG)
148      return "pat-preg";
149    if (code == AppointmentCancellationReason.PATSWL)
150      return "pat-swl";
151    if (code == AppointmentCancellationReason.PATUCP)
152      return "pat-ucp";
153    if (code == AppointmentCancellationReason.PROV)
154      return "prov";
155    if (code == AppointmentCancellationReason.PROVPERS)
156      return "prov-pers";
157    if (code == AppointmentCancellationReason.PROVDCH)
158      return "prov-dch";
159    if (code == AppointmentCancellationReason.PROVEDU)
160      return "prov-edu";
161    if (code == AppointmentCancellationReason.PROVHOSP)
162      return "prov-hosp";
163    if (code == AppointmentCancellationReason.PROVLABS)
164      return "prov-labs";
165    if (code == AppointmentCancellationReason.PROVMRI)
166      return "prov-mri";
167    if (code == AppointmentCancellationReason.PROVONC)
168      return "prov-onc";
169    if (code == AppointmentCancellationReason.MAINT)
170      return "maint";
171    if (code == AppointmentCancellationReason.MEDSINC)
172      return "meds-inc";
173    if (code == AppointmentCancellationReason.OTHER)
174      return "other";
175    if (code == AppointmentCancellationReason.OTHCMS)
176      return "oth-cms";
177    if (code == AppointmentCancellationReason.OTHERR)
178      return "oth-err";
179    if (code == AppointmentCancellationReason.OTHFIN)
180      return "oth-fin";
181    if (code == AppointmentCancellationReason.OTHIV)
182      return "oth-iv";
183    if (code == AppointmentCancellationReason.OTHINT)
184      return "oth-int";
185    if (code == AppointmentCancellationReason.OTHMU)
186      return "oth-mu";
187    if (code == AppointmentCancellationReason.OTHROOM)
188      return "oth-room";
189    if (code == AppointmentCancellationReason.OTHOERR)
190      return "oth-oerr";
191    if (code == AppointmentCancellationReason.OTHSWIE)
192      return "oth-swie";
193    if (code == AppointmentCancellationReason.OTHWEATH)
194      return "oth-weath";
195    return "?";
196  }
197
198    public String toSystem(AppointmentCancellationReason code) {
199      return code.getSystem();
200      }
201
202}
203