API Route Mapping & Consolidation
This document maps all routes from the existing applications to the new backend_2025 structure.
AI Service Routes
Base URL: http://localhost:8080
Source: algo_python
| Old Route (Flask) | New Route (FastAPI) | HTTP Method | Description |
|---|---|---|---|
/ai/g2_demo/medical_supervisor | /ai/v1/diagnosis/predict | POST | Main diagnosis prediction |
/ai/red_flags | /ai/v1/diagnosis/red_flags | POST | Urgent condition detection |
/ai/triage | /ai/v1/diagnosis/triage | POST | Patient triage assessment |
/ai/ai-image-quality/myderma_services/image_validity | /ai/v1/image_quality/validate | POST | Image quality validation |
/ai/next_question | /ai/v1/questionnaire/next | POST | Get next question in adaptive questionnaire |
/internal/format_anamnesis | /ai/v1/internal/format_anamnesis | POST | Convert API format to internal format |
/ | /ai/health | GET | Health check |
/ai | /ai/health | GET | Health check (legacy) |
Status: All endpoints require migration from Flask to FastAPI
API Gateway Routes
Base URL: http://localhost:8000
Authentication & Authorization
Patient Authentication (from dd_api)
| Source | Old Route | New Route | HTTP Method | Description |
|---|---|---|---|---|
| dd_api | /:lang/:tenant/api/auth/login | /api/v1/auth/login | POST | Patient login |
| dd_api | /:lang/:tenant/api/auth/register | /api/v1/auth/register | POST | Patient registration |
| dd_api | /:lang/:tenant/api/auth/token-validity | /api/v1/auth/token-validity | POST | Validate JWT token |
Notes:
langandtenantmoved from path to query parameters or headers- Multi-tenancy validation via middleware
Physician Authentication (from api-backoffice-maccabi)
| Source | Old Route | New Route | HTTP Method | Description |
|---|---|---|---|---|
| backoffice | /api/auth/login | /api/v1/backoffice/auth/login | POST | Physician login |
| backoffice | /api/auth/logout | /api/v1/backoffice/auth/logout | POST | Physician logout |
| backoffice | /api/auth/is-auth | /api/v1/backoffice/auth/is-auth | POST | Check authentication |
| backoffice | /api/auth/gen-access-token | /api/v1/backoffice/auth/token | GET | Generate API token |
| backoffice | /api/auth/invitation | /api/v1/backoffice/auth/invitation | POST | Invite physician |
| backoffice | /api/auth/registration-validation | /api/v1/backoffice/auth/registration-validation | POST | Validate registration code |
| backoffice | /api/auth/registration-password | /api/v1/backoffice/auth/registration-password | POST | Set registration password |
| backoffice | /api/auth/forgot-password | /api/v1/backoffice/auth/forgot-password | PATCH | Reset password |
| backoffice | /api/auth/csrf-token | /api/v1/backoffice/auth/csrf-token | GET | Get CSRF token |
| backoffice | /api/auth/env-settings | /api/v1/backoffice/config/env-settings | GET | Get environment settings |
SAML/SSO Authentication (from api-backoffice-maccabi)
| Source | Old Route | New Route | HTTP Method | Description |
|---|---|---|---|---|
| backoffice | /api/saml/metadata | /api/v1/backoffice/saml/metadata | GET | SAML metadata |
| backoffice | /api/saml/login | /api/v1/backoffice/saml/login | GET | SAML login redirect |
| backoffice | /api/saml/assert | /api/v1/backoffice/saml/assert | POST | SAML assertion callback |
| backoffice | /api/saml/logout | /api/v1/backoffice/saml/logout | GET | SAML logout |
| backoffice | /api/saml/is-auth | /api/v1/backoffice/saml/is-auth | GET | Check SAML auth |
Patient API (from dd_api)
AI Service Proxy
| Source | Old Route | New Route | HTTP Method | Description |
|---|---|---|---|---|
| dd_api | /:lang/:tenant/api/ai/predict_diagnosis | /api/v1/ai/predict-diagnosis | POST | Proxy to AI service |
| dd_api | /:lang/:tenant/api/ai/red_flags | /api/v1/ai/red-flags | POST | Proxy to AI service |
| dd_api | /:lang/:tenant/api/ai/image_validity | /api/v1/ai/image-validity | POST | Proxy to AI service |
| dd_api | /:lang/:tenant/api/ai/triage | /api/v1/ai/triage | POST | Proxy to AI service |
| dd_api | /:lang/:tenant/api/ai/next_question | /api/v1/ai/next-question | POST | Proxy to AI service |
Notes:
- All requests proxied to AI service
- Translation layer added for multi-language support
- Service logging for all calls
- Cases saved to database
Image Management
| Source | Old Route | New Route | HTTP Method | Description |
|---|---|---|---|---|
| dd_api | /:lang/:tenant/api/common/store_images | /api/v1/images/upload | POST | Upload images to cloud storage |
Frontend Utilities
| Source | Old Route | New Route | HTTP Method | Description |
|---|---|---|---|---|
| dd_api | /:lang/:tenant/api/frontend/download_resource/:resourceName | /api/v1/frontend/resources/:name | GET | Download frontend resources |
| dd_api | /:lang/:tenant/api/frontend/user_selection_to_primary_body_location | /api/v1/frontend/body-location | POST | Convert UI coordinates to body location |
Reports
| Source | Old Route | New Route | HTTP Method | Description |
|---|---|---|---|---|
| dd_api | /:lang/:tenant/api/reports/get_pdf | /api/v1/reports/pdf | POST | Generate PDF report |
Mobile API (from api-mobile-maccabi)
Case Management
| Source | Old Route | New Route | HTTP Method | Description |
|---|---|---|---|---|
| mobile | /api-mobile/maccabi/create-request | /api/v1/mobile/cases | POST | Create new case |
| mobile | /api-mobile/maccabi/update-request | /api/v1/mobile/cases/:uuid | PUT | Update case with patient details |
| mobile | /api-mobile/update_case_status/:uuid | /api/v1/mobile/cases/:uuid/status | PATCH | Mark case as viewed |
| mobile | /api-mobile/get_annotation/:caseId | /api/v1/mobile/cases/:uuid/annotations | GET | Get case annotations |
| mobile | /api-mobile/maccabi/parameters/:param | /api/v1/mobile/parameters/:param | GET | Get system parameter |
User & Family Management
| Source | Old Route | New Route | HTTP Method | Description |
|---|---|---|---|---|
| mobile | /api-mobile/offsprings | /api/v1/mobile/users/family | POST | Get family members (v1) |
| mobile | /api-mobile/offsprings-v2/:technicalID | /api/v1/mobile/users/family/:technicalID | POST | Get family members (v2) |
| mobile | /api-mobile/delete_user/:userId | /api/v1/mobile/users/:userId | DELETE | Delete user data (GDPR) |
Image Management
| Source | Old Route | New Route | HTTP Method | Description |
|---|---|---|---|---|
| mobile | /api-mobile/upload_image | /api/v1/mobile/images | POST | Upload image to Firebase |
| mobile | /api-mobile/delete_image/:name | /api/v1/mobile/images/:name | DELETE | Delete image from Firebase |
Configuration & Utilities
| Source | Old Route | New Route | HTTP Method | Description |
|---|---|---|---|---|
| mobile | /api-mobile/check-connectivity | /api/v1/mobile/config/connectivity | POST | Check app version and config |
| mobile | /api-mobile/parameter/:branch/:sub_branch | /api/v1/mobile/config/parameters/:branch/:sub_branch | GET | Get translations/parameters |
| mobile | /api-mobile/mailer/send-emails | /api/v1/mobile/support/email | POST | Send contact email |
Health Check
| Source | Old Route | New Route | HTTP Method | Description |
|---|---|---|---|---|
| mobile | /api-mobile/healthy | /api/v1/mobile/health | GET | Health check |
| mobile | /api-mobile/test | /api/v1/mobile/test | GET | Test endpoint |
Backoffice API (from api-backoffice-maccabi)
Case Management
| Source | Old Route | New Route | HTTP Method | Description |
|---|---|---|---|---|
| backoffice | /api/request/next-case | /api/v1/backoffice/cases/next | POST | Get next available case (NAC) |
| backoffice | /api/requests/ | /api/v1/backoffice/cases/search | POST | Search cases with filters |
| backoffice | /api/requests/:uuid | /api/v1/backoffice/cases/:uuid | GET | Get case details |
| backoffice | /api/requests/status/:uuid | /api/v1/backoffice/cases/:uuid/status | POST | Update case status |
| backoffice | /api/requests/update-record/:uuid | /api/v1/backoffice/cases/:uuid/record | POST | Update record details |
| backoffice | /api/requests/pdf/:uuid | /api/v1/backoffice/cases/:uuid/pdf | GET | Get case PDF |
| backoffice | /api/check-case-batch | /api/v1/backoffice/cases/batch/check | POST | Check if case has batch |
| backoffice | /api/cases-batch/:uuid | /api/v1/backoffice/cases/batch/:uuid | GET | Get all cases in batch |
| backoffice | /api/case-record-details/:uuid | /api/v1/backoffice/cases/:uuid/record-details | GET | Get case record details |
| backoffice | /api/changes-pending-status | /api/v1/backoffice/cases/batch/status | PATCH | Block/release batch |
| backoffice | /api/notify-patient | /api/v1/backoffice/cases/notify | PATCH | Notify patient about diagnosis |
| backoffice | /api/requests/trigger-eligibility | /api/v1/backoffice/cases/:uuid/eligibility | POST | Trigger eligibility check |
| backoffice | /api/requests/report-log | /api/v1/backoffice/cases/log | POST | Log request for debugging |
Physician Management
| Source | Old Route | New Route | HTTP Method | Description |
|---|---|---|---|---|
| backoffice | /api/doctor/ | /api/v1/backoffice/physicians | POST | Create physician |
| backoffice | /api/doctor/details | /api/v1/backoffice/physicians/details | POST | Get physician details |
| backoffice | /api/doctor/update/admin-settings | /api/v1/backoffice/physicians/settings | PATCH | Update physician settings |
| backoffice | /api/doctor/update/activity | /api/v1/backoffice/physicians/activity | PATCH | Activate/deactivate physician |
Annotations
| Source | Old Route | New Route | HTTP Method | Description |
|---|---|---|---|---|
| backoffice | /api/annotations/ | /api/v1/backoffice/annotations/bulk | POST | Get annotations by UUIDs (bulk) |
| backoffice | /api/annotations/:id | /api/v1/backoffice/annotations/:uuid | GET | Get annotations by case UUID |
| backoffice | /api/annotations/:id | /api/v1/backoffice/annotations/:uuid | POST | Create annotation |
| backoffice | /api/annotations/:id | /api/v1/backoffice/annotations/:uuid | PUT | Update annotation |
| backoffice | /api/annotations/:id/:uuid | /api/v1/backoffice/annotations/:uuid/cancel | PUT | Cancel annotation |
| backoffice | /api/annotations/notify | /api/v1/backoffice/annotations/:uuid/notify | POST | Notify patient |
Templates
| Source | Old Route | New Route | HTTP Method | Description |
|---|---|---|---|---|
| backoffice | /api/templates/ | /api/v1/backoffice/templates | GET | Get all templates |
| backoffice | /api/templates/disease/:diseaseId | /api/v1/backoffice/templates/disease/:diseaseId | GET | Get templates by disease |
| backoffice | /api/templates/doctor-email/:doctorEmail | /api/v1/backoffice/templates/physician/:email | GET | Get templates by physician |
| backoffice | /api/templates | /api/v1/backoffice/templates | POST | Create template |
| backoffice | /api/templates/:id | /api/v1/backoffice/templates/:id | PATCH | Update template |
| backoffice | /api/templates/:id | /api/v1/backoffice/templates/:id | DELETE | Delete template |
Diseases
| Source | Old Route | New Route | HTTP Method | Description |
|---|---|---|---|---|
| backoffice | /api/diseases/:vendor | /api/v1/backoffice/diseases/:vendor | GET | Get diseases by vendor |
Images
| Source | Old Route | New Route | HTTP Method | Description |
|---|---|---|---|---|
| backoffice | /api/image/?hash=<hash> | /api/v1/backoffice/images/hash/:hash | GET | Get image by hash (Firebase) |
| backoffice | /api/case-image/:imgid | /api/v1/backoffice/images/:imgid | GET | Get case image (GCP/Azure) |
Utilities
| Source | Old Route | New Route | HTTP Method | Description |
|---|---|---|---|---|
| backoffice | /api/history/:user_identifier | /api/v1/backoffice/patients/:user_identifier/history | GET | Get patient history |
| backoffice | /api/format-diagnoses | /api/v1/backoffice/util/format-diagnoses | POST | Format diagnosis data |
| backoffice | /api/set-language | /api/v1/backoffice/physicians/language | POST | Set physician language |
File Import
| Source | Old Route | New Route | HTTP Method | Description |
|---|---|---|---|---|
| backoffice | /api/file-import/upload | /api/v1/backoffice/import/upload | POST | Upload Excel for bulk import |
Real-time Features
| Source | Old Route | New Route | HTTP Method | Description |
|---|---|---|---|---|
| backoffice | /api/subscribe-nac-analytic | /api/v1/backoffice/analytics/subscribe | WebSocket | Subscribe to case analytics (SSE/WebSocket) |
| backoffice | /api/unique-sessions/connect | /api/v1/backoffice/sessions/connect | SSE | Single session enforcement (SSE) |
Health & Monitoring
| Source | Old Route | New Route | HTTP Method | Description |
|---|---|---|---|---|
| dd_api | /healthy | /api/health | GET | API Gateway health check |
| mobile | /api-mobile/healthy | /api/health | GET | API Gateway health check |
| backoffice | /healthy | /api/health | GET | API Gateway health check |
| backoffice | /api/_metrics | /api/metrics | GET | Prometheus metrics |
| backoffice | /api/cron/push-notification/test | /api/cron/push-notification/test | GET | Test cron job |
Static Files
| Source | Old Route | New Route | HTTP Method | Description |
|---|---|---|---|---|
| dd_api | /terms_of_service | /static/terms-of-service.pdf | GET | Download terms of service |
| dd_api | /privacy_policy | /static/privacy-policy.pdf | GET | Download privacy policy |
Route Consolidation Summary
Total Routes
| Service | Old Routes | New Routes | Status |
|---|---|---|---|
| algo_python | 7 | 7 | To be migrated |
| dd_api | 11 | 11 | To be migrated |
| api-mobile-maccabi | 15 | 15 | To be migrated |
| api-backoffice-maccabi | 80+ | 80+ | To be migrated |
| Total | 113+ | 113+ | - |
Consolidated Structure
API Gateway (services/api_gateway/)
βββ /api/v1/
β βββ /auth/ # Patient auth (dd_api)
β βββ /ai/ # AI proxy (dd_api)
β βββ /cases/ # Patient cases (dd_api)
β βββ /images/ # Image management (dd_api)
β βββ /frontend/ # Frontend utilities (dd_api)
β βββ /reports/ # PDF generation (dd_api)
β βββ /mobile/ # Mobile API (api-mobile-maccabi)
β β βββ /cases/
β β βββ /users/
β β βββ /images/
β β βββ /config/
β β βββ /support/
β βββ /backoffice/ # Physician portal (api-backoffice-maccabi)
β βββ /auth/
β βββ /saml/
β βββ /cases/
β βββ /physicians/
β βββ /annotations/
β βββ /templates/
β βββ /diseases/
β βββ /images/
β βββ /patients/
β βββ /util/
β βββ /import/
β βββ /analytics/
β βββ /sessions/
βββ /api/health # Health check
βββ /api/metrics # Prometheus metrics
βββ /static/ # Static files
AI Service (services/ai_service/)
βββ /ai/v1/
β βββ /diagnosis/
β β βββ /predict
β β βββ /red-flags
β β βββ /triage
β βββ /image_quality/
β β βββ /validate
β βββ /questionnaire/
β β βββ /next
β βββ /internal/
β βββ /format-anamnesis
βββ /ai/health # Health checkAPI Versioning Strategy
All routes are under /api/v1/ to allow for future breaking changes:
- v1 - Initial FastAPI implementation
- v2 (future) - Breaking changes (if needed)
- Legacy routes can be supported via middleware redirects
Backward Compatibility
Phase 1: Dual Operation
- Old services continue running
- New services deployed alongside
- Feature flag to route traffic
Phase 2: Legacy Route Support
- Add middleware to redirect old routes to new routes
- Example:
/:lang/:tenant/api/ai/predict_diagnosisβ/api/v1/ai/predict-diagnosis - Log deprecation warnings
Phase 3: Sunset Legacy Routes
- Remove redirects after 6 months
- Notify all clients
- Update all documentation
Client Migration Impact
Frontend Applications
- rn_B2C (React Native) - Update API base URL and routes
- dd-frontend (Next.js) - Update API base URL and routes
- rn-b2b-maccabi (React Native) - Update mobile API routes
- backoffice-maccabi (Web) - Update backoffice API routes
Required Changes Per Client
- Update API base URL
- Update route paths
- Update request/response models (if changed)
- Test all flows
- Deploy updated version
Migration Tools
- Provide API client SDKs (optional)
- Provide Postman collection with new routes
- Provide migration script for route updates
Last updated on