Skip to contents

Searches for specific SNOMED-CT (Systematized Nomenclature of Medicine - Clinical Terms) version 10 codes in Swedish hospital registry data and adds corresponding boolean variables to the skeleton. SNOMED-CT v10 provides standardized clinical terminology for procedures, findings, and diagnoses used in Swedish healthcare records.

Usage

add_snomedo10s(skeleton, dataset, id_name, codes = list(), snomedo10s = NULL)

Arguments

skeleton

A data.table containing the main skeleton structure created by create_skeleton

dataset

A data.table containing hospital registry data with SNOMED-CT v10 codes. Must have columns for person ID, date variables, and SNOMED-CT v10 code column (snomedo10)

id_name

Character string specifying the name of the ID variable in the dataset

codes

Named list of SNOMED-CT v10 code patterns. Names become column names in the skeleton; values are character vectors of code prefixes. Matching is prefix-only via startsWith(); "!"-prefixed patterns act as row-level vetoes. See add_diagnoses for the full pattern-syntax description.

Examples:

  • "80146002" – appendectomy procedure.

  • "44054006" – diabetes mellitus type 2.

snomedo10s

Deprecated. Use codes instead.

Value

The skeleton data.table is modified by reference with SNOMED-CT v10 variables added. New boolean variables are created for each SNOMED-CT pattern, TRUE when code is present.

See also

create_skeleton for creating the skeleton structure, add_diagnoses for ICD-10 diagnosis codes, add_snomed3s for SNOMED-CT version 3 codes, make_lowercase_names for data preprocessing

Other data_integration: add_annual(), add_cods(), add_diagnoses(), add_icdo3s(), add_onetime(), add_operations(), add_quality_registry(), add_rx(), add_snomed3s()

Examples

# Load fake data
data("fake_person_ids", package = "swereg")
data("fake_diagnoses", package = "swereg")
swereg::make_lowercase_names(fake_diagnoses, date_columns = "indatum")
#> Found additional date columns not in date_columns: utdatum. Consider adding them for automatic date parsing.

# Create skeleton
skeleton <- create_skeleton(fake_person_ids[1:10], "2020-01-01", "2020-12-31")

# Add SNOMED-CT v10 codes for specific clinical concepts
snomed_codes <- list(
  "appendectomy" = c("80146002"),
  "diabetes_t2" = c("44054006")
)
add_snomedo10s(skeleton, fake_diagnoses, "lopnr", snomed_codes)