Skip to main content
GET
/
cases
/
cases
/
{case_id}
Get Case by ID
curl --request GET \
  --url https://api.example.com/cases/cases/{case_id}
{
  "case": {
    "case.case_id": "<string>",
    "case.user_id": "<string>",
    "case.patient_name": "<string>",
    "case.patient_age": 123,
    "case.patient_gender": "<string>",
    "case.case_summary": "<string>",
    "case.status": "<string>",
    "case.created_at": "<string>",
    "case.updated_at": "<string>"
  },
  "files": [
    {
      "files[].file_id": "<string>",
      "files[].file_name": "<string>",
      "files[].file_type": "<string>",
      "files[].file_size": 123,
      "files[].file_url": "<string>",
      "files[].file_category": "<string>",
      "files[].uploaded_at": "<string>"
    }
  ],
  "ai_insights": {
    "ai_insights.case_summary": {
      "ai_insights.case_summary.comprehensive_summary": "<string>",
      "ai_insights.case_summary.key_findings": [
        "<string>"
      ],
      "ai_insights.case_summary.lab_summary": "<string>",
      "ai_insights.case_summary.radiology_summary": "<string>",
      "ai_insights.case_summary.confidence_score": 123
    },
    "ai_insights.soap_note": {
      "ai_insights.soap_note.subjective": "<string>",
      "ai_insights.soap_note.objective": "<string>",
      "ai_insights.soap_note.assessment": "<string>",
      "ai_insights.soap_note.plan": "<string>",
      "ai_insights.soap_note.confidence_score": 123
    },
    "ai_insights.primary_diagnosis": {
      "ai_insights.primary_diagnosis.primary_diagnosis": "<string>",
      "ai_insights.primary_diagnosis.icd_code": "<string>",
      "ai_insights.primary_diagnosis.description": "<string>",
      "ai_insights.primary_diagnosis.confidence_score": 123,
      "ai_insights.primary_diagnosis.supporting_evidence": [
        "<string>"
      ]
    },
    "ai_insights.overall_confidence_score": 123,
    "ai_insights.generated_at": "<string>"
  },
  "404 Not Found": {},
  "400 Bad Request": {},
  "500 Internal Server Error": {}
}

Authentication

This endpoint requires authentication via the case_id path parameter.

Path Parameters

case_id
string
required
The unique UUID identifier of the case to retrieve

Response

case
object
The complete case object with all details
case.case_id
string
Unique UUID identifier for the case
case.user_id
string
ID of the doctor who created the case
case.patient_name
string
Patient’s full name
case.patient_age
integer
Patient’s age in years
case.patient_gender
string
Patient’s gender
case.case_summary
string
Case summary or doctor’s notes
case.status
string
Current status of the case
case.created_at
string
ISO 8601 timestamp when the case was created
case.updated_at
string
ISO 8601 timestamp when the case was last updated
files
array
Array of files attached to the case
files[].file_id
string
Unique identifier for the file
files[].file_name
string
Original filename
files[].file_type
string
MIME type of the file
files[].file_size
integer
File size in bytes
files[].file_url
string
URL path to access the file
files[].file_category
string
Category of the file (“lab” or “radiology”)
files[].uploaded_at
string
Timestamp when the file was uploaded
ai_insights
object
AI-generated medical insights for the case
ai_insights.case_summary
object
Comprehensive case summary generated by AI
ai_insights.case_summary.comprehensive_summary
string
Detailed summary of the entire case
ai_insights.case_summary.key_findings
string[]
Array of key medical findings
ai_insights.case_summary.lab_summary
string
Summary of laboratory results
ai_insights.case_summary.radiology_summary
string
Summary of radiology findings
ai_insights.case_summary.confidence_score
float
Confidence score between 0.0 and 1.0
ai_insights.soap_note
object
SOAP (Subjective, Objective, Assessment, Plan) note
ai_insights.soap_note.subjective
string
Subjective findings from patient
ai_insights.soap_note.objective
string
Objective clinical findings
ai_insights.soap_note.assessment
string
Clinical assessment
ai_insights.soap_note.plan
string
Treatment and management plan
ai_insights.soap_note.confidence_score
float
Confidence score between 0.0 and 1.0
ai_insights.primary_diagnosis
object
Primary diagnosis information
ai_insights.primary_diagnosis.primary_diagnosis
string
The primary diagnosis
ai_insights.primary_diagnosis.icd_code
string
ICD code for the diagnosis
ai_insights.primary_diagnosis.description
string
Detailed description of the diagnosis
ai_insights.primary_diagnosis.confidence_score
float
Confidence score between 0.0 and 1.0
ai_insights.primary_diagnosis.supporting_evidence
string[]
Array of supporting evidence for the diagnosis
ai_insights.overall_confidence_score
float
Overall confidence score for all AI-generated insights
ai_insights.generated_at
string
Timestamp when the insights were generated

