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