001package org.hl7.fhir.r4.model.codesystems; 002 003 004 005 006/* 007 Copyright (c) 2011+, HL7, Inc. 008 All rights reserved. 009 010 Redistribution and use in source and binary forms, with or without modification, 011 are permitted provided that the following conditions are met: 012 013 * Redistributions of source code must retain the above copyright notice, this 014 list of conditions and the following disclaimer. 015 * Redistributions in binary form must reproduce the above copyright notice, 016 this list of conditions and the following disclaimer in the documentation 017 and/or other materials provided with the distribution. 018 * Neither the name of HL7 nor the names of its contributors may be used to 019 endorse or promote products derived from this software without specific 020 prior written permission. 021 022 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 023 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 024 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 025 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 026 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 027 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 028 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 029 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 030 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 031 POSSIBILITY OF SUCH DAMAGE. 032 033*/ 034 035// Generated on Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0 036 037 038import org.hl7.fhir.r4.model.EnumFactory; 039 040public class ConsentPolicyEnumFactory implements EnumFactory<ConsentPolicy> { 041 042 public ConsentPolicy fromCode(String codeString) throws IllegalArgumentException { 043 if (codeString == null || "".equals(codeString)) 044 return null; 045 if ("cric".equals(codeString)) 046 return ConsentPolicy.CRIC; 047 if ("illinois-minor-procedure".equals(codeString)) 048 return ConsentPolicy.ILLINOISMINORPROCEDURE; 049 if ("hipaa-auth".equals(codeString)) 050 return ConsentPolicy.HIPAAAUTH; 051 if ("hipaa-npp".equals(codeString)) 052 return ConsentPolicy.HIPAANPP; 053 if ("hipaa-restrictions".equals(codeString)) 054 return ConsentPolicy.HIPAARESTRICTIONS; 055 if ("hipaa-research".equals(codeString)) 056 return ConsentPolicy.HIPAARESEARCH; 057 if ("hipaa-self-pay".equals(codeString)) 058 return ConsentPolicy.HIPAASELFPAY; 059 if ("mdhhs-5515".equals(codeString)) 060 return ConsentPolicy.MDHHS5515; 061 if ("nyssipp".equals(codeString)) 062 return ConsentPolicy.NYSSIPP; 063 if ("va-10-0484".equals(codeString)) 064 return ConsentPolicy.VA100484; 065 if ("va-10-0485".equals(codeString)) 066 return ConsentPolicy.VA100485; 067 if ("va-10-5345".equals(codeString)) 068 return ConsentPolicy.VA105345; 069 if ("va-10-5345a".equals(codeString)) 070 return ConsentPolicy.VA105345A; 071 if ("va-10-5345a-mhv".equals(codeString)) 072 return ConsentPolicy.VA105345AMHV; 073 if ("va-10-10116".equals(codeString)) 074 return ConsentPolicy.VA1010116; 075 if ("va-21-4142".equals(codeString)) 076 return ConsentPolicy.VA214142; 077 if ("ssa-827".equals(codeString)) 078 return ConsentPolicy.SSA827; 079 if ("dch-3927".equals(codeString)) 080 return ConsentPolicy.DCH3927; 081 if ("squaxin".equals(codeString)) 082 return ConsentPolicy.SQUAXIN; 083 if ("nl-lsp".equals(codeString)) 084 return ConsentPolicy.NLLSP; 085 if ("at-elga".equals(codeString)) 086 return ConsentPolicy.ATELGA; 087 if ("nih-hipaa".equals(codeString)) 088 return ConsentPolicy.NIHHIPAA; 089 if ("nci".equals(codeString)) 090 return ConsentPolicy.NCI; 091 if ("nih-grdr".equals(codeString)) 092 return ConsentPolicy.NIHGRDR; 093 if ("nih-527".equals(codeString)) 094 return ConsentPolicy.NIH527; 095 if ("ga4gh".equals(codeString)) 096 return ConsentPolicy.GA4GH; 097 throw new IllegalArgumentException("Unknown ConsentPolicy code '"+codeString+"'"); 098 } 099 100 public String toCode(ConsentPolicy code) { 101 if (code == ConsentPolicy.CRIC) 102 return "cric"; 103 if (code == ConsentPolicy.ILLINOISMINORPROCEDURE) 104 return "illinois-minor-procedure"; 105 if (code == ConsentPolicy.HIPAAAUTH) 106 return "hipaa-auth"; 107 if (code == ConsentPolicy.HIPAANPP) 108 return "hipaa-npp"; 109 if (code == ConsentPolicy.HIPAARESTRICTIONS) 110 return "hipaa-restrictions"; 111 if (code == ConsentPolicy.HIPAARESEARCH) 112 return "hipaa-research"; 113 if (code == ConsentPolicy.HIPAASELFPAY) 114 return "hipaa-self-pay"; 115 if (code == ConsentPolicy.MDHHS5515) 116 return "mdhhs-5515"; 117 if (code == ConsentPolicy.NYSSIPP) 118 return "nyssipp"; 119 if (code == ConsentPolicy.VA100484) 120 return "va-10-0484"; 121 if (code == ConsentPolicy.VA100485) 122 return "va-10-0485"; 123 if (code == ConsentPolicy.VA105345) 124 return "va-10-5345"; 125 if (code == ConsentPolicy.VA105345A) 126 return "va-10-5345a"; 127 if (code == ConsentPolicy.VA105345AMHV) 128 return "va-10-5345a-mhv"; 129 if (code == ConsentPolicy.VA1010116) 130 return "va-10-10116"; 131 if (code == ConsentPolicy.VA214142) 132 return "va-21-4142"; 133 if (code == ConsentPolicy.SSA827) 134 return "ssa-827"; 135 if (code == ConsentPolicy.DCH3927) 136 return "dch-3927"; 137 if (code == ConsentPolicy.SQUAXIN) 138 return "squaxin"; 139 if (code == ConsentPolicy.NLLSP) 140 return "nl-lsp"; 141 if (code == ConsentPolicy.ATELGA) 142 return "at-elga"; 143 if (code == ConsentPolicy.NIHHIPAA) 144 return "nih-hipaa"; 145 if (code == ConsentPolicy.NCI) 146 return "nci"; 147 if (code == ConsentPolicy.NIHGRDR) 148 return "nih-grdr"; 149 if (code == ConsentPolicy.NIH527) 150 return "nih-527"; 151 if (code == ConsentPolicy.GA4GH) 152 return "ga4gh"; 153 return "?"; 154 } 155 156 public String toSystem(ConsentPolicy code) { 157 return code.getSystem(); 158 } 159 160}