![](/hapi-fhir/images/logos/raccoon-forwards.png)
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 Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0 033 034import org.hl7.fhir.r4.model.EnumFactory; 035 036public class LocationPhysicalTypeEnumFactory implements EnumFactory<LocationPhysicalType> { 037 038 public LocationPhysicalType fromCode(String codeString) throws IllegalArgumentException { 039 if (codeString == null || "".equals(codeString)) 040 return null; 041 if ("si".equals(codeString)) 042 return LocationPhysicalType.SI; 043 if ("bu".equals(codeString)) 044 return LocationPhysicalType.BU; 045 if ("wi".equals(codeString)) 046 return LocationPhysicalType.WI; 047 if ("wa".equals(codeString)) 048 return LocationPhysicalType.WA; 049 if ("lvl".equals(codeString)) 050 return LocationPhysicalType.LVL; 051 if ("co".equals(codeString)) 052 return LocationPhysicalType.CO; 053 if ("ro".equals(codeString)) 054 return LocationPhysicalType.RO; 055 if ("bd".equals(codeString)) 056 return LocationPhysicalType.BD; 057 if ("ve".equals(codeString)) 058 return LocationPhysicalType.VE; 059 if ("ho".equals(codeString)) 060 return LocationPhysicalType.HO; 061 if ("ca".equals(codeString)) 062 return LocationPhysicalType.CA; 063 if ("rd".equals(codeString)) 064 return LocationPhysicalType.RD; 065 if ("area".equals(codeString)) 066 return LocationPhysicalType.AREA; 067 if ("jdn".equals(codeString)) 068 return LocationPhysicalType.JDN; 069 throw new IllegalArgumentException("Unknown LocationPhysicalType code '" + codeString + "'"); 070 } 071 072 public String toCode(LocationPhysicalType code) { 073 if (code == LocationPhysicalType.SI) 074 return "si"; 075 if (code == LocationPhysicalType.BU) 076 return "bu"; 077 if (code == LocationPhysicalType.WI) 078 return "wi"; 079 if (code == LocationPhysicalType.WA) 080 return "wa"; 081 if (code == LocationPhysicalType.LVL) 082 return "lvl"; 083 if (code == LocationPhysicalType.CO) 084 return "co"; 085 if (code == LocationPhysicalType.RO) 086 return "ro"; 087 if (code == LocationPhysicalType.BD) 088 return "bd"; 089 if (code == LocationPhysicalType.VE) 090 return "ve"; 091 if (code == LocationPhysicalType.HO) 092 return "ho"; 093 if (code == LocationPhysicalType.CA) 094 return "ca"; 095 if (code == LocationPhysicalType.RD) 096 return "rd"; 097 if (code == LocationPhysicalType.AREA) 098 return "area"; 099 if (code == LocationPhysicalType.JDN) 100 return "jdn"; 101 return "?"; 102 } 103 104 public String toSystem(LocationPhysicalType code) { 105 return code.getSystem(); 106 } 107 108}