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.

FieldDescription
nms_idAuto incrementing primary key for the NMS record.
date_nms_addedDate and time when the NMS record was added.
nms_item_nameAggregated list of NMS preparation names linked to the record.
nms_statusOverall NMS lifecycle status derived from decline, escape, deletion, and stage completion logic.
nms_intervention_statusDerived intervention-stage status including claimability outcomes.
nms_followup_statusDerived follow-up-stage status including claimability outcomes.
date_exitedDate and time when the NMS pathway was exited.
drug_given_previously_status_idStatus 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.