Populate linking pairs: Difference between revisions

From CCMDB Wiki
Jump to navigation Jump to search
mNo edit summary
Line 20: Line 20:
{{Related Articles}}
{{Related Articles}}


[[Category: Data Processing]]
[[Category:Data Processing]]
[[Category: Multiple encounter longitudinal consistency check|*]]
[[Category:Multiple encounter longitudinal consistency check|*]]
[[Category:Multiple Encounter linking]]

Revision as of 15:57, 2021 July 27

As part of vetting CFE needs to pair up any records for the consecutive/continuous admission of a patient.

Instructions

Implementation

Because MS Access doesn't have functionality to compare data in a "current" to a "next" record this is implemented as an iterative process in Module linking Sub populate_linking_pairs which populates the linking_pairs table.

The process considers the output of

SELECT L_PHI.PHIN, L_Log.Arrive_DtTm, L_Log.D_ID, IIf(Not IsNull([accept_dttm]),[accept_dttm],[arrive_dttm]) AS adm
FROM L_Log INNER JOIN L_PHI ON L_Log.D_ID = L_PHI.D_ID
ORDER BY L_PHI.PHIN, IIf(Not IsNull([accept_dttm]),[accept_dttm],[arrive_dttm]);

For any line that has the same PHIN as the previous line it generates a record in linking_pairs table of the two D_IDs.

Related articles

Related articles: