parse_ids: Parse IDs from a string of delimited list of values.

View source: R/parse_ids.R

parse_idsR Documentation

Parse IDs from a string of delimited list of values.

Description

Creates columns corresponding to MRNs in the string of delimited list of values. If the string and the numeric part of the MRN are present in the same column, then supply the column to str. If the string portion and the numeric portion is in different columns, then supply the string part to str and the numeric part to num.

Usage

parse_ids(
  str,
  num = NULL,
  sep = ":",
  id_length = "standard",
  perc = 0.6,
  nThread = parallel::detectCores() - 1
)

Arguments

str

vector, delimited list of MRN string values.

num

vector, delimited list of MRN numeric values.

sep

string, divider between hospital ID and MRN. Defaults to :.

id_length

string, indicating whether to modify MRN length based-on required values id_length = standard, or to keep lengths as is id_length = asis. If id_length = standard then in case of MGH, BWH, MCL, EMPI and PMRN the length of the MRNs are corrected accordingly by adding zeros, or removing numeral from the beginning. In other cases the lengths are unchanged. Defaults to standard.

perc

numeric, a number between 0-1 indicating which parsed ID columns to keep. Columns present in perc x 100% of patients have are kept.

nThread

integer, number of threads to use by dopar for parallelization. If it is set to 1, then no parallel backends are created and the function is executed sequentially.

Value

data table, with columns corresponding to MRNs in the string of delimited list of values.


parseRPDR documentation built on June 24, 2024, 5:16 p.m.