Skip to content

Commit

Permalink
Brought back missing analyses, bugfixes for PG/Oracle, Redshift (#321)
Browse files Browse the repository at this point in the history
* Fix for #317 (more Oracle cast issues), #313 (allow vocabDatabaseSchema parameter in achillesHeel), #312 (convert cdmVersion to character). Also, some strange encoding in the exportToJson.R script. Removed redundant concept_hierarchy.sql file (this was supposed to be removed for 1.6).

* Added analyses 822, 823, 1822, 1823 back. Fixed missing null cast in Heel RD 25. Adjusted analysis_details CSV to match new analyses. Added drop index statements.

* Fixes to analysis_details CSV, analysis 1822 had the wrong field name, added drop if not null statements in dropAllScratchTables

* Removed usage of DatabaseConnector::getTableNames() due to inconsistent effectiveness in Redshift

* Updated version number to 1.6.1
  • Loading branch information
Ajit Londhe authored and t-abdul-basser committed Oct 2, 2018
1 parent 07c47f3 commit 7fa4deb
Show file tree
Hide file tree
Showing 40 changed files with 160 additions and 643 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: Achilles
Type: Package
Title: Creates descriptive statistics summary for an entire OMOP CDM instance
Version: 1.6
Date: 2018-04-09
Version: 1.6.1
Date: 2018-10-02
Author: Patrick Ryan, Martijn Schuemie, Vojtech Huser, Chris Knoll, Ajit Londhe
Maintainer: Patrick Ryan <[email protected]>
LazyData: true
Expand All @@ -20,4 +20,4 @@ Suggests:
R.utils
License: Apache License
Roxygen: list(wrap = FALSE)
RoxygenNote: 6.0.1
RoxygenNote: 6.1.0
30 changes: 13 additions & 17 deletions R/Achilles.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ achilles <- function (connectionDetails,
cdmVersion <- .getCdmVersion(connectionDetails, cdmDatabaseSchema)
}

cdmVersion <- as.character(cdmVersion)

# Check CDM version is valid ---------------------------------------------------------------------------------------------------

if (compareVersion(a = as.character(cdmVersion), b = "5") < 0) {
Expand Down Expand Up @@ -839,9 +841,6 @@ dropAllScratchTables <- function(connectionDetails,

connection <- DatabaseConnector::connect(connectionDetails = connectionDetails)

scratchTables <- lapply(DatabaseConnector::getTableNames(connection = connection,
databaseSchema = scratchDatabaseSchema), function(t) tolower(t))

if ("achilles" %in% tableTypes) {

# Drop Achilles Scratch Tables ------------------------------------------------------
Expand All @@ -856,13 +855,11 @@ dropAllScratchTables <- function(connectionDetails,
sprintf("%s_dist_%d", tempAchillesPrefix, id)
})

dropTables <- c(Reduce(intersect, list(scratchTables, resultsTables)),
Reduce(intersect, list(scratchTables, resultsDistTables)))

dropSqls <- lapply(dropTables, function(scratchTable) {
SqlRender::renderSql("drop table @scratchDatabaseSchema.@scratchTable;",
scratchDatabaseSchema = scratchDatabaseSchema,
scratchTable = scratchTable)$sql
dropSqls <- lapply(c(resultsTables, resultsDistTables), function(scratchTable) {
sql <- SqlRender::renderSql("IF OBJECT_ID('@scratchDatabaseSchema.@scratchTable', 'U') IS NOT NULL DROP TABLE @scratchDatabaseSchema.@scratchTable;",
scratchDatabaseSchema = scratchDatabaseSchema,
scratchTable = scratchTable)$sql
sql <- SqlRender::translateSql(sql = sql, targetDialect = connectionDetails$dbms)$sql
})

cluster <- OhdsiRTools::makeCluster(numberOfThreads = numThreads, singleThreadToMain = TRUE)
Expand Down Expand Up @@ -890,13 +887,12 @@ dropAllScratchTables <- function(connectionDetails,
parallelHeelTables <- lapply(parallelFiles, function(t) tolower(paste(tempHeelPrefix,
trimws(tools::file_path_sans_ext(basename(t))),
sep = "_")))

dropTables <- Reduce(intersect, list(scratchTables, parallelHeelTables))

dropSqls <- lapply(dropTables, function(scratchTable) {
SqlRender::renderSql("drop table @scratchDatabaseSchema.@scratchTable;",
dropSqls <- lapply(parallelHeelTables, function(scratchTable) {
sql <- SqlRender::renderSql("IF OBJECT_ID('@scratchDatabaseSchema.@scratchTable', 'U') IS NOT NULL DROP TABLE @scratchDatabaseSchema.@scratchTable;",
scratchDatabaseSchema = scratchDatabaseSchema,
scratchTable = scratchTable)$sql
sql <- SqlRender::translateSql(sql = sql, targetDialect = connectionDetails$dbms)$sql
})

cluster <- OhdsiRTools::makeCluster(numberOfThreads = numThreads, singleThreadToMain = TRUE)
Expand Down Expand Up @@ -924,12 +920,12 @@ dropAllScratchTables <- function(connectionDetails,
conceptHierarchyTables <- lapply(hierarchySqlFiles, function(t) tolower(paste(tempAchillesPrefix, "ch",
trimws(tools::file_path_sans_ext(basename(t))),
sep = "_")))
dropTables <- Reduce(intersect, list(scratchTables, conceptHierarchyTables))

dropSqls <- lapply(dropTables, function(scratchTable) {
SqlRender::renderSql("drop table @scratchDatabaseSchema.@scratchTable;",
dropSqls <- lapply(conceptHierarchyTables, function(scratchTable) {
sql <- SqlRender::renderSql("IF OBJECT_ID('@scratchDatabaseSchema.@scratchTable', 'U') IS NOT NULL DROP TABLE @scratchDatabaseSchema.@scratchTable;",
scratchDatabaseSchema = scratchDatabaseSchema,
scratchTable = scratchTable)$sql
sql <- SqlRender::translateSql(sql = sql, targetDialect = connectionDetails$dbms)$sql
})

cluster <- OhdsiRTools::makeCluster(numberOfThreads = numThreads, singleThreadToMain = TRUE)
Expand Down
8 changes: 8 additions & 0 deletions R/AchillesHeel.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#' @param resultsDatabaseSchema string name of database schema that we can write final results to. Default is cdmDatabaseSchema. On SQL Server, this should specifiy both the database and the schema,
#' so for example 'results.dbo'.
#' @param scratchDatabaseSchema (OPTIONAL, multi-threaded mode) Name of a fully qualified schema that is accessible to/from the resultsDatabaseSchema, that can store all of the scratch tables. Default is resultsDatabaseSchema.
#' @param vocabDatabaseSchema String name of database schema that contains OMOP Vocabulary. Default is cdmDatabaseSchema. On SQL Server, this should specifiy both the database and the schema, so for example 'results.dbo'.
#' @param cdmVersion Define the OMOP CDM version used: currently supports v5 and above. Default = "5".
#' @param numThreads (OPTIONAL, multi-threaded mode) The number of threads to use to run Achilles in parallel. Default is 1 thread.
#' @param tempHeelPrefix (OPTIONAL, multi-threaded mode) The prefix to use for the "temporary" (but actually permanent) Heel tables. Default is "tmpheel"
Expand All @@ -55,6 +56,7 @@
#' cdmDatabaseSchema = "cdm",
#' resultsDatabaseSchema = "results",
#' scratchDatabaseSchema = "scratch",
#' vocabDatabaseSchema = "vocab",
#' cdmVersion = "5.3.0",
#' numThreads = 10)
#' }
Expand All @@ -63,6 +65,7 @@ achillesHeel <- function(connectionDetails,
cdmDatabaseSchema,
resultsDatabaseSchema = cdmDatabaseSchema,
scratchDatabaseSchema = resultsDatabaseSchema,
vocabDatabaseSchema = cdmDatabaseSchema,
cdmVersion = "5",
numThreads = 1,
tempHeelPrefix = "tmpheel",
Expand All @@ -79,6 +82,8 @@ achillesHeel <- function(connectionDetails,
cdmVersion <- .getCdmVersion(connectionDetails, cdmDatabaseSchema)
}

cdmVersion <- as.character(cdmVersion)

# Check CDM version is valid ---------------------------------------------------------------------------------------------------

if (compareVersion(a = cdmVersion, b = "5") < 0) {
Expand Down Expand Up @@ -145,6 +150,7 @@ achillesHeel <- function(connectionDetails,
cdmDatabaseSchema = cdmDatabaseSchema,
resultsDatabaseSchema = resultsDatabaseSchema,
scratchDatabaseSchema = scratchDatabaseSchema,
vocabDatabaseSchema = vocabDatabaseSchema,
schemaDelim = schemaDelim,
tempHeelPrefix = tempHeelPrefix,
numThreads = numThreads,
Expand Down Expand Up @@ -360,6 +366,7 @@ achillesHeel <- function(connectionDetails,
cdmDatabaseSchema,
resultsDatabaseSchema,
scratchDatabaseSchema,
vocabDatabaseSchema,
schemaDelim,
tempHeelPrefix,
numThreads,
Expand All @@ -375,6 +382,7 @@ achillesHeel <- function(connectionDetails,
cdmDatabaseSchema = cdmDatabaseSchema,
resultsDatabaseSchema = resultsDatabaseSchema,
scratchDatabaseSchema = scratchDatabaseSchema,
vocabDatabaseSchema = vocabDatabaseSchema,
schemaDelim = schemaDelim,
tempHeelPrefix = tempHeelPrefix,
heelName = gsub(pattern = ".sql", replacement = "", x = basename(heelFile)))
Expand Down
2 changes: 1 addition & 1 deletion R/exportToJson.R
Original file line number Diff line number Diff line change
Expand Up @@ -1482,7 +1482,7 @@ generateObservationPeriodReport <- function(conn, dbms, cdmDatabaseSchema, resul
# a. Visualization: scatterplot
# b. X-axis: length of observation period
# c. Y-axis: % of population observed
# d. Note: will look like a Kaplan-Meier ‘survival’ plot, but information is the same as shown in ‘length of observation’ barchart, just plotted as cumulative
# d. Note: will look like a Kaplan-Meier survival plot, but information is the same as shown in a length of observation barchart, just plotted as cumulative

renderedSql <- SqlRender::loadRenderTranslateSql(sqlFilename = "export/observationperiod/cumulativeduration.sql",
packageName = "Achilles",
Expand Down
6 changes: 5 additions & 1 deletion inst/csv/achilles/achilles_analysis_details.csv
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ ANALYSIS_ID,DISTRIBUTION,COST,DISTRIBUTED_FIELD,ANALYSIS_NAME,STRATUM_1_NAME,STR
814,0,0,,"Number of observation records with no value (numeric, string, or concept)",,,,,
815,1,0,,"Distribution of numeric values, by observation_concept_id and unit_concept_id",,,,,
820,0,0,,Number of observation records by observation start month,calendar month,,,,
822,0,0,,"Number of observation records, by observation_concept_id and value_as_concept_id",observation_concept_id,value_as_concept_id,,,
823,0,0,,"Number of observation records, by observation_concept_id and qualifier_concept_id",observation_concept_id,qualifier_concept_id,,,
891,0,0,,Percentage of total persons that have at least x observations,observation_concept_id,observation_person,,,
900,0,0,,"Number of persons with at least one drug era, by drug_concept_id",drug_concept_id,,,,
901,0,0,,"Number of drug era records, by drug_concept_id",drug_concept_id,,,,
Expand Down Expand Up @@ -197,10 +199,12 @@ ANALYSIS_ID,DISTRIBUTION,COST,DISTRIBUTED_FIELD,ANALYSIS_NAME,STRATUM_1_NAME,STR
1814,0,0,,"Number of measurement records with no value (numeric, string, or concept)",,,,,
1815,1,0,,"Distribution of numeric values, by measurement_concept_id and unit_concept_id",,,,,
1816,1,0,,"Distribution of low range, by measurement_concept_id and unit_concept_id",,,,,
1817,1,0,,"Distribution of high range, by observation_concept_id and unit_concept_id",,,,,
1817,1,0,,"Distribution of high range, by measurement_concept_id and unit_concept_id",,,,,
1818,0,0,,"Number of measurement records below/within/above normal range, by measurement_concept_id and unit_concept_id",,,,,
1820,0,0,,Number of measurement records by measurement start month,calendar month,,,,
1821,0,0,,Number of measurement records with no numeric value,,,,,
1822,0,0,,"Number of measurement records, by measurement_concept_id and value_as_concept_id",measurement_concept_id,value_as_concept_id,,,
1823,0,0,,"Number of measurement records, by measurement_concept_id and operator_concept_id",measurement_concept_id,operator_concept_id,,,
1891,0,0,,Percentage of total persons that have at least x measurements,measurement_concept_id,measurement_person,,,
1900,0,0,,"Source values mapped to concept_id 0 by table, by source_value",table_name,source_value,,,
2000,0,0,,Number of patients with at least 1 Dx and 1 Rx,,,,,
Expand Down
15 changes: 15 additions & 0 deletions inst/sql/sql_server/analyses/1822.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

-- 1822 Number of measurement records, by measurement_concept_id and value_as_concept_id

--HINT DISTRIBUTE_ON_KEY(stratum_1)
select
1822 AS analysis_id,
cast(measurement_concept_id AS varchar(255)) AS stratum_1,
cast(value_as_concept_id AS varchar(255)) AS stratum_2,
cast(null as varchar(255)) as stratum_3,
cast(null as varchar(255)) as stratum_4,
cast(null as varchar(255)) as stratum_5,
count_big(*) AS count_value
into @scratchDatabaseSchema@schemaDelim@tempAchillesPrefix_1822
from @cdmDatabaseSchema.measurement
group by measurement_concept_id, value_as_concept_id;
15 changes: 15 additions & 0 deletions inst/sql/sql_server/analyses/1823.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

-- 1823 Number of measurement records, by measurement_concept_id and operator_concept_id

--HINT DISTRIBUTE_ON_KEY(stratum_1)
select
1823 AS analysis_id,
cast(measurement_concept_id AS varchar(255)) AS stratum_1,
cast(operator_concept_id AS varchar(255)) AS stratum_2,
cast(null as varchar(255)) as stratum_3,
cast(null as varchar(255)) as stratum_4,
cast(null as varchar(255)) as stratum_5,
count_big(*) AS count_value
into @scratchDatabaseSchema@schemaDelim@tempAchillesPrefix_1823
from @cdmDatabaseSchema.measurement
group by measurement_concept_id, operator_concept_id
15 changes: 15 additions & 0 deletions inst/sql/sql_server/analyses/822.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

-- 822 Number of observation records, by observation_concept_id and value_as_concept_id, observation_concept_id

--HINT DISTRIBUTE_ON_KEY(stratum_1)
select
822 AS analysis_id,
cast(observation_concept_id AS varchar(255)) AS stratum_1,
cast(value_as_concept_id AS varchar(255)) AS stratum_2,
cast(null as varchar(255)) as stratum_3,
cast(null as varchar(255)) as stratum_4,
cast(null as varchar(255)) as stratum_5,
count_big(*) AS count_value
into @scratchDatabaseSchema@schemaDelim@tempAchillesPrefix_822
from @cdmDatabaseSchema.observation
group by observation_concept_id, value_as_concept_id;
15 changes: 15 additions & 0 deletions inst/sql/sql_server/analyses/823.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

-- 823 Number of observation records, by observation_concept_id and qualifier_concept_id

--HINT DISTRIBUTE_ON_KEY(stratum_1)
select
823 AS analysis_id,
cast(observation_concept_id AS varchar(255)) AS stratum_1,
cast(qualifier_concept_id AS varchar(255)) AS stratum_2,
cast(null as varchar(255)) as stratum_3,
cast(null as varchar(255)) as stratum_4,
cast(null as varchar(255)) as stratum_5,
count_big(*) AS count_value
into @scratchDatabaseSchema@schemaDelim@tempAchillesPrefix_823
from @cdmDatabaseSchema.observation
group by observation_concept_id, qualifier_concept_id;
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ from
FROM @resultsDatabaseSchema.ACHILLES_results or1
INNER JOIN @resultsDatabaseSchema.ACHILLES_analysis oa1
ON or1.analysis_id = oa1.analysis_id
INNER JOIN @cdmDatabaseSchema.concept c1
INNER JOIN @vocabDatabaseSchema.concept c1
ON or1.stratum_1 = CAST(c1.concept_id AS VARCHAR(19))
WHERE or1.analysis_id IN (202)
AND or1.stratum_1 IS NOT NULL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ from
FROM @resultsDatabaseSchema.ACHILLES_results or1
INNER JOIN @resultsDatabaseSchema.ACHILLES_analysis oa1
ON or1.analysis_id = oa1.analysis_id
INNER JOIN @cdmDatabaseSchema.concept c1
INNER JOIN @vocabDatabaseSchema.concept c1
ON or1.stratum_1 = CAST(c1.concept_id AS VARCHAR(19))
WHERE or1.analysis_id IN (301)
AND or1.stratum_1 IS NOT NULL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ from
FROM @resultsDatabaseSchema.ACHILLES_results or1
INNER JOIN @resultsDatabaseSchema.ACHILLES_analysis oa1
ON or1.analysis_id = oa1.analysis_id
INNER JOIN @cdmDatabaseSchema.concept c1
INNER JOIN @vocabDatabaseSchema.concept c1
ON or1.stratum_1 = CAST(c1.concept_id AS VARCHAR(19))
WHERE or1.analysis_id IN (
400,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ from
FROM @resultsDatabaseSchema.ACHILLES_results or1
INNER JOIN @resultsDatabaseSchema.ACHILLES_analysis oa1
ON or1.analysis_id = oa1.analysis_id
INNER JOIN @cdmDatabaseSchema.concept c1
INNER JOIN @vocabDatabaseSchema.concept c1
ON or1.stratum_1 = CAST(c1.concept_id AS VARCHAR(19))
WHERE or1.analysis_id IN (
700,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ from
FROM @resultsDatabaseSchema.ACHILLES_results or1
INNER JOIN @resultsDatabaseSchema.ACHILLES_analysis oa1
ON or1.analysis_id = oa1.analysis_id
INNER JOIN @cdmDatabaseSchema.concept c1
INNER JOIN @vocabDatabaseSchema.concept c1
ON or1.stratum_1 = CAST(c1.concept_id AS VARCHAR(19))
WHERE or1.analysis_id IN (600)
AND or1.stratum_1 IS NOT NULL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ from
FROM @resultsDatabaseSchema.ACHILLES_results or1
INNER JOIN @resultsDatabaseSchema.ACHILLES_analysis oa1
ON or1.analysis_id = oa1.analysis_id
INNER JOIN @cdmDatabaseSchema.concept c1
INNER JOIN @vocabDatabaseSchema.concept c1
ON or1.stratum_1 = CAST(c1.concept_id AS VARCHAR(19))
WHERE or1.analysis_id IN (1610)
AND or1.stratum_1 IS NOT NULL
Expand Down
2 changes: 1 addition & 1 deletion inst/sql/sql_server/heels/parallel/heel_results/rule_4.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ from
FROM @resultsDatabaseSchema.ACHILLES_results or1
INNER JOIN @resultsDatabaseSchema.ACHILLES_analysis oa1
ON or1.analysis_id = oa1.analysis_id
LEFT JOIN @cdmDatabaseSchema.concept c1
LEFT JOIN @vocabDatabaseSchema.concept c1
ON or1.stratum_1 = CAST(c1.concept_id AS VARCHAR(19))
WHERE or1.analysis_id IN (
2,
Expand Down
2 changes: 1 addition & 1 deletion inst/sql/sql_server/heels/parallel/heel_results/rule_5.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ from
FROM @resultsDatabaseSchema.ACHILLES_results or1
INNER JOIN @resultsDatabaseSchema.ACHILLES_analysis oa1
ON or1.analysis_id = oa1.analysis_id
LEFT JOIN @cdmDatabaseSchema.concept c1
LEFT JOIN @vocabDatabaseSchema.concept c1
ON or1.stratum_2 = CAST(c1.concept_id AS VARCHAR(19))
WHERE or1.analysis_id IN (
405,
Expand Down
2 changes: 1 addition & 1 deletion inst/sql/sql_server/heels/parallel/heel_results/rule_7.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ from
FROM @resultsDatabaseSchema.ACHILLES_results or1
INNER JOIN @resultsDatabaseSchema.ACHILLES_analysis oa1
ON or1.analysis_id = oa1.analysis_id
INNER JOIN @cdmDatabaseSchema.concept c1
INNER JOIN @vocabDatabaseSchema.concept c1
ON or1.stratum_1 = CAST(c1.concept_id AS VARCHAR(19))
WHERE or1.analysis_id IN (2)
AND or1.stratum_1 IS NOT NULL
Expand Down
2 changes: 1 addition & 1 deletion inst/sql/sql_server/heels/parallel/heel_results/rule_8.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ from
FROM @resultsDatabaseSchema.ACHILLES_results or1
INNER JOIN @resultsDatabaseSchema.ACHILLES_analysis oa1
ON or1.analysis_id = oa1.analysis_id
INNER JOIN @cdmDatabaseSchema.concept c1
INNER JOIN @vocabDatabaseSchema.concept c1
ON or1.stratum_1 = CAST(c1.concept_id AS VARCHAR(19))
WHERE or1.analysis_id IN (4)
AND or1.stratum_1 IS NOT NULL
Expand Down
2 changes: 1 addition & 1 deletion inst/sql/sql_server/heels/parallel/heel_results/rule_9.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ from
FROM @resultsDatabaseSchema.ACHILLES_results or1
INNER JOIN @resultsDatabaseSchema.ACHILLES_analysis oa1
ON or1.analysis_id = oa1.analysis_id
INNER JOIN @cdmDatabaseSchema.concept c1
INNER JOIN @vocabDatabaseSchema.concept c1
ON or1.stratum_1 = CAST(c1.concept_id AS VARCHAR(19))
WHERE or1.analysis_id IN (5)
AND or1.stratum_1 IS NOT NULL
Expand Down
2 changes: 1 addition & 1 deletion inst/sql/sql_server/heels/parallel/results_derived/25.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ from
(
--100000+analysis_id,
select
NULL as analysis_id,
cast(null as int) as analysis_id,
stratum_2 as stratum_1,
cast(null as varchar(255)) as stratum_2,
count_value,
Expand Down
5 changes: 5 additions & 0 deletions inst/sql/sql_server/post_processing/achilles_indices.sql
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,15 @@ CREATE CLUSTERED COLUMNSTORE INDEX ClusteredIndex_Achilles_results
ON @resultsDatabaseSchema.ACHILLES_results;
}


DROP INDEX IF EXISTS idx_ar_aid on @resultsDatabaseSchema.ACHILLES_results (analysis_id);
CREATE INDEX idx_ar_aid
ON @resultsDatabaseSchema.ACHILLES_results (analysis_id);

DROP INDEX IF EXISTS idx_ar_s1 on @resultsDatabaseSchema.ACHILLES_results (stratum_1);
CREATE INDEX idx_ar_s1
ON @resultsDatabaseSchema.ACHILLES_results (stratum_1);

CREATE INDEX idx_ar_s2
ON @resultsDatabaseSchema.ACHILLES_results (stratum_2);
CREATE INDEX idx_ar_aid_s1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
snomed.concept_id,
snomed.concept_name AS concept_name,
'Condition' AS treemap,
null as concept_hierarchy_type,
cast(null as varchar(20)) as concept_hierarchy_type,
pt_to_hlt.pt_concept_name as level1_concept_name,
hlt_to_hlgt.hlt_concept_name as level2_concept_name,
hlgt_to_soc.hlgt_concept_name as level3_concept_name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
rxnorm.concept_id,
rxnorm.concept_name AS concept_name,
'Drug' AS treemap,
null as concept_hierarchy_type,
cast(null as varchar(20)) as concept_hierarchy_type,
rxnorm.rxnorm_ingredient_concept_name as level1_concept_name,
atc5_to_atc3.atc5_concept_name as level2_concept_name,
atc3_to_atc1.atc3_concept_name as level3_concept_name,
Expand Down
Loading

0 comments on commit 7fa4deb

Please sign in to comment.