Viv3ckj/update report apr#206
Open
viv3ckj wants to merge 5 commits into
Open
Conversation
fcd507c to
1ca8623
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are we trying to achieve?
We received a request via email asking whether the raw data behind the Pharmacy First monthly dashboard could also be made available for download alongside the report:
https://reports.opensafely.org/reports/opensafely-pharmacy-first-monthly-dashboard/
The aim is to make it easier for users to reuse and analyse the dashboard data themselves.
What is the problem?
Although we could publish the current outputs directly (
pf_breakdown_measures.csvandpf_descriptive_stats_measures.csv), these tables are analysis-oriented and difficult for external users to work with.Current issues include:
NA) columns_by_sex,_by_imd)For example:
This structure is difficult to filter/pivot and requires users to interpret metadata encoded inside the measure names.
Proposed approach
This PR creates:
analysis/create_monthly_tables.Rgenerate_pf_opensafely_monthly_report_tablesThese generate new user-facing downloadable tables from the existing analysis outputs.
The downloadable outputs would be:
pf_consultations_with_breakdowns.csvpf_completeness.csvThese are new outputs and would sit alongside the existing outputs rather than replace them.
The cleaned tables:
measure_type,group_type,group)Example proposed structure:
Alternatives considered
An alternative would be to publish the current analysis outputs directly.
However, this would make the downloads harder for external users to understand and work with, as the current tables are designed for report generation rather than public use.
Another option would be to create many separate CSVs for each stratification/figure, but this would increase maintenance burden and make the downloads harder to navigate.
The proposed approach keeps the number of downloadable files small while making the structure more user friendly.
Closes #205
The downloadable breakdown and descriptive tables will now look like this: