Skip to content
Partner Developer Portal

Definition

mart_nms contains New Medicine Service records at the NMS event level, including patient context, prescribed item groups, and stage progression across engagement, intervention, and follow-up. It combines stage flags, attendance outcomes, and derived status fields to support operational and performance analysis of NMS delivery. Duplicate records are filtered from the mart and routed to the quarantine model.

Field Description
nms_id Auto incrementing primary key for the NMS record.
date_nms_added Date and time when the NMS record was added.
nms_item_name Aggregated list of NMS preparation names linked to the record.
nms_status Overall NMS lifecycle status derived from decline, escape, deletion, and stage completion logic.
nms_intervention_status Derived intervention-stage status including claimability outcomes.
nms_followup_status Derived follow-up-stage status including claimability outcomes.
date_exited Date and time when the NMS pathway was exited.
drug_given_previously_status_id Status identifier used in intervention and follow-up claimability logic.

The lineage for this model is:

ProScript Connect NMS source tables -> stg_nms, stg_nms_drug, stg_nms_not_attended_reason, stg_appointment_session_nms, stg_pharmacy_patient, stg_patient_identifier, stg_patient_contact, stg_pharmacist -> dim_preparation and active_pharmacy -> nms -> mart_nms.

mart_nms is materialized as incremental with merge strategy and unique key (organisation, nms_id). Incremental updates are driven by the mart incremental filter and row hash comparison (row_id), so changed or new rows are inserted or updated while unchanged rows are skipped.