Mail merge is back, baby!
27 February 2025
In R:
populate_template(
scheme_code = "XYZ", # create a report for this scheme
result_sets = get_nhp_result_sets(), # fetch results metadata from Azure
run_stages = list( # list the tagged model runs
primary = "final_report_ndg2", # main data source for the report
secondary = "final_report_ndg1" # used as a comparator
)
)
Output file structure:
YYYY-MM-DD-HHMMSS_scheme/
├──YYYY-MM-DD-HHMMSS_scheme.log # log of printed metadata
├──YYYY-MM-DD-HHMMSS_scheme_outputs-report_draft.docx # populated report
├──figures/ # standalone PNG files
└──values/ # CSVs of calculated values
For calculated values:
For generated figures:
Find the repo at The Strategy Unit/nhp_final_reports