identify_icd: Find diagnosis using ICD-codes

Description Usage Arguments Examples

View source: R/identify_icd.R

Description

This function allows you to find a diagnosis based on ICD-codes. Creates a new column based on the ICD-codes.

Usage

1
2
3
4
5
6
7
8
9
identify_icd(
  .data,
  icd,
  new_variable,
  primary = TRUE,
  secondary = TRUE,
  simple = FALSE,
  patient_inclusion = FALSE
)

Arguments

.data

A tibble with data in QTF-format.

icd

A character vector (or scalar) with ICD-codes that should be identified in the data.

new_variable

A character string with the column name for the new variable.

primary

Search primary diagnoses. Defaults to TRUE.

secondary

Search secondary diagnoses. Defaults to TRUE.

simple

Only the new variable column will be returned. Support function. Defaults to FALSE.

patient_inclusion

Return a vector with unique patient id:s that can be used to filter data at a later stage. Defaults to FALSE.

Examples

1
2
data(data_icd)
data_icd %>% combine_sdia() %>% identify_icd("L405", "psa")

liljamathias/QRfunctions documentation built on Jan. 20, 2021, 1:32 a.m.