Skip to content
Partner Developer Portal

Definition

The Dbo Patientidentifier model holds identifier values recorded for patients. Each entry keeps a patient identifier, identifier-type identifier and identifier value together, alongside the organisation information recorded for that entry, describing the value and its recorded type for the patient.

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

dbo.patientidentifier with dbo.patient and dbo.patientidentifiertype details

Section titled “dbo.patientidentifier with dbo.patient and dbo.patientidentifiertype details”

Return records alongside descriptive values from the related tables.

SELECT
m."_primary_key",
m."patientid",
p1."displayname" AS "patient_displayname",
m."patientidentifiertypeid",
p2."description" AS "patientidentifiertype_description"
FROM dbo.patientidentifier AS m
LEFT JOIN dbo.patient AS p1
ON p1."patientid" = m."patientid"
AND p1."organisation" = m."organisation"
LEFT JOIN dbo.patientidentifiertype AS p2
ON p2."patientidentifiertypeid" = m."patientidentifiertypeid"
AND p2."organisation" = m."organisation";

Count dbo.patientidentifier records for each dbo.patient value, joined on patientid.

SELECT
p."displayname" AS "patient_displayname",
COUNT(*) AS row_count
FROM dbo.patientidentifier AS m
INNER JOIN dbo.patient AS p
ON p."patientid" = m."patientid"
AND p."organisation" = m."organisation"
GROUP BY p."displayname"
ORDER BY row_count DESC;

Row count by dbo.patientidentifiertype description

Section titled “Row count by dbo.patientidentifiertype description”

Count dbo.patientidentifier records for each dbo.patientidentifiertype value, joined on patientidentifiertypeid.

SELECT
p."description" AS "patientidentifiertype_description",
COUNT(*) AS row_count
FROM dbo.patientidentifier AS m
INNER JOIN dbo.patientidentifiertype AS p
ON p."patientidentifiertypeid" = m."patientidentifiertypeid"
AND p."organisation" = m."organisation"
GROUP BY p."description"
ORDER BY row_count DESC;