Skip to content
Partner Developer Portal

Definition

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.

FieldDescription
dmr_idPrimary identifier for the DMR entry.
eligibility_criterium_idIdentifier for the eligibility criterion associated with the DMR.
descriptionDescription of the eligibility criterion.
date_addedDate the DMR was added.
date_part_1_completedDate and time when DMR Part 1 was completed.
date_part_2_completedDate and time when DMR Part 2 was completed.
consent_status_descriptionPatient consent status (for example No, Yes to GP only, Yes to GP and NHS/LHB).
is_claimableWhether the DMR record meets the criteria for a claim.

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.