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.exceptions.FHIRException; 035 036public enum V3MaritalStatus { 037 038 /** 039 * Marriage contract has been declared null and to not have existed 040 */ 041 A, 042 /** 043 * Marriage contract has been declared dissolved and inactive 044 */ 045 D, 046 /** 047 * Subject to an Interlocutory Decree. 048 */ 049 I, 050 /** 051 * Legally Separated 052 */ 053 L, 054 /** 055 * A current marriage contract is active 056 */ 057 M, 058 /** 059 * More than 1 current spouse 060 */ 061 P, 062 /** 063 * No marriage contract has ever been entered 064 */ 065 S, 066 /** 067 * Person declares that a domestic partner relationship exists. 068 */ 069 T, 070 /** 071 * Currently not in a marriage contract. 072 */ 073 U, 074 /** 075 * The spouse has died 076 */ 077 W, 078 /** 079 * added to help the parsers 080 */ 081 NULL; 082 083 public static V3MaritalStatus fromCode(String codeString) throws FHIRException { 084 if (codeString == null || "".equals(codeString)) 085 return null; 086 if ("A".equals(codeString)) 087 return A; 088 if ("D".equals(codeString)) 089 return D; 090 if ("I".equals(codeString)) 091 return I; 092 if ("L".equals(codeString)) 093 return L; 094 if ("M".equals(codeString)) 095 return M; 096 if ("P".equals(codeString)) 097 return P; 098 if ("S".equals(codeString)) 099 return S; 100 if ("T".equals(codeString)) 101 return T; 102 if ("U".equals(codeString)) 103 return U; 104 if ("W".equals(codeString)) 105 return W; 106 throw new FHIRException("Unknown V3MaritalStatus code '" + codeString + "'"); 107 } 108 109 public String toCode() { 110 switch (this) { 111 case A: 112 return "A"; 113 case D: 114 return "D"; 115 case I: 116 return "I"; 117 case L: 118 return "L"; 119 case M: 120 return "M"; 121 case P: 122 return "P"; 123 case S: 124 return "S"; 125 case T: 126 return "T"; 127 case U: 128 return "U"; 129 case W: 130 return "W"; 131 case NULL: 132 return null; 133 default: 134 return "?"; 135 } 136 } 137 138 public String getSystem() { 139 return "http://terminology.hl7.org/CodeSystem/v3-MaritalStatus"; 140 } 141 142 public String getDefinition() { 143 switch (this) { 144 case A: 145 return "Marriage contract has been declared null and to not have existed"; 146 case D: 147 return "Marriage contract has been declared dissolved and inactive"; 148 case I: 149 return "Subject to an Interlocutory Decree."; 150 case L: 151 return "Legally Separated"; 152 case M: 153 return "A current marriage contract is active"; 154 case P: 155 return "More than 1 current spouse"; 156 case S: 157 return "No marriage contract has ever been entered"; 158 case T: 159 return "Person declares that a domestic partner relationship exists."; 160 case U: 161 return "Currently not in a marriage contract."; 162 case W: 163 return "The spouse has died"; 164 case NULL: 165 return null; 166 default: 167 return "?"; 168 } 169 } 170 171 public String getDisplay() { 172 switch (this) { 173 case A: 174 return "Annulled"; 175 case D: 176 return "Divorced"; 177 case I: 178 return "Interlocutory"; 179 case L: 180 return "Legally Separated"; 181 case M: 182 return "Married"; 183 case P: 184 return "Polygamous"; 185 case S: 186 return "Never Married"; 187 case T: 188 return "Domestic partner"; 189 case U: 190 return "unmarried"; 191 case W: 192 return "Widowed"; 193 case NULL: 194 return null; 195 default: 196 return "?"; 197 } 198 } 199 200}