Definition
Overview
Section titled “Overview”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.
Key Data Fields
Section titled “Key Data Fields”| Field | Description |
|---|---|
| attendance_register_id | Primary identifier for the attendance register entry. |
| attendance_date | The date when the attendance log entry was recorded. |
| pharmacist_name | Concatenated pharmacist forename and surname. |
| pharmacist_registration_number | The pharmacist’s registration number. |
| psc_time_signed_in | User-editable time when the pharmacist signed in. |
| system_time_signed_in | System-recorded time when the pharmacist signed in. |
| psc_time_signed_out | User-editable time when the pharmacist signed out. |
| system_time_signed_out | System-recorded time when the pharmacist signed out. |
Source
Section titled “Source”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.