Skip to content

Commit 2eeb33a

Browse files
committed
doc
1 parent 3f3869b commit 2eeb33a

8 files changed

+369
-135
lines changed

NAMESPACE

+5
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ export(createDiagnosticsExplorerZip)
55
export(createMergedResultsFile)
66
export(createResultsDataModel)
77
export(deployPositConnectApp)
8+
export(executeDiagnostics)
89
export(getCdmDataSourceInformation)
910
export(getCohortCounts)
1011
export(getConceptCountsTableName)
1112
export(getDataMigrator)
13+
export(getDefaultCovariateSettings)
1214
export(getDefaultVocabularyTableNames)
1315
export(getResultsDataModelSpecifications)
1416
export(launchDiagnosticsExplorer)
@@ -21,16 +23,19 @@ export(runInclusionStatistics)
2123
export(runOrphanConcepts)
2224
export(runTemporalCohortCharacterization)
2325
export(runTimeSeries)
26+
export(runVisitContext)
2427
export(uploadResults)
2528
import(DatabaseConnector)
2629
importFrom(CohortGenerator,getCohortCounts)
30+
importFrom(CohortGenerator,getCohortTableNames)
2731
importFrom(FeatureExtraction,createDefaultCovariateSettings)
2832
importFrom(FeatureExtraction,createTemporalCovariateSettings)
2933
importFrom(dplyr,"%>%")
3034
importFrom(grDevices,rgb)
3135
importFrom(methods,is)
3236
importFrom(rlang,.data)
3337
importFrom(stats,aggregate)
38+
importFrom(tidyr,any_of)
3439
importFrom(utils,install.packages)
3540
importFrom(utils,menu)
3641
importFrom(utils,packageName)

R/hold/executeDiagnostics.R R/executeDiagnostics.R

