Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix right join at #926

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions R/process_sc_all_alarms_telecare.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,24 @@
# Fix dates and create new variables
data[
,
service_end_date := fix_sc_missing_end_dates(

Check warning on line 27 in R/process_sc_all_alarms_telecare.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/process_sc_all_alarms_telecare.R,line=27,col=5,[object_usage_linter] no visible binding for global variable 'service_end_date'

Check warning on line 27 in R/process_sc_all_alarms_telecare.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/process_sc_all_alarms_telecare.R,line=27,col=5,[object_usage_linter] no visible binding for global variable 'service_end_date'
service_end_date,
period_end_date

Check warning on line 29 in R/process_sc_all_alarms_telecare.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/process_sc_all_alarms_telecare.R,line=29,col=7,[object_usage_linter] no visible binding for global variable 'period_end_date'
)
]
data[
,
service_start_date := fix_sc_start_dates(

Check warning on line 34 in R/process_sc_all_alarms_telecare.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/process_sc_all_alarms_telecare.R,line=34,col=5,[object_usage_linter] no visible binding for global variable 'service_start_date'

Check warning on line 34 in R/process_sc_all_alarms_telecare.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/process_sc_all_alarms_telecare.R,line=34,col=5,[object_usage_linter] no visible binding for global variable 'service_start_date'
service_start_date,
period_start_date

Check warning on line 36 in R/process_sc_all_alarms_telecare.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/process_sc_all_alarms_telecare.R,line=36,col=7,[object_usage_linter] no visible binding for global variable 'period_start_date'
)
]
data[
,
service_end_date := fix_sc_end_dates(

Check warning on line 41 in R/process_sc_all_alarms_telecare.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/process_sc_all_alarms_telecare.R,line=41,col=5,[object_usage_linter] no visible binding for global variable 'service_end_date'

Check warning on line 41 in R/process_sc_all_alarms_telecare.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/process_sc_all_alarms_telecare.R,line=41,col=5,[object_usage_linter] no visible binding for global variable 'service_end_date'
service_start_date,

Check warning on line 42 in R/process_sc_all_alarms_telecare.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/process_sc_all_alarms_telecare.R,line=42,col=7,[object_usage_linter] no visible binding for global variable 'service_start_date'
service_end_date,
period_end_date

Check warning on line 44 in R/process_sc_all_alarms_telecare.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/process_sc_all_alarms_telecare.R,line=44,col=7,[object_usage_linter] no visible binding for global variable 'period_end_date'
)
]

Expand Down Expand Up @@ -73,18 +73,19 @@
convert_sc_sending_location_to_lca(sending_location)
)
]

# RIGHT_JOIN with sc_demog_lookup
data <- data[sc_demog_lookup, on = .(sending_location, social_care_id)]

# Replace social_care_id with latest if needed (assuming replace_sc_id_with_latest is a custom function)
data <- replace_sc_id_with_latest(data)

data$person_id <- paste0(
data$sending_location,
"-",
data$social_care_id
)

# Join with sc_demog_lookup
data <- sc_demog_lookup[data, on = .(sending_location, social_care_id)]

# Replace social_care_id with latest if needed (assuming replace_sc_id_with_latest is a custom function)
data <- replace_sc_id_with_latest(data)

# Deal with episodes that have a package across quarters
data[, pkg_count := seq_len(.N), by = .(
sending_location,
Expand Down
Loading