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