::getAnalysisDetails() %>%
Achilles::datatable(options = list(
DTscrollX = T,
autoWidth = T,
columnDefs = list(
list(width = '500px', targets = 4),
list(width = '200px', targets = 11)
)
) )
Exercise
Use Achilles to
- View the kinds of analyses and characterizations it performs.
- Run Acilles
- Generate Achilles SQL
Packages
Installation
View Analyis Details
First, let’s look at the kind of analyses Achilles can perform. Note there are analysis_ids for each kind of analysis.
Since a full achilles run will take a long time, we will select a subset of analysis ids.
= "GiBleed"
datasetName = "sqlite"
dbms
<- Eunomia::getDatabaseFile(
datasetLocation datasetName = datasetName,
dbms = dbms,
databaseFile = tempfile(fileext = ".sqlite")
)<- DatabaseConnector::createConnectionDetails(dbms = dbms, server = datasetLocation)
connectionDetails = DatabaseConnector::connect(connectionDetails = connectionDetails)
connection ::createCohorts(connectionDetails)
Eunomia::getTableNames(connection, databaseSchema = 'main') DatabaseConnector
= "resources/artifacts/achilles"
base_dir <- Achilles::achilles(connectionDetails,
result cdmDatabaseSchema = "main",
resultsDatabaseSchema = "main",
sourceName = "Eunomia",
outputFolder = base_dir,
sqlOnly = T,
analysisIds = 1:10,
cdmVersion = "5.3.0")
<- readLines(file.path(base_dir, "achilles.sql"))
lines <- paste(lines, collapse = "\n") sql
::executeSql(connection, sql) DatabaseConnector
::getTableNames(connection, databaseSchema = 'main') DatabaseConnector
::querySql(connection, "select * from achilles_analysis limit 100") DatabaseConnector
::querySql(connection, "select * from achilles_results limit 100") DatabaseConnector
::querySql(connection, "select * from achilles_results_dist limit 100") DatabaseConnector
::exportToSQLite(connectionDetails, "main", SQLiteDbName = "eunomia-achilles.sqlite") ETLSyntheaBuilder
::exportToAres(
AchillesconnectionDetails = connectionDetails,
cdmDatabaseSchema = "main",
resultsDatabaseSchema = "main",
vocabDatabaseSchema = "main",
outputPath = "./data")
::executeDqChecks(
DataQualityDashboard
connectionDetails,cdmDatabaseSchema = "main",
resultsDatabaseSchema = "main",
outputFile = "synthea.json",
cdmSourceName = "Eunomia",
outputFolder = "./data")
::getTableNames(connection, databaseSchema = 'main') DatabaseConnector
# Note json_path must be an absolute path...
<- file.path(getwd(), base_dir, "synthea.json")
json_path ::viewDqDashboard(jsonPath = json_path) DataQualityDashboard
::querySql(connection = connection, "select * from main.\"main.dqdashboard_results\"") DatabaseConnector