-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add stored procedure to ensure RTC date is set
- Loading branch information
Showing
2 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-- Theoretically, this procedure should not be necessary but, for whatever reason, the model | ||
-- update doesn't always add the expected RTC date, so we add it here. | ||
drop procedure if exists update_encounter_rtc_dates_v1_0; | ||
create definer = analytics procedure predictions.update_encounter_rtc_dates_v1_0() | ||
begin | ||
update predictions.ml_weekly_predictions mp | ||
left join etl.flat_hiv_summary_v15b fs_next | ||
on mlp.encounter_id = fs.encounter_id | ||
set mlp.rtc_date = fs.rtc_date | ||
where mlp.rtc_date is null; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters