Count injury cases or episodes. Generally an episode shoulde be:
Main diagnosis is between S00 to T78
It's an acute injury ie. hastegrad is 1
Posibility to select days from previous to the following injury of similar code for multiple injuries
Usage
count_case(
d,
period = 0,
id = "lopenr",
date.col = "innDato",
acute = FALSE,
days = 0,
diag.col = "hoveddiagnoser"
)
Arguments
- d
Dataset that contain ICD-10 diagnosis codes
- period
Representing 4-months period ie. first, second or third. Default is 0 to include data for the whole period else use 1, 2 or 3.
- id
Columname representing unique id
- date.col
Columname for date for filtering
- acute
Default is
FALSE
. UseTRUE
to include only acute patients ie. Hastegrad = 1- days
If diffence in days of registration should be considered ie. when a person has more than one registered injuries of the same ICD-10 code. This is to avoid counting similar injuries more than once.
- diag.col
Columname of codes for main diagnosis