utlede_annenDiag_variabler: New variables from NORIC's AnnenDiag-table

utlede_annenDiag_variablerR Documentation

New variables from NORIC's AnnenDiag-table

Description

Functions for creating variables based on NORIC's AnnenDiag-table and for merging these variables into NORIC's AngioPCIVar-table by key variables ForlopsID and AvdRESH.

Usage

utlede_kar_annen_diag(df_ad)

legg_til_trykk_bilde_per_kar(df_ap, df_ad, metodeType = "FFR")

legg_til_trykkmaalinger(df_ap, df_ad)

Arguments

df_ad

NORIC's AnnenDiag-table, must contain variables ForlopsID, AVdRESH, segment, graft and metode

df_ap

NORIC's AngioPCIVar-table, must contain variables ForlopsID and AVdRESH

metodeType

value of variable metode from NORIC-table AnnenDiag. Must have one of following values : "FFR", "iFR", "IVUS" or "OCT"

Details

The function utlede_kar_annen_diag() groups the segments in df_ad into coronary arteries in the new variable kar, then df_ad is returned from the function.

The function legg_til_trykk_bilde_per_kar() uses the data in df_ad to calculate 5 new variables, where variable names prefix is type of method (one of: "FFR", "iFR", "IVUS" or "OCT") and suffix is each level of kar (p.ex. if metode is 'FFR' then variables are FFR_LAD, FFR_RCA, FFR_CX and FFR_Graft). The variable says whether or not a measure of this method is performed in each kar. If at least one measure is done in a kar the value of the corresponding variable is given the value ja, otherwise the value is nei. These 5 variables are then merged into df_ap, before df_ap is returned from the function. For procedures where no measures are done on segment-level (e.g. no entries available in df_ad), the values for the 5 new variables are <NA>.

The function legg_til_trykkmaalinger() adds variables PdPa, IMR, Pa and Pd to df_ap-table. Values of these 4 new variables (measures of pressure) depends on the df_ad-table: value "Ja" is attributed if the method is registered for the procedure, value "Nei" is attributed if no if this method not is performed. For procedures where no measures are done on segment-level (e.g. no entries available in df_ad), the values for the 4 new variables are <NA>.

Examples

df_ad <- data.frame(
   ForlopsID = c(1, 1, 3, 3, 5),
   AvdRESH = rep(1,5),
   segment = c("PDA/RPD (4)",
               "PLA (18)",
               "Midtre LAD (7)",
               "Ve hovedstamme (5)",
               "Ve hovedstamme (5)"),
   graft = c("Nei",
             "Arteriell",
             "Vene",
             "Nei",
             "Nei"),
   metode = c("FFR", "FFR", NA, "test", "FFR"))


df_ap <-data.frame(
   ForlopsID = c(1, 2, 3, 4, 5),
   AvdRESH = rep(1,5))


utlede_kar_annen_diag(df_ad)
legg_til_trykk_bilde_per_kar(df_ap = df_ap,
                             df_ad = df_ad,
                             metodeType = "FFR")


Rapporteket/NORIC documentation built on Sept. 7, 2024, 10:32 a.m.