Gilead-BioStats / gsm

Good Statistical Monitoring R Package
https://gilead-biostats.github.io/gsm/
Apache License 2.0
39 stars 9 forks source link

make analysis workflow work #1847

Closed samussiah closed 2 months ago

samussiah commented 2 months ago

Overview

Updates the analyze workflow to run on the output of the map workflow. The intent is to allow each of the numbered workflows to run on the output of the previous workflow without any additional variables. One design principle that I'm following is each input to the mapped, analysis, and reporting layers should correspond to a data frame rather than a list of data frames, to align with a database and/or flat file data model.

Test Notes/Sample Code

load_all()

lSourceData <- list(
    Source_STUDY = clindata::ctms_study,
    Source_SITE = clindata::ctms_site,
    Source_SUBJ = clindata::rawplus_dm,
    Source_AE = clindata::rawplus_ae,
    Source_PD = clindata::ctms_protdev,
    Source_LB = clindata::rawplus_lb,
    Source_STUDCOMP = clindata::rawplus_studcomp,
    Source_SDRGCOMP = clindata::rawplus_sdrgcomp,
    Source_QUERY = clindata::edc_queries,
    Source_DATAENT = clindata::edc_data_pages,
    Source_DATACHG = clindata::edc_data_points,
    Source_ENROLL = clindata::rawplus_enroll
)

lIngestWorkflow <- MakeWorkflowList('ingest')[[1]]
lRawData <- Ingest(lSourceData, lIngestWorkflow$spec)

lMapWorkflow <- MakeWorkflowList('map')[[1]]
lMappedData <- RunWorkflow(lMapWorkflow, lRawData)

lAnalyzeWorkflow <- MakeWorkflowList('analyze')[[1]]
lAnalysisData <- RunWorkflow(lAnalyzeWorkflow, lMappedData)

lReportingWorkflow <- MakeWorkflowList('reporting')[[1]]
lReportingData <- RunWorkflow(lReportingWorkflow, lAnalysisData)

lKRIReportBySiteWorkflow <- MakeWorkflowList(strPath = 'workflow/modules')[[2]]
lKRIReportBYSite <- RunWorkflow(lKRIReportBySiteWorkflow, lReportingData)

lKRIReportByCountryWorkflow <- MakeWorkflowList(strPath = 'workflow/modules')[[1]]
lKRIReportBYCountry <- RunWorkflow(lKRIReportByCountryWorkflow, lReportingData)

Connected Issues