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 Thu, Sep 13, 2018 09:04-0400 for FHIR v3.5.0 033 034 035import org.hl7.fhir.r4.model.EnumFactory; 036 037public class ServicePlaceEnumFactory implements EnumFactory<ServicePlace> { 038 039 public ServicePlace fromCode(String codeString) throws IllegalArgumentException { 040 if (codeString == null || "".equals(codeString)) 041 return null; 042 if ("01".equals(codeString)) 043 return ServicePlace._01; 044 if ("03".equals(codeString)) 045 return ServicePlace._03; 046 if ("04".equals(codeString)) 047 return ServicePlace._04; 048 if ("05".equals(codeString)) 049 return ServicePlace._05; 050 if ("06".equals(codeString)) 051 return ServicePlace._06; 052 if ("07".equals(codeString)) 053 return ServicePlace._07; 054 if ("08".equals(codeString)) 055 return ServicePlace._08; 056 if ("09".equals(codeString)) 057 return ServicePlace._09; 058 if ("11".equals(codeString)) 059 return ServicePlace._11; 060 if ("12".equals(codeString)) 061 return ServicePlace._12; 062 if ("13".equals(codeString)) 063 return ServicePlace._13; 064 if ("14".equals(codeString)) 065 return ServicePlace._14; 066 if ("15".equals(codeString)) 067 return ServicePlace._15; 068 if ("19".equals(codeString)) 069 return ServicePlace._19; 070 if ("20".equals(codeString)) 071 return ServicePlace._20; 072 if ("21".equals(codeString)) 073 return ServicePlace._21; 074 if ("41".equals(codeString)) 075 return ServicePlace._41; 076 throw new IllegalArgumentException("Unknown ServicePlace code '"+codeString+"'"); 077 } 078 079 public String toCode(ServicePlace code) { 080 if (code == ServicePlace._01) 081 return "01"; 082 if (code == ServicePlace._03) 083 return "03"; 084 if (code == ServicePlace._04) 085 return "04"; 086 if (code == ServicePlace._05) 087 return "05"; 088 if (code == ServicePlace._06) 089 return "06"; 090 if (code == ServicePlace._07) 091 return "07"; 092 if (code == ServicePlace._08) 093 return "08"; 094 if (code == ServicePlace._09) 095 return "09"; 096 if (code == ServicePlace._11) 097 return "11"; 098 if (code == ServicePlace._12) 099 return "12"; 100 if (code == ServicePlace._13) 101 return "13"; 102 if (code == ServicePlace._14) 103 return "14"; 104 if (code == ServicePlace._15) 105 return "15"; 106 if (code == ServicePlace._19) 107 return "19"; 108 if (code == ServicePlace._20) 109 return "20"; 110 if (code == ServicePlace._21) 111 return "21"; 112 if (code == ServicePlace._41) 113 return "41"; 114 return "?"; 115 } 116 117 public String toSystem(ServicePlace code) { 118 return code.getSystem(); 119 } 120 121} 122