-
[!NOTE]
This is a combined solution based on the fork of the MongoDB GitHub repository (https://github.com/mongodb-industry-solutions/hybrid-fhir-odl).
A comprehensive FHIR R4 compliant healthcare data management system built with MongoDB backend and TapData pipelines. Featuring advanced search capabilities and an interactive API demonstrator. This solution leverages Tapdata’s CDC data pipeline to replicate data from legacy system and transform proprietary healthcare data models into interoperable FHIR standards, enabling seamless healthcare interoperability without modifying your existing business applications.
tapdata-fhir/ ├── backend/ # Python FastAPI + MongoDB + PostgreSQL │ ├── fhir_toolkit/ # Main application package │ │ ├── api.py # FastAPI endpoints (3 APIs) │ │ ├── search_builders.py # Advanced FHIR search logic │ │ ├── db.py # MongoDB connection │ │ ├── db_pg.py # PostgreSQL connection │ │ ├── config.py # Configuration │ │ ├── synth.py # Legacy synthetic data inspection in PG │ │ ├── transform.py # Legacy data and FHIR model structure transformation │ │ └── mappings.py # FHIR resource mappings │ ├── .venv/ # Python virtual environment │ └── pyproject.toml # Python dependencies ├── frontend/ # Next.js React application │ ├── app/ # Next.js app router │ ├── components/ # React components │ │ └── views/fhir/ # FHIR-specific views │ │ ├── FhirOverview.jsx # Architecture Overview │ │ ├── FhirApiTester.jsx # Interactive API demonstrator │ │ ├── FhirResourceBrowser.jsx # FHIR Resource browser │ │ └── LegacySyntheticPanel.jsx # Legacy synthetic data UI │ │ └── DataTransformation.jsx # Transformation UI and Tapdata demo link │ ├── public/fhir-config/ # FHIR search configuration │ └── package.json # Node dependencies ├── docs/ # Project documentation ├── .env.local.example # Environment template ├── start-server.sh # Backend startup script ├── start-frontend.sh # Frontend startup script └── README.md # This fileZero-touch source systems: Keep legacy applications untouched while exposing FHIR APIs Real-time sync: CDC captures changes instantly; MongoDB stores transformed FHIR data Production-ready APIs: Deploy FHIR R4-compliant REST endpoints in days, not months Future-proof architecture: Add new data sources or target systems without modifying legacy code Schema-free flexibility: MongoDB's document model natively supports FHIR's nested, complex, and variable-structure resources
This project includes an external link to Tapdata Cloud to demonstrate the real-time data transformation capabilities that are typically required to generate FHIR models.
-
Real-time CDC (Change Data Capture): Automatically detect and stream data changes from source systems
-
Visual data mapping: No-code/low-code transformation designer
-
Continuous synchronization: Keep FHIR models in sync with legacy data in real-time
-
Enterprise-grade reliability: Built-in error handling, monitoring, and data validation
-
Scalable transformation: Transform millions of healthcare records efficiently
Visit: http://47.76.248.214:3101/ to quickly view the prepared demo.
- Python 3.11+
- Node.js 20+
# Start backend server ./start-server.sh # Backend runs on http://localhost:3100
# Start frontend development server cd frontend npm install cd .. ./start-frontend.sh # Frontend runs on http://localhost:3101
Visit http://localhost:3101 and explore:
-
Overview Tab: Browse overall architecture of the data flow
-
Synthetic Data Tab: Browse original relational data from PostgreSQL
-
Data Transformation Tab: Visualize how data is transformed to FHIR format
-
Data Viewer Tab: Browse the materialized view of FHIR data in MongoDB
-
FHIR API Tab: Execute API queries for example
- Open http://localhost:3101
- Navigate to "Synthetic Data Tab" and check the legacy relational data
- Navigate to "Data Transformation Tab" and check the data transformation
- Click "view the process" button to browse the data transformation tasks and processes
- Navigate to "FHIR API Tab"
- Query executes with results displayed
Resources are stored with two sections:
{ "tenant": "your-tenant", "resourceType": "Patient", "resource": { /* Standard FHIR resource */ }, "app": { /* Application-specific data */ }, }- Single Document: No joins, faster queries
- Schema-Free: Add extensions without database migration
- Native Array Support: Multiple identifiers, addresses, contacts stored naturally
- Flexible Structure: JSON like fields match FHIR model perfectly
- Version Compatible: Old and new FHIR versions coexist in same collection
- Rich Type Support: Native support for dates, nested objects, arrays
Real-Time CDC:
- Change Data Capture without business modification and source impact
- Detects changes in source PostgreSQL tables instantly
- Minimal latency between source and target updates
- Supports high-volume change streams
Data Enrichment:
- Add derived fields (e.g., age calculated from birthdate)
- Join data from multiple source tables
- Aggregate and summarize information
Data Cleansing:
- Normalize inconsistent data formats
- Remove or mask sensitive information
Schema Flexibility:
- Source schema can evolve without breaking pipeline
- Automatic field discovery and mapping
- Handle new tables dynamically
This is a demonstration/reference implementation showing:
- FHIR R4 API design patterns
- MongoDB document design for healthcare
- Tapdata Integrated data transformation workflows
- Fast search with pre-computed indexes
- Interactive API exploration tools
[Your License Here]
- Built with FastAPI, Next.js 14, and MongoDB
- Data Transformation by Tapdata
- FHIR R4 specification by HL7
- Tailwind CSS for styling
- Monaco Editor for JSON viewing
-
-
Notifications
You must be signed in to change notification settings - Fork 0
tapdata/fhir-solution
Folders and files
| Name | Name | Last commit message | Last commit date |
|---|---|---|---|
Repository files navigation
About
A solution for FHIR API without need of any changes to your existing systems - by MongoDB and TapData
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published