Return CQC inspection reports, either as a plain text character vector, or by saving a PDF to the chosen directory.
cqc_reports(inspection_report_link_id, related_document_type = NULL,
plain_text = TRUE, attempt_pdf = FALSE, directory = NULL,
file_name = NULL, verbose = TRUE)The ID of the report to return.
An optional qualifier to retrieve a document related to the main report. This parameter is the Related Document Type found from the relatedDocuments response object. e.g. "Use for the inspection is returned.
If TRUE, returns plain text of report. Otherwise returns
a PDF. Defaults to TRUE.
Set behaviour when attempting to retrieve plain text
of reports. If TRUE, attempts to retrieve a PDF if the plain text of the
report is not available and saves it to directory.
Ignored if plain_text == FALSE. Defaults to FALSE.
The directory to save PDF files in. Defaults to current working directory.
A custom file name given to a PDF file being saved locally.
If NULL, saves files as inspection_report_link_id.pdf.
Defaults to NULL.
If TRUE prints download progress to console if requesting
more than 1,000 records. Defaults to TRUE.
Either a PDF of the inspection report saved to the working directory, or a character vector with the plain text of the inspection report, depending on parameters used.
# NOT RUN {
report2 <- cqc_reports("41d035b1-43e7-4857-be33-cf1b57cf4311")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab