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 MedicationdispenseStatusReasonEnumFactory implements EnumFactory<MedicationdispenseStatusReason> { 037 038 public MedicationdispenseStatusReason fromCode(String codeString) throws IllegalArgumentException { 039 if (codeString == null || "".equals(codeString)) 040 return null; 041 if ("frr01".equals(codeString)) 042 return MedicationdispenseStatusReason.FRR01; 043 if ("frr02".equals(codeString)) 044 return MedicationdispenseStatusReason.FRR02; 045 if ("frr03".equals(codeString)) 046 return MedicationdispenseStatusReason.FRR03; 047 if ("frr04".equals(codeString)) 048 return MedicationdispenseStatusReason.FRR04; 049 if ("frr05".equals(codeString)) 050 return MedicationdispenseStatusReason.FRR05; 051 if ("frr06".equals(codeString)) 052 return MedicationdispenseStatusReason.FRR06; 053 if ("altchoice".equals(codeString)) 054 return MedicationdispenseStatusReason.ALTCHOICE; 055 if ("clarif".equals(codeString)) 056 return MedicationdispenseStatusReason.CLARIF; 057 if ("drughigh".equals(codeString)) 058 return MedicationdispenseStatusReason.DRUGHIGH; 059 if ("hospadm".equals(codeString)) 060 return MedicationdispenseStatusReason.HOSPADM; 061 if ("labint".equals(codeString)) 062 return MedicationdispenseStatusReason.LABINT; 063 if ("non-avail".equals(codeString)) 064 return MedicationdispenseStatusReason.NONAVAIL; 065 if ("preg".equals(codeString)) 066 return MedicationdispenseStatusReason.PREG; 067 if ("saig".equals(codeString)) 068 return MedicationdispenseStatusReason.SAIG; 069 if ("sddi".equals(codeString)) 070 return MedicationdispenseStatusReason.SDDI; 071 if ("sdupther".equals(codeString)) 072 return MedicationdispenseStatusReason.SDUPTHER; 073 if ("sintol".equals(codeString)) 074 return MedicationdispenseStatusReason.SINTOL; 075 if ("surg".equals(codeString)) 076 return MedicationdispenseStatusReason.SURG; 077 if ("washout".equals(codeString)) 078 return MedicationdispenseStatusReason.WASHOUT; 079 if ("outofstock".equals(codeString)) 080 return MedicationdispenseStatusReason.OUTOFSTOCK; 081 if ("offmarket".equals(codeString)) 082 return MedicationdispenseStatusReason.OFFMARKET; 083 throw new IllegalArgumentException("Unknown MedicationdispenseStatusReason code '" + codeString + "'"); 084 } 085 086 public String toCode(MedicationdispenseStatusReason code) { 087 if (code == MedicationdispenseStatusReason.NULL) 088 return null; 089 if (code == MedicationdispenseStatusReason.FRR01) 090 return "frr01"; 091 if (code == MedicationdispenseStatusReason.FRR02) 092 return "frr02"; 093 if (code == MedicationdispenseStatusReason.FRR03) 094 return "frr03"; 095 if (code == MedicationdispenseStatusReason.FRR04) 096 return "frr04"; 097 if (code == MedicationdispenseStatusReason.FRR05) 098 return "frr05"; 099 if (code == MedicationdispenseStatusReason.FRR06) 100 return "frr06"; 101 if (code == MedicationdispenseStatusReason.ALTCHOICE) 102 return "altchoice"; 103 if (code == MedicationdispenseStatusReason.CLARIF) 104 return "clarif"; 105 if (code == MedicationdispenseStatusReason.DRUGHIGH) 106 return "drughigh"; 107 if (code == MedicationdispenseStatusReason.HOSPADM) 108 return "hospadm"; 109 if (code == MedicationdispenseStatusReason.LABINT) 110 return "labint"; 111 if (code == MedicationdispenseStatusReason.NONAVAIL) 112 return "non-avail"; 113 if (code == MedicationdispenseStatusReason.PREG) 114 return "preg"; 115 if (code == MedicationdispenseStatusReason.SAIG) 116 return "saig"; 117 if (code == MedicationdispenseStatusReason.SDDI) 118 return "sddi"; 119 if (code == MedicationdispenseStatusReason.SDUPTHER) 120 return "sdupther"; 121 if (code == MedicationdispenseStatusReason.SINTOL) 122 return "sintol"; 123 if (code == MedicationdispenseStatusReason.SURG) 124 return "surg"; 125 if (code == MedicationdispenseStatusReason.WASHOUT) 126 return "washout"; 127 if (code == MedicationdispenseStatusReason.OUTOFSTOCK) 128 return "outofstock"; 129 if (code == MedicationdispenseStatusReason.OFFMARKET) 130 return "offmarket"; 131 return "?"; 132 } 133 134 public String toSystem(MedicationdispenseStatusReason code) { 135 return code.getSystem(); 136 } 137 138}