Skip to content

Commit

Permalink
Amend get_boxi_extract_path function for archiving DN and CMH data (#…
Browse files Browse the repository at this point in the history
…785)

* Update `get_boxi_extract_path` for DN/CMH data

* Remove extra function

* [check-spelling] Update metadata

Update for https://github.com/Public-Health-Scotland/source-linkage-files/actions/runs/5856792420/attempts/1
Accepted in #785 (comment)

Signed-off-by: check-spelling-bot <[email protected]>

---------

Signed-off-by: check-spelling-bot <[email protected]>
Co-authored-by: Jennit07 <[email protected]>
Co-authored-by: James McMahon <[email protected]>
  • Loading branch information
3 people authored Aug 14, 2023
1 parent 19779e3 commit 7e3215d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ hjust
hms
homecare
homev
hscdiip
hscp
hscpnames
IDPC
Expand Down
11 changes: 8 additions & 3 deletions R/get_boxi_extract_path.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ get_boxi_extract_path <- function(
)) {
type <- match.arg(type)

year_dir <- get_year_dir(year, extracts_dir = TRUE)
if (type %in% c("DN", "CMH")) {
dir <- fs::path(get_slf_dir(), "Archived_data")
} else {
dir <- get_year_dir(year, extracts_dir = TRUE)
}

if (!check_year_valid(year, type)) {
return(get_dummy_boxi_extract_path())
Expand All @@ -53,11 +57,12 @@ get_boxi_extract_path <- function(
)

boxi_extract_path_csv_gz <- fs::path(
year_dir,
dir,
stringr::str_glue("{file_name}-20{year}.csv.gz")
)

boxi_extract_path_csv <- fs::path(
year_dir,
dir,
stringr::str_glue("{file_name}-20{year}.csv")
)

Expand Down

0 comments on commit 7e3215d

Please sign in to comment.