https://github.com/samply/fhir2sql
Helper to export well-known data from FHIR store into an SQL database
https://github.com/samply/fhir2sql
Last synced: 3 months ago
JSON representation
Helper to export well-known data from FHIR store into an SQL database
- Host: GitHub
- URL: https://github.com/samply/fhir2sql
- Owner: samply
- Created: 2024-07-01T12:07:49.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-10-22T10:09:12.000Z (7 months ago)
- Last Synced: 2024-12-30T07:13:56.802Z (5 months ago)
- Language: Rust
- Size: 63.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
**FHIR2SQL**
=====================A Rust-based application that synchronizes FHIR (Fast Healthcare Interoperability Resources) data with a PostgreSQL database.
**Overview**
------------This application connects to a FHIR server, retrieves data, and syncs it with a PostgreSQL database. It uses the `sqlx` library for database interactions and `reqwest` for making HTTP requests to the FHIR server. The application is designed to run continuously, syncing data at regular intervals.
**Features**
------------* Connects to a PostgreSQL database and creates necessary tables and triggers if they don't exist
* Retrieves FHIR data from a specified server and syncs it with the PostgreSQL database
* Supports regular syncing at a specified interval
* Handles errors and retries connections to the FHIR server and PostgreSQL database
* Supports graceful shutdown on SIGTERM and SIGINT signals**Components**
--------------* `main.rs`: The main application entry point
* `db_utils.rs`: Database utility functions for connecting to PostgreSQL and creating tables and triggers
* `models.rs`: Data models for FHIR resources and database interactions
* `graceful_shutdown.rs`: Functions for handling graceful shutdown on SIGTERM and SIGINT signals**Getting Started**
-------------------To use this application, you'll need to:
1. Install Rust and the required dependencies
2. Configure the application by setting environment variables for the FHIR server URL, PostgreSQL connection details, and syncing interval
3. Run the application using `cargo run`