FHIRVINE-Smart-Proxy/README_INTEGRATION.md
Sudo-JHare 897e875e29 V0.5 - incremental
App should be mostly functional now
2025-04-24 09:27:48 +10:00

72 lines
2.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Integrating FHIRVINE with FHIRFLARE
## Overview
FHIRVINE can be integrated with FHIRFLARE (a Flask-based FHIR Implementation Guide toolkit) as a SMART on FHIR proxy module. This guide explains how to set up and integrate FHIRVINE with FHIRFLARE for seamless FHIR data access and validation.
## Prerequisites
- FHIRVINE and FHIRFLARE repositories cloned.
- Docker and Docker Compose installed.
- Both applications configured and running.
## Setup
### 1. Deploy FHIRVINE
Follow the FHIRVINE proxy setup guide (see `README_PROXY.md`). Ensure its running at `http://localhost:5001`.
### 2. Configure FHIRFLARE
- Clone FHIRFLARE:
```bash
git clone https://github.com/Sudo-JHare/FHIRFLARE-IG-Toolkit
cd FHIRFLARE-IG-Toolkit
```
- Update `appsettings.json` or environment variables to point to FHIRVINEs proxy:
```json
{
"FhirServerUrl": "http://localhost:5001/oauth2/proxy",
"AuthServerUrl": "http://localhost:5001/oauth2"
}
```
### 3. Register FHIRFLARE as a SMART App in FHIRVINE
- In FHIRVINE, go to `http://localhost:5001/app-gallery`.
- Register FHIRFLARE as a new app:
- Redirect URI: `http://localhost:8080/callback` (or FHIRFLAREs callback URL).
- Scopes: `patient/*.read offline_access`.
- Note the Client ID and Secret.
### 4. Update FHIRVINE Configuration
- In FHIRVINE, go to `http://localhost:5001/configure/proxy-settings`.
- Set the upstream FHIR server to FHIRFLAREs target FHIR server (e.g., `http://hapi.fhir.org/baseR4`).
## Integration Steps
### 1. Authenticate FHIRFLARE via FHIRVINE
- In FHIRFLARE, initiate an OAuth2 flow using FHIRVINEs `/oauth2/authorize` endpoint.
- Use the Client ID and Secret from FHIRVINE.
- After authorization, FHIRFLARE will receive an access token.
### 2. Access FHIR Data
- FHIRFLARE can now make FHIR requests through FHIRVINEs proxy (e.g., `http://localhost:5001/oauth2/proxy/Patient`).
- The proxy will handle authentication and forward requests to the upstream FHIR server.
### 3. Validate FHIR Resources
- Use FHIRFLAREs validation module to validate resources fetched via FHIRVINEs proxy.
- Example: Fetch a Patient resource and validate it against an IG in FHIRFLARE.
## Troubleshooting
- **Auth Errors**: Ensure FHIRFLAREs redirect URI matches the registered URI in FHIRVINE.
- **Proxy Errors**: Check FHIRVINE logs (`docker logs fhirvine_app`) and verify the upstream FHIR server URL.
- **Validation Issues**: Ensure FHIRFLAREs IG package is correctly loaded.