Skip to content

Commit

Permalink
fix minCharacterizationMean in query (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
ginberg authored Sep 11, 2024
1 parent b5bb15d commit fe5c03c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: FeatureExtraction
Type: Package
Title: Generating Features for a Cohort
Version: 3.7.0
Date: 2024-09-02
Version: 3.7.1
Date: 2024-09-11
Authors@R: c(
person("Martijn", "Schuemie", , "schuemie@ohdsi.org", role = c("aut")),
person("Marc", "Suchard", role = c("aut")),
Expand Down
2 changes: 1 addition & 1 deletion inst/csv/jarChecksum.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d9f6ed460fb4a758786965f83b3c18f85dcdf3a1c9cb1b12319b1f7af243f9ef
b7c50aec30a5ec21a39c02253133a4e9607c9630010123844a75d858c0ec684a
Binary file not shown.
2 changes: 1 addition & 1 deletion java/org/ohdsi/featureExtraction/FeatureExtraction.java
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ private static String createQuerySql(JSONObject jsonObject, String cohortTable,
sql.append("\n) all_covariates\nINNER JOIN (\nSELECT cohort_definition_id, COUNT(*) AS total_count\nFROM @cohort_table {@cohort_definition_id != -1} ? {\nWHERE cohort_definition_id IN (@cohort_definition_id)}");
sql.append(" GROUP BY cohort_definition_id\n) total\n ON all_covariates.cohort_definition_id = total.cohort_definition_id");
if (minCharacterizationMean != 0) {
sql.append(" WHERE average_value >= " + minCharacterizationMean);
sql.append(" WHERE all_covariates.sum_value / (1.0 * total.total_count) >= " + minCharacterizationMean);
}
sql.append(";");
} else {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>org.ohdsi</groupId>
<artifactId>featureExtraction</artifactId>
<packaging>jar</packaging>
<version>3.7.0-SNAPSHOT</version>
<version>3.7.1-SNAPSHOT</version>
<name>featureExtraction</name>
<scm>
<connection>scm:git:https://github.com/OHDSI/featureExtraction</connection>
Expand Down
6 changes: 4 additions & 2 deletions tests/testthat/test-query-no-fail.R
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,8 @@ runExtractionAggregated <- function(connection, cdmDatabaseSchema, ohdsiDatabase
cohortIds = c(1124300),
rowIdField = "subject_id",
covariateSettings = settings,
aggregated = TRUE
aggregated = TRUE,
minCharacterizationMean = 0.001
))
return(covariateData)
}
Expand Down Expand Up @@ -531,7 +532,8 @@ runExtractionTemporalAggregated <- function(connection, cdmDatabaseSchema, ohdsi
cohortIds = c(1124300),
rowIdField = "subject_id",
covariateSettings = settings,
aggregated = TRUE
aggregated = TRUE,
minCharacterizationMean = 0.001
))
return(covariateData)
}
Expand Down

0 comments on commit fe5c03c

Please sign in to comment.