Skip to content

translate pccc to a snomed concept ids #27

@wibeasley

Description

@wibeasley

@onaqvi11 here is the code we sketched out in today's meeting

pattern <- "^dx\\d{1,2}$"

pccc::pccc_icd10_dataset |> 
  dplyr::mutate(
    dplyr::across(tidyselect::everything(), \(x) as.character(x))
  ) |> 
  tidyr::pivot_longer(
    cols = -"id",
    values_drop_na = TRUE
    # values_ptypes = character()
  ) |> 
  dplyr::filter(grepl(pattern, name)) |> 
  dplyr::mutate(
    icd_code = paste0(substr(value, 1, 3), ".", substr(value, 4, nchar(value))),
  ) |> 
  dplyr::select(
    icd_code,
  ) |> 
  dplyr::arrange(icd_code)
# A tibble: 7,973 × 1
   icd_code 
   <chr> 
 1 A01.01
 2 A01.04
 3 A01.09
 4 A01.3 
 5 A03.1 
 6 A03.3 
 7 A04.4 
 8 A04.5 
 9 A05.5 
10 A06.5 
# ℹ 7,963 more rows
# ℹ Use `print(n = ...)` to see more rows

source:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions