Skip to content
Partner Developer Portal

Definition

The Appointment Bookingmethod model holds descriptions of appointment booking methods. Each entry records a method identifier, its description and source organisation information.

_deleted indicates whether the record has been deleted in the source system.

appointment.slot count per appointment.bookingmethod

Section titled “appointment.slot count per appointment.bookingmethod”

Count related appointment.slot records for each appointment.bookingmethod record, joined on bookingmethodid.

:::caution[Unverified join] This join is inferred from matching column names and is not part of the documented relationships. Check the results before relying on it. :::

SELECT
m."methodid",
m."methoddescription",
COUNT(c."bookingmethodid") AS slot_count
FROM appointment.bookingmethod AS m
LEFT JOIN appointment.slot AS c
ON m."methodid" = c."bookingmethodid"
AND m."organisation" = c."organisation"
GROUP BY m."methodid", m."methoddescription"
ORDER BY slot_count DESC;

appointment.slot records with appointment.bookingmethod details

Section titled “appointment.slot records with appointment.bookingmethod details”

List appointment.slot records with the appointment.bookingmethod values they reference through bookingmethodid.

:::caution[Unverified join] This join is inferred from matching column names and is not part of the documented relationships. Check the results before relying on it. :::

SELECT
c."slotid",
c."enddatetime",
m."methodid",
m."methoddescription" AS "bookingmethod_methoddescription"
FROM appointment.slot AS c
INNER JOIN appointment.bookingmethod AS m
ON m."methodid" = c."bookingmethodid"
AND m."organisation" = c."organisation";

appointment.slothistory count per appointment.bookingmethod

Section titled “appointment.slothistory count per appointment.bookingmethod”

Count related appointment.slothistory records for each appointment.bookingmethod record, joined on bookingmethodid.

:::caution[Unverified join] This join is inferred from matching column names and is not part of the documented relationships. Check the results before relying on it. :::

SELECT
m."methodid",
m."methoddescription",
COUNT(c."bookingmethodid") AS slothistory_count
FROM appointment.bookingmethod AS m
LEFT JOIN appointment.slothistory AS c
ON m."methodid" = c."bookingmethodid"
AND m."organisation" = c."organisation"
GROUP BY m."methodid", m."methoddescription"
ORDER BY slothistory_count DESC;