Definition
Overview
Section titled “Overview”mart_mds is a warehouse model for Monitored Dosage System (MDS) activity at patient-item level. It combines patient, pharmacy, nursing home, and product context to support operational reporting on MDS medicines and dispensing timelines. Duplicate records are filtered from the mart and routed to the quarantine model.
Key Data Fields
Section titled “Key Data Fields”| Field | Description |
|---|---|
| mds_item_id | Primary identifier for each MDS item record. |
| patient_full_name | Formatted patient name used for operational review. |
| nursing_home_name | Name of the nursing home linked to the patient where applicable. |
| nursing_home_type | Category of nursing home associated with the patient. |
| dispensed_date | Date and time when the matching item was dispensed. |
| product_name | Product description for the dispensed pack. |
| quantity | Quantity recorded for the MDS item. |
| pharmacy_name | Pharmacy name for the organisation that owns the record. |
Source
Section titled “Source”The lineage for this model is: proscript_connect MDS, prescription, patient, nursing home, pharmacy, and PKB pack source tables -> stg_mds_item, stg_prescription, stg_prescription_item, stg_prescription_item_dispensed, stg_pharmacy_patient, stg_nursing_home, stg_nursing_home_type, active_pharmacy, and dim_product_pack -> mds -> mart_mds.
mart_mds is materialized as incremental with merge strategy and unique key (organisation, mds_item_id). Incremental updates are driven by the mart incremental filter and row hash comparison (row_id), so changed or new records are inserted or updated while unchanged rows are skipped.