001package org.hl7.fhir.r4.model.codesystems;
002
003/*-
004 * #%L
005 * org.hl7.fhir.r4
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 Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0
054
055
056import org.hl7.fhir.r4.model.EnumFactory;
057
058public class ConsentPolicyEnumFactory implements EnumFactory<ConsentPolicy> {
059
060  public ConsentPolicy fromCode(String codeString) throws IllegalArgumentException {
061    if (codeString == null || "".equals(codeString))
062      return null;
063    if ("cric".equals(codeString))
064      return ConsentPolicy.CRIC;
065    if ("illinois-minor-procedure".equals(codeString))
066      return ConsentPolicy.ILLINOISMINORPROCEDURE;
067    if ("hipaa-auth".equals(codeString))
068      return ConsentPolicy.HIPAAAUTH;
069    if ("hipaa-npp".equals(codeString))
070      return ConsentPolicy.HIPAANPP;
071    if ("hipaa-restrictions".equals(codeString))
072      return ConsentPolicy.HIPAARESTRICTIONS;
073    if ("hipaa-research".equals(codeString))
074      return ConsentPolicy.HIPAARESEARCH;
075    if ("hipaa-self-pay".equals(codeString))
076      return ConsentPolicy.HIPAASELFPAY;
077    if ("mdhhs-5515".equals(codeString))
078      return ConsentPolicy.MDHHS5515;
079    if ("nyssipp".equals(codeString))
080      return ConsentPolicy.NYSSIPP;
081    if ("va-10-0484".equals(codeString))
082      return ConsentPolicy.VA100484;
083    if ("va-10-0485".equals(codeString))
084      return ConsentPolicy.VA100485;
085    if ("va-10-5345".equals(codeString))
086      return ConsentPolicy.VA105345;
087    if ("va-10-5345a".equals(codeString))
088      return ConsentPolicy.VA105345A;
089    if ("va-10-5345a-mhv".equals(codeString))
090      return ConsentPolicy.VA105345AMHV;
091    if ("va-10-10116".equals(codeString))
092      return ConsentPolicy.VA1010116;
093    if ("va-21-4142".equals(codeString))
094      return ConsentPolicy.VA214142;
095    if ("ssa-827".equals(codeString))
096      return ConsentPolicy.SSA827;
097    if ("dch-3927".equals(codeString))
098      return ConsentPolicy.DCH3927;
099    if ("squaxin".equals(codeString))
100      return ConsentPolicy.SQUAXIN;
101    if ("nl-lsp".equals(codeString))
102      return ConsentPolicy.NLLSP;
103    if ("at-elga".equals(codeString))
104      return ConsentPolicy.ATELGA;
105    if ("nih-hipaa".equals(codeString))
106      return ConsentPolicy.NIHHIPAA;
107    if ("nci".equals(codeString))
108      return ConsentPolicy.NCI;
109    if ("nih-grdr".equals(codeString))
110      return ConsentPolicy.NIHGRDR;
111    if ("nih-527".equals(codeString))
112      return ConsentPolicy.NIH527;
113    if ("ga4gh".equals(codeString))
114      return ConsentPolicy.GA4GH;
115    throw new IllegalArgumentException("Unknown ConsentPolicy code '"+codeString+"'");
116  }
117
118  public String toCode(ConsentPolicy code) {
119    if (code == ConsentPolicy.CRIC)
120      return "cric";
121    if (code == ConsentPolicy.ILLINOISMINORPROCEDURE)
122      return "illinois-minor-procedure";
123    if (code == ConsentPolicy.HIPAAAUTH)
124      return "hipaa-auth";
125    if (code == ConsentPolicy.HIPAANPP)
126      return "hipaa-npp";
127    if (code == ConsentPolicy.HIPAARESTRICTIONS)
128      return "hipaa-restrictions";
129    if (code == ConsentPolicy.HIPAARESEARCH)
130      return "hipaa-research";
131    if (code == ConsentPolicy.HIPAASELFPAY)
132      return "hipaa-self-pay";
133    if (code == ConsentPolicy.MDHHS5515)
134      return "mdhhs-5515";
135    if (code == ConsentPolicy.NYSSIPP)
136      return "nyssipp";
137    if (code == ConsentPolicy.VA100484)
138      return "va-10-0484";
139    if (code == ConsentPolicy.VA100485)
140      return "va-10-0485";
141    if (code == ConsentPolicy.VA105345)
142      return "va-10-5345";
143    if (code == ConsentPolicy.VA105345A)
144      return "va-10-5345a";
145    if (code == ConsentPolicy.VA105345AMHV)
146      return "va-10-5345a-mhv";
147    if (code == ConsentPolicy.VA1010116)
148      return "va-10-10116";
149    if (code == ConsentPolicy.VA214142)
150      return "va-21-4142";
151    if (code == ConsentPolicy.SSA827)
152      return "ssa-827";
153    if (code == ConsentPolicy.DCH3927)
154      return "dch-3927";
155    if (code == ConsentPolicy.SQUAXIN)
156      return "squaxin";
157    if (code == ConsentPolicy.NLLSP)
158      return "nl-lsp";
159    if (code == ConsentPolicy.ATELGA)
160      return "at-elga";
161    if (code == ConsentPolicy.NIHHIPAA)
162      return "nih-hipaa";
163    if (code == ConsentPolicy.NCI)
164      return "nci";
165    if (code == ConsentPolicy.NIHGRDR)
166      return "nih-grdr";
167    if (code == ConsentPolicy.NIH527)
168      return "nih-527";
169    if (code == ConsentPolicy.GA4GH)
170      return "ga4gh";
171    return "?";
172  }
173
174    public String toSystem(ConsentPolicy code) {
175      return code.getSystem();
176      }
177
178}
179