From 20f58862389081b8f5e45291eb3a1f26955a3e6f Mon Sep 17 00:00:00 2001 From: Anders Aasted Isaksen Date: Fri, 20 Sep 2024 13:37:39 +0200 Subject: [PATCH] Updates join_lpr function description to filter to necessary diagnoses. --- vignettes/function-flow.Rmd | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/vignettes/function-flow.Rmd b/vignettes/function-flow.Rmd index 11bd3df..127f6db 100644 --- a/vignettes/function-flow.Rmd +++ b/vignettes/function-flow.Rmd @@ -105,9 +105,10 @@ The helper functions `join_lpr2()` and `join_lpr3()` join records of diagnoses to administrative information in LPR2-formatted and LPR3-formatted data, respectively. -`join_lpr2()` takes `lpr_diag` and `lpr_adm` as inputs, joins the -required information by record number (`recnum`), and outputs a -`data.frame` with the following variables: +`join_lpr2()` takes `lpr_diag` and `lpr_adm` as inputs, filters to the +necessary diagnoses (`c_diag` starting with "DO", "DZ3", "DE1[0-4]", +"249", or "250"), joins the required information by record number +(`recnum`), and outputs a `data.frame` with the following variables: - identifier variable (`pnr`) - date (`d_inddto`) @@ -115,9 +116,11 @@ required information by record number (`recnum`), and outputs a - diagnosis code (`c_diag`) - diagnosis type (`c_diagtype`) -`join_lpr3()` takes `diagnoser` and `kontakter` as inputs, joins the -required information by record number (`dw_ek_kontakt`), and outputs a -`data.frame` with the following variables: +`join_lpr3()` takes `diagnoser` and `kontakter` as inputs, filters to +the necessary diagnoses (`diagnosekode` starting with "DO", "DZ3", or +"DE1[0-4]"), joins the required information by record number +(`dw_ek_kontakt`), and outputs a `data.frame` with the following +variables: - identifier variable (`cpr`) - date (`dato_start`) @@ -438,4 +441,3 @@ is within a time-period of insufficient data coverage, contains the inclusion date of this individual. -