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