![](/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 ResourceStatusEnumFactory implements EnumFactory<ResourceStatus> { 037 038 public ResourceStatus fromCode(String codeString) throws IllegalArgumentException { 039 if (codeString == null || "".equals(codeString)) 040 return null; 041 if ("error".equals(codeString)) 042 return ResourceStatus.ERROR; 043 if ("proposed".equals(codeString)) 044 return ResourceStatus.PROPOSED; 045 if ("planned".equals(codeString)) 046 return ResourceStatus.PLANNED; 047 if ("draft".equals(codeString)) 048 return ResourceStatus.DRAFT; 049 if ("requested".equals(codeString)) 050 return ResourceStatus.REQUESTED; 051 if ("received".equals(codeString)) 052 return ResourceStatus.RECEIVED; 053 if ("declined".equals(codeString)) 054 return ResourceStatus.DECLINED; 055 if ("accepted".equals(codeString)) 056 return ResourceStatus.ACCEPTED; 057 if ("arrived".equals(codeString)) 058 return ResourceStatus.ARRIVED; 059 if ("active".equals(codeString)) 060 return ResourceStatus.ACTIVE; 061 if ("suspended".equals(codeString)) 062 return ResourceStatus.SUSPENDED; 063 if ("failed".equals(codeString)) 064 return ResourceStatus.FAILED; 065 if ("replaced".equals(codeString)) 066 return ResourceStatus.REPLACED; 067 if ("complete".equals(codeString)) 068 return ResourceStatus.COMPLETE; 069 if ("inactive".equals(codeString)) 070 return ResourceStatus.INACTIVE; 071 if ("abandoned".equals(codeString)) 072 return ResourceStatus.ABANDONED; 073 if ("unknown".equals(codeString)) 074 return ResourceStatus.UNKNOWN; 075 if ("unconfirmed".equals(codeString)) 076 return ResourceStatus.UNCONFIRMED; 077 if ("confirmed".equals(codeString)) 078 return ResourceStatus.CONFIRMED; 079 if ("resolved".equals(codeString)) 080 return ResourceStatus.RESOLVED; 081 if ("refuted".equals(codeString)) 082 return ResourceStatus.REFUTED; 083 if ("differential".equals(codeString)) 084 return ResourceStatus.DIFFERENTIAL; 085 if ("partial".equals(codeString)) 086 return ResourceStatus.PARTIAL; 087 if ("busy-unavailable".equals(codeString)) 088 return ResourceStatus.BUSYUNAVAILABLE; 089 if ("free".equals(codeString)) 090 return ResourceStatus.FREE; 091 if ("on-target".equals(codeString)) 092 return ResourceStatus.ONTARGET; 093 if ("ahead-of-target".equals(codeString)) 094 return ResourceStatus.AHEADOFTARGET; 095 if ("behind-target".equals(codeString)) 096 return ResourceStatus.BEHINDTARGET; 097 if ("not-ready".equals(codeString)) 098 return ResourceStatus.NOTREADY; 099 if ("transduc-discon".equals(codeString)) 100 return ResourceStatus.TRANSDUCDISCON; 101 if ("hw-discon".equals(codeString)) 102 return ResourceStatus.HWDISCON; 103 throw new IllegalArgumentException("Unknown ResourceStatus code '" + codeString + "'"); 104 } 105 106 public String toCode(ResourceStatus code) { 107 if (code == ResourceStatus.ERROR) 108 return "error"; 109 if (code == ResourceStatus.PROPOSED) 110 return "proposed"; 111 if (code == ResourceStatus.PLANNED) 112 return "planned"; 113 if (code == ResourceStatus.DRAFT) 114 return "draft"; 115 if (code == ResourceStatus.REQUESTED) 116 return "requested"; 117 if (code == ResourceStatus.RECEIVED) 118 return "received"; 119 if (code == ResourceStatus.DECLINED) 120 return "declined"; 121 if (code == ResourceStatus.ACCEPTED) 122 return "accepted"; 123 if (code == ResourceStatus.ARRIVED) 124 return "arrived"; 125 if (code == ResourceStatus.ACTIVE) 126 return "active"; 127 if (code == ResourceStatus.SUSPENDED) 128 return "suspended"; 129 if (code == ResourceStatus.FAILED) 130 return "failed"; 131 if (code == ResourceStatus.REPLACED) 132 return "replaced"; 133 if (code == ResourceStatus.COMPLETE) 134 return "complete"; 135 if (code == ResourceStatus.INACTIVE) 136 return "inactive"; 137 if (code == ResourceStatus.ABANDONED) 138 return "abandoned"; 139 if (code == ResourceStatus.UNKNOWN) 140 return "unknown"; 141 if (code == ResourceStatus.UNCONFIRMED) 142 return "unconfirmed"; 143 if (code == ResourceStatus.CONFIRMED) 144 return "confirmed"; 145 if (code == ResourceStatus.RESOLVED) 146 return "resolved"; 147 if (code == ResourceStatus.REFUTED) 148 return "refuted"; 149 if (code == ResourceStatus.DIFFERENTIAL) 150 return "differential"; 151 if (code == ResourceStatus.PARTIAL) 152 return "partial"; 153 if (code == ResourceStatus.BUSYUNAVAILABLE) 154 return "busy-unavailable"; 155 if (code == ResourceStatus.FREE) 156 return "free"; 157 if (code == ResourceStatus.ONTARGET) 158 return "on-target"; 159 if (code == ResourceStatus.AHEADOFTARGET) 160 return "ahead-of-target"; 161 if (code == ResourceStatus.BEHINDTARGET) 162 return "behind-target"; 163 if (code == ResourceStatus.NOTREADY) 164 return "not-ready"; 165 if (code == ResourceStatus.TRANSDUCDISCON) 166 return "transduc-discon"; 167 if (code == ResourceStatus.HWDISCON) 168 return "hw-discon"; 169 return "?"; 170 } 171 172 public String toSystem(ResourceStatus code) { 173 return code.getSystem(); 174 } 175 176}