steno-aarhus / osdc

Open-Source Diabetes Classifier: an R package to classify diabetes status in Danish registers
https://steno-aarhus.github.io/osdc/
Other
1 stars 1 forks source link

feat: function to join the LPR2 registers #118

Closed lwjohnst86 closed 4 months ago

lwjohnst86 commented 5 months ago

Closes #88. Has tests and documentation generated.

I don't know what I did, but I think I made a branch off of the hba1c branch, so this is a stacked PR.

lwjohnst86 commented 5 months ago

Right now there is no logic for the algorithm here 😉 so no need to fill in the algorithm file. Only the include_ and exclude_ functions contain the actual logic. This and the other future functions are helper functions.

signekb commented 5 months ago

Ah! I thought we wanted logic from all functions (including helper functions) in the algorithms.csv

Aastedet commented 4 months ago

Don't we need a recnum in one of actual_lpr_diag and/or actual_lpr_adm that's not in the other to test that its actually a full join and not e.g., a left join?

In the real data there is always a record of each recnum in both _diag and _adm, so it doesn't matter if it's a full/inner/right or left-join in practice. Now that I think about it, I guess that if there was a mismatch/corruption in the input data, I think we would want to only keep the complete records, so I'll change it to inner_join?

lwjohnst86 commented 4 months ago

Added some more tests and refined a few things, but nothing major. Merging in.