14
14
# See the License for the specific language governing permissions and
15
15
# limitations under the License.
16
16
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
-
85
17
# ' Execute cohort diagnostics
86
18
# '
87
19
# ' @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.
90
22
# '
91
23
# ' Characterization:
92
24
# ' If runTemporalCohortCharacterization argument is TRUE, then the following default covariateSettings object will be created
93
25
# ' using \code{RFeatureExtraction::createTemporalCovariateSettings}
94
26
# ' Alternatively, a covariate setting object may be created using the above as an example.
95
27
# '
96
28
# ' @template Connection
97
- # '
98
29
# ' @template CdmDatabaseSchema
99
30
# ' @template VocabularyDatabaseSchema
100
31
# ' @template CohortDatabaseSchema
101
32
# ' @template TempEmulationSchema
102
- # '
103
33
# ' @template CohortTable
104
- # '
105
- # '
106
34
# ' @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
+ # '
112
44
# ' @param cohortTableNames Cohort Table names used by CohortGenerator package
113
45
# ' @param conceptCountsTable Concepts count table name. The default is "#concept_counts" to create a temporal concept counts table.
114
46
# ' 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').
116
47
# ' @param databaseName The full name of the database. If NULL, defaults to value in cdm_source table
117
48
# ' @param databaseDescription A short description (several sentences) of the database. If NULL, defaults to value in cdm_source table
118
- # ' @template cdmVersion
119
49
# ' @param runInclusionStatistics Generate and export statistic on the cohort inclusion rules?
120
50
# ' @param runIncludedSourceConcepts Generate and export the source concepts included in the cohorts?
121
51
# ' @param runOrphanConcepts Generate and export potential orphan concepts?
@@ -130,12 +60,7 @@ getDefaultCovariateSettings <- function() {
130
60
# ' @param temporalCovariateSettings Either an object of type \code{covariateSettings} as created using one of
131
61
# ' the createTemporalCovariateSettings function in the FeatureExtraction package, or a list
132
62
# ' 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)
137
63
# ' @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?
139
64
# ' @param incrementalFolder If \code{incremental = TRUE}, specify a folder where records are kept
140
65
# ' of which cohort diagnostics has been executed.
141
66
# ' @param useExternalConceptCountsTable If TRUE an external table for the cohort concept counts will be used.
@@ -243,15 +168,11 @@ executeDiagnostics <- function(cohortDefinitionSet,
243
168
runFeatureExtractionOnSample = FALSE ,
244
169
sampleN = 1000 ,
245
170
seed = 64374 ,
246
- <<<<<<< HEAD : R / RunDiagnostics.R
247
- seedArgs = NULL ) {
248
- =======
249
171
seedArgs = NULL ,
250
172
sampleIdentifierExpression = " cohortId * 1000 + seed" ,
251
173
useAchilles = FALSE ,
252
174
achillesDatabaseSchema = NULL ,
253
175
workDatabaseSchema = NULL ) {
254
- >>>>>>> darwin_sprint : R / hold / executeDiagnostics.R
255
176
# collect arguments that were passed to cohort diagnostics at initiation
256
177
callingArgsJson <-
257
178
list (
0 commit comments