Evaluate phenotypes with the DARWIN TreatmentPatterns Package
Source:R/Module-TreatmentPatterns.R
TreatmentPatternsModule.RdCharacterization and description of patterns of events (cohorts). against the OMOP Common Data Model.
Super class
Strategus::StrategusModule -> TreatmentPatternsModule
Methods
Method execute()
Execute Treatment Patterns
Usage
TreatmentPatternsModule$execute(
connectionDetails,
analysisSpecifications,
executionSettings
)Arguments
connectionDetailsAn object of class
connectionDetailsas created by theDatabaseConnector::createConnectionDetails()function.analysisSpecificationsAn object of type
AnalysisSpecificationsas created bycreateEmptyAnalysisSpecificiations().analysisSpecificationsAn object of type
AnalysisSpecificationsas created bycreateEmptyAnalysisSpecificiations().executionSettingsAn object of type
ExecutionSettingsas created bycreateCdmExecutionSettings()orcreateResultsExecutionSettings().
Method createResultsDataModel()
Create the results data model for the module
Usage
TreatmentPatternsModule$createResultsDataModel(
resultsConnectionDetails,
resultsDatabaseSchema,
tablePrefix = self$tablePrefix
)Arguments
resultsConnectionDetailsThe connection details to the results database which is an object of class
connectionDetailsas created by theDatabaseConnector::createConnectionDetails()function.resultsConnectionDetailsThe connection details to the results database which is an object of class
connectionDetailsas created by theDatabaseConnector::createConnectionDetails()function.resultsDatabaseSchemaThe schema in the results database that holds the results data model.
tablePrefixA prefix to apply to the database table names (optional).
tablePrefixA prefix to apply to the database table names (optional).
Method uploadResults()
Upload the results for TreatmentPatterns
Usage
TreatmentPatternsModule$uploadResults(
resultsConnectionDetails,
analysisSpecifications,
resultsDataModelSettings
)Arguments
resultsConnectionDetailsThe connection details to the results database which is an object of class
connectionDetailsas created by theDatabaseConnector::createConnectionDetails()function.resultsConnectionDetailsThe connection details to the results database which is an object of class
connectionDetailsas created by theDatabaseConnector::createConnectionDetails()function.analysisSpecificationsAn object of type
AnalysisSpecificationsas created bycreateEmptyAnalysisSpecificiations().analysisSpecificationsAn object of type
AnalysisSpecificationsas created bycreateEmptyAnalysisSpecificiations().resultsDataModelSettingsThe results data model settings as created using [@seealso
createResultsDataModelSettings()]
Method createModuleSpecifications()
Creates the TreatmentPatternsnModule Specifications
Usage
TreatmentPatternsModule$createModuleSpecifications(
cohorts,
includeTreatments = NULL,
indexDateOffset = NULL,
minEraDuration = 0,
splitEventCohorts = NULL,
splitTime = NULL,
eraCollapseSize = 30,
combinationWindow = 30,
minPostCombinationDuration = 30,
filterTreatments = "First",
maxPathLength = 5,
ageWindow = 5,
minCellCount = 1,
censorType = "minCellCount",
overlapMethod = "truncate",
concatTargets = TRUE,
startAnchor = "startDate",
windowStart = 0,
endAnchor = "endDate",
windowEnd = 0
)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")DEPRECATED"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)DEPRECATEDOffset the index date of theTargetcohort.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-18which includes subjects< 19. And age group18-150which includes subjects> 18.minCellCount(
integer(1):5)
Minimum count required per pathway. Censors data belowxas<x. This minimum value will carry over to the sankey diagram and sunburst plot.censorType(
character(1))"minCellCount"Censors pathways <
minCellCounttominCellCount."remove"Censors pathways <
minCellCountby removing them completely."mean"Censors pathways <
minCellCountto the mean of all frequencies belowminCellCount
overlapMethod(
character(1):"truncate") Method to decide how to deal with overlap that is not significant enough for combination."keep"will keep the dates as is."truncate"truncates the first occurring event to the start date of the next event.concatTargets(
logical(1):TRUE) Should multiple target cohorts for the same person be concatenated or not?startAnchor(
character(1):"startDate") Start date anchor. One of:"startDate","endDate"windowStart(
numeric(1):0) Offset forstartAnchorin days.endAnchor(
character(1):"endDate") End date anchor. One of:"startDate","endDate"windowEnd(
numeric(1):0) Offset forendAnchorin days.