Skip to content

Commit

Permalink
moved utils to fuimus (closes #5)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewallenbruce committed Apr 17, 2024
1 parent 5802e79 commit d217f81
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 59 deletions.
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ export(mount_board)
export(remove_dot)
export(search_edits)
export(search_msdrg)
export(years_floor)
32 changes: 1 addition & 31 deletions R/icd_edits.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
#' @autoglobal
#'
#' @export
search_edits <- function(icd = NULL,
...) {
search_edits <- function(icd = NULL, ...) {

edt <- pins::pin_read(mount_board(), "code_edits")

Expand All @@ -30,35 +29,6 @@ search_edits <- function(icd = NULL,
return(edt)
}


#' Calculate the number of years between two dates
#'
#' @param from `<date>` Start date
#'
#' @param to `<date>` End date
#'
#' @template returns
#'
#' @examples
#' years_floor(
#' from = as.Date("2020-01-01"),
#' to = as.Date("2020-01-01") + 2057)
#'
#' @autoglobal
#'
#' @export
years_floor <- function(from, to) {
floor(
as.integer(
difftime(
to,
from,
units = "weeks",
tz = "UTC"
)
) / 52.17857)
}

#' Apply Age Conflict Edits
#'
#' @param rule `<chr>` ICD-10-CM Conflict Rule
Expand Down
25 changes: 0 additions & 25 deletions man/years_floor.Rd

This file was deleted.

5 changes: 3 additions & 2 deletions vignettes/pathologie.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,10 @@ ex_data() |>
dplyr::mutate(conflict = apply_age_edits(rule = icd_conflict_rule,
age = patient_age)) |>
dplyr::filter(!is.na(conflict)) |>
dplyr::select(-icd_conflict_group, -conflict) |>
dplyr::select(-icd_conflict_group) |>
gt(groupname_col = "icd_conflict_rule",
row_group_as_column = TRUE) |>
gt_style()
gt_style() |>
tab_options(column_labels.hidden = FALSE)
```

0 comments on commit d217f81

Please sign in to comment.