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