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 SmartCapabilities {
059
060        /**
061         * support for SMART’s EHR Launch mode.
062         */
063        LAUNCHEHR, 
064        /**
065         * support for SMART’s Standalone Launch mode.
066         */
067        LAUNCHSTANDALONE, 
068        /**
069         * support for SMART’s public client profile (no client authentication).
070         */
071        CLIENTPUBLIC, 
072        /**
073         * support for SMART’s confidential client profile (symmetric client secret authentication).
074         */
075        CLIENTCONFIDENTIALSYMMETRIC, 
076        /**
077         * support for SMART’s OpenID Connect profile.
078         */
079        SSOOPENIDCONNECT, 
080        /**
081         * support for “need patient banner” launch context (conveyed via need_patient_banner token parameter).
082         */
083        CONTEXTPASSTHROUGHBANNER, 
084        /**
085         * support for “SMART style URL” launch context (conveyed via smart_style_url token parameter).
086         */
087        CONTEXTPASSTHROUGHSTYLE, 
088        /**
089         * support for patient-level launch context (requested by launch/patient scope, conveyed via patient token parameter).
090         */
091        CONTEXTEHRPATIENT, 
092        /**
093         * support for encounter-level launch context (requested by launch/encounter scope, conveyed via encounter token parameter).
094         */
095        CONTEXTEHRENCOUNTER, 
096        /**
097         * support for patient-level launch context (requested by launch/patient scope, conveyed via patient token parameter).
098         */
099        CONTEXTSTANDALONEPATIENT, 
100        /**
101         * support for encounter-level launch context (requested by launch/encounter scope, conveyed via encounter token parameter).
102         */
103        CONTEXTSTANDALONEENCOUNTER, 
104        /**
105         * support for refresh tokens (requested by offline_access scope).
106         */
107        PERMISSIONOFFLINE, 
108        /**
109         * support for patient-level scopes (e.g. patient/Observation.read).
110         */
111        PERMISSIONPATIENT, 
112        /**
113         * support for user-level scopes (e.g. user/Appointment.read).
114         */
115        PERMISSIONUSER, 
116        /**
117         * added to help the parsers
118         */
119        NULL;
120        public static SmartCapabilities fromCode(String codeString) throws FHIRException {
121            if (codeString == null || "".equals(codeString))
122                return null;
123        if ("launch-ehr".equals(codeString))
124          return LAUNCHEHR;
125        if ("launch-standalone".equals(codeString))
126          return LAUNCHSTANDALONE;
127        if ("client-public".equals(codeString))
128          return CLIENTPUBLIC;
129        if ("client-confidential-symmetric".equals(codeString))
130          return CLIENTCONFIDENTIALSYMMETRIC;
131        if ("sso-openid-connect".equals(codeString))
132          return SSOOPENIDCONNECT;
133        if ("context-passthrough-banner".equals(codeString))
134          return CONTEXTPASSTHROUGHBANNER;
135        if ("context-passthrough-style".equals(codeString))
136          return CONTEXTPASSTHROUGHSTYLE;
137        if ("context-ehr-patient".equals(codeString))
138          return CONTEXTEHRPATIENT;
139        if ("context-ehr-encounter".equals(codeString))
140          return CONTEXTEHRENCOUNTER;
141        if ("context-standalone-patient".equals(codeString))
142          return CONTEXTSTANDALONEPATIENT;
143        if ("context-standalone-encounter".equals(codeString))
144          return CONTEXTSTANDALONEENCOUNTER;
145        if ("permission-offline".equals(codeString))
146          return PERMISSIONOFFLINE;
147        if ("permission-patient".equals(codeString))
148          return PERMISSIONPATIENT;
149        if ("permission-user".equals(codeString))
150          return PERMISSIONUSER;
151        throw new FHIRException("Unknown SmartCapabilities code '"+codeString+"'");
152        }
153        public String toCode() {
154          switch (this) {
155            case LAUNCHEHR: return "launch-ehr";
156            case LAUNCHSTANDALONE: return "launch-standalone";
157            case CLIENTPUBLIC: return "client-public";
158            case CLIENTCONFIDENTIALSYMMETRIC: return "client-confidential-symmetric";
159            case SSOOPENIDCONNECT: return "sso-openid-connect";
160            case CONTEXTPASSTHROUGHBANNER: return "context-passthrough-banner";
161            case CONTEXTPASSTHROUGHSTYLE: return "context-passthrough-style";
162            case CONTEXTEHRPATIENT: return "context-ehr-patient";
163            case CONTEXTEHRENCOUNTER: return "context-ehr-encounter";
164            case CONTEXTSTANDALONEPATIENT: return "context-standalone-patient";
165            case CONTEXTSTANDALONEENCOUNTER: return "context-standalone-encounter";
166            case PERMISSIONOFFLINE: return "permission-offline";
167            case PERMISSIONPATIENT: return "permission-patient";
168            case PERMISSIONUSER: return "permission-user";
169            default: return "?";
170          }
171        }
172        public String getSystem() {
173          return "http://terminology.hl7.org/CodeSystem/smart-capabilities";
174        }
175        public String getDefinition() {
176          switch (this) {
177            case LAUNCHEHR: return "support for SMART’s EHR Launch mode.";
178            case LAUNCHSTANDALONE: return "support for SMART’s Standalone Launch mode.";
179            case CLIENTPUBLIC: return "support for SMART’s public client profile (no client authentication).";
180            case CLIENTCONFIDENTIALSYMMETRIC: return "support for SMART’s confidential client profile (symmetric client secret authentication).";
181            case SSOOPENIDCONNECT: return "support for SMART’s OpenID Connect profile.";
182            case CONTEXTPASSTHROUGHBANNER: return "support for “need patient banner” launch context (conveyed via need_patient_banner token parameter).";
183            case CONTEXTPASSTHROUGHSTYLE: return "support for “SMART style URL” launch context (conveyed via smart_style_url token parameter).";
184            case CONTEXTEHRPATIENT: return "support for patient-level launch context (requested by launch/patient scope, conveyed via patient token parameter).";
185            case CONTEXTEHRENCOUNTER: return "support for encounter-level launch context (requested by launch/encounter scope, conveyed via encounter token parameter).";
186            case CONTEXTSTANDALONEPATIENT: return "support for patient-level launch context (requested by launch/patient scope, conveyed via patient token parameter).";
187            case CONTEXTSTANDALONEENCOUNTER: return "support for encounter-level launch context (requested by launch/encounter scope, conveyed via encounter token parameter).";
188            case PERMISSIONOFFLINE: return "support for refresh tokens (requested by offline_access scope).";
189            case PERMISSIONPATIENT: return "support for patient-level scopes (e.g. patient/Observation.read).";
190            case PERMISSIONUSER: return "support for user-level scopes (e.g. user/Appointment.read).";
191            default: return "?";
192          }
193        }
194        public String getDisplay() {
195          switch (this) {
196            case LAUNCHEHR: return "EHR Launch Mode";
197            case LAUNCHSTANDALONE: return "Standalone Launch Mode";
198            case CLIENTPUBLIC: return "Public Client Profile";
199            case CLIENTCONFIDENTIALSYMMETRIC: return "Confidential Client Profile";
200            case SSOOPENIDCONNECT: return "Supports OpenID Connect";
201            case CONTEXTPASSTHROUGHBANNER: return "Allows \"Need Patient Banner\"";
202            case CONTEXTPASSTHROUGHSTYLE: return "Allows \"Smart Style Style\"";
203            case CONTEXTEHRPATIENT: return "Allows \"Patient Level Launch Context (EHR)\"";
204            case CONTEXTEHRENCOUNTER: return "Allows \"Encounter Level Launch Context (EHR)\"";
205            case CONTEXTSTANDALONEPATIENT: return "Allows \"Patient Level Launch Context (STANDALONE)\"";
206            case CONTEXTSTANDALONEENCOUNTER: return "Allows \"Encounter Level Launch Context (STANDALONE)\"";
207            case PERMISSIONOFFLINE: return "Supports Refresh Token";
208            case PERMISSIONPATIENT: return "Supports Patient Level Scopes";
209            case PERMISSIONUSER: return "Supports User Level Scopes";
210            default: return "?";
211          }
212    }
213
214
215}
216