Definition
Overview
Section titled “Overview”mart_rds is a warehouse mart for Remote Dispensing System activity in Community Pharmacy. It captures order and order-item level events with dispensing/check workflow detail, patient context, and quantities ordered versus received. Duplicate records are filtered from the mart and routed to the quarantine model.
Key Data Fields
Section titled “Key Data Fields”| Field | Description |
|---|---|
| ods_order_id | Identifier for the RDS order. |
| ods_order_item_id | Identifier for the RDS order item within an order. |
| local_dispense | Indicates whether the item was dispensed locally. |
| item_status_reason | Status reason recorded for the order item. |
| action_description | Description of the latest relevant action for the order item. |
| quantity_ordered | Quantity requested for the order item. |
| quantity_received | Quantity confirmed as received from the service response. |
| date_accuracy_checked | Timestamp when the order item accuracy check was completed. |
Source
Section titled “Source”The lineage for this model is: psc RDS order and order item source tables -> staging RDS/prescribing/patient/user models -> rds -> mart_rds.
The upstream control model joins stg_rds_ods_order, stg_rds_ods_order_item, stg_rds_ods_order_item_action, stg_rds_ods_order_item_status, stg_rds_ods_order_item_tote, stg_prescription, stg_prescription_item, stg_pharmacy_patient, stg_pharmacy_user, stg_pharmacy_user_in_role, stg_pharmacist, and active_pharmacy to produce enriched RDS rows.
mart_rds is materialized as incremental with merge strategy and unique key (organisation, ods_order_id, ods_order_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.