From 26ecbd1852a20e40beb9fb1a4d0fd492bf8d29dc Mon Sep 17 00:00:00 2001 From: amantahiliani Date: Tue, 1 Apr 2025 23:23:12 -0400 Subject: [PATCH] Added README --- README.md | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..2e1ffa5 --- /dev/null +++ b/README.md @@ -0,0 +1,77 @@ +# 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: + ```go + SMARTAppConfig { + redirectPath: "http://localhost:8080/auth-redirect", + clientID: "your-client-id", + clientSecret: "your-client-secret", + scopes: []string{"launch", "patient/*.read"}, + } +2. EHR Client settings: + ```go + 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: +```bash +git clone github.com/AmanTahiliani/fhir-sandbox.git +cd fhir-sandbox +``` +2. Install dependencies: +```bash +go mod tidy +``` + +## Running the Application + +1. Start the application: +```bash +go run main.go +``` +2. 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 +