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