This document describes the REST API for the XRayVision application, a DICOM processor with OpenAI integration.
The API is accessible at http://localhost:8000 by default. The port can be configured in the xrayvision.cfg file under [dashboard] section with the DASHBOARD_PORT parameter.
All API endpoints (except static file serving) require HTTP Basic Authentication. Credentials are configured in the xrayvision.cfg file under the [users] section.
Example:
Authorization: Basic base64(username:password)
Serve the main dashboard HTML page.
Serve the statistics HTML page.
Serve the about HTML page.
Serve the report check HTML page.
Serve the favicon.ico file.
Handle WebSocket connections for real-time dashboard updates.
Provide paginated exam data with optional filters.
Query Parameters:
page(integer, default: 1) - Page numberreviewed(string, enum: any, yes, no) - Filter by review status (yes = severity > -1, no = severity = -1)positive(string, enum: any, yes, no) - Filter by AI predictioncorrect(string, enum: any, yes, no) - Filter by correctness statusregion(string) - Filter by anatomic regionstatus(string) - Filter by processing statussearch(string) - Filter by patient namediagnostic(string) - Filter by radiologist diagnostic summaryradiologist(string) - Filter by radiologist name
Response:
{
"exams": [
{
"uid": "string",
"patient": {
"name": "string",
"cnp": "string",
"id": "string",
"age": "integer",
"sex": "string"
},
"exam": {
"created": "string",
"date": "string",
"time": "string",
"protocol": "string",
"region": "string",
"status": "string",
"type": "string",
"study": "string",
"series": "string",
"id": "string"
},
"report": {
"ai": {
"text": "string",
"short": "string",
"created": "string",
"updated": "string",
"positive": "boolean",
"confidence": "integer",
"model": "string",
"latency": "integer"
},
"rad": {
"text": "string",
"positive": "boolean",
"severity": "integer",
"summary": "string",
"created": "string",
"updated": "string",
"id": "string",
"type": "string",
"radiologist": "string",
"justification": "string",
"model": "string",
"latency": "integer"
},
"correct": "integer",
"reviewed": "integer"
}
}
],
"total": "integer",
"pages": "integer",
"filters": "object"
}Provide statistical data for the dashboard.
Response:
{
"total": "integer",
"reviewed": "integer",
"positive": "integer",
"correct": "integer",
"wrong": "integer",
"region": "object",
"trends": "object",
"monthly_trends": "object",
"avg_processing_time": "number",
"throughput": "number",
"error_stats": "object"
}Provide global configuration parameters to the frontend.
Response:
{
"OPENAI_URL_PRIMARY": "string",
"OPENAI_URL_SECONDARY": "string",
"NTFY_URL": "string",
"AE_TITLE": "string",
"AE_PORT": "integer",
"REMOTE_AE_TITLE": "string",
"REMOTE_AE_IP": "string",
"REMOTE_AE_PORT": "integer"
}Provide supported regions for the frontend dropdown.
Response:
["string"]Provide paginated patient data with optional filters.
Query Parameters:
page(integer, default: 1) - Page numbersearch(string) - Filter by patient name or CNP
Response:
{
"patients": [
{
"cnp": "string",
"id": "string",
"name": "string",
"age": "integer",
"sex": "string"
}
],
"total": "integer",
"pages": "integer",
"filters": "object"
}Provide a single patient's data by CNP.
Path Parameters:
cnp(string) - Patient CNP
Response:
{
"cnp": "string",
"id": "string",
"name": "string",
"age": "integer",
"sex": "string",
"exams": ["string"]
}Error Response:
{
"error": "Patient not found"
}Provide a single exam's data by UID.
Path Parameters:
uid(string) - Exam UID
Response:
{
"uid": "string",
"patient": {
"name": "string",
"cnp": "string",
"id": "string",
"age": "integer",
"sex": "string"
},
"exam": {
"created": "string",
"date": "string",
"time": "string",
"protocol": "string",
"region": "string",
"status": "string",
"type": "string",
"study": "string",
"series": "string",
"id": "string"
},
"report": {
"ai": {
"text": "string",
"short": "string",
"created": "string",
"updated": "string",
"positive": "boolean",
"confidence": "integer",
"model": "string",
"latency": "integer"
},
"rad": {
"text": "string",
"positive": "boolean",
"severity": "integer",
"summary": "string",
"created": "string",
"updated": "string",
"id": "string",
"type": "string",
"radiologist": "string",
"justification": "string",
"model": "string",
"latency": "integer"
},
"correct": "integer",
"reviewed": "integer"
}
}Error Response:
{
"error": "Exam not found"
}Record radiologist's review of an exam as normal or abnormal.
Request Body:
{
"uid": "string",
"normal": "boolean"
}Response:
{
"status": "string"
}Re-queue an exam for processing.
Request Body:
{
"uid": "string"
}Response:
{
"status": "string",
"message": "string"
}Trigger a manual DICOM query/retrieve operation.
Request Body:
{
"hours": "integer"
}Response:
{
"status": "string",
"message": "string"
}Analyze a free-text radiology report for pathological findings.
Request Body:
{
"report": "string"
}Response:
{
"pathologic": "string",
"severity": "integer",
"summary": "string"
}Serve the OpenAPI specification file.
Response:
{
"openapi": "string",
"info": "object",
"servers": "array",
"components": "object",
"paths": "object"
}Serve static image files (PNG, DCM) from the images/ directory.
Serve other static files (CSS, JS, HTML, WAV, PNG, ICO) from the static/ directory.