Skip to main content
Prescriptions map to the FHIR R4 MedicationRequest resource — a medication order written by a practitioner for a specific patient. Each prescription captures the drug, dosage instructions, supply quantity, refills, and current status. You can provide dosage as free text, structured data, or both.

Create a prescription

const { data: rx } = await clinik.prescriptions.create({
  patientId: 'pt_abc123',
  prescriberId: 'prac_def456',
  encounterId: 'enc_xyz789',
  medication: {
    system: 'http://www.nlm.nih.gov/research/umls/rxnorm',
    code: '197361',
    display: 'Lisinopril 10 MG Oral Tablet',
  },
  intent: 'order',
  status: 'active',
  priority: 'routine',
  dosageText: 'Take 1 tablet by mouth once daily',
  dosage: {
    dose: { value: 10, unit: 'mg' },
    frequency: 1,
    period: 1,
    periodUnit: 'd',
    route: 'oral',
  },
  refills: 3,
  quantity: { value: 30, unit: 'tablets' },
  supplyDays: 30,
  substitutionAllowed: true,
  reason: 'Essential hypertension',
  note: 'Monitor blood pressure weekly',
});

Dosage instructions

You can provide dosage as free text, structured data, or both. Including both is recommended: structured dosage enables computation, free text improves display in clinical UIs.
// Free text only
{ dosageText: 'Take 1 tablet twice daily with food' }

// Structured only
{
  dosage: {
    dose: { value: 500, unit: 'mg' },
    frequency: 2,
    period: 1,
    periodUnit: 'd',
    route: 'oral',
  }
}

// Both — recommended
{
  dosageText: 'Take 500mg twice daily with food',
  dosage: {
    dose: { value: 500, unit: 'mg' },
    frequency: 2,
    period: 1,
    periodUnit: 'd',
    route: 'oral',
  }
}

Period units

UnitMeaning
hHours
dDays
wkWeeks
moMonths

Read a prescription

const { data: prescription } = await clinik.prescriptions.read('rx_abc123');

Update a prescription

Update the status to reflect changes in therapy — holding a prescription, cancelling it, or marking it complete:
// Put a prescription on hold
await clinik.prescriptions.update('rx_abc123', {
  status: 'on-hold',
  note: 'Patient reported dizziness — holding pending follow-up',
});

// Cancel a prescription
await clinik.prescriptions.update('rx_abc123', {
  status: 'cancelled',
});

Delete a prescription

await clinik.prescriptions.delete('rx_abc123');

Status lifecycle

draft → active → on-hold → completed / cancelled / stopped
StatusDescription
draftNot yet authorized
activeCurrently in effect
on-holdTemporarily suspended
completedTherapy is complete
cancelledCancelled before dispensing
stoppedStopped after dispensing began

Search prescriptions

const { data: results } = await clinik.prescriptions.search({
  patientId: 'pt_abc123',
  status: 'active',
  prescriberId: 'prac_def456',
});

for (const rx of results.data) {
  console.log(rx.medicationCodeableConcept?.coding?.[0]?.display);
}