-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: ✨ skeleton of the core diabetes classification #142
base: main
Are you sure you want to change the base?
Conversation
classify_t1d <- function(data) { | ||
# data |> | ||
# get_has_t1d_primary_diagnosis() |> | ||
# get_only_insulin_purchases() |> | ||
# get_majority_of_t1d_primary_diagnosis() |> | ||
# get_insulin_purchases_within_180_days() |> | ||
# get_insulin_is_two_thirds_of_gld_purchases() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is still present in the classify_diabetes()
function environment, then adding the gld_hba1c_after_exclusions
object as an input to get_insulin_purchases_within_180_days()
would allow us to reuse the post-exclusion GLD data to assess insulin purchases in relation to the date of diabetes variable. This could be a way to solve what we discussed earlier today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function outputs and helper functions currently described in #133 need a bit of aligning to match what ends up being implemented in this script (right now I've added another helper function, get_type_diagnosis_majority(), but that one only relates to hospital diagnoses, not GLD, so it should be fine for this PR). There will probably be some back-and-forth between the function flow docs and this script as we go along.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I really like the overview this provides 👍 🌟
…/skeleton-main-functions
Co-authored-by: Signe Kirk Brødbæk <40836345+signekb@users.noreply.github.com>
…no-aarhus/osdc into feat/skeleton-main-functions
I've updated this function. I don't remember exactly where we were at, and I think it would be good to have another review of it. And then merge it in once approved so we can slowly update it as we go along? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Just one question, otherwise approved ✅
# classify_t1d() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to include this here and then defining the function classify_t1d()
below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand the question. What do you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean rather than have it all as one pipe? Mainly to split out the code conceptually and to mimic what was done in the function flow diagram
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I see how that wasn’t too specific, sorry about that :)
I actually meant: How come you are defining a function here and not having the classify_t1d()
in a separate file as we do with the other functions?
Closes #141.
This will form the basis of slowly building up this function. So as we add more inclusion/exclusion functions, we uncomment from here. And at the same time, the general logic of what is needed and what goes into what, as well as the argument names of the functions, can be seen from this function.
@Aastedet I know you had some things you mentioned that needed updating from the diagram, so maybe this function can help clarify that.