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