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
- this takes ~3 minutes to run (as of 2021-08-04)
- After this is done, move on to Correcting suspect links
Implementation
click expand to see implementation details |
Because MS Access SQL doesn't have functionality to compare data in a "current" to a "next" record this is implemented as an iterative process in VBA in Module linking Sub populate_linking_pairs which populates the linking_pairs table. The process considers the output of Query linking_pairs_preList, which contains records that are not in linking_pairs table, and that have more than one instance of a PHIN. After these are linked, if there are any non-sequential entries in linking pairs, these are deleted by Query linking_pairs_out_of_sequence/linking_pairs_out_of_sequence_deleter, and then their entries are recreated. That happens until all are sequential. ScenariosTwo things will make a record require a pairs update:
|