Definition
Information
Section titled “Information”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.
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.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 mLEFT 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_countFROM appointment.linkedslot AS mINNER JOIN appointment.linkedslottype AS p ON p."linkedslottypeid" = m."linkedslottypeid" AND p."organisation" = m."organisation"GROUP BY p."description"ORDER BY row_count DESC;Row count by appointment.slot patientname
Section titled “Row count by appointment.slot patientname”Count appointment.linkedslot records for each appointment.slot value, joined on slotid.
SELECT p."patientname" AS "slot_patientname", COUNT(*) AS row_countFROM appointment.linkedslot AS mINNER JOIN appointment.slot AS p ON p."slotid" = m."slotid" AND p."organisation" = m."organisation"GROUP BY p."patientname"ORDER BY row_count DESC;