Skip to Content
General APIPrescriptions

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

ParameterTypeRequiredDescription
pageintegerNoPage number for pagination
page_sizeintegerNoNumber of items per page
patient_idintegerNoFilter by patient ID
provider_idintegerNoFilter by provider ID
statusstringNoFilter by prescription status
medication_namestringNoFilter 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_here

Create Prescription

Endpoint: POST /v1/prescriptions
Authentication: Required

Request Body Parameters

ParameterTypeRequiredDescription
prescriptionobjectYesPrescription data object
prescription.patient_idintegerYesPatient ID
prescription.medication_idintegerYesMedication ID
prescription.dosagestringYesDosage instructions
prescription.frequencystringYesFrequency of administration
prescription.quantityintegerYesQuantity prescribed
prescription.refillsintegerNoNumber of refills allowed
prescription.instructionsstringNoSpecial instructions
prescription.prescription_datestringYesDate 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

ParameterTypeRequiredDescription
idintegerYesPrescription 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

ParameterTypeRequiredDescription
idintegerYesPrescription ID

Example Request

GET /v1/prescriptions/456 HTTP/1.1 Content-Type: application/json X-User-Token: your_token_here

Delete Prescription

Endpoint: DELETE /v1/prescriptions/{id}
Authentication: Required

Path Parameters

ParameterTypeRequiredDescription
idintegerYesPrescription ID

Example Request

DELETE /v1/prescriptions/456 HTTP/1.1 Content-Type: application/json X-User-Token: your_token_here

Response 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 active
  • completed - Prescription course completed
  • discontinued - Prescription discontinued by provider
  • expired - Prescription has expired
  • on_hold - Prescription temporarily on hold
  • cancelled - Prescription was cancelled

Common Frequencies

  • once daily - Once per day
  • twice daily - Twice per day
  • three times daily - Three times per day
  • four times daily - Four times per day
  • every other day - Every other day
  • weekly - Once per week
  • as needed - As needed (PRN)
  • at bedtime - At bedtime

Common Dosage Instructions

  • Take with food - Take with meals
  • Take on empty stomach - Take without food
  • Take at bedtime - Take before sleep
  • Take in the morning - Take in AM
  • Do not crush or chew - Swallow whole
  • Dissolve 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