Definition
Information
Section titled “Information”The Professionalcontact Patientprofessionalcontact model records associations between patients and professional contacts, including the recorded contact type. It holds effective-from and effective-until dates with their date-part values and a current flag, alongside patient, contact and association identifiers and organisation 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”professionalcontact.patientprofessionalcontact with professionalcontact.contact, dbo.patient and professionalcontact.professionalcontacttype details
Section titled “professionalcontact.patientprofessionalcontact with professionalcontact.contact, dbo.patient and professionalcontact.professionalcontacttype details”Return records alongside descriptive values from the related tables.
SELECT m."patientprofessionalcontactid", m."contactid", p1."title" AS "contact_title", m."patientid", p2."displayname" AS "patient_displayname", m."professionalcontacttypeid", p3."professionalcontacttypename" AS "professionalcontacttypename"FROM professionalcontact.patientprofessionalcontact AS mLEFT JOIN professionalcontact.contact AS p1 ON p1."contactid" = m."contactid" AND p1."organisation" = m."organisation"LEFT JOIN dbo.patient AS p2 ON p2."patientid" = m."patientid" AND p2."organisation" = m."organisation"LEFT JOIN professionalcontact.professionalcontacttype AS p3 ON p3."professionalcontacttypeid" = m."professionalcontacttypeid" AND p3."organisation" = m."organisation";Row count by professionalcontact.contact title
Section titled “Row count by professionalcontact.contact title”Count professionalcontact.patientprofessionalcontact records for each professionalcontact.contact value, joined on contactid.
SELECT p."title" AS "contact_title", COUNT(*) AS row_countFROM professionalcontact.patientprofessionalcontact AS mINNER JOIN professionalcontact.contact AS p ON p."contactid" = m."contactid" AND p."organisation" = m."organisation"GROUP BY p."title"ORDER BY row_count DESC;Row count by dbo.patient displayname
Section titled “Row count by dbo.patient displayname”Count professionalcontact.patientprofessionalcontact records for each dbo.patient value, joined on patientid.
SELECT p."displayname" AS "patient_displayname", COUNT(*) AS row_countFROM professionalcontact.patientprofessionalcontact AS mINNER JOIN dbo.patient AS p ON p."patientid" = m."patientid" AND p."organisation" = m."organisation"GROUP BY p."displayname"ORDER BY row_count DESC;