Evaluate phenotypes with the DARWIN TreatmentPatterns Package
Source:R/Module-TreatmentPatterns.R
TreatmentPatternsModule.Rd
Characterization and description of patterns of events (cohorts). against the OMOP Common Data Model.
Super class
Strategus::StrategusModule
-> TreatmentPatternsModule
Methods
Inherited methods
Method execute()
Execute Treatment Patterns
Usage
TreatmentPatternsModule$execute(
connectionDetails,
analysisSpecifications,
executionSettings
)
Arguments
connectionDetails
An object of class
connectionDetails
as created by theDatabaseConnector::createConnectionDetails()
function.analysisSpecifications
An object of type
AnalysisSpecifications
as created bycreateEmptyAnalysisSpecificiations()
.analysisSpecifications
An object of type
AnalysisSpecifications
as created bycreateEmptyAnalysisSpecificiations()
.executionSettings
An object of type
ExecutionSettings
as created bycreateCdmExecutionSettings()
orcreateResultsExecutionSettings()
.
Method createResultsDataModel()
Create the results data model for the module
Usage
TreatmentPatternsModule$createResultsDataModel(
resultsConnectionDetails,
resultsDatabaseSchema,
tablePrefix = self$tablePrefix
)
Arguments
resultsConnectionDetails
The connection details to the results database which is an object of class
connectionDetails
as created by theDatabaseConnector::createConnectionDetails()
function.resultsConnectionDetails
The connection details to the results database which is an object of class
connectionDetails
as created by theDatabaseConnector::createConnectionDetails()
function.resultsDatabaseSchema
The schema in the results database that holds the results data model.
tablePrefix
A prefix to apply to the database table names (optional).
tablePrefix
A prefix to apply to the database table names (optional).
Method uploadResults()
Upload the results for TreatmentPatterns
Usage
TreatmentPatternsModule$uploadResults(
resultsConnectionDetails,
analysisSpecifications,
resultsDataModelSettings
)
Arguments
resultsConnectionDetails
The connection details to the results database which is an object of class
connectionDetails
as created by theDatabaseConnector::createConnectionDetails()
function.resultsConnectionDetails
The connection details to the results database which is an object of class
connectionDetails
as created by theDatabaseConnector::createConnectionDetails()
function.analysisSpecifications
An object of type
AnalysisSpecifications
as created bycreateEmptyAnalysisSpecificiations()
.analysisSpecifications
An object of type
AnalysisSpecifications
as created bycreateEmptyAnalysisSpecificiations()
.resultsDataModelSettings
The results data model settings as created using [@seealso
createResultsDataModelSettings()
]
Method createModuleSpecifications()
Creates the TreatmentPatternsnModule Specifications
Usage
TreatmentPatternsModule$createModuleSpecifications(
cohorts,
includeTreatments = "startDate",
indexDateOffset = 0,
minEraDuration = 0,
splitEventCohorts = NULL,
splitTime = NULL,
eraCollapseSize = 30,
combinationWindow = 30,
minPostCombinationDuration = 30,
filterTreatments = "First",
maxPathLength = 5,
ageWindow = 5,
minCellCount = 1,
censorType = "minCellCount"
)
Arguments
cohorts
(
data.frame()
)
Data frame containing the following columns and data types:- cohortId
numeric(1)
Cohort ID's of the cohorts to be used in the cohort table.
- cohortName
character(1)
Cohort names of the cohorts to be used in the cohort table.
- type
character(1)
["target", "event', "exit"] Cohort type, describing if the cohort is a target, event, or exit cohort
- cohortId
includeTreatments
(
character(1)
:"startDate"
)"startDate"
Include treatments after the target cohort start date and onwards.
"endDate"
Include treatments before target cohort end date and before.
indexDateOffset
(
integer(1)
:0
)
Offset the index date of theTarget
cohort.minEraDuration
(
integer(1)
:0
)
Minimum time an event era should last to be included in analysissplitEventCohorts
(
character(n)
:""
)
Specify event cohort to split in acute (< X days) and therapy (>= X days)splitTime
(
integer(1)
:30
)
Specify number of days (X) at which each of the split event cohorts should be split in acute and therapyeraCollapseSize
(
integer(1)
:30
)
Window of time between which two eras of the same event cohort are collapsed into one eracombinationWindow
(
integer(1)
:30
)
Window of time two event cohorts need to overlap to be considered a combination treatmentminPostCombinationDuration
(
integer(1)
:30
)
Minimum time an event era before or after a generated combination treatment should last to be included in analysisfilterTreatments
(
character(1)
:"First"
["first", "Changes", "all"])
Select first occurrence of (‘First’); changes between (‘Changes’); or all event cohorts (‘All’).maxPathLength
(
integer(1)
:5
)
Maximum number of steps included in treatment pathwayageWindow
(
integer(n)
:10
)
Number of years to bin age groups into. It may also be a vector of integers. I.e.c(0, 18, 150)
which will results in age group0-18
which includes subjects< 19
. And age group18-150
which includes subjects> 18
.minCellCount
(
integer(1)
:5
)
Minimum count required per pathway. Censors data belowx
as<x
. This minimum value will carry over to the sankey diagram and sunburst plot.censorType
(
character(1)
)"minCellCount"
Censors pathways <
minCellCount
tominCellCount
."remove"
Censors pathways <
minCellCount
by removing them completely."mean"
Censors pathways <
minCellCount
to the mean of all frequencies belowminCellCount