From d217f816996f736c8bc21566f09976f5775924ed Mon Sep 17 00:00:00 2001 From: Andrew Bruce Date: Wed, 17 Apr 2024 03:54:32 -0700 Subject: [PATCH] moved utils to fuimus (closes #5) --- NAMESPACE | 1 - R/icd_edits.R | 32 +------------------------------- man/years_floor.Rd | 25 ------------------------- vignettes/pathologie.Rmd | 5 +++-- 4 files changed, 4 insertions(+), 59 deletions(-) delete mode 100644 man/years_floor.Rd diff --git a/NAMESPACE b/NAMESPACE index e4972b2..4909bb6 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -18,4 +18,3 @@ export(mount_board) export(remove_dot) export(search_edits) export(search_msdrg) -export(years_floor) diff --git a/R/icd_edits.R b/R/icd_edits.R index 4a55bcc..70bbbd1 100644 --- a/R/icd_edits.R +++ b/R/icd_edits.R @@ -20,8 +20,7 @@ #' @autoglobal #' #' @export -search_edits <- function(icd = NULL, - ...) { +search_edits <- function(icd = NULL, ...) { edt <- pins::pin_read(mount_board(), "code_edits") @@ -30,35 +29,6 @@ search_edits <- function(icd = NULL, return(edt) } - -#' Calculate the number of years between two dates -#' -#' @param from `` Start date -#' -#' @param to `` 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 `` ICD-10-CM Conflict Rule diff --git a/man/years_floor.Rd b/man/years_floor.Rd deleted file mode 100644 index d212557..0000000 --- a/man/years_floor.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/icd_edits.R -\name{years_floor} -\alias{years_floor} -\title{Calculate the number of years between two dates} -\usage{ -years_floor(from, to) -} -\arguments{ -\item{from}{\verb{} Start date} - -\item{to}{\verb{} End date} -} -\value{ -a \link[tibble:tibble-package]{tibble} -} -\description{ -Calculate the number of years between two dates -} -\examples{ -years_floor( - from = as.Date("2020-01-01"), - to = as.Date("2020-01-01") + 2057) - -} diff --git a/vignettes/pathologie.Rmd b/vignettes/pathologie.Rmd index 5c8cbfb..9c83d54 100644 --- a/vignettes/pathologie.Rmd +++ b/vignettes/pathologie.Rmd @@ -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) ```