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