# \donttest{
# Download mapping file
dx_map <- download_ccsr("diagnosis")
# Create sample data
sample_data <- tibble::tibble(
patient_id = 1:3,
icd10_code = c("E11.9", "I10", "M79.3")
)
# Map codes (long format - default)
mapped_long <- ccsr_map(
data = sample_data,
code_col = "icd10_code",
map_df = dx_map
)
# Map codes (wide format)
mapped_wide <- ccsr_map(
data = sample_data,
code_col = "icd10_code",
map_df = dx_map,
output_format = "wide"
)
# Map codes (default category only)
mapped_default <- ccsr_map(
data = sample_data,
code_col = "icd10_code",
map_df = dx_map,
default_only = TRUE
)
# }
Run the code above in your browser using DataLab