Entity: Prescription
Member-submitted prescription for pharmacist review and covered medicine fulfillment.
Workspace: /Users/kirukib/Desktop/Yaltopia Project/Gishen-B2B
Fields
| Field |
Type |
Required |
Notes |
id |
string |
✓ |
rx_* |
member_id |
string |
✓ |
|
org_id |
string |
✓ |
|
customer_id |
string |
✓ |
Shared identity |
status |
PrescriptionStatus |
✓ |
|
pages |
PrescriptionPage[] |
✓ |
Images/files — clinical withhold |
medicine_lines |
MedicineLine[] |
|
Pharmacist-entered after review |
prescriber_notes |
string |
|
Clinical — withheld from HR/Finance |
diagnosis_codes |
string[] |
|
Withheld |
days_supply |
integer |
|
For refill reminders |
refill_due_at |
date |
|
Computed |
submitted_at |
Timestamp |
|
|
reviewed_at |
Timestamp |
|
Admin pharmacist |
reviewer_id |
string |
|
Admin user |
query_message |
string |
|
If status=queried |
rejection_reason |
string |
|
If status=rejected |
created_at |
Timestamp |
✓ |
|
updated_at |
Timestamp |
✓ |
|
PrescriptionStatus
draft | submitted | under_review | approved | queried | rejected
PrescriptionPage
| Field |
Type |
Notes |
id |
string |
|
page_number |
integer |
|
url |
string |
Signed URL |
mime_type |
string |
|
uploaded_at |
Timestamp |
|
MedicineLine
| Field |
Type |
Notes |
name |
string |
Clinical |
dosage |
string |
|
quantity |
integer |
|
sku |
string |
|
instructions |
string |
|
Status flow
draft → submitted → under_review → approved
↘ queried → (member resubmits) → under_review
↘ rejected
Review/dispensing queue lives in Gishen-Admin. B2B emits prescription.submitted and consumes review status updates.
Validation rules
| Rule |
Error code |
Member must be active |
MEMBER_INACTIVE |
| At least one page on submit |
VALIDATION_FAILED |
| Max 10 pages |
VALIDATION_FAILED |
| Only MEMBER (own) or SUPER_USER may upload |
FORBIDDEN |
Clinical withhold
| Role |
pages |
medicine_lines |
prescriber_notes |
diagnosis_codes |
Status/metadata |
| MEMBER (own) |
✓ |
✓ when approved |
✓ |
✓ |
✓ |
| SUPER_USER |
✓ |
✓ |
✓ |
✓ |
✓ |
| HR_ADMIN |
✗ |
✗ |
✗ |
✗ |
✓ status + dates only |
| FINANCE |
✗ |
✗ |
✗ |
✗ |
✗ (use spend aggregates) |
HR/Finance listing endpoint returns 403 or redacted stub if clinical fields requested.
Sample payload (member view)
{
"id": "rx_01H001",
"member_id": "mbr_01HMEM001",
"org_id": "org_01HQXYZ",
"customer_id": "cus_01HSHARED",
"status": "under_review",
"pages": [
{
"id": "rxp_01",
"page_number": 1,
"url": "https://storage.gishen.../rx_01H001_p1.jpg",
"mime_type": "image/jpeg",
"uploaded_at": "2026-03-10T08:00:00Z"
}
],
"medicine_lines": [],
"days_supply": null,
"refill_due_at": null,
"submitted_at": "2026-03-10T08:00:00Z",
"reviewed_at": null,
"created_at": "2026-03-10T07:55:00Z",
"updated_at": "2026-03-10T08:00:00Z"
}
Sample payload (HR redacted)
{
"id": "rx_01H001",
"member_id": "mbr_01HMEM001",
"status": "under_review",
"submitted_at": "2026-03-10T08:00:00Z",
"clinical_withheld": true
}
Events
| Event |
When |
prescription.submitted |
Member submits |
prescription.review_updated |
Admin review (consumed) |
Related endpoints
Platform notes
- Multi-page photo/file upload on web; edge-detection camera is Mobile-only.
- No handwritten OCR.