The World Health Organization (WHO) has developed Argus, an open source IT tool to support public health surveillance for early detection and response. It uses Short Message Service (SMS) technology for the transmission of information between the local healthcare facilities and all levels of the public health surveillance system via a mobile application. A web platform complements the application for data management and analysis.
R has been integrated in the server to enhance Argus data management and data analysis capacities. This repository aims to produce in a regular manner an administrative and an epidemiological dasboard displayed in the Argus web platform.
- R (>=3.4.1)
- R tools
- Pandoc (>= 1.16.0.2) (for
rmarkdown) - For Unix-alikes, GDAL (>= 2.0.0), GEOS (>= 3.3.0) and Proj.4 (>= 4.8.0) are required for
sfpackage.sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstablesudo apt-get updatesudo apt-get install libudunits2-dev libgdal-dev libgeos-dev libproj-dev
Needed R packages are available as zip binaries for windows in the PROJECT_DIRECTORY\argus\packages folder.
All packages can be installed using the below R script.
install.packages(list.files("PROJECT_DIRECTORY/packages/", full.names = T), repos=NULL, type="win.binary")
Should the packages be updated, or new packages required, an R script is available to facilitate the process PROJECT_DIRECTORY\packages_to_install.R
It is possible to generate the reports in different languages. The internationalization is done by shiny.i18n package. User needs to provide the translations in the csv file: PROJECT_DIRECTORY\dashboards\translations\translations.csv. Raw column contains the alias for the translation for R. This shouldn't be modified in the csv (unless also modified in R). To add new translation add new column with the language and provide the translations.
- Create the appropriate folders in the server
- Open
C:\xampp\htdocsand create a folder namedScriptsR - Open
C:\xampp\htdocs\ScriptsRand create a folder namedargusto have the hierarchical folderC:\xampp\htdocs\ScriptsR\argus
- Open
- Download all this repository: https://github.com/reconhub/argus
- Copy its content to the
C:\xampp\htdocs\ScriptsR\argusfolder.
- Update the information to access the local database
- Update and save the file
PROJECT_DIRECTORY\db\db_config.yamlwith correct database name, host, port number, user and password.
- Update and save the file
- Update local constants
- Update and save the file
PROJECT_DIRECTORY\dashboards\config.yamlwith the language, country name, first day of the week and update frequency in minutes.- Language: e.g. "fr" for French; "en" for English. Use the same abbreviation as in the first row of the file:
PROJECT_DIRECTORY\dashboards\translations\translations.csv. - Country name (used to produce the maps): e.g. "Togo". Use names displayed in the file
PROJECT_DIRECTORY\dashboards\countryNames.csv. - First day of the week: either 1 if Monday, or 7 if Sunday.
- Frequency of the dashboards update: e.g. 15. Don't put less than 15 minutes.
- Language: e.g. "fr" for French; "en" for English. Use the same abbreviation as in the first row of the file:
- Update and save the file
- Check the working directory path at the top of
PROJECT_DIRECTORY\dashboards\master.R, update it if needed (in a standard installation it should beC:/xampp/htdocs/ScriptsR/argus)
For windows:
-
run the
dashboards\master.ronce -
you can then use the following command in R to create the scheduled task:
taskscheduleR::taskscheduler_create(taskname="ArgusR", rscript=paste0(getwd(),"/dashboards/master.R"), schedule="MINUTE", startdate = format(today(), "%d/%m/%Y"), starttime=format(Sys.time() + 120, "%H:%M"), modifier=config$freqCron) -
If an error message such as:
ERROR: Incorrect Start Dateappears:- Run the following command in the R console:
taskscheduleR::taskscheduler_create(taskname="ArgusR", rscript=paste0(getwd(),"/dashboards/master.R"), schedule="ONCE", startdate = format(today(), "%d/%m/%Y"), starttime=format(Sys.time() + 120, "%H:%M")) - Then open the application
Task schedulerin Windows:- Go in the left panel to
Task scheduler library - Select the task
ArgusRin the middle panel. - Click on properties in the right panel.
- Go to the
Triggerstab and select inAdvanced settings: "Repeat task every15 minutesfor a duration ofIndefinitely" - Press OK
- Press “Run” in the right panel.
- Go in the left panel to
- Run the following command in the R console:
Whole workflow is controlled through the PROJECT_DIRECTORY\dashboards\master.R script.
-
Generate data objects for the dashboards: run
[PROJECT_DIRECTORY]/dashboards/scripts/argus_dashboard_raw_input_script.R -
Generate the charts and tables of the dashboards:
- Run
[PROJECT_DIRECTORY]/dashboards/scripts/administrative_dashboard_inputfor administrative dashboard. - Run
[PROJECT_DIRECTORY]/dashboards/scripts/epidemiological_dashboard_inputfor epidemiological dashboard.
- Run
-
Produce the HTML dashboards: knit the
[PROJECT_DIRECTORY]/dashboards/reports/administrative_dashboard.Rmdand[PROJECT_DIRECTORY]/dashboards/reports/epidemiological_dashboard.Rmdfiles.