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

Refactor pf desc stats measure #93

Conversation

milanwiedemann
Copy link
Member

@milanwiedemann milanwiedemann commented Jan 8, 2025

While reviewing the PR I noticed that there were still a couple things that we should change, here are my suggestions. The main issues and changes I tried to address are:

Main change

  • Explicit separation of events frames (clinical events and medications) linked by consultation ID or date, but not both
    • Events linked by date now have an explicit where condition removing events that are matched by consultation id: where(selected_events.consultation_id.is_not_in(pf_ids))

Smaller changes include:

  • Reduce repetition of code:
    • Define measures interval in measures.define_defaults()
    • Created two filtered event frames (selected_events, selected_medications) for the measures interval at the top of the script
  • Improve consistency of variable names
    • Replaced all occurances of the word pathways with conditions)
    • Consistent naming of filtered event frames by Pharmacy First consultation ID (_pfid_) or Pharmacy First consultation date (_pfdate_)
  • Clear structure throughout the script now follows (1) PF consultations, (2) PF conditions, (3) PF medications, and (4) Measures

@milanwiedemann milanwiedemann marked this pull request as ready for review January 8, 2025 13:02
@milanwiedemann milanwiedemann requested a review from viv3ckj January 8, 2025 13:02
Copy link
Contributor

@viv3ckj viv3ckj left a comment

Choose a reason for hiding this comment

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

This does read much clearer. Thanks!

@viv3ckj viv3ckj merged commit 77f607b into viv3ckj/move_validation_data Jan 8, 2025
1 check passed
@viv3ckj viv3ckj deleted the milanwiedemann/refactor_pf_desc_stats_measure branch January 8, 2025 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants