2025-04-01 23:23:12 -04:00
2025-04-01 23:11:30 -04:00
2025-04-01 23:11:30 -04:00
2025-04-01 23:11:30 -04:00
2025-04-01 23:23:12 -04:00

FHIR-Sandbox: SMART on FHIR Integration Application

A Go-based application that demonstrates integration with Electronic Health Record (EHR) systems using the SMART on FHIR protocol.

Overview

This application implements a SMART on FHIR client that can:

  • Launch from an EHR context
  • Authenticate using OAuth 2.0
  • Retrieve patient information from FHIR servers
  • Display patient details in a structured format

Prerequisites

  • Go 1.16 or higher
  • Access to a SMART on FHIR-compatible EHR system
  • Client credentials (client ID and secret) from your EHR system

Configuration

The application uses a configuration structure defined in main.go. You'll need to configure:

  1. SMART App settings:
    SMARTAppConfig {
        redirectPath: "http://localhost:8080/auth-redirect",
        clientID:     "your-client-id",
        clientSecret: "your-client-secret",
        scopes:       []string{"launch", "patient/*.read"},
    }
    
  2. EHR Client settings:
     EHRClientsConfig {
         name:         "EHR_NAME",
         url:          "https://your-ehr-fhir-endpoint.com",
         authType:     "auth-2",
         clientID:     "your-ehr-client-id",
         clientSecret: "your-ehr-client-secret",
         patientAPI:   true,
     }
    

Installation

  1. Clone the repository:
git clone github.com/AmanTahiliani/fhir-sandbox.git
cd fhir-sandbox
  1. Install dependencies:
go mod tidy

Running the Application

  1. Start the application:
go run main.go
  1. The application will start and listen on http://localhost:8080.

Endpoints

  • / - Root endpoint, displays welcome message
  • /launch - SMART launch endpoint
  • /auth-redirect - OAuth2 redirect endpoint

SMART on FHIR Launch Flow

  • EHR system initiates launch with parameters:
    • launch - Launch ID
    • iss - FHIR server URL
  • Application authenticates with the EHR:
    • Retrieves SMART configuration
    • Initiates OAuth2 flow
    • Exchanges code for access token
  • Application retrieves and displays patient information
Description
No description provided
Readme 201 KiB
Languages
Go 80.7%
HTML 12.9%
CSS 6.4%