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