001package org.hl7.fhir.r5.model.codesystems; 002 003/* 004 * #%L 005 * org.hl7.fhir.r5 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 Copyright (c) 2011+, HL7, Inc. 025 All rights reserved. 026 027 Redistribution and use in source and binary forms, with or without modification, 028 are permitted provided that the following conditions are met: 029 030 * Redistributions of source code must retain the above copyright notice, this 031 list of conditions and the following disclaimer. 032 * Redistributions in binary form must reproduce the above copyright notice, 033 this list of conditions and the following disclaimer in the documentation 034 and/or other materials provided with the distribution. 035 * Neither the name of HL7 nor the names of its contributors may be used to 036 endorse or promote products derived from this software without specific 037 prior written permission. 038 039 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 040 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 041 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 042 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 043 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 044 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 045 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 046 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 047 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 048 POSSIBILITY OF SUCH DAMAGE. 049 050*/ 051 052// Generated on Thu, Oct 17, 2019 09:42+1100 for FHIR v4.1.0 053 054 055import org.hl7.fhir.exceptions.FHIRException; 056 057public enum SmartCapabilities { 058 059 /** 060 * support for SMART’s EHR Launch mode. 061 */ 062 LAUNCHEHR, 063 /** 064 * support for SMART’s Standalone Launch mode. 065 */ 066 LAUNCHSTANDALONE, 067 /** 068 * support for SMART’s public client profile (no client authentication). 069 */ 070 CLIENTPUBLIC, 071 /** 072 * support for SMART’s confidential client profile (symmetric client secret authentication). 073 */ 074 CLIENTCONFIDENTIALSYMMETRIC, 075 /** 076 * support for SMART’s OpenID Connect profile. 077 */ 078 SSOOPENIDCONNECT, 079 /** 080 * support for “need patient banner” launch context (conveyed via need_patient_banner token parameter). 081 */ 082 CONTEXTPASSTHROUGHBANNER, 083 /** 084 * support for “SMART style URL” launch context (conveyed via smart_style_url token parameter). 085 */ 086 CONTEXTPASSTHROUGHSTYLE, 087 /** 088 * support for patient-level launch context (requested by launch/patient scope, conveyed via patient token parameter). 089 */ 090 CONTEXTEHRPATIENT, 091 /** 092 * support for encounter-level launch context (requested by launch/encounter scope, conveyed via encounter token parameter). 093 */ 094 CONTEXTEHRENCOUNTER, 095 /** 096 * support for patient-level launch context (requested by launch/patient scope, conveyed via patient token parameter). 097 */ 098 CONTEXTSTANDALONEPATIENT, 099 /** 100 * support for encounter-level launch context (requested by launch/encounter scope, conveyed via encounter token parameter). 101 */ 102 CONTEXTSTANDALONEENCOUNTER, 103 /** 104 * support for refresh tokens (requested by offline_access scope). 105 */ 106 PERMISSIONOFFLINE, 107 /** 108 * support for patient-level scopes (e.g. patient/Observation.read). 109 */ 110 PERMISSIONPATIENT, 111 /** 112 * support for user-level scopes (e.g. user/Appointment.read). 113 */ 114 PERMISSIONUSER, 115 /** 116 * added to help the parsers 117 */ 118 NULL; 119 public static SmartCapabilities fromCode(String codeString) throws FHIRException { 120 if (codeString == null || "".equals(codeString)) 121 return null; 122 if ("launch-ehr".equals(codeString)) 123 return LAUNCHEHR; 124 if ("launch-standalone".equals(codeString)) 125 return LAUNCHSTANDALONE; 126 if ("client-public".equals(codeString)) 127 return CLIENTPUBLIC; 128 if ("client-confidential-symmetric".equals(codeString)) 129 return CLIENTCONFIDENTIALSYMMETRIC; 130 if ("sso-openid-connect".equals(codeString)) 131 return SSOOPENIDCONNECT; 132 if ("context-passthrough-banner".equals(codeString)) 133 return CONTEXTPASSTHROUGHBANNER; 134 if ("context-passthrough-style".equals(codeString)) 135 return CONTEXTPASSTHROUGHSTYLE; 136 if ("context-ehr-patient".equals(codeString)) 137 return CONTEXTEHRPATIENT; 138 if ("context-ehr-encounter".equals(codeString)) 139 return CONTEXTEHRENCOUNTER; 140 if ("context-standalone-patient".equals(codeString)) 141 return CONTEXTSTANDALONEPATIENT; 142 if ("context-standalone-encounter".equals(codeString)) 143 return CONTEXTSTANDALONEENCOUNTER; 144 if ("permission-offline".equals(codeString)) 145 return PERMISSIONOFFLINE; 146 if ("permission-patient".equals(codeString)) 147 return PERMISSIONPATIENT; 148 if ("permission-user".equals(codeString)) 149 return PERMISSIONUSER; 150 throw new FHIRException("Unknown SmartCapabilities code '"+codeString+"'"); 151 } 152 public String toCode() { 153 switch (this) { 154 case LAUNCHEHR: return "launch-ehr"; 155 case LAUNCHSTANDALONE: return "launch-standalone"; 156 case CLIENTPUBLIC: return "client-public"; 157 case CLIENTCONFIDENTIALSYMMETRIC: return "client-confidential-symmetric"; 158 case SSOOPENIDCONNECT: return "sso-openid-connect"; 159 case CONTEXTPASSTHROUGHBANNER: return "context-passthrough-banner"; 160 case CONTEXTPASSTHROUGHSTYLE: return "context-passthrough-style"; 161 case CONTEXTEHRPATIENT: return "context-ehr-patient"; 162 case CONTEXTEHRENCOUNTER: return "context-ehr-encounter"; 163 case CONTEXTSTANDALONEPATIENT: return "context-standalone-patient"; 164 case CONTEXTSTANDALONEENCOUNTER: return "context-standalone-encounter"; 165 case PERMISSIONOFFLINE: return "permission-offline"; 166 case PERMISSIONPATIENT: return "permission-patient"; 167 case PERMISSIONUSER: return "permission-user"; 168 default: return "?"; 169 } 170 } 171 public String getSystem() { 172 return "http://terminology.hl7.org/CodeSystem/smart-capabilities"; 173 } 174 public String getDefinition() { 175 switch (this) { 176 case LAUNCHEHR: return "support for SMART’s EHR Launch mode."; 177 case LAUNCHSTANDALONE: return "support for SMART’s Standalone Launch mode."; 178 case CLIENTPUBLIC: return "support for SMART’s public client profile (no client authentication)."; 179 case CLIENTCONFIDENTIALSYMMETRIC: return "support for SMART’s confidential client profile (symmetric client secret authentication)."; 180 case SSOOPENIDCONNECT: return "support for SMART’s OpenID Connect profile."; 181 case CONTEXTPASSTHROUGHBANNER: return "support for “need patient banner” launch context (conveyed via need_patient_banner token parameter)."; 182 case CONTEXTPASSTHROUGHSTYLE: return "support for “SMART style URL” launch context (conveyed via smart_style_url token parameter)."; 183 case CONTEXTEHRPATIENT: return "support for patient-level launch context (requested by launch/patient scope, conveyed via patient token parameter)."; 184 case CONTEXTEHRENCOUNTER: return "support for encounter-level launch context (requested by launch/encounter scope, conveyed via encounter token parameter)."; 185 case CONTEXTSTANDALONEPATIENT: return "support for patient-level launch context (requested by launch/patient scope, conveyed via patient token parameter)."; 186 case CONTEXTSTANDALONEENCOUNTER: return "support for encounter-level launch context (requested by launch/encounter scope, conveyed via encounter token parameter)."; 187 case PERMISSIONOFFLINE: return "support for refresh tokens (requested by offline_access scope)."; 188 case PERMISSIONPATIENT: return "support for patient-level scopes (e.g. patient/Observation.read)."; 189 case PERMISSIONUSER: return "support for user-level scopes (e.g. user/Appointment.read)."; 190 default: return "?"; 191 } 192 } 193 public String getDisplay() { 194 switch (this) { 195 case LAUNCHEHR: return "EHR Launch Mode"; 196 case LAUNCHSTANDALONE: return "Standalone Launch Mode"; 197 case CLIENTPUBLIC: return "Public Client Profile"; 198 case CLIENTCONFIDENTIALSYMMETRIC: return "Confidential Client Profile"; 199 case SSOOPENIDCONNECT: return "Supports OpenID Connect"; 200 case CONTEXTPASSTHROUGHBANNER: return "Allows \"Need Patient Banner\""; 201 case CONTEXTPASSTHROUGHSTYLE: return "Allows \"Smart Style Style\""; 202 case CONTEXTEHRPATIENT: return "Allows \"Patient Level Launch Context (EHR)\""; 203 case CONTEXTEHRENCOUNTER: return "Allows \"Encounter Level Launch Context (EHR)\""; 204 case CONTEXTSTANDALONEPATIENT: return "Allows \"Patient Level Launch Context (STANDALONE)\""; 205 case CONTEXTSTANDALONEENCOUNTER: return "Allows \"Encounter Level Launch Context (STANDALONE)\""; 206 case PERMISSIONOFFLINE: return "Supports Refresh Token"; 207 case PERMISSIONPATIENT: return "Supports Patient Level Scopes"; 208 case PERMISSIONUSER: return "Supports User Level Scopes"; 209 default: return "?"; 210 } 211 } 212 213 214} 215