Pharmacy dispensing & inventory database schema

How a dispensing pharmacy models its data: a drug catalogue by strength and form, stock held as batches with expiry dates picked first-expired-first-out, dispense events, interaction and allergy checks, insurance claims and a controlled-drugs register.

Pharmacy ER diagram

Pharmacy dispensing & inventory database schema n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 11 n1 11 n1 n1 n1 drugs idBIGINT product_codeVARCHAR nameVARCHAR generic_nameVARCHAR strengthVARCHAR formVARCHAR pack_sizeINTEGER controlled_schedu…VARCHAR requires_counsell…BOOLEAN is_activeBOOLEAN drug_batches idBIGINT drug_idBIGINT lot_numberVARCHAR expiry_dateDATE quantity_receivedINTEGER quantity_on_handINTEGER supplier_nameVARCHAR unit_cost_centsINTEGER currency_codeCHAR received_atTIMESTAMPTZ statusVARCHAR patients idBIGINT given_nameVARCHAR family_nameVARCHAR date_of_birthDATE phoneVARCHAR address_lineVARCHAR preferred_languageVARCHAR created_atTIMESTAMPTZ patient_allergies idBIGINT patient_idBIGINT allergen_codeVARCHAR allergen_nameVARCHAR reactionVARCHAR severityVARCHAR recorded_atTIMESTAMPTZ prescribers idBIGINT registration_numb…VARCHAR full_nameVARCHAR practice_nameVARCHAR phoneVARCHAR is_verifiedBOOLEAN prescriptions idBIGINT patient_idBIGINT prescriber_idBIGINT drug_idBIGINT external_referenceVARCHAR written_onDATE expires_onDATE directionsVARCHAR quantity_authoris…INTEGER days_supplyINTEGER refills_authorisedINTEGER refills_remainingINTEGER statusVARCHAR received_atTIMESTAMPTZ pharmacists idBIGINT licence_numberVARCHAR full_nameVARCHAR roleVARCHAR is_activeBOOLEAN dispenses idBIGINT prescription_idBIGINT batch_idBIGINT patient_idBIGINT pharmacist_idBIGINT fill_numberINTEGER quantity_dispensedINTEGER is_partialBOOLEAN label_directionsVARCHAR price_centsINTEGER currency_codeCHAR dispensed_atTIMESTAMPTZ drug_interactions idBIGINT drug_idBIGINT interacts_with_dr…BIGINT severityVARCHAR mechanismVARCHAR guidanceVARCHAR sourceVARCHAR safety_checks idBIGINT dispense_idBIGINT check_typeVARCHAR severityVARCHAR conflicting_drug_…BIGINT allergy_idBIGINT outcomeVARCHAR override_reasonVARCHAR checked_by_idBIGINT checked_atTIMESTAMPTZ insurance_claims idBIGINT dispense_idBIGINT payer_nameVARCHAR bin_numberVARCHAR processor_control…VARCHAR group_numberVARCHAR member_numberVARCHAR submitted_atTIMESTAMPTZ statusVARCHAR billed_centsINTEGER paid_centsINTEGER patient_pay_centsINTEGER currency_codeCHAR rejection_codeVARCHAR counselling_records idBIGINT dispense_idBIGINT pharmacist_idBIGINT was_offeredBOOLEAN was_acceptedBOOLEAN methodVARCHAR topicsVARCHAR counselled_atTIMESTAMPTZ controlled_register idBIGINT dispense_idBIGINT drug_idBIGINT controlled_schedu…VARCHAR quantityINTEGER running_balanceINTEGER patient_identific…VARCHAR collected_byVARCHAR pharmacist_idBIGINT witness_idBIGINT recorded_atTIMESTAMPTZ

Related database schemas