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            default: return "?";
152          }
153        }
154        public String getSystem() {
155          return "http://terminology.hl7.org/CodeSystem/smart-capabilities";
156        }
157        public String getDefinition() {
158          switch (this) {
159            case LAUNCHEHR: return "support for SMART’s EHR Launch mode.";
160            case LAUNCHSTANDALONE: return "support for SMART’s Standalone Launch mode.";
161            case CLIENTPUBLIC: return "support for SMART’s public client profile (no client authentication).";
162            case CLIENTCONFIDENTIALSYMMETRIC: return "support for SMART’s confidential client profile (symmetric client secret authentication).";
163            case SSOOPENIDCONNECT: return "support for SMART’s OpenID Connect profile.";
164            case CONTEXTPASSTHROUGHBANNER: return "support for “need patient banner” launch context (conveyed via need_patient_banner token parameter).";
165            case CONTEXTPASSTHROUGHSTYLE: return "support for “SMART style URL” launch context (conveyed via smart_style_url token parameter).";
166            case CONTEXTEHRPATIENT: return "support for patient-level launch context (requested by launch/patient scope, conveyed via patient token parameter).";
167            case CONTEXTEHRENCOUNTER: return "support for encounter-level launch context (requested by launch/encounter scope, conveyed via encounter token parameter).";
168            case CONTEXTSTANDALONEPATIENT: return "support for patient-level launch context (requested by launch/patient scope, conveyed via patient token parameter).";
169            case CONTEXTSTANDALONEENCOUNTER: return "support for encounter-level launch context (requested by launch/encounter scope, conveyed via encounter token parameter).";
170            case PERMISSIONOFFLINE: return "support for refresh tokens (requested by offline_access scope).";
171            case PERMISSIONPATIENT: return "support for patient-level scopes (e.g. patient/Observation.read).";
172            case PERMISSIONUSER: return "support for user-level scopes (e.g. user/Appointment.read).";
173            default: return "?";
174          }
175        }
176        public String getDisplay() {
177          switch (this) {
178            case LAUNCHEHR: return "EHR Launch Mode";
179            case LAUNCHSTANDALONE: return "Standalone Launch Mode";
180            case CLIENTPUBLIC: return "Public Client Profile";
181            case CLIENTCONFIDENTIALSYMMETRIC: return "Confidential Client Profile";
182            case SSOOPENIDCONNECT: return "Supports OpenID Connect";
183            case CONTEXTPASSTHROUGHBANNER: return "Allows \"Need Patient Banner\"";
184            case CONTEXTPASSTHROUGHSTYLE: return "Allows \"Smart Style Style\"";
185            case CONTEXTEHRPATIENT: return "Allows \"Patient Level Launch Context (EHR)\"";
186            case CONTEXTEHRENCOUNTER: return "Allows \"Encounter Level Launch Context (EHR)\"";
187            case CONTEXTSTANDALONEPATIENT: return "Allows \"Patient Level Launch Context (STANDALONE)\"";
188            case CONTEXTSTANDALONEENCOUNTER: return "Allows \"Encounter Level Launch Context (STANDALONE)\"";
189            case PERMISSIONOFFLINE: return "Supports Refresh Token";
190            case PERMISSIONPATIENT: return "Supports Patient Level Scopes";
191            case PERMISSIONUSER: return "Supports User Level Scopes";
192            default: return "?";
193          }
194    }
195
196
197}