Definition
Information
Section titled “Information”The Appointment Status model holds appointment status definitions, including descriptions, abbreviations and shortcut values. It also records status identifiers and a cancellation-status identifier, together with source organisation information, retaining descriptive and configuration details for the recorded statuses.
Soft-Deleted Records
Section titled “Soft-Deleted Records”_deleted indicates whether the record has been deleted in the source system.
Examples
Section titled “Examples”appointment.slotstatus count per appointment.status
Section titled “appointment.slotstatus count per appointment.status”Count related appointment.slotstatus records for each appointment.status record, joined on statusid.
SELECT m."statusid", m."description", COUNT(c."statusid") AS slotstatus_countFROM appointment.status AS mLEFT JOIN appointment.slotstatus AS c ON m."statusid" = c."statusid" AND m."organisation" = c."organisation"GROUP BY m."statusid", m."description"ORDER BY slotstatus_count DESC;appointment.slotstatus records with appointment.status details
Section titled “appointment.slotstatus records with appointment.status details”List appointment.slotstatus records with the appointment.status values they reference through statusid.
SELECT c."_primary_key", c."statusdatetime", m."statusid", m."description" AS "status_description"FROM appointment.slotstatus AS cINNER JOIN appointment.status AS m ON m."statusid" = c."statusid" AND m."organisation" = c."organisation";appointment.statusprogression count per appointment.status
Section titled “appointment.statusprogression count per appointment.status”Count related appointment.statusprogression records for each appointment.status record, joined on statusid.
SELECT m."statusid", m."description", COUNT(c."statusid") AS statusprogression_countFROM appointment.status AS mLEFT JOIN appointment.statusprogression AS c ON m."statusid" = c."statusid" AND m."organisation" = c."organisation"GROUP BY m."statusid", m."description"ORDER BY statusprogression_count DESC;