001package org.hl7.fhir.r5.model.codesystems;
002
003/*
004 * #%L
005 * org.hl7.fhir.r5
006 * %%
007 * Copyright (C) 2014 - 2019 Health Level 7
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 * 
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 * 
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023/*
024  Copyright (c) 2011+, HL7, Inc.
025  All rights reserved.
026  
027  Redistribution and use in source and binary forms, with or without modification, 
028  are permitted provided that the following conditions are met:
029  
030   * Redistributions of source code must retain the above copyright notice, this 
031     list of conditions and the following disclaimer.
032   * Redistributions in binary form must reproduce the above copyright notice, 
033     this list of conditions and the following disclaimer in the documentation 
034     and/or other materials provided with the distribution.
035   * Neither the name of HL7 nor the names of its contributors may be used to 
036     endorse or promote products derived from this software without specific 
037     prior written permission.
038  
039  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
040  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
041  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
042  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
043  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
044  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
045  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
046  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
047  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
048  POSSIBILITY OF SUCH DAMAGE.
049  
050*/
051
052// Generated on Thu, Oct 17, 2019 09:42+1100 for FHIR v4.1.0
053
054
055import org.hl7.fhir.exceptions.FHIRException;
056
057public enum RestfulInteraction {
058
059        /**
060         * Read the current state of the resource.
061         */
062        READ, 
063        /**
064         * Read the state of a specific version of the resource.
065         */
066        VREAD, 
067        /**
068         * Update an existing resource by its id (or create it if it is new).
069         */
070        UPDATE, 
071        /**
072         * Update an existing resource by posting a set of changes to it.
073         */
074        PATCH, 
075        /**
076         * Delete a resource.
077         */
078        DELETE, 
079        /**
080         * Retrieve the change history for a particular resource, type of resource, or the entire system.
081         */
082        HISTORY, 
083        /**
084         * Retrieve the change history for a particular resource.
085         */
086        HISTORYINSTANCE, 
087        /**
088         * Retrieve the change history for all resources of a particular type.
089         */
090        HISTORYTYPE, 
091        /**
092         * Retrieve the change history for all resources on a system.
093         */
094        HISTORYSYSTEM, 
095        /**
096         * Create a new resource with a server assigned id.
097         */
098        CREATE, 
099        /**
100         * Search a resource type or all resources based on some filter criteria.
101         */
102        SEARCH, 
103        /**
104         * Search all resources of the specified type based on some filter criteria.
105         */
106        SEARCHTYPE, 
107        /**
108         * Search all resources based on some filter criteria.
109         */
110        SEARCHSYSTEM, 
111        /**
112         * Get a Capability Statement for the system.
113         */
114        CAPABILITIES, 
115        /**
116         * Update, create or delete a set of resources as a single transaction.
117         */
118        TRANSACTION, 
119        /**
120         * perform a set of a separate interactions in a single http operation
121         */
122        BATCH, 
123        /**
124         * Perform an operation as defined by an OperationDefinition.
125         */
126        OPERATION, 
127        /**
128         * added to help the parsers
129         */
130        NULL;
131        public static RestfulInteraction fromCode(String codeString) throws FHIRException {
132            if (codeString == null || "".equals(codeString))
133                return null;
134        if ("read".equals(codeString))
135          return READ;
136        if ("vread".equals(codeString))
137          return VREAD;
138        if ("update".equals(codeString))
139          return UPDATE;
140        if ("patch".equals(codeString))
141          return PATCH;
142        if ("delete".equals(codeString))
143          return DELETE;
144        if ("history".equals(codeString))
145          return HISTORY;
146        if ("history-instance".equals(codeString))
147          return HISTORYINSTANCE;
148        if ("history-type".equals(codeString))
149          return HISTORYTYPE;
150        if ("history-system".equals(codeString))
151          return HISTORYSYSTEM;
152        if ("create".equals(codeString))
153          return CREATE;
154        if ("search".equals(codeString))
155          return SEARCH;
156        if ("search-type".equals(codeString))
157          return SEARCHTYPE;
158        if ("search-system".equals(codeString))
159          return SEARCHSYSTEM;
160        if ("capabilities".equals(codeString))
161          return CAPABILITIES;
162        if ("transaction".equals(codeString))
163          return TRANSACTION;
164        if ("batch".equals(codeString))
165          return BATCH;
166        if ("operation".equals(codeString))
167          return OPERATION;
168        throw new FHIRException("Unknown RestfulInteraction code '"+codeString+"'");
169        }
170        public String toCode() {
171          switch (this) {
172            case READ: return "read";
173            case VREAD: return "vread";
174            case UPDATE: return "update";
175            case PATCH: return "patch";
176            case DELETE: return "delete";
177            case HISTORY: return "history";
178            case HISTORYINSTANCE: return "history-instance";
179            case HISTORYTYPE: return "history-type";
180            case HISTORYSYSTEM: return "history-system";
181            case CREATE: return "create";
182            case SEARCH: return "search";
183            case SEARCHTYPE: return "search-type";
184            case SEARCHSYSTEM: return "search-system";
185            case CAPABILITIES: return "capabilities";
186            case TRANSACTION: return "transaction";
187            case BATCH: return "batch";
188            case OPERATION: return "operation";
189            default: return "?";
190          }
191        }
192        public String getSystem() {
193          return "http://hl7.org/fhir/restful-interaction";
194        }
195        public String getDefinition() {
196          switch (this) {
197            case READ: return "Read the current state of the resource.";
198            case VREAD: return "Read the state of a specific version of the resource.";
199            case UPDATE: return "Update an existing resource by its id (or create it if it is new).";
200            case PATCH: return "Update an existing resource by posting a set of changes to it.";
201            case DELETE: return "Delete a resource.";
202            case HISTORY: return "Retrieve the change history for a particular resource, type of resource, or the entire system.";
203            case HISTORYINSTANCE: return "Retrieve the change history for a particular resource.";
204            case HISTORYTYPE: return "Retrieve the change history for all resources of a particular type.";
205            case HISTORYSYSTEM: return "Retrieve the change history for all resources on a system.";
206            case CREATE: return "Create a new resource with a server assigned id.";
207            case SEARCH: return "Search a resource type or all resources based on some filter criteria.";
208            case SEARCHTYPE: return "Search all resources of the specified type based on some filter criteria.";
209            case SEARCHSYSTEM: return "Search all resources based on some filter criteria.";
210            case CAPABILITIES: return "Get a Capability Statement for the system.";
211            case TRANSACTION: return "Update, create or delete a set of resources as a single transaction.";
212            case BATCH: return "perform a set of a separate interactions in a single http operation";
213            case OPERATION: return "Perform an operation as defined by an OperationDefinition.";
214            default: return "?";
215          }
216        }
217        public String getDisplay() {
218          switch (this) {
219            case READ: return "read";
220            case VREAD: return "vread";
221            case UPDATE: return "update";
222            case PATCH: return "patch";
223            case DELETE: return "delete";
224            case HISTORY: return "history";
225            case HISTORYINSTANCE: return "history-instance";
226            case HISTORYTYPE: return "history-type";
227            case HISTORYSYSTEM: return "history-system";
228            case CREATE: return "create";
229            case SEARCH: return "search";
230            case SEARCHTYPE: return "search-type";
231            case SEARCHSYSTEM: return "search-system";
232            case CAPABILITIES: return "capabilities";
233            case TRANSACTION: return "transaction";
234            case BATCH: return "batch";
235            case OPERATION: return "operation";
236            default: return "?";
237          }
238    }
239
240
241}
242