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 /translate endpoint performs a concept lookup against the loaded mappings, returning the matched ICD-11 code for a given NAMASTE source code. This endpoint is rate limited to 30 requests per minute per IP address.

Endpoint

Method: POST
Path: /translate
Auth: None (demo mode)
Rate Limit: 30 requests per minute

Request Body

sourceCode
string
required
The NAMASTE code to translate. Must be a string value (e.g. "NAM-001").
sourceSystem
string
required
The coding system of the source code. Must be "NAMASTE".

Response

sourceCode
string
The NAMASTE code that was submitted for translation.
targetCode
string
The matched ICD-11 code (e.g. "TM2-001" or "BM-001").
targetSystem
string
The ICD-11 system the target code belongs to. Either "ICD-11 TM2" or "ICD-11 Biomedicine".
equivalence
string
The mapping type. One of equivalent, equal, wider, or subsumes.
confidence
number
A float from 0.0 to 1.0 representing the accuracy of the mapping.

Error Responses

StatusCondition
400 Bad RequestsourceCode or sourceSystem is missing or empty — returns "Validation failed" with a details array.
400 Bad RequestsourceCode or sourceSystem is present but not a string type — returns "Invalid input format".
404 Not FoundNo mapping exists for the provided sourceCode / sourceSystem pair.
A 400 from missing or empty fields includes a details array listing each validation failure:
400 — Validation Error
{
  "error": "Validation failed",
  "details": [
    "Missing required field: sourceCode"
  ]
}
A 400 from a non-string value returns a flat error object (no details array):
400 — Invalid Input Format
{
  "error": "Invalid input format"
}
404 — No Mapping Found
{
  "error": "No mapping found"
}

Examples

curl -X POST http://localhost:5000/translate \
  -H "Content-Type: application/json" \
  -d '{"sourceCode": "NAM-001", "sourceSystem": "NAMASTE"}'
Response
{
  "sourceCode": "NAM-001",
  "targetCode": "TM2-001",
  "targetSystem": "ICD-11 TM2",
  "equivalence": "equivalent",
  "confidence": 0.9
}

Validation

Both sourceCode and sourceSystem are validated in two sequential steps before the lookup is performed:
  1. Presence check — Both fields must exist in the request body and must not be empty. Failures here return {"error": "Validation failed", "details": [...]} with an array that names every missing field.
  2. Type check — Both values must be strings. Passing a number, null, or any non-string type triggers a separate {"error": "Invalid input format"} response with no details array.
The two-step design means a caller may receive either error shape depending on which check fails first.
Currently only the NAMASTE → ICD-11 translation direction is supported. Reverse lookups (ICD-11 → NAMASTE) are not yet implemented and will return a 404 if attempted.

Build docs developers (and LLMs) love