This repo contains the code for GoContactR, an R-shiny application built to allow contact tracing teams to generate automated reports that summarize contact follow-up data.
Find a sample live app HERE.
The application has been built to work with two primary data sources: data from KoboCollect-exported csv files, and data from a Go.Data instance (by direct API connection).
At the start of the global.R file, the developer sets the PARAMS$country_code
variable; this determines whether the Go.Data or KoboCollect versions will be loaded.
The application generates reports in the following formats:
- HTML slides. See here (Download and open in browser)
- Flat HTML page. See here (Download and open in browser)
- Powerpoint document. See here
- Word document. See here
We recommend deploying your application to RStudio's shinyapps.io service, as they have built-in tools that make this process mostly pain-free.
Two important points when doing this:
-
Do not push the DESCRIPTION file up to shinyapps.io. If you push the DESCRIPTION file, shinyapps will assume that your application is package, and it will only load libraries listed in the DESCRIPTION file. (We created the description file to enable documentation via
pkgdown
). -
Similarly, do not push the .Rprofile file. This will introduce problems related to the
renv
package.
The application is split into the global.R, server.R and ui.R files. The server file sources its functions from the helper_scripts folder.
The data flow for the application is fairly straightforward. A single dataset is loaded in with the read_file_raw
function, processed with the read_file_transformed
function, filtered with the read_file_filtered
function, then passed on to all the application outputs.
The application calculates and plots:
- New contacts over time;
- Total cumulative contacts over time;
- Contacts under surveillance over time;
- % follow-up of contacts;
- Number of contacts per index case;
- Number of contacts per case type; and
- Follow-up state among active contacts
among others
UI inputs and outputs to load and peruse the contacts data.
Outputs related to all contacts.
Outputs related to contacts under surveillance on the review date.