Public-Health-Scotland / phsmethods

An R package to standardise methods used in Public Health Scotland (https://public-health-scotland.github.io/phsmethods/)
https://public-health-scotland.github.io/phsmethods/
54 stars 13 forks source link

Functions to extract the DoB / age from CHI #42

Closed Moohan closed 2 years ago

Moohan commented 4 years ago

This is something I've been doing a bit recently and have done in the past. Have also had conversations with other people where they have needed to do the same thing.

University of Edinburgh do it here https://github.com/SurgicalInformatics/chiTools which I think is a pretty fast implementation (although could probably be faster with gsub instead of stringr) but would need some modification to align with phsmethods other CHI related functions.

I think my implementation https://github.com/Health-SocialCare-Scotland/cocin-scotland/blob/master/functions/fix_age_sex_from_chi.R is probably slower, it also has a fixed max age.

I like the idea of the UoE cutoff_year param, could also have a max_age param which would serve the same purpose but obviously take input slightly differently.

Moohan commented 3 years ago

Comment on Teams re this issue