Skip to content
Partner Developer Portal

Definition

The Appointment Assignmentlistpatientscheduleslot model links assignment-list patient schedule entries with appointment slots. Each record stores the identifiers of the patient schedule entry and slot involved, together with source organisation information describing the organisational context of the recorded association.

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

appointment.assignmentlistpatientscheduleslot with appointment.assignmentlistpatientschedule and appointment.slot details

Section titled “appointment.assignmentlistpatientscheduleslot with appointment.assignmentlistpatientschedule and appointment.slot details”

Return records alongside descriptive values from the related tables.

SELECT
m."_primary_key",
m."assignmentlistpatientscheduleid",
p1."assignmentlistpatientscheduledeferredto" AS "assignmentlistpatientscheduledeferredto",
m."slotid",
p2."patientname" AS "slot_patientname"
FROM appointment.assignmentlistpatientscheduleslot AS m
LEFT JOIN appointment.assignmentlistpatientschedule AS p1
ON p1."assignmentlistpatientscheduleid" = m."assignmentlistpatientscheduleid"
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.assignmentlistpatientschedule assignmentlistpatientscheduledeferredto

Section titled “Row count by appointment.assignmentlistpatientschedule assignmentlistpatientscheduledeferredto”

Count appointment.assignmentlistpatientscheduleslot records for each appointment.assignmentlistpatientschedule value, joined on assignmentlistpatientscheduleid.

SELECT
p."assignmentlistpatientscheduledeferredto" AS "assignmentlistpatientscheduledeferredto",
COUNT(*) AS row_count
FROM appointment.assignmentlistpatientscheduleslot AS m
INNER JOIN appointment.assignmentlistpatientschedule AS p
ON p."assignmentlistpatientscheduleid" = m."assignmentlistpatientscheduleid"
AND p."organisation" = m."organisation"
GROUP BY p."assignmentlistpatientscheduledeferredto"
ORDER BY row_count DESC;

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

SELECT
p."patientname" AS "slot_patientname",
COUNT(*) AS row_count
FROM appointment.assignmentlistpatientscheduleslot 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;