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 Sun, May 6, 2018 17:51-0400 for FHIR v3.4.0
033
034
035import org.hl7.fhir.r4.model.EnumFactory;
036
037public class Hl7WorkGroupEnumFactory implements EnumFactory<Hl7WorkGroup> {
038
039  public Hl7WorkGroup fromCode(String codeString) throws IllegalArgumentException {
040    if (codeString == null || "".equals(codeString))
041      return null;
042    if ("cbcc".equals(codeString))
043      return Hl7WorkGroup.CBCC;
044    if ("cds".equals(codeString))
045      return Hl7WorkGroup.CDS;
046    if ("cqi".equals(codeString))
047      return Hl7WorkGroup.CQI;
048    if ("cg".equals(codeString))
049      return Hl7WorkGroup.CG;
050    if ("dev".equals(codeString))
051      return Hl7WorkGroup.DEV;
052    if ("ehr".equals(codeString))
053      return Hl7WorkGroup.EHR;
054    if ("fhir".equals(codeString))
055      return Hl7WorkGroup.FHIR;
056    if ("fm".equals(codeString))
057      return Hl7WorkGroup.FM;
058    if ("hsi".equals(codeString))
059      return Hl7WorkGroup.HSI;
060    if ("ii".equals(codeString))
061      return Hl7WorkGroup.II;
062    if ("inm".equals(codeString))
063      return Hl7WorkGroup.INM;
064    if ("its".equals(codeString))
065      return Hl7WorkGroup.ITS;
066    if ("oo".equals(codeString))
067      return Hl7WorkGroup.OO;
068    if ("pa".equals(codeString))
069      return Hl7WorkGroup.PA;
070    if ("pc".equals(codeString))
071      return Hl7WorkGroup.PC;
072    if ("pher".equals(codeString))
073      return Hl7WorkGroup.PHER;
074    if ("phx".equals(codeString))
075      return Hl7WorkGroup.PHX;
076    if ("rcrim".equals(codeString))
077      return Hl7WorkGroup.RCRIM;
078    if ("sd".equals(codeString))
079      return Hl7WorkGroup.SD;
080    if ("sec".equals(codeString))
081      return Hl7WorkGroup.SEC;
082    if ("us".equals(codeString))
083      return Hl7WorkGroup.US;
084    if ("vocab".equals(codeString))
085      return Hl7WorkGroup.VOCAB;
086    if ("aid".equals(codeString))
087      return Hl7WorkGroup.AID;
088    throw new IllegalArgumentException("Unknown Hl7WorkGroup code '"+codeString+"'");
089  }
090
091  public String toCode(Hl7WorkGroup code) {
092    if (code == Hl7WorkGroup.CBCC)
093      return "cbcc";
094    if (code == Hl7WorkGroup.CDS)
095      return "cds";
096    if (code == Hl7WorkGroup.CQI)
097      return "cqi";
098    if (code == Hl7WorkGroup.CG)
099      return "cg";
100    if (code == Hl7WorkGroup.DEV)
101      return "dev";
102    if (code == Hl7WorkGroup.EHR)
103      return "ehr";
104    if (code == Hl7WorkGroup.FHIR)
105      return "fhir";
106    if (code == Hl7WorkGroup.FM)
107      return "fm";
108    if (code == Hl7WorkGroup.HSI)
109      return "hsi";
110    if (code == Hl7WorkGroup.II)
111      return "ii";
112    if (code == Hl7WorkGroup.INM)
113      return "inm";
114    if (code == Hl7WorkGroup.ITS)
115      return "its";
116    if (code == Hl7WorkGroup.OO)
117      return "oo";
118    if (code == Hl7WorkGroup.PA)
119      return "pa";
120    if (code == Hl7WorkGroup.PC)
121      return "pc";
122    if (code == Hl7WorkGroup.PHER)
123      return "pher";
124    if (code == Hl7WorkGroup.PHX)
125      return "phx";
126    if (code == Hl7WorkGroup.RCRIM)
127      return "rcrim";
128    if (code == Hl7WorkGroup.SD)
129      return "sd";
130    if (code == Hl7WorkGroup.SEC)
131      return "sec";
132    if (code == Hl7WorkGroup.US)
133      return "us";
134    if (code == Hl7WorkGroup.VOCAB)
135      return "vocab";
136    if (code == Hl7WorkGroup.AID)
137      return "aid";
138    return "?";
139  }
140
141    public String toSystem(Hl7WorkGroup code) {
142      return code.getSystem();
143      }
144
145}
146