Definition
Information
Section titled “Information”The Episodemanagement Patientpathway model records patient associations with care pathways. It holds patient and care-pathway identifiers, patient-pathway identifiers and a legacy-episode identifier, together with source organisation information describing the pathway association and legacy episode information recorded for the patient.
Soft-Deleted Records
Section titled “Soft-Deleted Records”_deleted indicates whether the record has been deleted in the source system.
Examples
Section titled “Examples”episodemanagement.patientpathway with episodemanagement.carepathway and dbo.patient details
Section titled “episodemanagement.patientpathway with episodemanagement.carepathway and dbo.patient details”Return records alongside descriptive values from the related tables.
SELECT m."patientpathwayid", m."carepathwayid", p1."pathwayname" AS "carepathway_pathwayname", m."patientid", p2."displayname" AS "patient_displayname"FROM episodemanagement.patientpathway AS mLEFT JOIN episodemanagement.carepathway AS p1 ON p1."carepathwayid" = m."carepathwayid" AND p1."organisation" = m."organisation"LEFT JOIN dbo.patient AS p2 ON p2."patientid" = m."patientid" AND p2."organisation" = m."organisation";episodemanagement.referralepisode count per episodemanagement.patientpathway
Section titled “episodemanagement.referralepisode count per episodemanagement.patientpathway”Count related episodemanagement.referralepisode records for each episodemanagement.patientpathway record, joined on patientpathwayid.
SELECT m."patientpathwayid", COUNT(c."patientpathwayid") AS referralepisode_countFROM episodemanagement.patientpathway AS mLEFT JOIN episodemanagement.referralepisode AS c ON m."patientpathwayid" = c."patientpathwayid" AND m."organisation" = c."organisation"GROUP BY m."patientpathwayid"ORDER BY referralepisode_count DESC;Row count by episodemanagement.carepathway pathwayname
Section titled “Row count by episodemanagement.carepathway pathwayname”Count episodemanagement.patientpathway records for each episodemanagement.carepathway value, joined on carepathwayid.
SELECT p."pathwayname" AS "carepathway_pathwayname", COUNT(*) AS row_countFROM episodemanagement.patientpathway AS mINNER JOIN episodemanagement.carepathway AS p ON p."carepathwayid" = m."carepathwayid" AND p."organisation" = m."organisation"GROUP BY p."pathwayname"ORDER BY row_count DESC;