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 PatientContactRelationship { 041 042 /** 043 * Contact for use in case of emergency. 044 */ 045 EMERGENCY, 046 /** 047 * null 048 */ 049 FAMILY, 050 /** 051 * null 052 */ 053 GUARDIAN, 054 /** 055 * null 056 */ 057 FRIEND, 058 /** 059 * null 060 */ 061 PARTNER, 062 /** 063 * Contact for matters related to the patients occupation/employment. 064 */ 065 WORK, 066 /** 067 * (Non)professional caregiver 068 */ 069 CAREGIVER, 070 /** 071 * Contact that acts on behalf of the patient 072 */ 073 AGENT, 074 /** 075 * Contact for financial matters 076 */ 077 GUARANTOR, 078 /** 079 * For animals, the owner of the animal 080 */ 081 OWNER, 082 /** 083 * Parent of the patient 084 */ 085 PARENT, 086 /** 087 * added to help the parsers 088 */ 089 NULL; 090 public static PatientContactRelationship fromCode(String codeString) throws FHIRException { 091 if (codeString == null || "".equals(codeString)) 092 return null; 093 if ("emergency".equals(codeString)) 094 return EMERGENCY; 095 if ("family".equals(codeString)) 096 return FAMILY; 097 if ("guardian".equals(codeString)) 098 return GUARDIAN; 099 if ("friend".equals(codeString)) 100 return FRIEND; 101 if ("partner".equals(codeString)) 102 return PARTNER; 103 if ("work".equals(codeString)) 104 return WORK; 105 if ("caregiver".equals(codeString)) 106 return CAREGIVER; 107 if ("agent".equals(codeString)) 108 return AGENT; 109 if ("guarantor".equals(codeString)) 110 return GUARANTOR; 111 if ("owner".equals(codeString)) 112 return OWNER; 113 if ("parent".equals(codeString)) 114 return PARENT; 115 throw new FHIRException("Unknown PatientContactRelationship code '"+codeString+"'"); 116 } 117 public String toCode() { 118 switch (this) { 119 case EMERGENCY: return "emergency"; 120 case FAMILY: return "family"; 121 case GUARDIAN: return "guardian"; 122 case FRIEND: return "friend"; 123 case PARTNER: return "partner"; 124 case WORK: return "work"; 125 case CAREGIVER: return "caregiver"; 126 case AGENT: return "agent"; 127 case GUARANTOR: return "guarantor"; 128 case OWNER: return "owner"; 129 case PARENT: return "parent"; 130 case NULL: return null; 131 default: return "?"; 132 } 133 } 134 public String getSystem() { 135 return "http://hl7.org/fhir/patient-contact-relationship"; 136 } 137 public String getDefinition() { 138 switch (this) { 139 case EMERGENCY: return "Contact for use in case of emergency."; 140 case FAMILY: return ""; 141 case GUARDIAN: return ""; 142 case FRIEND: return ""; 143 case PARTNER: return ""; 144 case WORK: return "Contact for matters related to the patients occupation/employment."; 145 case CAREGIVER: return "(Non)professional caregiver"; 146 case AGENT: return "Contact that acts on behalf of the patient"; 147 case GUARANTOR: return "Contact for financial matters"; 148 case OWNER: return "For animals, the owner of the animal"; 149 case PARENT: return "Parent of the patient"; 150 case NULL: return null; 151 default: return "?"; 152 } 153 } 154 public String getDisplay() { 155 switch (this) { 156 case EMERGENCY: return "Emergency"; 157 case FAMILY: return "Family"; 158 case GUARDIAN: return "Guardian"; 159 case FRIEND: return "Friend"; 160 case PARTNER: return "Partner"; 161 case WORK: return "Work"; 162 case CAREGIVER: return "Caregiver"; 163 case AGENT: return "Agent"; 164 case GUARANTOR: return "Guarantor"; 165 case OWNER: return "Owner of animal"; 166 case PARENT: return "Parent"; 167 case NULL: return null; 168 default: return "?"; 169 } 170 } 171 172 173}