utlede_OppholdsID: Add variable OppholdsID

View source: R/utlede_variabler.R

utlede_OppholdsIDR Documentation

Add variable OppholdsID

Description

Procedures that belongs to the same hospital-stay are given the same ID.

Usage

utlede_OppholdsID(df)

Arguments

df

data.frame med Angio PCI data

Value

returns df with a new column OppholdsID. For primaerforlop OppholdsID are copied from ForlopsID, whereas for sekundaerforlop OppholdsID are copied from PrimaerForlopsID aka KobletForlopsID. PrimaerForlopsID.

Examples

x <- data.frame(
   Regtype = c(rep("Primær", 4), "Sekundær", "Sekundær"),
   ForlopsID = c(1, 2, 3, 4, 5, 6),
   PrimaerForlopsID = c(rep(NA, 4), 1, 3))
utlede_OppholdsID(x)

Rapporteket/NORIC documentation built on Feb. 15, 2024, 5:25 p.m.