Learn R Programming

Achilles (version 1.4)

addDatasource: addDatasource

Description

addDatasource adds a data source to the datasource.json file.

Usage

addDatasource(jsonFolderPath, dataName = NULL, datasourcePath = NULL,
  datasourcesFilename = "datasources.json",
  additionalParam = list(cdmVersion = 5))

Arguments

jsonFolderPath

Path of the Json files generated by exportToJson.

dataName

Name of Achilles report. Default is the base folder of jsonFolderPath.

datasourcePath

Path where datasource file will be saved. Default is one folder above the jsonFolderPath

datasourcesFilename

Name of the file where the datasource is located or stored. Default is "datasources.json".

additionalParam

A R list specifying which additinal parameters to write to the datasource object. Default is list(cdmVersion=5).

Value

none

Details

Used to update the datasources file with the reference to a specified datasource. This makes the new datasource findable for OHDSI tools. If the datasources file exists, the data source will be added to the file. If the datasources file does not exist, a new file wil be initialized with the specified data source.

Examples

Run this code
# NOT RUN {
jsonFolderPath <- "your/output/path"
connectionDetails <- createConnectionDetails(dbms="sql server", server="yourserver")
exportToJson(connectionDetails, cdmDatabaseSchema="cdm5", outputPath=jsonFolderPath)
addDatasource(jsonFolderPath, "your_data_name")
# }

Run the code above in your browser using DataLab