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 V3DataOperationEnumFactory implements EnumFactory<V3DataOperation> { 041 042 public V3DataOperation fromCode(String codeString) throws IllegalArgumentException { 043 if (codeString == null || "".equals(codeString)) 044 return null; 045 if ("OPERATE".equals(codeString)) 046 return V3DataOperation.OPERATE; 047 if ("CREATE".equals(codeString)) 048 return V3DataOperation.CREATE; 049 if ("DELETE".equals(codeString)) 050 return V3DataOperation.DELETE; 051 if ("EXECUTE".equals(codeString)) 052 return V3DataOperation.EXECUTE; 053 if ("READ".equals(codeString)) 054 return V3DataOperation.READ; 055 if ("UPDATE".equals(codeString)) 056 return V3DataOperation.UPDATE; 057 if ("APPEND".equals(codeString)) 058 return V3DataOperation.APPEND; 059 if ("MODIFYSTATUS".equals(codeString)) 060 return V3DataOperation.MODIFYSTATUS; 061 if ("ABORT".equals(codeString)) 062 return V3DataOperation.ABORT; 063 if ("ACTIVATE".equals(codeString)) 064 return V3DataOperation.ACTIVATE; 065 if ("CANCEL".equals(codeString)) 066 return V3DataOperation.CANCEL; 067 if ("COMPLETE".equals(codeString)) 068 return V3DataOperation.COMPLETE; 069 if ("HOLD".equals(codeString)) 070 return V3DataOperation.HOLD; 071 if ("JUMP".equals(codeString)) 072 return V3DataOperation.JUMP; 073 if ("NULLIFY".equals(codeString)) 074 return V3DataOperation.NULLIFY; 075 if ("OBSOLETE".equals(codeString)) 076 return V3DataOperation.OBSOLETE; 077 if ("REACTIVATE".equals(codeString)) 078 return V3DataOperation.REACTIVATE; 079 if ("RELEASE".equals(codeString)) 080 return V3DataOperation.RELEASE; 081 if ("RESUME".equals(codeString)) 082 return V3DataOperation.RESUME; 083 if ("SUSPEND".equals(codeString)) 084 return V3DataOperation.SUSPEND; 085 throw new IllegalArgumentException("Unknown V3DataOperation code '"+codeString+"'"); 086 } 087 088 public String toCode(V3DataOperation code) { 089 if (code == V3DataOperation.NULL) 090 return null; 091 if (code == V3DataOperation.OPERATE) 092 return "OPERATE"; 093 if (code == V3DataOperation.CREATE) 094 return "CREATE"; 095 if (code == V3DataOperation.DELETE) 096 return "DELETE"; 097 if (code == V3DataOperation.EXECUTE) 098 return "EXECUTE"; 099 if (code == V3DataOperation.READ) 100 return "READ"; 101 if (code == V3DataOperation.UPDATE) 102 return "UPDATE"; 103 if (code == V3DataOperation.APPEND) 104 return "APPEND"; 105 if (code == V3DataOperation.MODIFYSTATUS) 106 return "MODIFYSTATUS"; 107 if (code == V3DataOperation.ABORT) 108 return "ABORT"; 109 if (code == V3DataOperation.ACTIVATE) 110 return "ACTIVATE"; 111 if (code == V3DataOperation.CANCEL) 112 return "CANCEL"; 113 if (code == V3DataOperation.COMPLETE) 114 return "COMPLETE"; 115 if (code == V3DataOperation.HOLD) 116 return "HOLD"; 117 if (code == V3DataOperation.JUMP) 118 return "JUMP"; 119 if (code == V3DataOperation.NULLIFY) 120 return "NULLIFY"; 121 if (code == V3DataOperation.OBSOLETE) 122 return "OBSOLETE"; 123 if (code == V3DataOperation.REACTIVATE) 124 return "REACTIVATE"; 125 if (code == V3DataOperation.RELEASE) 126 return "RELEASE"; 127 if (code == V3DataOperation.RESUME) 128 return "RESUME"; 129 if (code == V3DataOperation.SUSPEND) 130 return "SUSPEND"; 131 return "?"; 132 } 133 134 public String toSystem(V3DataOperation code) { 135 return code.getSystem(); 136 } 137 138}