General Prescriptions API
Endpoints for managing patient prescriptions and medication orders.
List Prescriptions
Get a list of prescriptions.
Endpoint: GET /v1/prescriptions
Authentication: Required
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | No | Page number for pagination |
page_size | integer | No | Number of items per page |
patient_id | integer | No | Filter by patient ID |
provider_id | integer | No | Filter by provider ID |
status | string | No | Filter by prescription status |
medication_name | string | No | Filter by medication name |
Example Request
GET /v1/prescriptions?patient_id=1049&status=active HTTP/1.1
Content-Type: application/json
X-User-Token: your_token_hereCreate Prescription
Endpoint: POST /v1/prescriptions
Authentication: Required
Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
prescription | object | Yes | Prescription data object |
prescription.patient_id | integer | Yes | Patient ID |
prescription.medication_id | integer | Yes | Medication ID |
prescription.dosage | string | Yes | Dosage instructions |
prescription.frequency | string | Yes | Frequency of administration |
prescription.quantity | integer | Yes | Quantity prescribed |
prescription.refills | integer | No | Number of refills allowed |
prescription.instructions | string | No | Special instructions |
prescription.prescription_date | string | Yes | Date prescribed (YYYY-MM-DD) |
Example Request
POST /v1/prescriptions HTTP/1.1
Content-Type: application/json
X-User-Token: your_token_here
{
"prescription": {
"patient_id": 1049,
"medication_id": 123,
"dosage": "50mg",
"frequency": "once daily",
"quantity": 30,
"refills": 5,
"instructions": "Take with food in the morning",
"prescription_date": "2023-10-27"
}
}Update Prescription
Endpoint: PUT /v1/prescriptions/{id}
Authentication: Required
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | Prescription ID |
Request Body Parameters
Same as Create Prescription endpoint, but all fields are optional.
Example Request
PUT /v1/prescriptions/456 HTTP/1.1
Content-Type: application/json
X-User-Token: your_token_here
{
"prescription": {
"dosage": "75mg",
"instructions": "Take with food in the morning, increased dose"
}
}Get Prescription Details
Endpoint: GET /v1/prescriptions/{id}
Authentication: Required
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | Prescription ID |
Example Request
GET /v1/prescriptions/456 HTTP/1.1
Content-Type: application/json
X-User-Token: your_token_hereDelete Prescription
Endpoint: DELETE /v1/prescriptions/{id}
Authentication: Required
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | Prescription ID |
Example Request
DELETE /v1/prescriptions/456 HTTP/1.1
Content-Type: application/json
X-User-Token: your_token_hereResponse Format
Prescription Response
{
"id": 456,
"patient_id": 1049,
"provider_id": 789,
"medication_id": 123,
"dosage": "50mg",
"frequency": "once daily",
"quantity": 30,
"refills": 5,
"refills_remaining": 5,
"instructions": "Take with food in the morning",
"prescription_date": "2023-10-27",
"status": "active",
"start_date": "2023-10-27",
"end_date": null,
"created_at": "2023-10-27T14:30:00.000Z",
"updated_at": "2023-10-27T14:30:00.000Z",
"medication": {
"id": 123,
"name": "Sertraline",
"generic_name": "sertraline",
"brand_names": ["Zoloft"],
"strength": "50mg",
"dosage_form": "tablet"
},
"patient": {
"id": 1049,
"first_name": "John",
"last_name": "Doe"
},
"provider": {
"id": 789,
"first_name": "Dr. Jane",
"last_name": "Smith"
}
}Prescription Status Values
active- Prescription is currently activecompleted- Prescription course completeddiscontinued- Prescription discontinued by providerexpired- Prescription has expiredon_hold- Prescription temporarily on holdcancelled- Prescription was cancelled
Common Frequencies
once daily- Once per daytwice daily- Twice per daythree times daily- Three times per dayfour times daily- Four times per dayevery other day- Every other dayweekly- Once per weekas needed- As needed (PRN)at bedtime- At bedtime
Common Dosage Instructions
Take with food- Take with mealsTake on empty stomach- Take without foodTake at bedtime- Take before sleepTake in the morning- Take in AMDo not crush or chew- Swallow wholeDissolve under tongue- Sublingual administration
Error Responses
422 Unprocessable Entity
{
"errors": {
"patient_id": ["can't be blank"],
"medication_id": ["can't be blank"],
"dosage": ["can't be blank"],
"quantity": ["must be greater than 0"]
}
}404 Not Found
{
"errors": "Prescription not found"
}403 Forbidden
{
"errors": "You are not authorized to access this prescription"
}Notes
- Prescriptions must be created by authorized healthcare providers
- Refill tracking helps monitor medication compliance
- Status changes are automatically tracked for audit purposes
- Medication information is linked from the medications database
- Special instructions provide important safety and administration guidance
- Prescription dates help track medication history and timing
- Access to prescription information is restricted based on user permissions
- All prescription changes are logged for regulatory compliance