Definition
The Drug Record model captures medication prescribing records at patient level, including prescribing details, issue cadence, quantities, and lifecycle status. Multiple issue records can be created from a single drug record for repeat prescriptions.
Constraints and Notes
Section titled “Constraints and Notes”Soft deletion: Whenis_deletedis true, data fields will be nullified in upstream transformations and should be excluded from most analytical queries. Primary keys and foreign keys to patient data are preserved so deleted records and their relationships can still be identified. Foreign keys to coding tables are nullified as the coded information is no longer valid.dmd_product_code_idis resolved fromcode_idand may beNULLif no matching concept exists.
Examples
Section titled “Examples”Find active medication records
Section titled “Find active medication records”SELECT drug_record_id, patient_id, code_id, effective_datetime, review_dateFROM explorer_open_safely.medication_drug_recordWHERE is_deleted = FALSEORDER BY effective_datetime DESCFind records due for review
Section titled “Find records due for review”SELECT drug_record_id, patient_id, dosage, review_date, organisationFROM explorer_open_safely.medication_drug_recordWHERE review_date <= CURRENT_DATE AND is_deleted = FALSEORDER BY review_date ASC