Skip to content
Partner Developer Portal

Definition

The Appointment Linkedslot model records appointment slot linkage information. Each entry contains a slot identifier, a linked-slot identifier and a link-type identifier, together with source organisation information describing the organisational context of the recorded slot linkage.

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

appointment.linkedslot with appointment.linkedslottype and appointment.slot details

Section titled “appointment.linkedslot with appointment.linkedslottype and appointment.slot details”

Return records alongside descriptive values from the related tables.

SELECT
m."linkedslotid",
m."linkedslottypeid",
p1."description" AS "linkedslottype_description",
m."slotid",
p2."patientname" AS "slot_patientname"
FROM appointment.linkedslot AS m
LEFT JOIN appointment.linkedslottype AS p1
ON p1."linkedslottypeid" = m."linkedslottypeid"
AND p1."organisation" = m."organisation"
LEFT JOIN appointment.slot AS p2
ON p2."slotid" = m."slotid"
AND p2."organisation" = m."organisation";

Row count by appointment.linkedslottype description

Section titled “Row count by appointment.linkedslottype description”

Count appointment.linkedslot records for each appointment.linkedslottype value, joined on linkedslottypeid.

SELECT
p."description" AS "linkedslottype_description",
COUNT(*) AS row_count
FROM appointment.linkedslot AS m
INNER JOIN appointment.linkedslottype AS p
ON p."linkedslottypeid" = m."linkedslottypeid"
AND p."organisation" = m."organisation"
GROUP BY p."description"
ORDER BY row_count DESC;

Count appointment.linkedslot records for each appointment.slot value, joined on slotid.

SELECT
p."patientname" AS "slot_patientname",
COUNT(*) AS row_count
FROM appointment.linkedslot AS m
INNER JOIN appointment.slot AS p
ON p."slotid" = m."slotid"
AND p."organisation" = m."organisation"
GROUP BY p."patientname"
ORDER BY row_count DESC;