Public-Health-Scotland / source-linkage-files

This repo is for the syntax used for the PHS Source Linkage File project
https://public-health-scotland.github.io/source-linkage-files/
Other
4 stars 2 forks source link

this join_by is not 100% accurate. Consider use ep_file_row_id to join #998

Closed github-actions[bot] closed 1 month ago

github-actions[bot] commented 2 months ago

https://github.com/Public-Health-Scotland/source-linkage-files/blob/bd01b2839561a4978c0a7a91d4974bff6ec0c8af/R/add_activity_after_death_flag.R#L87


  final_data <- data %>%
    dplyr::left_join(
      flag_data,
      # TODO: this join_by is not 100% accurate. Consider use ep_file_row_id to join
      by = c("year", "chi", "record_keydate1", "record_keydate2"),
      na_matches = "never"
    ) %>%
    dplyr::mutate(death_date = lubridate::as_date(ifelse(is.na(death_date) & !(is.na(death_date_boxi)),
      death_date_boxi, death_date
    ))) %>%
    dplyr::select(-death_date_boxi) %>%
    dplyr::distinct(ep_file_row_id, .keep_all = TRUE)
github-actions[bot] commented 1 month ago

Closed in 7190e313c09965c7b1609c7bf8b4efd1881fac08.

github-actions[bot] commented 1 month ago

Closed in ffa3d0c6028a92cab628772c00368f82eb054383.