File size: 1,695 Bytes
1935826
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# API Integration Guide

## Endpoint: Triage Health Check

**URL:** `POST /api/health-check`  
**Base URL:** `https://medagen-backend.hf.space` (hoặc URL của bạn)

### Request

```json
{
  "user_id": "string (required)",
  "text": "string (optional, required if no image_url)",
  "image_url": "string (optional, required if no text)",
  "session_id": "string (optional)",
  "location": {
    "lat": "number (optional)",
    "lng": "number (optional)"
  }
}
```

### Response

```json
{
  "triage_level": "emergency|urgent|routine|self-care",
  "symptom_summary": "string",
  "red_flags": ["string"],
  "suspected_conditions": [
    {
      "name": "string",
      "source": "cv_model|guideline|user_report",
      "confidence": "low|medium|high"
    }
  ],
  "cv_findings": {
    "model_used": "derm_cv|eye_cv|wound_cv|none",
    "raw_output": {}
  },
  "recommendation": {
    "action": "string",
    "timeframe": "string",
    "home_care_advice": "string",
    "warning_signs": "string"
  },
  "message": "string (markdown response)",
  "session_id": "string",
  "nearest_clinic": {
    "name": "string",
    "distance_km": "number",
    "address": "string",
    "rating": "number"
  }
}
```

### Example

```bash
curl -X POST https://medagen-backend.hf.space/api/health-check \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "user123",
    "text": "đau mũi, có mụt nhọt",
    "image_url": "https://example.com/image.jpg"
  }'
```

### Notes

- `text` hoặc `image_url` phải có ít nhất một
- `session_id` tự động tạo nếu không có
- Response `message` chứa markdown tự nhiên từ LLM
- `triage_level` xác định mức độ khẩn cấp