Definition
Overview
Section titled “Overview”mart_dmr is a warehouse model for Discharge Medicines Review (DMR) records. Each row represents a DMR eligibility criterion associated with a DMR entry, capturing the review lifecycle (consent, part completion dates, contact attempts, cancellation), pharmacy and patient context, and claimability status. Duplicate records are filtered from the mart and routed to the quarantine model.
Key Data Fields
Section titled “Key Data Fields”| Field | Description |
|---|---|
| dmr_id | Primary identifier for the DMR entry. |
| eligibility_criterium_id | Identifier for the eligibility criterion associated with the DMR. |
| description | Description of the eligibility criterion. |
| date_added | Date the DMR was added. |
| date_part_1_completed | Date and time when DMR Part 1 was completed. |
| date_part_2_completed | Date and time when DMR Part 2 was completed. |
| consent_status_description | Patient consent status (for example No, Yes to GP only, Yes to GP and NHS/LHB). |
| is_claimable | Whether the DMR record meets the criteria for a claim. |
Source
Section titled “Source”The lineage for this model is: proscript_connect DMR, patient, pharmacist, and pharmacy source tables -> stg_dmr, stg_pharmacist, mart_patient, active_pharmacy, and dmr_eligibility_criterium -> dmr -> mart_dmr.
The upstream dmr control model joins stg_dmr to mart_patient and active_pharmacy for patient and pharmacy context, to stg_pharmacist for the pharmacist full name, and to the dmr_eligibility_criterium intermediary model to expand one row per eligibility criterion per DMR.
mart_dmr is materialized as incremental with merge strategy and unique key (organisation, dmr_id, eligibility_criterium_id, description). 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.