001package org.hl7.fhir.dstu3.model.codesystems; 002 003/*- 004 * #%L 005 * org.hl7.fhir.dstu3 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 Sat, Mar 25, 2017 21:03-0400 for FHIR v3.0.0 054 055 056import org.hl7.fhir.dstu3.model.EnumFactory; 057 058public class ConsentCategoryEnumFactory implements EnumFactory<ConsentCategory> { 059 060 public ConsentCategory fromCode(String codeString) throws IllegalArgumentException { 061 if (codeString == null || "".equals(codeString)) 062 return null; 063 if ("42-CFR-2".equals(codeString)) 064 return ConsentCategory._42CFR2; 065 if ("ACD".equals(codeString)) 066 return ConsentCategory.ACD; 067 if ("CRIC".equals(codeString)) 068 return ConsentCategory.CRIC; 069 if ("DNR".equals(codeString)) 070 return ConsentCategory.DNR; 071 if ("EMRGONLY".equals(codeString)) 072 return ConsentCategory.EMRGONLY; 073 if ("Illinois-Minor-Procedure".equals(codeString)) 074 return ConsentCategory.ILLINOISMINORPROCEDURE; 075 if ("HCD".equals(codeString)) 076 return ConsentCategory.HCD; 077 if ("HIPAA-Auth".equals(codeString)) 078 return ConsentCategory.HIPAAAUTH; 079 if ("HIPAA-NPP".equals(codeString)) 080 return ConsentCategory.HIPAANPP; 081 if ("HIPAA-Restrictions".equals(codeString)) 082 return ConsentCategory.HIPAARESTRICTIONS; 083 if ("HIPAA-Research".equals(codeString)) 084 return ConsentCategory.HIPAARESEARCH; 085 if ("HIPAA-Self-Pay".equals(codeString)) 086 return ConsentCategory.HIPAASELFPAY; 087 if ("MDHHS-5515".equals(codeString)) 088 return ConsentCategory.MDHHS5515; 089 if ("NYSSIPP".equals(codeString)) 090 return ConsentCategory.NYSSIPP; 091 if ("NPP".equals(codeString)) 092 return ConsentCategory.NPP; 093 if ("POLST".equals(codeString)) 094 return ConsentCategory.POLST; 095 if ("RESEARCH".equals(codeString)) 096 return ConsentCategory.RESEARCH; 097 if ("RSDID".equals(codeString)) 098 return ConsentCategory.RSDID; 099 if ("RSREID".equals(codeString)) 100 return ConsentCategory.RSREID; 101 if ("SSA-827".equals(codeString)) 102 return ConsentCategory.SSA827; 103 if ("VA-10-0484".equals(codeString)) 104 return ConsentCategory.VA100484; 105 if ("VA-10-0485".equals(codeString)) 106 return ConsentCategory.VA100485; 107 if ("VA-10-5345".equals(codeString)) 108 return ConsentCategory.VA105345; 109 if ("VA-10-5345a".equals(codeString)) 110 return ConsentCategory.VA105345A; 111 if ("VA-10-5345a-MHV".equals(codeString)) 112 return ConsentCategory.VA105345AMHV; 113 if ("VA-10-10116".equals(codeString)) 114 return ConsentCategory.VA1010116; 115 if ("VA-21-4142".equals(codeString)) 116 return ConsentCategory.VA214142; 117 throw new IllegalArgumentException("Unknown ConsentCategory code '"+codeString+"'"); 118 } 119 120 public String toCode(ConsentCategory code) { 121 if (code == ConsentCategory._42CFR2) 122 return "42-CFR-2"; 123 if (code == ConsentCategory.ACD) 124 return "ACD"; 125 if (code == ConsentCategory.CRIC) 126 return "CRIC"; 127 if (code == ConsentCategory.DNR) 128 return "DNR"; 129 if (code == ConsentCategory.EMRGONLY) 130 return "EMRGONLY"; 131 if (code == ConsentCategory.ILLINOISMINORPROCEDURE) 132 return "Illinois-Minor-Procedure"; 133 if (code == ConsentCategory.HCD) 134 return "HCD"; 135 if (code == ConsentCategory.HIPAAAUTH) 136 return "HIPAA-Auth"; 137 if (code == ConsentCategory.HIPAANPP) 138 return "HIPAA-NPP"; 139 if (code == ConsentCategory.HIPAARESTRICTIONS) 140 return "HIPAA-Restrictions"; 141 if (code == ConsentCategory.HIPAARESEARCH) 142 return "HIPAA-Research"; 143 if (code == ConsentCategory.HIPAASELFPAY) 144 return "HIPAA-Self-Pay"; 145 if (code == ConsentCategory.MDHHS5515) 146 return "MDHHS-5515"; 147 if (code == ConsentCategory.NYSSIPP) 148 return "NYSSIPP"; 149 if (code == ConsentCategory.NPP) 150 return "NPP"; 151 if (code == ConsentCategory.POLST) 152 return "POLST"; 153 if (code == ConsentCategory.RESEARCH) 154 return "RESEARCH"; 155 if (code == ConsentCategory.RSDID) 156 return "RSDID"; 157 if (code == ConsentCategory.RSREID) 158 return "RSREID"; 159 if (code == ConsentCategory.SSA827) 160 return "SSA-827"; 161 if (code == ConsentCategory.VA100484) 162 return "VA-10-0484"; 163 if (code == ConsentCategory.VA100485) 164 return "VA-10-0485"; 165 if (code == ConsentCategory.VA105345) 166 return "VA-10-5345"; 167 if (code == ConsentCategory.VA105345A) 168 return "VA-10-5345a"; 169 if (code == ConsentCategory.VA105345AMHV) 170 return "VA-10-5345a-MHV"; 171 if (code == ConsentCategory.VA1010116) 172 return "VA-10-10116"; 173 if (code == ConsentCategory.VA214142) 174 return "VA-21-4142"; 175 return "?"; 176 } 177 178 public String toSystem(ConsentCategory code) { 179 return code.getSystem(); 180 } 181 182} 183