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 ConsentPolicyEnumFactory implements EnumFactory<ConsentPolicy> { 037 038 public ConsentPolicy fromCode(String codeString) throws IllegalArgumentException { 039 if (codeString == null || "".equals(codeString)) 040 return null; 041 if ("cric".equals(codeString)) 042 return ConsentPolicy.CRIC; 043 if ("illinois-minor-procedure".equals(codeString)) 044 return ConsentPolicy.ILLINOISMINORPROCEDURE; 045 if ("hipaa-auth".equals(codeString)) 046 return ConsentPolicy.HIPAAAUTH; 047 if ("hipaa-npp".equals(codeString)) 048 return ConsentPolicy.HIPAANPP; 049 if ("hipaa-restrictions".equals(codeString)) 050 return ConsentPolicy.HIPAARESTRICTIONS; 051 if ("hipaa-research".equals(codeString)) 052 return ConsentPolicy.HIPAARESEARCH; 053 if ("hipaa-self-pay".equals(codeString)) 054 return ConsentPolicy.HIPAASELFPAY; 055 if ("mdhhs-5515".equals(codeString)) 056 return ConsentPolicy.MDHHS5515; 057 if ("nyssipp".equals(codeString)) 058 return ConsentPolicy.NYSSIPP; 059 if ("va-10-0484".equals(codeString)) 060 return ConsentPolicy.VA100484; 061 if ("va-10-0485".equals(codeString)) 062 return ConsentPolicy.VA100485; 063 if ("va-10-5345".equals(codeString)) 064 return ConsentPolicy.VA105345; 065 if ("va-10-5345a".equals(codeString)) 066 return ConsentPolicy.VA105345A; 067 if ("va-10-5345a-mhv".equals(codeString)) 068 return ConsentPolicy.VA105345AMHV; 069 if ("va-10-10116".equals(codeString)) 070 return ConsentPolicy.VA1010116; 071 if ("va-21-4142".equals(codeString)) 072 return ConsentPolicy.VA214142; 073 if ("ssa-827".equals(codeString)) 074 return ConsentPolicy.SSA827; 075 if ("dch-3927".equals(codeString)) 076 return ConsentPolicy.DCH3927; 077 if ("squaxin".equals(codeString)) 078 return ConsentPolicy.SQUAXIN; 079 if ("nl-lsp".equals(codeString)) 080 return ConsentPolicy.NLLSP; 081 if ("at-elga".equals(codeString)) 082 return ConsentPolicy.ATELGA; 083 if ("nih-hipaa".equals(codeString)) 084 return ConsentPolicy.NIHHIPAA; 085 if ("nci".equals(codeString)) 086 return ConsentPolicy.NCI; 087 if ("nih-grdr".equals(codeString)) 088 return ConsentPolicy.NIHGRDR; 089 if ("nih-527".equals(codeString)) 090 return ConsentPolicy.NIH527; 091 if ("ga4gh".equals(codeString)) 092 return ConsentPolicy.GA4GH; 093 throw new IllegalArgumentException("Unknown ConsentPolicy code '" + codeString + "'"); 094 } 095 096 public String toCode(ConsentPolicy code) { 097 if (code == ConsentPolicy.NULL) 098 return null; 099 if (code == ConsentPolicy.CRIC) 100 return "cric"; 101 if (code == ConsentPolicy.ILLINOISMINORPROCEDURE) 102 return "illinois-minor-procedure"; 103 if (code == ConsentPolicy.HIPAAAUTH) 104 return "hipaa-auth"; 105 if (code == ConsentPolicy.HIPAANPP) 106 return "hipaa-npp"; 107 if (code == ConsentPolicy.HIPAARESTRICTIONS) 108 return "hipaa-restrictions"; 109 if (code == ConsentPolicy.HIPAARESEARCH) 110 return "hipaa-research"; 111 if (code == ConsentPolicy.HIPAASELFPAY) 112 return "hipaa-self-pay"; 113 if (code == ConsentPolicy.MDHHS5515) 114 return "mdhhs-5515"; 115 if (code == ConsentPolicy.NYSSIPP) 116 return "nyssipp"; 117 if (code == ConsentPolicy.VA100484) 118 return "va-10-0484"; 119 if (code == ConsentPolicy.VA100485) 120 return "va-10-0485"; 121 if (code == ConsentPolicy.VA105345) 122 return "va-10-5345"; 123 if (code == ConsentPolicy.VA105345A) 124 return "va-10-5345a"; 125 if (code == ConsentPolicy.VA105345AMHV) 126 return "va-10-5345a-mhv"; 127 if (code == ConsentPolicy.VA1010116) 128 return "va-10-10116"; 129 if (code == ConsentPolicy.VA214142) 130 return "va-21-4142"; 131 if (code == ConsentPolicy.SSA827) 132 return "ssa-827"; 133 if (code == ConsentPolicy.DCH3927) 134 return "dch-3927"; 135 if (code == ConsentPolicy.SQUAXIN) 136 return "squaxin"; 137 if (code == ConsentPolicy.NLLSP) 138 return "nl-lsp"; 139 if (code == ConsentPolicy.ATELGA) 140 return "at-elga"; 141 if (code == ConsentPolicy.NIHHIPAA) 142 return "nih-hipaa"; 143 if (code == ConsentPolicy.NCI) 144 return "nci"; 145 if (code == ConsentPolicy.NIHGRDR) 146 return "nih-grdr"; 147 if (code == ConsentPolicy.NIH527) 148 return "nih-527"; 149 if (code == ConsentPolicy.GA4GH) 150 return "ga4gh"; 151 return "?"; 152 } 153 154 public String toSystem(ConsentPolicy code) { 155 return code.getSystem(); 156 } 157 158}