Definition
Information
Section titled “Information”The Dbo Organisation model holds organisation identity, naming, classification and administrative configuration information. It records national practice and system identifiers, parent-organisation details, opening and closing dates and settings concerning patients, users, referrals, appointments and sharing. It also holds contract, backup and update information.
Soft-Deleted Records
Section titled “Soft-Deleted Records”_deleted indicates whether the record has been deleted in the source system.
Examples
Section titled “Examples”dbo.organisation with dbo.organisationtype details
Section titled “dbo.organisation with dbo.organisationtype details”Return records alongside descriptive values from the related dbo.organisationtype record.
SELECT m."organisationid", m."organisationtypeid", p1."organisationtypedescription" AS "organisationtypedescription"FROM dbo.organisation AS mLEFT JOIN dbo.organisationtype AS p1 ON p1."organisationtypeid" = m."organisationtypeid" AND p1."organisation" = m."organisation";admin.globaluserinrole count per dbo.organisation
Section titled “admin.globaluserinrole count per dbo.organisation”Count related admin.globaluserinrole records for each dbo.organisation record, joined on organisationid.
SELECT m."organisationid", m."organisationdisplayname", COUNT(c."organisationid") AS globaluserinrole_countFROM dbo.organisation AS mLEFT JOIN admin.globaluserinrole AS c ON m."organisationid" = c."organisationid" AND m."organisation" = c."organisation"GROUP BY m."organisationid", m."organisationdisplayname"ORDER BY globaluserinrole_count DESC;Row count by dbo.organisationtype organisationtypedescription
Section titled “Row count by dbo.organisationtype organisationtypedescription”Count dbo.organisation records for each dbo.organisationtype value, joined on organisationtypeid.
SELECT p."organisationtypedescription" AS "organisationtypedescription", COUNT(*) AS row_countFROM dbo.organisation AS mINNER JOIN dbo.organisationtype AS p ON p."organisationtypeid" = m."organisationtypeid" AND p."organisation" = m."organisation"GROUP BY p."organisationtypedescription"ORDER BY row_count DESC;