001package org.hl7.fhir.dstu3.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 Mon, Apr 17, 2017 17:38-0400 for FHIR v3.0.1 033 034 035import org.hl7.fhir.dstu3.model.EnumFactory; 036 037public class ConsentCategoryEnumFactory implements EnumFactory<ConsentCategory> { 038 039 public ConsentCategory fromCode(String codeString) throws IllegalArgumentException { 040 if (codeString == null || "".equals(codeString)) 041 return null; 042 if ("42-CFR-2".equals(codeString)) 043 return ConsentCategory._42CFR2; 044 if ("ACD".equals(codeString)) 045 return ConsentCategory.ACD; 046 if ("CRIC".equals(codeString)) 047 return ConsentCategory.CRIC; 048 if ("DNR".equals(codeString)) 049 return ConsentCategory.DNR; 050 if ("EMRGONLY".equals(codeString)) 051 return ConsentCategory.EMRGONLY; 052 if ("Illinois-Minor-Procedure".equals(codeString)) 053 return ConsentCategory.ILLINOISMINORPROCEDURE; 054 if ("HCD".equals(codeString)) 055 return ConsentCategory.HCD; 056 if ("HIPAA-Auth".equals(codeString)) 057 return ConsentCategory.HIPAAAUTH; 058 if ("HIPAA-NPP".equals(codeString)) 059 return ConsentCategory.HIPAANPP; 060 if ("HIPAA-Restrictions".equals(codeString)) 061 return ConsentCategory.HIPAARESTRICTIONS; 062 if ("HIPAA-Research".equals(codeString)) 063 return ConsentCategory.HIPAARESEARCH; 064 if ("HIPAA-Self-Pay".equals(codeString)) 065 return ConsentCategory.HIPAASELFPAY; 066 if ("MDHHS-5515".equals(codeString)) 067 return ConsentCategory.MDHHS5515; 068 if ("NYSSIPP".equals(codeString)) 069 return ConsentCategory.NYSSIPP; 070 if ("NPP".equals(codeString)) 071 return ConsentCategory.NPP; 072 if ("POLST".equals(codeString)) 073 return ConsentCategory.POLST; 074 if ("RESEARCH".equals(codeString)) 075 return ConsentCategory.RESEARCH; 076 if ("RSDID".equals(codeString)) 077 return ConsentCategory.RSDID; 078 if ("RSREID".equals(codeString)) 079 return ConsentCategory.RSREID; 080 if ("SSA-827".equals(codeString)) 081 return ConsentCategory.SSA827; 082 if ("VA-10-0484".equals(codeString)) 083 return ConsentCategory.VA100484; 084 if ("VA-10-0485".equals(codeString)) 085 return ConsentCategory.VA100485; 086 if ("VA-10-5345".equals(codeString)) 087 return ConsentCategory.VA105345; 088 if ("VA-10-5345a".equals(codeString)) 089 return ConsentCategory.VA105345A; 090 if ("VA-10-5345a-MHV".equals(codeString)) 091 return ConsentCategory.VA105345AMHV; 092 if ("VA-10-10116".equals(codeString)) 093 return ConsentCategory.VA1010116; 094 if ("VA-21-4142".equals(codeString)) 095 return ConsentCategory.VA214142; 096 throw new IllegalArgumentException("Unknown ConsentCategory code '"+codeString+"'"); 097 } 098 099 public String toCode(ConsentCategory code) { 100 if (code == ConsentCategory._42CFR2) 101 return "42-CFR-2"; 102 if (code == ConsentCategory.ACD) 103 return "ACD"; 104 if (code == ConsentCategory.CRIC) 105 return "CRIC"; 106 if (code == ConsentCategory.DNR) 107 return "DNR"; 108 if (code == ConsentCategory.EMRGONLY) 109 return "EMRGONLY"; 110 if (code == ConsentCategory.ILLINOISMINORPROCEDURE) 111 return "Illinois-Minor-Procedure"; 112 if (code == ConsentCategory.HCD) 113 return "HCD"; 114 if (code == ConsentCategory.HIPAAAUTH) 115 return "HIPAA-Auth"; 116 if (code == ConsentCategory.HIPAANPP) 117 return "HIPAA-NPP"; 118 if (code == ConsentCategory.HIPAARESTRICTIONS) 119 return "HIPAA-Restrictions"; 120 if (code == ConsentCategory.HIPAARESEARCH) 121 return "HIPAA-Research"; 122 if (code == ConsentCategory.HIPAASELFPAY) 123 return "HIPAA-Self-Pay"; 124 if (code == ConsentCategory.MDHHS5515) 125 return "MDHHS-5515"; 126 if (code == ConsentCategory.NYSSIPP) 127 return "NYSSIPP"; 128 if (code == ConsentCategory.NPP) 129 return "NPP"; 130 if (code == ConsentCategory.POLST) 131 return "POLST"; 132 if (code == ConsentCategory.RESEARCH) 133 return "RESEARCH"; 134 if (code == ConsentCategory.RSDID) 135 return "RSDID"; 136 if (code == ConsentCategory.RSREID) 137 return "RSREID"; 138 if (code == ConsentCategory.SSA827) 139 return "SSA-827"; 140 if (code == ConsentCategory.VA100484) 141 return "VA-10-0484"; 142 if (code == ConsentCategory.VA100485) 143 return "VA-10-0485"; 144 if (code == ConsentCategory.VA105345) 145 return "VA-10-5345"; 146 if (code == ConsentCategory.VA105345A) 147 return "VA-10-5345a"; 148 if (code == ConsentCategory.VA105345AMHV) 149 return "VA-10-5345a-MHV"; 150 if (code == ConsentCategory.VA1010116) 151 return "VA-10-10116"; 152 if (code == ConsentCategory.VA214142) 153 return "VA-21-4142"; 154 return "?"; 155 } 156 157 public String toSystem(ConsentCategory code) { 158 return code.getSystem(); 159 } 160 161} 162