Skip to content
Partner Developer Portal

Definition

mart_attendance_register is a warehouse model for pharmacy pharmacist attendance sign-in and sign-out records. It captures both user-editable and system-recorded sign times, resolved pharmacist name, and pharmacy context for each attendance entry. Duplicate records are filtered from the mart and routed to the quarantine model.

FieldDescription
attendance_register_idPrimary identifier for the attendance register entry.
attendance_dateThe date when the attendance log entry was recorded.
pharmacist_nameConcatenated pharmacist forename and surname.
pharmacist_registration_numberThe pharmacist’s registration number.
psc_time_signed_inUser-editable time when the pharmacist signed in.
system_time_signed_inSystem-recorded time when the pharmacist signed in.
psc_time_signed_outUser-editable time when the pharmacist signed out.
system_time_signed_outSystem-recorded time when the pharmacist signed out.

The lineage for this model is: proscript_connect.attendanceregister_attendanceregister -> stg_attendance_register, stg_attendance_register_edit, and active_pharmacy -> attendance_register -> mart_attendance_register.

The upstream attendance_register control model joins stg_attendance_register to active_pharmacy on pharmacy_id and organisation, and left joins stg_attendance_register_edit to resolve the latest user-edited sign times via COALESCE.

mart_attendance_register is materialized as incremental with merge strategy and unique key (organisation, attendance_register_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.