Skip to main content

clinik.medicationDispenses

Medication Dispenses (FHIR MedicationDispense) track the supply of medications to patients — typically by a pharmacy. Use clinik.prescriptions for medication orders and clinik.medications for drug definitions.

create

const { data, meta } = await clinik.medicationDispenses.create(request: MedicationDispenseCreateRequest): Promise<ApiResponse<MedicationDispense>>
FieldTypeRequiredDescription
statusstringYespreparation, in-progress, cancelled, on-hold, completed, stopped, declined
medicationstring | { system?, code, display? }YesMedication code or name
patientIdstringYesPatient ID
encounterIdstringNoEncounter ID
statusReasonCodeableConceptstringNoReason for current status
categorystringNoCategory of dispense
performerArrayNoWho performed the dispense
locationIdstringNoLocation ID
authorizingPrescriptionIdsstring[]NoMedicationRequest IDs
typestringNotrial fill, partial fill, emergency fill
quantity{ value, unit? }NoQuantity dispensed
daysSupplynumberNoNumber of days supply
whenPreparedstringNoWhen prepared
whenHandedOverstringNoWhen handed over
dosageTextstringNoDosage instructions
substitutionobjectNoSubstitution details
notestringNoAdditional notes

Example

const { data } = await clinik.medicationDispenses.create({
  status: 'completed',
  medication: {
    system: 'http://www.nlm.nih.gov/research/umls/rxnorm',
    code: '197361',
    display: 'Lisinopril 10 MG Oral Tablet',
  },
  patientId: 'pt_abc123',
  authorizingPrescriptionIds: ['rx_order456'],
  quantity: { value: 30, unit: 'tablets' },
  daysSupply: 30,
  whenPrepared: '2024-03-15T10:00:00Z',
  whenHandedOver: '2024-03-15T14:30:00Z',
  dosageText: 'Take 1 tablet daily in the morning',
});
Same pattern as other resources. Update supports status, statusReasonCodeableConcept, note. Search supports patientId, status, medication filters.