Prescriptions
The Prescriptions API manages medication requests (e-prescriptions) and medication statements. Prescriptions are created by providers and can be fulfilled at any participating pharmacy in the MediLoop marketplace.
Endpoints
/api/v1/medication-requests/Create a prescription/api/v1/medication-requests/List prescriptions/api/v1/medication-requests/{id}/Get prescription details/api/v1/medication-requests/{id}/Update prescription/api/v1/medication-statements/Record medication statement/api/v1/medication-statements/List medication statementsThe MedicationRequest Object
Attributes
iduuidUnique identifier.
prescription_numberstringHuman-readable prescription number.
patient_uhidstringPatient UHID.
encounter_iduuidnullableAssociated encounter.
statusstringStatus: active, completed, cancelled, stopped.
intentstringIntent: order, plan, proposal.
medication_codestringMedication code (RxNorm or local).
medication_namestringMedication display name.
dosage_instructionstringDosage instructions.
dose_quantitynumbernullableDose amount.
dose_unitstringnullableDose unit (mg, ml, etc.).
frequencystringFrequency (e.g., "3 times daily").
duration_valuenumbernullableDuration value.
duration_unitstringnullableDuration unit (days, weeks).
quantitynumberTotal quantity to dispense.
refills_allowednumberNumber of refills allowed.
prescriber_iduuidPrescribing provider ID.
prescriber_namestringPrescriber name.
authored_ondatetimeWhen prescription was written.
fhir_medication_request_idstringFHIR resource ID.
{
"id": "rx-123-456-789",
"prescription_number": "RX-2024-001234",
"patient_uhid": "UG123456789A",
"encounter_id": "enc-abc-123",
"status": "active",
"intent": "order",
"medication_code": "308182",
"medication_name": "Amoxicillin 500mg Capsule",
"dosage_instruction": "Take 1 capsule 3 times daily with food",
"dose_quantity": 500,
"dose_unit": "mg",
"frequency": "3 times daily",
"duration_value": 7,
"duration_unit": "days",
"quantity": 21,
"refills_allowed": 0,
"prescriber_id": "prov-xyz-789",
"prescriber_name": "Dr. Sarah Nakamya",
"authored_on": "2024-01-15T10:30:00Z",
"fhir_medication_request_id": "MedicationRequest/fhir-rx-123"
}Create a Prescription
Creates a new medication request (e-prescription) for a patient.
/api/v1/medication-requests/Request Body
patient_uhidstringrequiredPatient UHID
medication_codestringrequiredMedication code
medication_namestringrequiredMedication name
dosage_instructionstringrequiredDosage instructions
quantitynumberrequiredQuantity to dispense
encounter_iduuidoptionalAssociated encounter
dose_quantitynumberoptionalDose amount
dose_unitstringoptionalDose unit
frequencystringoptionalFrequency
duration_valuenumberoptionalDuration value
duration_unitstringoptionalDuration unit
refills_allowednumberoptionalRefills allowed
Default: 0
notesstringoptionalAdditional notes
curl -X POST https://api.mediloop.co/api/v1/medication-requests/ \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"patient_uhid": "UG123456789A",
"medication_code": "308182",
"medication_name": "Amoxicillin 500mg Capsule",
"dosage_instruction": "Take 1 capsule 3 times daily with food",
"dose_quantity": 500,
"dose_unit": "mg",
"frequency": "3 times daily",
"duration_value": 7,
"duration_unit": "days",
"quantity": 21,
"encounter_id": "enc-abc-123"
}'{
"id": "rx-new-123",
"prescription_number": "RX-2024-001234",
"patient_uhid": "UG123456789A",
"status": "active",
"medication_name": "Amoxicillin 500mg Capsule",
"quantity": 21,
"authored_on": "2024-01-15T10:30:00Z"
}List Prescriptions
Retrieve prescriptions with filtering options.
/api/v1/medication-requests/Query Parameters
patient_uhidstringoptionalFilter by patient
statusstringoptionalFilter by status
prescriber_iduuidoptionalFilter by prescriber
date_fromdateoptionalFilter from date
date_todateoptionalFilter to date
curl "https://api.mediloop.co/api/v1/medication-requests/?patient_uhid=UG123456789A&status=active" \
-H "Authorization: Bearer sk_test_..."{
"count": 2,
"results": [
{
"id": "rx-123",
"prescription_number": "RX-2024-001234",
"medication_name": "Amoxicillin 500mg",
"status": "active",
"authored_on": "2024-01-15T10:30:00Z"
},
{
"id": "rx-124",
"prescription_number": "RX-2024-001235",
"medication_name": "Paracetamol 500mg",
"status": "active",
"authored_on": "2024-01-15T10:30:00Z"
}
]
}Prescription Status
| Status | Description |
|---|---|
active | Prescription is active and can be dispensed |
completed | Prescription has been fully dispensed |
cancelled | Prescription was cancelled |
stopped | Prescription was stopped by provider |
on-hold | Prescription is temporarily on hold |
MediLoop Marketplace
MediLoop is a national healthcare marketplace. Prescriptions created through the API can be fulfilled at any participating pharmacy. Patients have the freedom to choose where to purchase their medications.