Administrator Manual
CEDARS is provided as-is with no guarantee whatsoever and users agree to be held responsible for compliance with their local government/institutional regulations. All CEDARS installations should be reviewed with institutional information security authorities.
CEDARS was tested on a desktop PC. R 3.5.0 or above and all dependency packages need to be installed:
fastmatch
jsonlite
mongolite
parallel
readr
shiny
udpipe
utils
RStudio is required to use the app locally and to publish it to RStudio Connect. A MongoDB installation is required to hold all the project data, preferably on a dedicated server.
Lastly, the Unified Medical Language System (UMLS) MRCONSO.RRF file is required for searches using Concept Unique Identifiers (CUI's). The UMLS is a rich compendium of biomedical lexicons. It is maintained by the National Institutes of Health (NIH) and requires establishing an account in order to access the associated files. Those files are not included with the CEDARS R package, but CEDARS is designed to use them natively so individual users can easily include them in their annotation pipeline.

CEDARS Operational Schema
The CEDARS app runs from within a Shiny instance. It is possible to use either RStudio Connect or alternatively a dedicated server running Shiny Server. The former is easy to use from RStudio desktop but requires an existing RStudio Connect installation within your organization, while the latter is typically more costly and labor intensive.
Users connect to the Shiny app by accessing a web URL provided by RStudio Connect or a web server on a dedicated Shiny Server installation. CEDARS performs the operations to pull data from the database, process it and present it to the end users. Data entered by users is processed by CEDARS and saved to the database. RStudio Connect and Shiny Server Pro allow for the automatic generation of multiple processes ("workers") when multiple end users access the app simultaneously, however this is rarely needed with CEDARS since in most implementations only a few abstractors (i.e. <5) will have access to the interface. In most cases, if pre-search is used (see below), CEDARS will run fairly quickly with 2 simultaneous users in a single-threaded setup.
CEDARS can handle authentication, but ideally this will be done by Active Directory through RStudio Connect. This approach ensures optimal integration with an organization's IT architecture.
From RStudio, and with the devtools package installed:
devtools::install_github("simon-hans/CEDARS", upgrade="never")
This will install CEDARS on a desktop or server. In the case of RStudio Connect implementations, CEDARS will be automatically installed when uploading the app through RStudio.
Extracting clinical event dates with CEDARS is a simple, sequential process:

Project Execution Overview
The CEDARS package includes its data entry interface in the form of a Shiny app. However, additional information from the administrator is required for the app instance to connect with MongoDB, including:
database user ID and password
host server and port (default is 27017)
database name
whether or not Active Directory will be used for user authentication
destination path to save the app, mapped from the R working directory
The function save_credentials() must be called to generate the app and associated Rdata file:
db_user_name <- "myname"
db_user_pw <- "mypassword"
db_host <- "myserver"
db_replica_set <- "my_mongo_set"
db_port <- 27017
db_name <- "MyDB"
use_LDAP <- TRUE
app_path <- "Out/app"
save_credentials(db_user_name, db_user_pw, db_host, db_replica_set, db_port, db_name, use_LDAP, app_path)
Both the app.R and db_credentials.Rdata files must be uploaded to the Shiny instance.
This option assumes you have an account with your institution's RStudio Connect service. From within RStudio, simply navigate to the folder where the app was saved and click on the app.R file. Click the "Publish to Server" icon, making sure both necessary files are included and hit "Publish".
A discussion of the installation process and use of Shiny Server is beyond the scope of this manual; pertinent information can be found on the maker's website. The CEDARS app.R and db_credentials.Rdata files should be uploaded to the desired app directory.
Creating the database and populating it with data pertaining to the project occurs as follows:

Preparing the Database
Each data collection task on a given cohort of patients is a distinct CEDARS "project" with its own MongoDB database including all collections needed to operate. Different projects cannot share the same database or collections. This encapsulation allows for reliable backup and deletion of project data upon completion, also avoiding data corruption due to cross-talk between different annotation tasks. Initialization is the process by which necessary collections are generated and populated with project-specific data.
The function create_project() generates a database which will hold all collections pertaining to the project. If the CEDARS project administrator has database creation privileges, a new MongoDB instance will be created and collections generated automatically. If database creation privileges have not been granted, it is possible to have the MongoDB administrator create the blank database. Once this is done, create_project() can be used to generate the collections:
uri_fun <- mongo_uri_standard
db_user_name <- "myname"
db_user_pw <- "mypassword"
db_host <- "myserver"
db_replica_set <- "my_mongo_set"
db_port <- 27017
db_name <- "MyDB"
project_name <- "CEDARS Example Project"
project_owner <- "Dr Smith"