Example Request

curl -X GET "https://api.medmitra.com/cases/cases/a1b2c3d4-5678-90ab-cdef-1234567890ab" \
  -H "Content-Type: application/json"

Example Response

{
  "case": {
    "case_id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
    "user_id": "b8acad4b-4944-4d66-b405-de70886e7248",
    "patient_name": "John Doe",
    "patient_age": 45,
    "patient_gender": "male",
    "case_summary": "Patient presents with chest pain and shortness of breath",
    "status": "completed",
    "created_at": "2026-03-04T10:30:00Z",
    "updated_at": "2026-03-04T11:45:00Z"
  },
  "files": [
    {
      "file_id": "f1e2d3c4-5678-90ab-cdef-1234567890ab",
      "file_name": "lab_report.pdf",
      "file_type": "application/pdf",
      "file_size": 245678,
      "file_url": "lab_files/a1b2c3d4-5678-90ab-cdef-1234567890ab/lab_report.pdf",
      "file_category": "lab",
      "uploaded_at": "2026-03-04T10:30:15Z"
    }
  ],
  "ai_insights": {
    "case_summary": {
      "comprehensive_summary": "45-year-old male presenting with acute chest pain and dyspnea. Laboratory findings indicate elevated cardiac markers. Radiology shows pulmonary congestion.",
      "key_findings": [
        "Elevated troponin levels",
        "ST-segment changes on ECG",
        "Pulmonary edema on chest X-ray"
      ],
      "lab_summary": "Troponin I: 0.8 ng/mL (elevated), BNP: 450 pg/mL (elevated)",
      "radiology_summary": "Chest X-ray shows bilateral pulmonary congestion consistent with heart failure",
      "confidence_score": 0.92
    },
    "soap_note": {
      "subjective": "Patient reports acute onset chest pain radiating to left arm, associated with shortness of breath",
      "objective": "Vital signs: BP 150/95, HR 105, RR 24. Elevated cardiac markers. Bilateral rales on auscultation.",
      "assessment": "Acute coronary syndrome with heart failure",
      "plan": "Admit to CCU, initiate dual antiplatelet therapy, beta-blockers, ACE inhibitors. Cardiology consultation.",
      "confidence_score": 0.89
    },
    "primary_diagnosis": {
      "primary_diagnosis": "Acute Coronary Syndrome",
      "icd_code": "I24.9",
      "description": "Acute myocardial ischemia with elevated cardiac biomarkers and ECG changes",
      "confidence_score": 0.91,
      "supporting_evidence": [
        "Elevated troponin levels",
        "Clinical presentation of chest pain",
        "ECG abnormalities"
      ]
    },
    "overall_confidence_score": 0.91,
    "generated_at": "2026-03-04T11:45:00Z"
  }
}

Error Responses

404 Not Found
error
Case with the specified ID was not found
{
  "detail": "Case not found"
}
400 Bad Request
error
Invalid request or Supabase client error
{
  "detail": "Error message describing the issue"
}
500 Internal Server Error
error
Server error during data retrieval
{
  "detail": "Internal server error: {error details}"
}

Notes

  • This endpoint retrieves the most complete information about a case
  • AI insights may be null if the background processing has not completed yet
  • The files array includes all uploaded documents (both lab and radiology)
  • Confidence scores range from 0.0 (low confidence) to 1.0 (high confidence)

Build docs developers (and LLMs) love