API Documentation

FHIR Capabilities

Access the SCAN FHIR server capabilities using the metadata endpoint as defined in the Capabilities section of the FHIR standard.

Client Registration

  1. Some APIs require Clients to register with us. Please see API Library Client Registration column to complete the registration form specific to an API.
  2. Enter and submit the required information on the web form.
  3. SCAN Health Plan will review the submitted information and respond via email to provide your Client ID and Client Secret

OpenID Configuration

For the authorization servers's configuration, please use the following link to obtain details such as OAuth endpoints, scopes, response types, etc. https://oauth.scanhealthplan.com/oauth2/.well-known/openid-configuration

Authentication Type

Some APIs require authorization prior to connection. Please see API Library to determine which authorization protocol is required for each API.

SMART on FHIR

Authorization Code Flow
Please note that PKCE is required for this flow, see OpenID Configuration’s code_challenge_methods_supported for supported encryption methods. In addition, this flow assumes your application has successfully registered with SCAN and has been issued a Client ID and Secret.
SCAN Authorization Code Flow
  1. Patient initiates the request via the 3rd Party Application
  2. The 3rd Party Application initiates the authorize request to the SCAN Authorization Server
  3. The SCAN Authorization Server provides the Login Page Redirect URL with an authorization code to the 3rd Party Application
  4. The 3rd Party Application redirects to the SCAN Login Page with an authorization code
  5. The Patient is displayed the SCAN Login Page
  6. The Patient logs in and provides authorization and consent on the SCAN Login Page
  7. The SCAN Login Page redirects the Patient to the 3rd Party Application Redirect URL with the activated authorization code
  8. The 3rd Party Application sends active authorization code with Client Credentials to the SCAN Authorization Server
  9. The SCAN Authorization Server returns an Access and Refresh Token to the 3rd Party Application
  10. The 3rd Party Application requests the Patient Data Resource with the Access Token from the SCAN FHIR Server
  11. The SCAN FHIR server sends the Patient Data Resource to the 3rd Party Application
Refresh Token Flow
SCAN Refresh Token Flow
  1. The Client sends the Refresh Token with Client Credentials to the SCAN Authorization Server
  2. The SCAN Authorization Server identifies if the Refresh Token is expired:
    • If the Refresh Token is expired, then the Client is notified that the Authorization Code Flow must be restarted
    • If the Refresh Token is not expired, then the Client is provided a valid Access Token with a new Refresh Token
      Please note: The exchange for an access token is also an exchange for a new refresh token
  3. The Client sends the request for the Data Resource with the valid Access Token to the SCAN FHIR Server
  4. The SCAN FHIR Server then sends the Data Resource to the Client

Basic Auth

This authentication type uses the HTTP "Basic" authentication schema. The credentials will be provided upon successful registration.

Client Credentials Flow

SCAN Client Credentials Flow
  1. The Client sends a Token request with Client Credentials to the SCAN Authorization Server
    • Certain APIs may need separate parameters to be included which are tagged as “when needed”. Please see API Library Authentication Type column for more details on parameters required for each API.
  2. The SCAN Authorization Server provides the Access Token to the Client
  3. The Client requests the Resource(s) with the Access Token from the SCAN FHIR Server
  4. The SCAN FHIR server sends the requested Resource(s) to the Client

Code and Token Intervals

  • Authorization Code - An authorization code will expire 60 seconds after it is validated
  • Access Token - An access token issued by the authorization server will expire 30 minutes after creation
  • Refresh Token - A refresh token expires 90 days after the initial refresh token was created after consent

Errors and Exceptions

FHIR

The FHIR based APIs are conformant with the errors and exceptions defined by the FHIR RESTful API and FHIR Access Denied Response Handling sections in the FHIR standard.

OAuth

SCAN’s Patient Access API utilizes the SMART on FHIR Framework and is conformant with the errors and exceptions defined by the Authorization Request, Access Token, and Accessing Protected Resources sections of the OAuth 2.0 Authorization Framework.

Special characters in the Redirect URI can result in errors. In order to avoid these errors, please URL encode the Redirect URI when it has a special character and is included as a url parameter. When the Redirect URI is included in the request body it should not be URL encoded.