Definition
Information
Section titled “Information”The Bedmanagement Wardgraphiclocation model records graphical placement information for ward items. It holds horizontal and vertical location values and an angle in degrees, alongside ward, item-type and graphical-location identifiers, together with source organisation information describing the recorded placement’s context.
Soft-Deleted Records
Section titled “Soft-Deleted Records”_deleted indicates whether the record has been deleted in the source system.
Examples
Section titled “Examples”bedmanagement.wardgraphiclocation with bedmanagement.ward and bedmanagement.warditemtype details
Section titled “bedmanagement.wardgraphiclocation with bedmanagement.ward and bedmanagement.warditemtype details”Return records alongside descriptive values from the related tables.
SELECT m."wardgraphiclocationid", m."wardid", p1."warddisplayname" AS "warddisplayname", m."warditemtypeid", p2."description" AS "warditemtype_description"FROM bedmanagement.wardgraphiclocation AS mLEFT JOIN bedmanagement.ward AS p1 ON p1."wardid" = m."wardid" AND p1."organisation" = m."organisation"LEFT JOIN bedmanagement.warditemtype AS p2 ON p2."warditemtypeid" = m."warditemtypeid" AND p2."organisation" = m."organisation";bedmanagement.bed count per bedmanagement.wardgraphiclocation
Section titled “bedmanagement.bed count per bedmanagement.wardgraphiclocation”Count related bedmanagement.bed records for each bedmanagement.wardgraphiclocation record, joined on wardgraphiclocationid.
SELECT m."wardgraphiclocationid", m."angledegrees", COUNT(c."wardgraphiclocationid") AS bed_countFROM bedmanagement.wardgraphiclocation AS mLEFT JOIN bedmanagement.bed AS c ON m."wardgraphiclocationid" = c."wardgraphiclocationid" AND m."organisation" = c."organisation"GROUP BY m."wardgraphiclocationid", m."angledegrees"ORDER BY bed_count DESC;Row count by bedmanagement.ward warddisplayname
Section titled “Row count by bedmanagement.ward warddisplayname”Count bedmanagement.wardgraphiclocation records for each bedmanagement.ward value, joined on wardid.
SELECT p."warddisplayname" AS "warddisplayname", COUNT(*) AS row_countFROM bedmanagement.wardgraphiclocation AS mINNER JOIN bedmanagement.ward AS p ON p."wardid" = m."wardid" AND p."organisation" = m."organisation"GROUP BY p."warddisplayname"ORDER BY row_count DESC;