+11-90
Original file line numberDiff line numberDiff line change
@@ -14,108 +14,38 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
#' Get default covariate settings
18-
#' @description
19-
#' Default covariate settings for cohort diagnostics execution
20-
#' @export
21-
getDefaultCovariateSettings <- function() {
22-
FeatureExtraction::createTemporalCovariateSettings(
23-
useDemographicsGender = TRUE,
24-
useDemographicsAge = TRUE,
25-
useDemographicsAgeGroup = TRUE,
26-
useDemographicsRace = TRUE,
27-
useDemographicsEthnicity = TRUE,
28-
useDemographicsIndexYear = TRUE,
29-
useDemographicsIndexMonth = TRUE,
30-
useDemographicsIndexYearMonth = TRUE,
31-
useDemographicsPriorObservationTime = TRUE,
32-
useDemographicsPostObservationTime = TRUE,
33-
useDemographicsTimeInCohort = TRUE,
34-
useConditionOccurrence = TRUE,
35-
useProcedureOccurrence = TRUE,
36-
useDrugEraStart = TRUE,
37-
useMeasurement = TRUE,
38-
useConditionEraStart = TRUE,
39-
useConditionEraOverlap = TRUE,
40-
useConditionEraGroupStart = FALSE, # do not use because https://github.com/OHDSI/FeatureExtraction/issues/144
41-
useConditionEraGroupOverlap = TRUE,
42-
useDrugExposure = FALSE, # leads to too many concept id
43-
useDrugEraOverlap = FALSE,
44-
useDrugEraGroupStart = FALSE, # do not use because https://github.com/OHDSI/FeatureExtraction/issues/144
45-
useDrugEraGroupOverlap = TRUE,
46-
useObservation = TRUE,
47-
useDeviceExposure = TRUE,
48-
useCharlsonIndex = TRUE,
49-
useDcsi = TRUE,
50-
useChads2 = TRUE,
51-
useChads2Vasc = TRUE,
52-
useHfrs = FALSE,
53-
temporalStartDays = c(
54-
# components displayed in cohort characterization
55-
-9999, # anytime prior
56-
-365, # long term prior
57-
-180, # medium term prior
58-
-30, # short term prior
59-
60-
# components displayed in temporal characterization
61-
-365, # one year prior to -31
62-
-30, # 30 day prior not including day 0
63-
0, # index date only
64-
1, # 1 day after to day 30
65-
31,
66-
-9999 # Any time prior to any time future
67-
),
68-
temporalEndDays = c(
69-
0, # anytime prior
70-
0, # long term prior
71-
0, # medium term prior
72-
0, # short term prior
73-
74-
# components displayed in temporal characterization
75-
-31, # one year prior to -31
76-
-1, # 30 day prior not including day 0
77-
0, # index date only
78-
30, # 1 day after to day 30
79-
365,
80-
9999 # Any time prior to any time future
81-
)
82-
)
83-
}
84-
8517
#' Execute cohort diagnostics
8618
#'
8719
#' @description
88-
#' Runs the cohort diagnostics on all (or a subset of) the cohorts instantiated using the
89-
#' Assumes the cohorts have already been instantiated. with the CohortGenerator package
20+
#' Runs the cohort diagnostics on all (or a subset of) the cohorts.
21+
#' Assumes the cohorts have already been instantiated with the CohortGenerator package.
9022
#'
9123
#' Characterization:
9224
#' If runTemporalCohortCharacterization argument is TRUE, then the following default covariateSettings object will be created
9325
#' using \code{RFeatureExtraction::createTemporalCovariateSettings}
9426
#' Alternatively, a covariate setting object may be created using the above as an example.
9527
#'
9628
#' @template Connection
97-
#'
9829
#' @template CdmDatabaseSchema
9930
#' @template VocabularyDatabaseSchema
10031
#' @template CohortDatabaseSchema
10132
#' @template TempEmulationSchema
102-
#'
10333
#' @template CohortTable
104-
#'
105-
#'
10634
#' @template CohortSetReference
107-
#' @param exportFolder The folder where the output will be exported to. If this folder
108-
#' does not exist it will be created.
109-
#' @param cohortIds Optionally, provide a subset of cohort IDs to restrict the
110-
#' diagnostics to.
111-
#' @param cohortDefinitionSet Data.frame of cohorts must include columns cohortId, cohortName, json, sql
35+
#' @template exportFolder
36+
#' @template cohortIds
37+
#' @template cohortDefinitionSet
38+
#' @template MinCellCount
39+
#' @template Incremental
40+
#' @template cdmVersion
41+
#' @template databaseId
42+
#' @template minCharacterizationMean
43+
#'
11244
#' @param cohortTableNames Cohort Table names used by CohortGenerator package
11345
#' @param conceptCountsTable Concepts count table name. The default is "#concept_counts" to create a temporal concept counts table.
11446
#' If an external concept counts table is used, provide the name in character, e.g. "concept_counts" without a hash
115-
#' @param databaseId A short string for identifying the database (e.g. 'Synpuf').
11647
#' @param databaseName The full name of the database. If NULL, defaults to value in cdm_source table
11748
#' @param databaseDescription A short description (several sentences) of the database. If NULL, defaults to value in cdm_source table
118-
#' @template cdmVersion
11949
#' @param runInclusionStatistics Generate and export statistic on the cohort inclusion rules?
12050
#' @param runIncludedSourceConcepts Generate and export the source concepts included in the cohorts?
12151
#' @param runOrphanConcepts Generate and export potential orphan concepts?
@@ -130,12 +60,7 @@ getDefaultCovariateSettings <- function() {
13060
#' @param temporalCovariateSettings Either an object of type \code{covariateSettings} as created using one of
13161
#' the createTemporalCovariateSettings function in the FeatureExtraction package, or a list
13262
#' of such objects.
133-
#' @param minCellCount The minimum cell count for fields contains person counts or fractions.
134-
#' @param minCharacterizationMean The minimum mean value for characterization output. Values below this will be cut off from output. This
135-
#' will help reduce the file size of the characterization output, but will remove information
136-
#' on covariates that have very low values. The default is 0.001 (i.e. 0.1 percent)
13763
#' @param irWashoutPeriod Number of days washout to include in calculation of incidence rates - default is 0
138-
#' @param incremental Create only cohort diagnostics that haven't been created before?
13964
#' @param incrementalFolder If \code{incremental = TRUE}, specify a folder where records are kept
14065
#' of which cohort diagnostics has been executed.
14166
#' @param useExternalConceptCountsTable If TRUE an external table for the cohort concept counts will be used.
@@ -243,15 +168,11 @@ executeDiagnostics <- function(cohortDefinitionSet,
243168
runFeatureExtractionOnSample = FALSE,
244169
sampleN = 1000,
245170
seed = 64374,
246-
<<<<<<< HEAD:R/RunDiagnostics.R
247-
seedArgs = NULL) {
248-
=======
249171
seedArgs = NULL,
250172
sampleIdentifierExpression = "cohortId * 1000 + seed",
251173
useAchilles = FALSE,
252174
achillesDatabaseSchema = NULL,
253175
workDatabaseSchema = NULL) {
254-
>>>>>>> darwin_sprint:R/hold/executeDiagnostics.R
255176
# collect arguments that were passed to cohort diagnostics at initiation
256177
callingArgsJson <-
257178
list(

man-roxygen/minCharacterizationMean.R

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#' @param minCharacterizationMean The minimum mean value for characterization output. Values below this will be cut off from output. This
2+
#' will help reduce the file size of the characterization output, but will remove information
3+
#' on covariates that have very low values. The default is 0.001 (i.e. 0.1 percent)

man/createConceptCountsTable.Rd

+14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)