Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

lwjohnst86
Copy link
Member

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.

)

# Exclusion steps -----
exclusions <- gld_purchases |>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe name the output gld_hba1c_after_exclusions or something similar?

Comment on lines +98 to +105
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()
}
Copy link
Collaborator

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.

Copy link
Collaborator

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.

Copy link
Contributor

@signekb signekb left a 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 👍 🌟

# lmdb = lmdb
# )

included_hba1c <- include_hba1c(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
included_hba1c <- include_hba1c(
hba1c_over_threshold <- include_hba1c(

Or something to be more like the other inclusion step variable names (i.e., not start with an "included").

Comment on lines +27 to +28
verify_required_variables(sysi, "sysi")
verify_required_variables(sssy, "sssy")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I've included this in include_podiatrist_services() too. Should it only be here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Make skeleton of main functions
3 participants