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