001package org.hl7.fhir.dstu2016may.model.codesystems; 002 003 004 005 006/* 007 Copyright (c) 2011+, HL7, Inc. 008 All rights reserved. 009 010 Redistribution and use in source and binary forms, with or without modification, 011 are permitted provided that the following conditions are met: 012 013 * Redistributions of source code must retain the above copyright notice, this 014 list of conditions and the following disclaimer. 015 * Redistributions in binary form must reproduce the above copyright notice, 016 this list of conditions and the following disclaimer in the documentation 017 and/or other materials provided with the distribution. 018 * Neither the name of HL7 nor the names of its contributors may be used to 019 endorse or promote products derived from this software without specific 020 prior written permission. 021 022 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 023 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 024 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 025 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 026 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 027 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 028 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 029 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 030 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 031 POSSIBILITY OF SUCH DAMAGE. 032 033*/ 034 035// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 036 037 038import org.hl7.fhir.exceptions.FHIRException; 039 040public enum HspcAddressUse { 041 042 /** 043 * null 044 */ 045 BAD, 046 /** 047 * null 048 */ 049 PHYS, 050 /** 051 * null 052 */ 053 PST, 054 /** 055 * null 056 */ 057 HP, 058 /** 059 * null 060 */ 061 PUB, 062 /** 063 * null 064 */ 065 TMP, 066 /** 067 * null 068 */ 069 HV, 070 /** 071 * null 072 */ 073 WP, 074 /** 075 * null 076 */ 077 H, 078 /** 079 * null 080 */ 081 DIR, 082 /** 083 * null 084 */ 085 CONF, 086 /** 087 * added to help the parsers 088 */ 089 NULL; 090 public static HspcAddressUse fromCode(String codeString) throws FHIRException { 091 if (codeString == null || "".equals(codeString)) 092 return null; 093 if ("BAD".equals(codeString)) 094 return BAD; 095 if ("PHYS".equals(codeString)) 096 return PHYS; 097 if ("PST".equals(codeString)) 098 return PST; 099 if ("HP".equals(codeString)) 100 return HP; 101 if ("PUB".equals(codeString)) 102 return PUB; 103 if ("TMP".equals(codeString)) 104 return TMP; 105 if ("HV".equals(codeString)) 106 return HV; 107 if ("WP".equals(codeString)) 108 return WP; 109 if ("H".equals(codeString)) 110 return H; 111 if ("DIR".equals(codeString)) 112 return DIR; 113 if ("CONF".equals(codeString)) 114 return CONF; 115 throw new FHIRException("Unknown HspcAddressUse code '"+codeString+"'"); 116 } 117 public String toCode() { 118 switch (this) { 119 case BAD: return "BAD"; 120 case PHYS: return "PHYS"; 121 case PST: return "PST"; 122 case HP: return "HP"; 123 case PUB: return "PUB"; 124 case TMP: return "TMP"; 125 case HV: return "HV"; 126 case WP: return "WP"; 127 case H: return "H"; 128 case DIR: return "DIR"; 129 case CONF: return "CONF"; 130 case NULL: return null; 131 default: return "?"; 132 } 133 } 134 public String getSystem() { 135 return "http://hl7.org/fhir/addressUse"; 136 } 137 public String getDefinition() { 138 switch (this) { 139 case BAD: return ""; 140 case PHYS: return ""; 141 case PST: return ""; 142 case HP: return ""; 143 case PUB: return ""; 144 case TMP: return ""; 145 case HV: return ""; 146 case WP: return ""; 147 case H: return ""; 148 case DIR: return ""; 149 case CONF: return ""; 150 case NULL: return null; 151 default: return "?"; 152 } 153 } 154 public String getDisplay() { 155 switch (this) { 156 case BAD: return "Bad address"; 157 case PHYS: return "Physical visit address"; 158 case PST: return "Postal address"; 159 case HP: return "Primary home"; 160 case PUB: return "Public"; 161 case TMP: return "Temporary address"; 162 case HV: return "Vacation home"; 163 case WP: return "Work place"; 164 case H: return "Home address"; 165 case DIR: return "Direct address"; 166 case CONF: return "Conficential address"; 167 case NULL: return null; 168 default: return "?"; 169 } 170 } 171 172 173}