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 LocationPhysicalTypeEnumFactory implements EnumFactory<LocationPhysicalType> { 038 039 public LocationPhysicalType fromCode(String codeString) throws IllegalArgumentException { 040 if (codeString == null || "".equals(codeString)) 041 return null; 042 if ("si".equals(codeString)) 043 return LocationPhysicalType.SI; 044 if ("bu".equals(codeString)) 045 return LocationPhysicalType.BU; 046 if ("wi".equals(codeString)) 047 return LocationPhysicalType.WI; 048 if ("wa".equals(codeString)) 049 return LocationPhysicalType.WA; 050 if ("lvl".equals(codeString)) 051 return LocationPhysicalType.LVL; 052 if ("co".equals(codeString)) 053 return LocationPhysicalType.CO; 054 if ("ro".equals(codeString)) 055 return LocationPhysicalType.RO; 056 if ("bd".equals(codeString)) 057 return LocationPhysicalType.BD; 058 if ("ve".equals(codeString)) 059 return LocationPhysicalType.VE; 060 if ("ho".equals(codeString)) 061 return LocationPhysicalType.HO; 062 if ("ca".equals(codeString)) 063 return LocationPhysicalType.CA; 064 if ("rd".equals(codeString)) 065 return LocationPhysicalType.RD; 066 if ("area".equals(codeString)) 067 return LocationPhysicalType.AREA; 068 if ("jdn".equals(codeString)) 069 return LocationPhysicalType.JDN; 070 throw new IllegalArgumentException("Unknown LocationPhysicalType code '"+codeString+"'"); 071 } 072 073 public String toCode(LocationPhysicalType code) { 074 if (code == LocationPhysicalType.SI) 075 return "si"; 076 if (code == LocationPhysicalType.BU) 077 return "bu"; 078 if (code == LocationPhysicalType.WI) 079 return "wi"; 080 if (code == LocationPhysicalType.WA) 081 return "wa"; 082 if (code == LocationPhysicalType.LVL) 083 return "lvl"; 084 if (code == LocationPhysicalType.CO) 085 return "co"; 086 if (code == LocationPhysicalType.RO) 087 return "ro"; 088 if (code == LocationPhysicalType.BD) 089 return "bd"; 090 if (code == LocationPhysicalType.VE) 091 return "ve"; 092 if (code == LocationPhysicalType.HO) 093 return "ho"; 094 if (code == LocationPhysicalType.CA) 095 return "ca"; 096 if (code == LocationPhysicalType.RD) 097 return "rd"; 098 if (code == LocationPhysicalType.AREA) 099 return "area"; 100 if (code == LocationPhysicalType.JDN) 101 return "jdn"; 102 return "?"; 103 } 104 105 public String toSystem(LocationPhysicalType code) { 106 return code.getSystem(); 107 } 108 109} 110