Definition
Information
Section titled “Information”The Dbo Patientadditionaladdress model records additional address associations for patients, including address-type and secondary-address-type identifiers. It holds effective-from and effective-to dates with their date-part values, correspondence and legacy-data flags and notes, together with patient, address and association identifiers.
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.patientadditionaladdress with dbo.address, dbo.addresstype and dbo.patient details
Section titled “dbo.patientadditionaladdress with dbo.address, dbo.addresstype and dbo.patient details”Return records alongside descriptive values from the related tables.
SELECT m."patientadditionaladdressid", m."addressid", p1."countrycode" AS "address_countrycode", m."addresstypeid", p2."addresstypedescription" AS "addresstypedescription", m."patientid", p3."displayname" AS "patient_displayname"FROM dbo.patientadditionaladdress AS mLEFT JOIN dbo.address AS p1 ON p1."addressid" = m."addressid" AND p1."organisation" = m."organisation"LEFT JOIN dbo.addresstype AS p2 ON p2."addresstypeid" = m."addresstypeid" AND p2."organisation" = m."organisation"LEFT JOIN dbo.patient AS p3 ON p3."patientid" = m."patientid" AND p3."organisation" = m."organisation";Row count by dbo.address countrycode
Section titled “Row count by dbo.address countrycode”Count dbo.patientadditionaladdress records for each dbo.address value, joined on addressid.
SELECT p."countrycode" AS "address_countrycode", COUNT(*) AS row_countFROM dbo.patientadditionaladdress AS mINNER JOIN dbo.address AS p ON p."addressid" = m."addressid" AND p."organisation" = m."organisation"GROUP BY p."countrycode"ORDER BY row_count DESC;Row count by dbo.addresstype addresstypedescription
Section titled “Row count by dbo.addresstype addresstypedescription”Count dbo.patientadditionaladdress records for each dbo.addresstype value, joined on addresstypeid.
SELECT p."addresstypedescription" AS "addresstypedescription", COUNT(*) AS row_countFROM dbo.patientadditionaladdress AS mINNER JOIN dbo.addresstype AS p ON p."addresstypeid" = m."addresstypeid" AND p."organisation" = m."organisation"GROUP BY p."addresstypedescription"ORDER BY row_count DESC;