001package org.hl7.fhir.r4.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 Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0 036 037 038import org.hl7.fhir.exceptions.FHIRException; 039 040public enum RestfulInteraction { 041 042 /** 043 * Read the current state of the resource. 044 */ 045 READ, 046 /** 047 * Read the state of a specific version of the resource. 048 */ 049 VREAD, 050 /** 051 * Update an existing resource by its id (or create it if it is new). 052 */ 053 UPDATE, 054 /** 055 * Update an existing resource by posting a set of changes to it. 056 */ 057 PATCH, 058 /** 059 * Delete a resource. 060 */ 061 DELETE, 062 /** 063 * Retrieve the change history for a particular resource, type of resource, or the entire system. 064 */ 065 HISTORY, 066 /** 067 * Retrieve the change history for a particular resource. 068 */ 069 HISTORYINSTANCE, 070 /** 071 * Retrieve the change history for all resources of a particular type. 072 */ 073 HISTORYTYPE, 074 /** 075 * Retrieve the change history for all resources on a system. 076 */ 077 HISTORYSYSTEM, 078 /** 079 * Create a new resource with a server assigned id. 080 */ 081 CREATE, 082 /** 083 * Search a resource type or all resources based on some filter criteria. 084 */ 085 SEARCH, 086 /** 087 * Search all resources of the specified type based on some filter criteria. 088 */ 089 SEARCHTYPE, 090 /** 091 * Search all resources based on some filter criteria. 092 */ 093 SEARCHSYSTEM, 094 /** 095 * Get a Capability Statement for the system. 096 */ 097 CAPABILITIES, 098 /** 099 * Update, create or delete a set of resources as a single transaction. 100 */ 101 TRANSACTION, 102 /** 103 * perform a set of a separate interactions in a single http operation 104 */ 105 BATCH, 106 /** 107 * Perform an operation as defined by an OperationDefinition. 108 */ 109 OPERATION, 110 /** 111 * added to help the parsers 112 */ 113 NULL; 114 public static RestfulInteraction fromCode(String codeString) throws FHIRException { 115 if (codeString == null || "".equals(codeString)) 116 return null; 117 if ("read".equals(codeString)) 118 return READ; 119 if ("vread".equals(codeString)) 120 return VREAD; 121 if ("update".equals(codeString)) 122 return UPDATE; 123 if ("patch".equals(codeString)) 124 return PATCH; 125 if ("delete".equals(codeString)) 126 return DELETE; 127 if ("history".equals(codeString)) 128 return HISTORY; 129 if ("history-instance".equals(codeString)) 130 return HISTORYINSTANCE; 131 if ("history-type".equals(codeString)) 132 return HISTORYTYPE; 133 if ("history-system".equals(codeString)) 134 return HISTORYSYSTEM; 135 if ("create".equals(codeString)) 136 return CREATE; 137 if ("search".equals(codeString)) 138 return SEARCH; 139 if ("search-type".equals(codeString)) 140 return SEARCHTYPE; 141 if ("search-system".equals(codeString)) 142 return SEARCHSYSTEM; 143 if ("capabilities".equals(codeString)) 144 return CAPABILITIES; 145 if ("transaction".equals(codeString)) 146 return TRANSACTION; 147 if ("batch".equals(codeString)) 148 return BATCH; 149 if ("operation".equals(codeString)) 150 return OPERATION; 151 throw new FHIRException("Unknown RestfulInteraction code '"+codeString+"'"); 152 } 153 public String toCode() { 154 switch (this) { 155 case READ: return "read"; 156 case VREAD: return "vread"; 157 case UPDATE: return "update"; 158 case PATCH: return "patch"; 159 case DELETE: return "delete"; 160 case HISTORY: return "history"; 161 case HISTORYINSTANCE: return "history-instance"; 162 case HISTORYTYPE: return "history-type"; 163 case HISTORYSYSTEM: return "history-system"; 164 case CREATE: return "create"; 165 case SEARCH: return "search"; 166 case SEARCHTYPE: return "search-type"; 167 case SEARCHSYSTEM: return "search-system"; 168 case CAPABILITIES: return "capabilities"; 169 case TRANSACTION: return "transaction"; 170 case BATCH: return "batch"; 171 case OPERATION: return "operation"; 172 default: return "?"; 173 } 174 } 175 public String getSystem() { 176 return "http://hl7.org/fhir/restful-interaction"; 177 } 178 public String getDefinition() { 179 switch (this) { 180 case READ: return "Read the current state of the resource."; 181 case VREAD: return "Read the state of a specific version of the resource."; 182 case UPDATE: return "Update an existing resource by its id (or create it if it is new)."; 183 case PATCH: return "Update an existing resource by posting a set of changes to it."; 184 case DELETE: return "Delete a resource."; 185 case HISTORY: return "Retrieve the change history for a particular resource, type of resource, or the entire system."; 186 case HISTORYINSTANCE: return "Retrieve the change history for a particular resource."; 187 case HISTORYTYPE: return "Retrieve the change history for all resources of a particular type."; 188 case HISTORYSYSTEM: return "Retrieve the change history for all resources on a system."; 189 case CREATE: return "Create a new resource with a server assigned id."; 190 case SEARCH: return "Search a resource type or all resources based on some filter criteria."; 191 case SEARCHTYPE: return "Search all resources of the specified type based on some filter criteria."; 192 case SEARCHSYSTEM: return "Search all resources based on some filter criteria."; 193 case CAPABILITIES: return "Get a Capability Statement for the system."; 194 case TRANSACTION: return "Update, create or delete a set of resources as a single transaction."; 195 case BATCH: return "perform a set of a separate interactions in a single http operation"; 196 case OPERATION: return "Perform an operation as defined by an OperationDefinition."; 197 default: return "?"; 198 } 199 } 200 public String getDisplay() { 201 switch (this) { 202 case READ: return "read"; 203 case VREAD: return "vread"; 204 case UPDATE: return "update"; 205 case PATCH: return "patch"; 206 case DELETE: return "delete"; 207 case HISTORY: return "history"; 208 case HISTORYINSTANCE: return "history-instance"; 209 case HISTORYTYPE: return "history-type"; 210 case HISTORYSYSTEM: return "history-system"; 211 case CREATE: return "create"; 212 case SEARCH: return "search"; 213 case SEARCHTYPE: return "search-type"; 214 case SEARCHSYSTEM: return "search-system"; 215 case CAPABILITIES: return "capabilities"; 216 case TRANSACTION: return "transaction"; 217 case BATCH: return "batch"; 218 case OPERATION: return "operation"; 219 default: return "?"; 220 } 221 } 222 223 224}