Skip to contents

Identify unique external causes of injury cases based on FMDS dataset. Three possible methods are used:

  1. Keep only those that are found in FMDS, and those found in both FMDS and Somatic when the date and health institution are matched

  2. If multiple registries in FMDS with similar dates and health institution identified, then keep the earlier based on time

  3. If multiple registries in FMDS with same date BUT different health institutions identified, then check health institution in Somatic data. Matching health institution will be kept.

Usage

find_cause(
  d1,
  d2,
  id = "lopenr",
  skade = "skadeDato",
  rhf = "helseforetak_nr",
  filter = NULL,
  days = 3,
  verbose = FALSE,
  clean = FALSE
)

Arguments

d1

Dataset for FMDS ie. external explanation for injury

d2

Dataset for NPR ie. entry registration for injury

id

Unique patient identity

skade

Coloumn name for date of injury

rhf

Coloumn name for health institutions

filter

Column name for filtering inclusion and exclusion ie. is.na(filter)

days

A selected time period to consider as similar injury. Default is 3 days

verbose

Keep variables for making the selection ie. xx.VariableName to produce DELXX

clean

Delete all the possible duplicated cases

Value

A dataset with a DELXX column is created indicating non-cases ie. DELXX = 1. Use argument verbose = TRUE to include the columns needed for crating DELXX column. Argument clean = TRUE will exclude all DELXX == 1.

Examples

if (FALSE) { # \dontrun{
 dd <- find_cause(d1, d2)
} # }