![](/hapi-fhir/images/logos/raccoon-forwards.png)
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.CRIC) 098 return "cric"; 099 if (code == ConsentPolicy.ILLINOISMINORPROCEDURE) 100 return "illinois-minor-procedure"; 101 if (code == ConsentPolicy.HIPAAAUTH) 102 return "hipaa-auth"; 103 if (code == ConsentPolicy.HIPAANPP) 104 return "hipaa-npp"; 105 if (code == ConsentPolicy.HIPAARESTRICTIONS) 106 return "hipaa-restrictions"; 107 if (code == ConsentPolicy.HIPAARESEARCH) 108 return "hipaa-research"; 109 if (code == ConsentPolicy.HIPAASELFPAY) 110 return "hipaa-self-pay"; 111 if (code == ConsentPolicy.MDHHS5515) 112 return "mdhhs-5515"; 113 if (code == ConsentPolicy.NYSSIPP) 114 return "nyssipp"; 115 if (code == ConsentPolicy.VA100484) 116 return "va-10-0484"; 117 if (code == ConsentPolicy.VA100485) 118 return "va-10-0485"; 119 if (code == ConsentPolicy.VA105345) 120 return "va-10-5345"; 121 if (code == ConsentPolicy.VA105345A) 122 return "va-10-5345a"; 123 if (code == ConsentPolicy.VA105345AMHV) 124 return "va-10-5345a-mhv"; 125 if (code == ConsentPolicy.VA1010116) 126 return "va-10-10116"; 127 if (code == ConsentPolicy.VA214142) 128 return "va-21-4142"; 129 if (code == ConsentPolicy.SSA827) 130 return "ssa-827"; 131 if (code == ConsentPolicy.DCH3927) 132 return "dch-3927"; 133 if (code == ConsentPolicy.SQUAXIN) 134 return "squaxin"; 135 if (code == ConsentPolicy.NLLSP) 136 return "nl-lsp"; 137 if (code == ConsentPolicy.ATELGA) 138 return "at-elga"; 139 if (code == ConsentPolicy.NIHHIPAA) 140 return "nih-hipaa"; 141 if (code == ConsentPolicy.NCI) 142 return "nci"; 143 if (code == ConsentPolicy.NIHGRDR) 144 return "nih-grdr"; 145 if (code == ConsentPolicy.NIH527) 146 return "nih-527"; 147 if (code == ConsentPolicy.GA4GH) 148 return "ga4gh"; 149 return "?"; 150 } 151 152 public String toSystem(ConsentPolicy code) { 153 return code.getSystem(); 154 } 155 156}