Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/sagar-grv/ayush-synapse/llms.txt

Use this file to discover all available pages before exploring further.

The Technical Dashboard (served at /technical.html) is built for developers, system integrators, and DevOps teams. It bundles an in-browser API testing interface, live system health monitoring, performance metrics drawn from GET /api/stats, and step-by-step integration guides for connecting external EMR systems to the Ayush Synapse API — all accessible without leaving the browser.

Accessing the Dashboard

Start the Ayush Synapse server and navigate to:
http://localhost:5000/technical.html
No authentication is required to load the dashboard or view health metrics. Sending requests to protected endpoints from within the API tester requires a demo token — see the Professional Dashboard authentication guide for how to obtain one.

Features

The Technical Dashboard embeds an interactive request builder that lets you compose and fire requests to any Ayush Synapse endpoint directly from the browser. For each request you can:
  • Select the HTTP method (GET / POST)
  • Enter the endpoint path and any query parameters
  • Set the Authorization: Bearer header for protected routes
  • Inspect the raw JSON response and HTTP status code in the output pane
This eliminates the need to switch between a terminal and the browser when iterating on integration logic. All endpoints listed in Related API Endpoints can be tested here.
The monitoring panel polls two health-check endpoints and renders their responses in a live status view:
EndpointDescription
GET /healthLightweight liveness check — status, timestamp, and code counts
GET /health/detailedFull readiness check with per-service status flags and data-load verification
Green/amber/red badges reflect the "status" field in each response ("healthy" or "degraded"). The panel auto-refreshes every 30 seconds.
The metrics panel calls GET /api/stats on load and renders three key numbers:
  • NAMASTE code count — total codes loaded from CSV or database
  • ICD-11 code count — combined TM2 and Biomedicine totals
  • Mapping coverage percentage(mapped / total_namaste_codes) × 100
These figures help integrators quickly confirm that the service is loaded with the expected dataset before pointing production traffic at it.
curl http://localhost:5000/api/stats
{
  "namaste_codes": {
    "total": 85,
    "by_system": { "Ayurveda": 60, "Siddha": 15, "Unani": 10 }
  },
  "icd11_codes": {
    "tm2_total": 55,
    "biomedicine_total": 30
  },
  "mappings": {
    "mapped": 85,
    "unmapped": 0,
    "coverage_percentage": 100.0
  }
}
The dashboard includes a guided walkthrough for connecting an external EMR or HIS to the Ayush Synapse API. The guide covers:
  1. Authentication — obtaining and rotating demo tokens via POST /auth/login
  2. Code lookup — querying GET /api/search and parsing the dual-code response
  3. Translation — using POST /translate to convert a known NAMASTE code to its ICD-11 equivalent programmatically
  4. FHIR import/export — fetching GET /codesystem/namaste, GET /codesystem/icd11, and GET /conceptmap for integration with FHIR-aware systems
  5. Bundle ingestion — posting a FHIR Bundle with dual coding via POST /bundle
Each step includes a cURL snippet and a JavaScript fetch equivalent.

Health Monitoring

The GET /health/detailed endpoint returns a comprehensive readiness snapshot. Below is the complete response shape:
curl http://localhost:5000/health/detailed
{
  "status": "healthy",
  "timestamp": "2025-01-15T10:32:44.123456",
  "demo_mode": true,
  "data": {
    "namaste_codes": true,
    "concept_maps": true,
    "sample_data_loaded": true
  },
  "services": {
    "csv_parser_service": true,
    "who_api_service": true,
    "auth_service": true
  },
  "counts": {
    "namaste_codes": 85,
    "concept_maps": 85
  }
}
FieldTypeDescription
statusstring"healthy" when all checks pass; "degraded" if any service or data check fails
timestampstringUTC ISO-8601 timestamp of the health check
demo_modebooleantrue when the DEMO_MODE environment variable is set
data.namaste_codesbooleantrue when at least one NAMASTE code is loaded
data.concept_mapsbooleantrue when at least one concept mapping is loaded
data.sample_data_loadedbooleantrue when both NAMASTE codes and concept maps are present
services.csv_parser_servicebooleantrue when the CSV parser service is available
services.who_api_servicebooleantrue when the WHO API service instance is initialised
services.auth_servicebooleantrue when the authentication service can issue tokens
counts.namaste_codesintegerTotal NAMASTE codes currently loaded in memory or database
counts.concept_mapsintegerTotal concept mappings currently loaded
The lightweight GET /health endpoint returns a subset of this data — useful for load-balancer or Kubernetes liveness probes:
curl http://localhost:5000/health
{
  "status": "healthy",
  "timestamp": "2025-01-15T10:32:44.123456",
  "demo_mode": true,
  "namaste_codes_count": 85,
  "mappings_count": 85
}
The Technical Dashboard makes use of the following endpoints:
MethodEndpointAuth RequiredDescription
GET/healthNoLightweight liveness check
GET/health/detailedNoFull readiness check with per-service flags
GET/api/statsNoMapping counts and coverage percentage
GET/api/searchNoFull-text search across NAMASTE and ICD-11
POST/auth/loginIssues a demo JWT token
POST/translateNoTranslate a NAMASTE code to ICD-11
POST/bundleNoIngest a FHIR Bundle with dual coding
GET/codesystem/namasteNoFHIR R4 CodeSystem for NAMASTE codes
GET/codesystem/icd11NoFHIR R4 CodeSystem for ICD-11
GET/conceptmapNoFHIR R4 ConceptMap (NAMASTE → ICD-11)
If flask-swagger-ui is installed in your environment, an interactive Swagger UI is automatically registered at /api/docs. This provides a full OpenAPI-based testing interface as an alternative to the built-in tester on the Technical Dashboard.
pip install flask-swagger-ui
python app.py
# Then open: http://localhost:5000/api/docs

Build docs developers (and LLMs) love