001package org.hl7.fhir.dstu3.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 Sat, Mar 25, 2017 21:03-0400 for FHIR v3.0.0 036 037 038import org.hl7.fhir.dstu3.model.EnumFactory; 039 040public class V3TimingEventEnumFactory implements EnumFactory<V3TimingEvent> { 041 042 public V3TimingEvent fromCode(String codeString) throws IllegalArgumentException { 043 if (codeString == null || "".equals(codeString)) 044 return null; 045 if ("AC".equals(codeString)) 046 return V3TimingEvent.AC; 047 if ("ACD".equals(codeString)) 048 return V3TimingEvent.ACD; 049 if ("ACM".equals(codeString)) 050 return V3TimingEvent.ACM; 051 if ("ACV".equals(codeString)) 052 return V3TimingEvent.ACV; 053 if ("C".equals(codeString)) 054 return V3TimingEvent.C; 055 if ("CD".equals(codeString)) 056 return V3TimingEvent.CD; 057 if ("CM".equals(codeString)) 058 return V3TimingEvent.CM; 059 if ("CV".equals(codeString)) 060 return V3TimingEvent.CV; 061 if ("HS".equals(codeString)) 062 return V3TimingEvent.HS; 063 if ("IC".equals(codeString)) 064 return V3TimingEvent.IC; 065 if ("ICD".equals(codeString)) 066 return V3TimingEvent.ICD; 067 if ("ICM".equals(codeString)) 068 return V3TimingEvent.ICM; 069 if ("ICV".equals(codeString)) 070 return V3TimingEvent.ICV; 071 if ("PC".equals(codeString)) 072 return V3TimingEvent.PC; 073 if ("PCD".equals(codeString)) 074 return V3TimingEvent.PCD; 075 if ("PCM".equals(codeString)) 076 return V3TimingEvent.PCM; 077 if ("PCV".equals(codeString)) 078 return V3TimingEvent.PCV; 079 if ("WAKE".equals(codeString)) 080 return V3TimingEvent.WAKE; 081 throw new IllegalArgumentException("Unknown V3TimingEvent code '"+codeString+"'"); 082 } 083 084 public String toCode(V3TimingEvent code) { 085 if (code == V3TimingEvent.NULL) 086 return null; 087 if (code == V3TimingEvent.AC) 088 return "AC"; 089 if (code == V3TimingEvent.ACD) 090 return "ACD"; 091 if (code == V3TimingEvent.ACM) 092 return "ACM"; 093 if (code == V3TimingEvent.ACV) 094 return "ACV"; 095 if (code == V3TimingEvent.C) 096 return "C"; 097 if (code == V3TimingEvent.CD) 098 return "CD"; 099 if (code == V3TimingEvent.CM) 100 return "CM"; 101 if (code == V3TimingEvent.CV) 102 return "CV"; 103 if (code == V3TimingEvent.HS) 104 return "HS"; 105 if (code == V3TimingEvent.IC) 106 return "IC"; 107 if (code == V3TimingEvent.ICD) 108 return "ICD"; 109 if (code == V3TimingEvent.ICM) 110 return "ICM"; 111 if (code == V3TimingEvent.ICV) 112 return "ICV"; 113 if (code == V3TimingEvent.PC) 114 return "PC"; 115 if (code == V3TimingEvent.PCD) 116 return "PCD"; 117 if (code == V3TimingEvent.PCM) 118 return "PCM"; 119 if (code == V3TimingEvent.PCV) 120 return "PCV"; 121 if (code == V3TimingEvent.WAKE) 122 return "WAKE"; 123 return "?"; 124 } 125 126 public String toSystem(V3TimingEvent code) { 127 return code.getSystem(); 128 } 129 130}