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