| 72 | |
| 73 | == Receive Process |
| 74 | |
| 75 | Again uses the database {{{DWPATMATCH}}}. |
| 76 | |
| 77 | 1. Copy results in the processed file into {{{DBS_NNITS_RESULTS}}} table. |
| 78 | 1. Run the stored procedure {{{USP_UPDATE_DBS_TRACING_FILES_RECEIVED}}} to log that the file has been received. |
| 79 | 1. Run the stored procedure {{{USP_UPDATE_IDS_MERGES_DBS_TRACING}}}, which updates the S Number and sets a merged flag on the {{{DBS_TRACING}}} table if the S number used on the {{{DBS_TRACING}}} table has been merged into another S number. |
| 80 | 1. Run {{{USP_UPDATE_DEATHS_DBS_TRACING}}}, which updates the death indicator on the {{{DBS_TRACING}}} table if necessary. |
| 81 | 1. Run {{{USP_UPDATE_DEMOGRAPHICS_FROM_PMI_TO_DBS_TRACING}}} which updates the name and address fields on the {{{DBS_TRACING}}} table from UHL demographics and sets flags on the {{{DBS_TRACING}}} table if they are different than before. |
| 82 | 1. Runs {{{USP_UPDATE_DEMOGRAPHICS_FROM_NSTS_TO_DBS_TRACING}}} which updates the DBS_... name and address fields on the {{{DBS_TRACING}}} table from the {{{DBS_NNITS_RESULTS}}} table and sets a flag if they are different from the existing ones. |
| 83 | 1. Runs {{{USP_UPDATE_INPATIENTS_DBS_TRACING}}} which sets the flags to indicate if the patient has an upcoming or has had a recent in patient appointment. |
| 84 | 1. Run {{{USP_UPDATE_AE_DBS_TRACING}}} which sets the flags to say if the patient is currently or has recently been in A&E. |
| 85 | 1. Run {{{USP_UPDATE_OUTPATIENTS_DBS_TRACING}}} which sets the flag if the patient has had a recent output appointment. |
| 86 | 1. Run {{{USP_UPDATE_FUTURE_OUTPATIENTS_DBS_TRACING}}} which sets the flag if the patient has an upcoming out-patient appointment and records some details of it. |
| 87 | 1. Create the output Excel files. |