Skip to content

Pro routes

Mounted at /pro. JWT audience snr_pro. Same encrypted Authorization header as /app and /admin.

Lists second_opinions assigned to the authenticated doctor (JWT id = doctor_id on the row). Only active = 1 rows. Paginated.

FieldTypeRequiredNotes
coordinatorbooleannoIf true, only rows with is_coordinator = 1. If false or omitted, only rows with is_coordinator = 0.
pagenumbernodefault 1
page_sizenumbernodefault 15, max 100
{
"coordinator": true,
"page": 1,
"page_size": 15
}
FieldTypeNotes
sop_idstringPrimary key
case_idstringReview case
doctor_idstringSame as JWT id for this list
requested_documentsstring[]Parsed from JSON
created_datestringISO timestamp
is_coordinatorboolean

pagination: total, page, page_size.

Single review case for the authenticated pro doctor (JWT id). Allowed only if review_cases.case_coordinator_id equals that id or there is an active second_opinions row for the same case_id and doctor_id. Otherwise 404 (Case not found — no distinction from missing case).

FieldTypeRequired
case_idstringyes

Same shape as POST /app/review-case-details: case_id, rt_id, dc_id, patient_age, patient_gender, status, medical_history, medical_documents, created_date, updated_date, reject_reason, case_coordinator_id.

Assigns another doctor to the review case by inserting a second_opinions row with is_coordinator = 0. Only the case coordinator may call this: review_cases.case_coordinator_id must equal the JWT id. If the case has no coordinator or the caller is not that coordinator → 403.

FieldTypeRequiredNotes
case_idstringyes
doctor_idstringyesAssignee provider id (stored on new second_opinions row)
requested_documentsstring[]noSame as POST /admin/assign-coordinator; omit or [] for none
{
"status": 1000,
"message": "Doctor assigned to case",
"data": {
"case_id": "uuid",
"doctor_id": "EMP2",
"sop_id": "uuid"
}
}

404 if case_id does not exist. 403 if caller is not the case coordinator.

Updates second_opinions.requested_documents (JSON array of strings) for an existing active row. doctor_id in the body must equal the JWT id (the doctor may only update their own assignment). sop_id identifies the row.

FieldTypeRequiredNotes
sop_idstringyessecond_opinions.sop_id
doctor_idstringyesMust match JWT id
request_documentsstring[]yesEach item non-empty after trim; [] clears to an empty list
{
"status": 1000,
"message": "Requested documents updated",
"data": {
"sop_id": "uuid",
"doctor_id": "EMP1"
}
}

404 if no matching active row (sop_id + doctor_id). 403 if doctor_id ≠ JWT id.