Skip to content

Commit

Permalink
Updates join_lpr function description to filter to necessary diagnoses.
Browse files Browse the repository at this point in the history
  • Loading branch information
Anders Aasted Isaksen authored and Anders Aasted Isaksen committed Sep 20, 2024
1 parent 092824e commit 20f5886
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions vignettes/function-flow.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,22 @@ 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`)
- department specialty (`c_spec`)
- 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`)
Expand Down Expand Up @@ -438,4 +441,3 @@ is within a time-period of insufficient data coverage,
contains the inclusion date of this individual.

<!-- TODO: Specify the "stable" time-period: e.g., later than 1997 -->

0 comments on commit 20f5886

Please sign in to comment.