Creating a report
creating-reports.RmdIf you have not already set up your project, please follow the
instructions in vignette("initial-setup").
The RoundtableReporting package takes the output from Gaston’s SAS process, draws figures and combines the data and figures with Typst template files to produce a standardised PDF Roundtable quarterly report.
There are two steps to creating a report:
- Check and update the report settings in
report_settings.yaml - Create the report by running
make_report("[provider]")
We also produce a homes report for each provider, presenting
longitudinal figures for each indicator for each home. This is created
by running make_supplement("[provider]").
It is possible to create both the main report and the homes report in one command:
make_report("[provider]", supplement=TRUE)
This will create the main report, and then go on to create the homes report.
Steps to create a report
First you need to open RStudio to the project you set up for the reports. RStudio will default to the last project you had opened, so you probably just have to open RStudio.
Update the package
If the reporting package has been updated to include new report feature or corrections, you will need to install the updated version. It is probably easiest to update all packages. In RStudio, go to the “Packages” tab (lower right pane), and click on “Select all” and then “Install updates”.
If that has errors, you will need to find expert help.
Load the reporting package
library(RoundtableReporting)
#> Loading RoundtableReporting version 0.3.6Check and update the report settings
In the RStudio “Files” pane (bottom right) you should see
report_settings.yaml (and
figure_settings.yaml). Click on
report_settings.yaml to open it.
The settings files are in YAML format. Note that indentation is important so be careful to change only the values, not the formatting. Anything after a ‘#’ is a comment and is ignored in processing.
The first section is the reporting dates.
dates:
report:
month: "March"
year: 2025
period:
quarter: "Q4"
year: 2024
long_period: "Q1 2024 to Q1 2025"
data_collection:
week: "9-15 November"
day: "15 November"
Report month and year are the month and year of the Roundtable
meeting where this report will be presented. Period quarter and year are
the period reported on in this report, and the data collection week and
day are the dates used for indicators that do not use the full quarter’s
data. long_period is the period for the longitudinal graphs
in the supplementary report.
The next section is the published national rates for antipsychotic use and polypharmacy, and the quarter that those rates relate to. (National data is typically one quarter behind our reports.)
national: # https://www.gen-agedcaredata.gov.au/topics/quality-in-aged-care/residential-aged-care-quality-indicators-latest-release
antipsychotics: 17.3 # July -- September 2024
polypharmacy: 34.6 # July -- September 2024
national_qtr: "Q3 2024"
You should be able to Ctrl-Click on the URL to go to the website to check for updated data.
Next is the list of indicators to include in this report:
reporting_on:
- psychotropics
- antipsychotics
- antidepressants
- antiepileptics
- hypnotics
- polypharmacy
- antibiotics
- opioids
This should not be changed. (Changing it currently requires changes to the R code and Typst templates as well.)
The next setting is the data directories. The main data directory and the longitudinal data directory are set separately. These settings should point to the files output by Gaston, wherever he or you have saved them. Note that the directory path uses forward slash ‘/’ to separate folders.
data_directory: "~/Macquarie University/CHSSR_Medication_Roundtable_Data (ETHICS) - Documents/Indicator Calcul/202502"
data_longitudinal: "~/Macquarie University/CHSSR_Roundtable (Ethics)_Automation - Documents/Step 3 - Indicators/_OverTime/2024/Q4"
Finally, there is the text for the “What’s new” section of the report.
whats_new:
title: "What's new in this Quarter's report?"
content1: "Medication indicators during Q4 (1 October -- 31 December) 2024"
content2: >
We report the core Roundtable indicators:
- National Aged Care Quality indicators
- Antipsychotic use
- Polypharmacy
- Other indicators of interest
- Overall psychotropic use
- Antidepressant use
- Antiepileptic use
- Hypnotic, sedative, and anxiolytic use
- Antibiotic use
- Opioid analgesic use
“content1” and “content2” will be separated by a line in the what’s new box. You can write whatever you want in either content section. You can surround the entire text in double quotes and separate paragraphs using a blank line:
whats_new:
content1: "Medication indicators during Q4 (1 September -- 31 December) 2024
In this quarterly report we introduce new figures showing the indicator values over the
previous year."
This is good for simple text, but does not allow complex formatting.
Alternatively, you can put ‘>’ after the content label, then write markdown formatted text on the lines below. In this case, it is very important that every line is indented 2 spaces past the content label (4 spaces past the whats_new label).
whats_new:
content1: >
This report contains indicators updated to Q4 (1 September to 31 December) 2024. We
also add new figures showing the indicator values over time.
This is a significant enhancement of the reports, which now show:
- rates in the reporting quarter
- rates in each month for the reporting quarter and the three preceding quarter.
Once you have updated the report settings and saved the file, you are ready to output the reports.
Create the reports
To make the overview report:
make_report("Overview")
To make a main provider report (without supplementary report):
make_report("Anglicare")
To make a provider supplementary report:
make_supplement("Anglicare")
To make main provider report and supplementary report in one command:
make_report("Anglicare", supplement=TRUE)
You can also produce separate graphs of the indicators for including in the Roundtable slides:
make_report("Overview", presentation_figures = TRUE)
Check the reports
Check the reports. If there are problems with layout you will need
someone to work with the templates and R code. But for minor issues with
the figures, you can adjust the figure settings:
vignette("tweak-fig-settings").