Populate linking pairs
As part of vetting CFE needs to pair up any records for the consecutive/continuous admission of a patient.
Instructions
- be sure you have completed Pre-linking checks
- click the "populate linking_pairs" button on the main screen
- 2019-Feb-07: NOTE: takes ~08 minutes to run
- After this is done, move on to Correcting suspect links
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.