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 Thu, Sep 13, 2018 09:04-0400 for FHIR v3.5.0 033 034 035import org.hl7.fhir.exceptions.FHIRException; 036 037public enum V3MaritalStatus { 038 039 /** 040 * Marriage contract has been declared null and to not have existed 041 */ 042 A, 043 /** 044 * Marriage contract has been declared dissolved and inactive 045 */ 046 D, 047 /** 048 * Subject to an Interlocutory Decree. 049 */ 050 I, 051 /** 052 * Legally Separated 053 */ 054 L, 055 /** 056 * A current marriage contract is active 057 */ 058 M, 059 /** 060 * More than 1 current spouse 061 */ 062 P, 063 /** 064 * No marriage contract has ever been entered 065 */ 066 S, 067 /** 068 * Person declares that a domestic partner relationship exists. 069 */ 070 T, 071 /** 072 * Currently not in a marriage contract. 073 */ 074 U, 075 /** 076 * The spouse has died 077 */ 078 W, 079 /** 080 * added to help the parsers 081 */ 082 NULL; 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 public String toCode() { 109 switch (this) { 110 case A: return "A"; 111 case D: return "D"; 112 case I: return "I"; 113 case L: return "L"; 114 case M: return "M"; 115 case P: return "P"; 116 case S: return "S"; 117 case T: return "T"; 118 case U: return "U"; 119 case W: return "W"; 120 default: return "?"; 121 } 122 } 123 public String getSystem() { 124 return "http://terminology.hl7.org/CodeSystem/v3-MaritalStatus"; 125 } 126 public String getDefinition() { 127 switch (this) { 128 case A: return "Marriage contract has been declared null and to not have existed"; 129 case D: return "Marriage contract has been declared dissolved and inactive"; 130 case I: return "Subject to an Interlocutory Decree."; 131 case L: return "Legally Separated"; 132 case M: return "A current marriage contract is active"; 133 case P: return "More than 1 current spouse"; 134 case S: return "No marriage contract has ever been entered"; 135 case T: return "Person declares that a domestic partner relationship exists."; 136 case U: return "Currently not in a marriage contract."; 137 case W: return "The spouse has died"; 138 default: return "?"; 139 } 140 } 141 public String getDisplay() { 142 switch (this) { 143 case A: return "Annulled"; 144 case D: return "Divorced"; 145 case I: return "Interlocutory"; 146 case L: return "Legally Separated"; 147 case M: return "Married"; 148 case P: return "Polygamous"; 149 case S: return "Never Married"; 150 case T: return "Domestic partner"; 151 case U: return "unmarried"; 152 case W: return "Widowed"; 153 default: return "?"; 154 } 155 } 156 157 158} 159