-
Notifications
You must be signed in to change notification settings - Fork 9
Mavis cli stats #4199
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
Mavis cli stats #4199
Conversation
d656b97
to
2942d28
Compare
2942d28
to
04a8237
Compare
04a8237
to
d719d46
Compare
d719d46
to
102c384
Compare
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.
Overall looks pretty good, nice to see these!
I'm wondering if it's worth extracting the logic related to generating the stats in to separate service classes which returns the data in a structure manner which is then used in these tools to output the data as CSV, JSON, human-readable text, etc. I'm thinking that might make the testing a bit easier and even allow us to get stats quickly in a Rails console. Not a blocker, as we can always refactor this later, but what do you think?
102c384
to
d0c2ad2
Compare
d0c2ad2
to
afa97bf
Compare
afa97bf
to
86f1a7b
Compare
I've done a bit of refactor to be in line with |
86f1a7b
to
4c5a148
Compare
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 really good, definitely like the classes in lib/stats
.
- Introduces a new CLI command to report vaccination counts by programme and outcome. - Supports filtering by date range (`--since`, `--until`), output format (`--format`: table, json, csv), programme type, outcome, team name and organisation ODS code. Example usage: - All vaccinations, table output (default) mavis_cli stats vaccinations - Filter by programme and outcome, as JSON mavis_cli stats vaccinations --programme flu --outcome administered --format json - Filter by date range, team and organisation, as CSV mavis_cli stats vaccinations --since 2023-09-01 --until 2024-07-23 --organisation XYZ123 --format csv --team_name "SAIS Org 1"
…lysis - Introduces a new CLI command to generate consent response statistics by school, providing both date-based and days-since-request analyses in CSV format. - Supports filtering by organisation ODS code (`--ods_code`), optional team name (`--team_name`), optional programme type (`--programme`: flu, hpv, menacwy, td_ipv), and academic year (`--academic_year`). - When programme is not specified, analyses all programmes within the organisation. - Outputs two CSV reports: consent responses by date and consent responses by days since request sent. Example usage: - All programmes for an organisation, specific team mavis stats consents-by-school --ods_code ABC123 --team_name "SAIS Org 1" - Specific programme only mavis stats consents-by-school --ods_code ABC123 --programme flu - Filter by academic year mavis stats consents-by-school --ods_code ABC123 --academic_year 2023
- Introduces a new CLI command to report comprehensive organisation statistics including cohorts, schools, communications, consents and vaccination rates. - Supports filtering by organisation ODS code (`--ods_code`), team name (`--team_name`), programme type (`--programme`: flu, hpv, menacwy, td_ipv), academic year (`--academic_year`), and output format (`--format`: table, json). Example usage: - Organisation statistics, table output (default) mavis_cli stats organisations --ods_code ABC123 --team_name "SAIS Org 1" - Filter by programme, as JSON mavis_cli stats organisations --ods_code ABC123 --programme flu --format json - Filter by academic year mavis_cli stats organisations --ods_code ABC123 --academic_year 2023
4c5a148
to
a45825c
Compare
|
mavis stats vaccinations
Provides vaccination counts by programme and outcome with flexible filtering options.
Usage:
mavis stats organisations
Reports organisation statistics including cohorts, schools, communications, consents and vaccination rates.
mavis stats consents-by-school
Generates consent response statistics by school with date-based and days-since-request analyses in CSV format.