This page provides a sample Premature Deaths Report generated using
the gsm.kri package. Expand the “Setup” section below to
see the code used to generate the report. Or scroll down for the
standard report output.
# Load libraries
library(gsm.core)
library(gsm.mapping)
library(gsm.kri)
library(gsm.reporting)
library(dplyr)
window_days <- 90 # must match meta.WindowDays on kri0015 / cou0015 / pat0015
# --- Step 1: Map raw data (real gsm.mapping pipeline, per run_kri_report.R) ---
core_mappings <- c(
"AE",
"COUNTRY",
"DATACHG",
"DATAENT",
"ENROLL",
"IE",
"EXCLUSION",
"LB",
"PD",
"QUERY",
"STUDY",
"STUDCOMP",
"SDRGCOMP",
"SITE",
"SUBJ",
# Death + its mapping dependencies (needed to derive death_dy)
"Death",
"OverallResponse",
"Randomization"
)
mappings_wf <- MakeWorkflowList(
strNames = core_mappings,
strPath = "workflow/1_mappings",
strPackage = "gsm.mapping"
)
## Warning: `MakeWorkflowList()` was deprecated in gsm.core 1.3.0.
## ℹ Please use `workr::MakeWorkflowList()` instead.
## This warning is displayed once per session.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
lRaw <- Ingest(gsm.core::lSource, CombineSpecs(mappings_wf))
## ℹ Ingesting data for AE.
## [INFO] Creating a new temporary DuckDB connection.
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.
## [INFO] SQL Query complete: 3000 rows returned.
##
## [INFO] Disconnected from temporary DuckDB connection.
##
## ℹ Ingesting data for ENROLL.
##
## [INFO] Creating a new temporary DuckDB connection.
##
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.
## [INFO] SQL Query complete: 1000 rows returned.
##
## [INFO] Disconnected from temporary DuckDB connection.
##
## ℹ Ingesting data for IE.
##
## [INFO] Creating a new temporary DuckDB connection.
##
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.
## [INFO] SQL Query complete: 252 rows returned.
##
## [INFO] Disconnected from temporary DuckDB connection.
##
## ℹ Ingesting data for LB.
##
## [INFO] Creating a new temporary DuckDB connection.
##
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.
## [INFO] SQL Query complete: 405720 rows returned.
##
## [INFO] Disconnected from temporary DuckDB connection.
##
## ℹ Ingesting data for OverallResponse.
##
## [INFO] Creating a new temporary DuckDB connection.
##
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.
## [INFO] SQL Query complete: 1485 rows returned.
##
## [INFO] Disconnected from temporary DuckDB connection.
##
## ℹ Ingesting data for PD.
##
## [INFO] Creating a new temporary DuckDB connection.
##
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.
## [INFO] SQL Query complete: 3000 rows returned.
##
## [INFO] Disconnected from temporary DuckDB connection.
##
## ℹ Ingesting data for Randomization.
##
## [INFO] Creating a new temporary DuckDB connection.
##
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.
## [INFO] SQL Query complete: 757 rows returned.
##
## [INFO] Disconnected from temporary DuckDB connection.
##
## ℹ Ingesting data for SDRGCOMP.
##
## [INFO] Creating a new temporary DuckDB connection.
##
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.
## [INFO] SQL Query complete: 100 rows returned.
##
## [INFO] Disconnected from temporary DuckDB connection.
##
## ℹ Ingesting data for STUDCOMP.
##
## [INFO] Creating a new temporary DuckDB connection.
##
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.
## [INFO] SQL Query complete: 100 rows returned.
##
## [INFO] Disconnected from temporary DuckDB connection.
##
## ℹ Ingesting data for SUBJ.
##
## [INFO] Creating a new temporary DuckDB connection.
##
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.
## [INFO] SQL Query complete: 1000 rows returned.
##
## [INFO] Disconnected from temporary DuckDB connection.
##
## ℹ Ingesting data for DATACHG.
##
## [INFO] Creating a new temporary DuckDB connection.
##
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.
## [INFO] SQL Query complete: 435968 rows returned.
##
## [INFO] Disconnected from temporary DuckDB connection.
##
## ℹ Ingesting data for SUBJ.
##
## [INFO] Creating a new temporary DuckDB connection.
##
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.
## [INFO] SQL Query complete: 1000 rows returned.
##
## [INFO] Disconnected from temporary DuckDB connection.
##
## ℹ Ingesting data for DATAENT.
##
## [INFO] Creating a new temporary DuckDB connection.
##
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.
## [INFO] SQL Query complete: 108992 rows returned.
##
## [INFO] Disconnected from temporary DuckDB connection.
##
## ℹ Ingesting data for Death.
##
## [INFO] Creating a new temporary DuckDB connection.
##
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.
## [INFO] SQL Query complete: 12 rows returned.
##
## [INFO] Disconnected from temporary DuckDB connection.
##
## ℹ Ingesting data for STUDCOMP.
##
## [INFO] Creating a new temporary DuckDB connection.
##
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.
## [INFO] SQL Query complete: 100 rows returned.
##
## [INFO] Disconnected from temporary DuckDB connection.
##
## ℹ Ingesting data for OverallResponse.
##
## [INFO] Creating a new temporary DuckDB connection.
##
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.
## [INFO] SQL Query complete: 1485 rows returned.
##
## [INFO] Disconnected from temporary DuckDB connection.
##
## ℹ Ingesting data for Randomization.
##
## [INFO] Creating a new temporary DuckDB connection.
##
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.
## [INFO] SQL Query complete: 757 rows returned.
##
## [INFO] Disconnected from temporary DuckDB connection.
##
## ℹ Ingesting data for IE.
##
## [INFO] Creating a new temporary DuckDB connection.
##
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.
## [INFO] SQL Query complete: 252 rows returned.
##
## [INFO] Disconnected from temporary DuckDB connection.
##
## ℹ Ingesting data for ENROLL.
##
## [INFO] Creating a new temporary DuckDB connection.
##
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.
## [INFO] SQL Query complete: 1000 rows returned.
##
## [INFO] Disconnected from temporary DuckDB connection.
##
## ℹ Ingesting data for PD.
##
## [INFO] Creating a new temporary DuckDB connection.
##
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.
## [INFO] SQL Query complete: 3000 rows returned.
##
## [INFO] Disconnected from temporary DuckDB connection.
##
## ℹ Ingesting data for QUERY.
##
## [INFO] Creating a new temporary DuckDB connection.
##
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.
## [INFO] SQL Query complete: 27248 rows returned.
##
## [INFO] Disconnected from temporary DuckDB connection.
##
## ℹ Ingesting data for SITE.
##
## [INFO] Creating a new temporary DuckDB connection.
##
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.
## [INFO] SQL Query complete: 150 rows returned.
##
## [INFO] Disconnected from temporary DuckDB connection.
##
## ℹ Ingesting data for STUDY.
##
## [INFO] Creating a new temporary DuckDB connection.
##
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.
## [INFO] SQL Query complete: 1 rows returned.
##
## [INFO] Disconnected from temporary DuckDB connection.
lMapped <- RunWorkflows(mappings_wf, lRaw)
## Warning: `RunWorkflows()` was deprecated in gsm.core 1.3.0.
## ℹ Please use `workr::RunWorkflows()` instead.
## This warning is displayed once per session.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## [INFO] Running 18 Workflows
## [INFO] Initializing `Mapped_AE` Workflow
## [INFO] Checking data against spec
## [INFO] Workflow Step 1 of 1: `=`
## [INFO] Evaluating 2 parameter(s) for `=`
## [INFO] lhs = Mapped_AE: No matching data found. Passing 'Mapped_AE' as a string.
## [INFO] rhs = Raw_AE: Passing lData$Raw_AE.
## [INFO] Calling `=`
## [INFO] 3000x11 data.frame saved as `lData$Mapped_AE`.
## [INFO] Returning results from final step: 3000x11 data.frame`.
## [INFO] Completed `Mapped_AE` Workflow
## [INFO] Initializing `Mapped_ENROLL` Workflow
## [INFO] Checking data against spec
## [INFO] Workflow Step 1 of 1: `=`
## [INFO] Evaluating 2 parameter(s) for `=`
## [INFO] lhs = Mapped_ENROLL: No matching data found. Passing 'Mapped_ENROLL' as a string.
## [INFO] rhs = Raw_ENROLL: Passing lData$Raw_ENROLL.
## [INFO] Calling `=`
## [INFO] 1000x7 data.frame saved as `lData$Mapped_ENROLL`.
## [INFO] Returning results from final step: 1000x7 data.frame`.
## [INFO] Completed `Mapped_ENROLL` Workflow
## [INFO] Initializing `Mapped_IE` Workflow
## [INFO] Checking data against spec
## [INFO] Workflow Step 1 of 3: `workr::RunQuery`
## [INFO] Evaluating 2 parameter(s) for `workr::RunQuery`
## [INFO] df = Raw_IE: Passing lData$Raw_IE.
## [INFO] strQuery = SELECT *, CASE WHEN ietestcd ILIKE '%EXC%' THEN 'EX' WHEN ietestcd ILIKE '%INC%' THEN 'IN' END as iecat_custom FROM df: No matching data found. Passing 'SELECT *, CASE WHEN ietestcd ILIKE '%EXC%' THEN 'EX' WHEN ietestcd ILIKE '%INC%' THEN 'IN' END as iecat_custom FROM df' as a string.
## [INFO] Calling `workr::RunQuery`
## [INFO] Creating a new temporary DuckDB connection.
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.[INFO] SQL Query complete: 252 rows returned.
## [INFO] Disconnected from temporary DuckDB connection.
## [INFO] 252x8 data.frame saved as `lData$iecat_custom`.
## [INFO] Workflow Step 2 of 3: `workr::RunQuery`
## [INFO] Evaluating 2 parameter(s) for `workr::RunQuery`
## [INFO] df = iecat_custom: Passing lData$iecat_custom.
## [INFO] strQuery = SELECT * , CASE WHEN iecat_custom = 'EX' AND ieorres = 'Yes' then 'Y' WHEN iecat_custom = 'IN' AND ieorres = 'No' then 'Y' END as ie_violation FROM df: No matching data found. Passing 'SELECT * , CASE WHEN iecat_custom = 'EX' AND ieorres = 'Yes' then 'Y' WHEN iecat_custom = 'IN' AND ieorres = 'No' then 'Y' END as ie_violation FROM df' as a string.
## [INFO] Calling `workr::RunQuery`
## [INFO] Creating a new temporary DuckDB connection.
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.[INFO] SQL Query complete: 252 rows returned.
## [INFO] Disconnected from temporary DuckDB connection.
## [INFO] 252x9 data.frame saved as `lData$ie_violation`.
## [INFO] Workflow Step 3 of 3: `workr::RunQuery`
## [INFO] Evaluating 2 parameter(s) for `workr::RunQuery`
## [INFO] df = ie_violation: Passing lData$ie_violation.
## [INFO] strQuery = SELECT * FROM df WHERE subjid IS NOT NULL AND ie_violation = 'Y': No matching data found. Passing 'SELECT * FROM df WHERE subjid IS NOT NULL AND ie_violation = 'Y'' as a string.
## [INFO] Calling `workr::RunQuery`
## [INFO] Creating a new temporary DuckDB connection.
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.[INFO] SQL Query complete: 143 rows returned.
## [INFO] Disconnected from temporary DuckDB connection.
## [INFO] 143x9 data.frame saved as `lData$Mapped_IE`.
## [INFO] Returning results from final step: 143x9 data.frame`.
## [INFO] Completed `Mapped_IE` Workflow
## [INFO] Initializing `Mapped_LB` Workflow
## [INFO] Checking data against spec
## [INFO] Workflow Step 1 of 1: `=`
## [INFO] Evaluating 2 parameter(s) for `=`
## [INFO] lhs = Mapped_LB: No matching data found. Passing 'Mapped_LB' as a string.
## [INFO] rhs = Raw_LB: Passing lData$Raw_LB.
## [INFO] Calling `=`
## [INFO] 405720x4 data.frame saved as `lData$Mapped_LB`.
## [INFO] Returning results from final step: 405720x4 data.frame`.
## [INFO] Completed `Mapped_LB` Workflow
## [INFO] Initializing `Mapped_OverallResponse` Workflow
## [INFO] Checking data against spec
## [INFO] Workflow Step 1 of 1: `workr::RunQuery`
## [INFO] Evaluating 2 parameter(s) for `workr::RunQuery`
## [INFO] df = Raw_OverallResponse: Passing lData$Raw_OverallResponse.
## [INFO] strQuery = SELECT studyid, subjid, response_folder, ovrlresp, rs_dt FROM df WHERE subjid IS NOT NULL: No matching data found. Passing 'SELECT studyid, subjid, response_folder, ovrlresp, rs_dt FROM df WHERE subjid IS NOT NULL' as a string.
## [INFO] Calling `workr::RunQuery`
## [INFO] Creating a new temporary DuckDB connection.
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.[INFO] SQL Query complete: 1485 rows returned.
## [INFO] Disconnected from temporary DuckDB connection.
## [INFO] 1485x5 data.frame saved as `lData$Mapped_OverallResponse`.
## [INFO] Returning results from final step: 1485x5 data.frame`.
## [INFO] Completed `Mapped_OverallResponse` Workflow
## [INFO] Initializing `Mapped_PD` Workflow
## [INFO] Checking data against spec
## [INFO] Workflow Step 1 of 1: `=`
## [INFO] Evaluating 2 parameter(s) for `=`
## [INFO] lhs = Mapped_PD: No matching data found. Passing 'Mapped_PD' as a string.
## [INFO] rhs = Raw_PD: Passing lData$Raw_PD.
## [INFO] Calling `=`
## [INFO] 3000x6 data.frame saved as `lData$Mapped_PD`.
## [INFO] Returning results from final step: 3000x6 data.frame`.
## [INFO] Completed `Mapped_PD` Workflow
## [INFO] Initializing `Mapped_Randomization` Workflow
## [INFO] Checking data against spec
## [INFO] Workflow Step 1 of 1: `workr::RunQuery`
## [INFO] Evaluating 2 parameter(s) for `workr::RunQuery`
## [INFO] df = Raw_Randomization: Passing lData$Raw_Randomization.
## [INFO] strQuery = SELECT studyid, invid, subjid, rgmn_dt, status, country FROM df WHERE subjid IS NOT NULL AND (status != 'Screen Failed' OR status IS NULL): No matching data found. Passing 'SELECT studyid, invid, subjid, rgmn_dt, status, country FROM df WHERE subjid IS NOT NULL AND (status != 'Screen Failed' OR status IS NULL)' as a string.
## [INFO] Calling `workr::RunQuery`
## [INFO] Creating a new temporary DuckDB connection.
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.[INFO] SQL Query complete: 757 rows returned.
## [INFO] Disconnected from temporary DuckDB connection.
## [INFO] 757x6 data.frame saved as `lData$Mapped_Randomization`.
## [INFO] Returning results from final step: 757x6 data.frame`.
## [INFO] Completed `Mapped_Randomization` Workflow
## [INFO] Initializing `Mapped_SDRGCOMP` Workflow
## [INFO] Checking data against spec
## [INFO] Workflow Step 1 of 1: `=`
## [INFO] Evaluating 2 parameter(s) for `=`
## [INFO] lhs = Mapped_SDRGCOMP: No matching data found. Passing 'Mapped_SDRGCOMP' as a string.
## [INFO] rhs = Raw_SDRGCOMP: Passing lData$Raw_SDRGCOMP.
## [INFO] Calling `=`
## [INFO] 100x5 data.frame saved as `lData$Mapped_SDRGCOMP`.
## [INFO] Returning results from final step: 100x5 data.frame`.
## [INFO] Completed `Mapped_SDRGCOMP` Workflow
## [INFO] Initializing `Mapped_STUDCOMP` Workflow
## [INFO] Checking data against spec
## [INFO] Workflow Step 1 of 1: `=`
## [INFO] Evaluating 2 parameter(s) for `=`
## [INFO] lhs = Mapped_STUDCOMP: No matching data found. Passing 'Mapped_STUDCOMP' as a string.
## [INFO] rhs = Raw_STUDCOMP: Passing lData$Raw_STUDCOMP.
## [INFO] Calling `=`
## [INFO] 100x6 data.frame saved as `lData$Mapped_STUDCOMP`.
## [INFO] Returning results from final step: 100x6 data.frame`.
## [INFO] Completed `Mapped_STUDCOMP` Workflow
## [INFO] Initializing `Mapped_SUBJ` Workflow
## [INFO] Checking data against spec
## [INFO] Workflow Step 1 of 1: `workr::RunQuery`
## [INFO] Evaluating 2 parameter(s) for `workr::RunQuery`
## [INFO] df = Raw_SUBJ: Passing lData$Raw_SUBJ.
## [INFO] strQuery = SELECT * FROM df WHERE enrollyn == 'Y': No matching data found. Passing 'SELECT * FROM df WHERE enrollyn == 'Y'' as a string.
## [INFO] Calling `workr::RunQuery`
## [INFO] Creating a new temporary DuckDB connection.
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.[INFO] SQL Query complete: 762 rows returned.
## [INFO] Disconnected from temporary DuckDB connection.
## [INFO] 762x14 data.frame saved as `lData$Mapped_SUBJ`.
## [INFO] Returning results from final step: 762x14 data.frame`.
## [INFO] Completed `Mapped_SUBJ` Workflow
## [INFO] Initializing `Mapped_DATACHG` Workflow
## [INFO] Checking data against spec
## [INFO] Workflow Step 1 of 2: `dplyr::select`
## [INFO] Evaluating 4 parameter(s) for `dplyr::select`
## [INFO] .data = Mapped_SUBJ: Passing lData$Mapped_SUBJ.
## [INFO] subjid = subjid: No matching data found. Passing 'subjid' as a string.
## [INFO] subject_nsv = subject_nsv: No matching data found. Passing 'subject_nsv' as a string.
## [INFO] studyid = studyid: No matching data found. Passing 'studyid' as a string.
## [INFO] Calling `dplyr::select`
## [INFO] 762x3 data.frame saved as `lData$Temp_SubjectLookup`.
## [INFO] Workflow Step 2 of 2: `dplyr::left_join`
## [INFO] Evaluating 3 parameter(s) for `dplyr::left_join`
## [INFO] x = Raw_DATACHG: Passing lData$Raw_DATACHG.
## [INFO] y = Temp_SubjectLookup: Passing lData$Temp_SubjectLookup.
## [INFO] by is of length 2: Parameter is a vector. Passing as is.
## [INFO] Calling `dplyr::left_join`
## [INFO] 435968x5 data.frame saved as `lData$Mapped_DATACHG`.
## [INFO] Returning results from final step: 435968x5 data.frame`.
## [INFO] Completed `Mapped_DATACHG` Workflow
## [INFO] Initializing `Mapped_DATAENT` Workflow
## [INFO] Checking data against spec
## [INFO] Workflow Step 1 of 2: `dplyr::select`
## [INFO] Evaluating 4 parameter(s) for `dplyr::select`
## [INFO] .data = Mapped_SUBJ: Passing lData$Mapped_SUBJ.
## [INFO] subjid = subjid: No matching data found. Passing 'subjid' as a string.
## [INFO] subject_nsv = subject_nsv: No matching data found. Passing 'subject_nsv' as a string.
## [INFO] studyid = studyid: No matching data found. Passing 'studyid' as a string.
## [INFO] Calling `dplyr::select`
## [INFO] 762x3 data.frame saved as `lData$Temp_SubjectLookup`.
## [INFO] Workflow Step 2 of 2: `dplyr::left_join`
## [INFO] Evaluating 3 parameter(s) for `dplyr::left_join`
## [INFO] x = Raw_DATAENT: Passing lData$Raw_DATAENT.
## [INFO] y = Temp_SubjectLookup: Passing lData$Temp_SubjectLookup.
## [INFO] by is of length 2: Parameter is a vector. Passing as is.
## [INFO] Calling `dplyr::left_join`
## [INFO] 108992x5 data.frame saved as `lData$Mapped_DATAENT`.
## [INFO] Returning results from final step: 108992x5 data.frame`.
## [INFO] Completed `Mapped_DATAENT` Workflow
## [INFO] Initializing `Mapped_Death` Workflow
## [INFO] Checking data against spec
## [INFO] Workflow Step 1 of 2: `workr::RunQuery`
## [INFO] Evaluating 2 parameter(s) for `workr::RunQuery`
## [INFO] df = Raw_Death: Passing lData$Raw_Death.
## [INFO] strQuery = SELECT studyid, subjid, death_dt, deathcls FROM df WHERE subjid IS NOT NULL AND death_dt IS NOT NULL: No matching data found. Passing 'SELECT studyid, subjid, death_dt, deathcls FROM df WHERE subjid IS NOT NULL AND death_dt IS NOT NULL' as a string.
## [INFO] Calling `workr::RunQuery`
## [INFO] Creating a new temporary DuckDB connection.
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.[INFO] SQL Query complete: 12 rows returned.
## [INFO] Disconnected from temporary DuckDB connection.
## [INFO] 12x4 data.frame saved as `lData$Temp_Death`.
## [INFO] Workflow Step 2 of 2: `gsm.mapping::complete_death`
## [INFO] Evaluating 4 parameter(s) for `gsm.mapping::complete_death`
## [INFO] dfDeath = Temp_Death: Passing lData$Temp_Death.
## [INFO] dfStudyCompletion = Mapped_STUDCOMP: Passing lData$Mapped_STUDCOMP.
## [INFO] dfOverallResponse = Mapped_OverallResponse: Passing lData$Mapped_OverallResponse.
## [INFO] dfRandomization = Mapped_Randomization: Passing lData$Mapped_Randomization.
## [INFO] Calling `gsm.mapping::complete_death`
## Joining with `by = join_by(studyid, subjid)`! Death date missing for patients: S62400, S44367, S33412, S78705
## Last known date will be used as a substitute.
## [INFO] 341x7 data.frame saved as `lData$Mapped_Death`.
## [INFO] Returning results from final step: 341x7 data.frame`.
## [INFO] Completed `Mapped_Death` Workflow
## [INFO] Initializing `Mapped_EXCLUSION` Workflow
## [INFO] Checking data against spec
## [INFO] Workflow Step 1 of 5: `workr::RunQuery`
## [INFO] Evaluating 2 parameter(s) for `workr::RunQuery`
## [INFO] df = Mapped_IE: Passing lData$Mapped_IE.
## [INFO] strQuery = SELECT subjid, studyid, array_to_string(array_agg(ietestcd), ',') AS ietestcd_concat, ie_violation FROM df GROUP BY studyid, subjid, ie_violation: No matching data found. Passing 'SELECT subjid, studyid, array_to_string(array_agg(ietestcd), ',') AS ietestcd_concat, ie_violation FROM df GROUP BY studyid, subjid, ie_violation' as a string.
## [INFO] Calling `workr::RunQuery`
## [INFO] Creating a new temporary DuckDB connection.
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.[INFO] SQL Query complete: 143 rows returned.
## [INFO] Disconnected from temporary DuckDB connection.
## [INFO] 143x4 data.frame saved as `lData$pivot_ie`.
## [INFO] Workflow Step 2 of 5: `dplyr::left_join`
## [INFO] Evaluating 3 parameter(s) for `dplyr::left_join`
## [INFO] x = Mapped_ENROLL: Passing lData$Mapped_ENROLL.
## [INFO] y = pivot_ie: Passing lData$pivot_ie.
## [INFO] by is of length 2: Parameter is a vector. Passing as is.
## [INFO] Calling `dplyr::left_join`
## [INFO] 1000x9 data.frame saved as `lData$add_ie`.
## [INFO] Workflow Step 3 of 5: `workr::RunQuery`
## [INFO] Evaluating 2 parameter(s) for `workr::RunQuery`
## [INFO] df = Mapped_PD: Passing lData$Mapped_PD.
## [INFO] strQuery = SELECT studyid, subjid, array_to_string(array_agg(dvdtm), ';;;') AS dvdtm, array_to_string(array_agg(dvterm), ';;;') AS eligibility_criteria FROM df WHERE dvdecod IN ('Exclusion Criteria', 'Inclusion Criteria') GROUP BY studyid, subjid: No matching data found. Passing 'SELECT studyid, subjid, array_to_string(array_agg(dvdtm), ';;;') AS dvdtm, array_to_string(array_agg(dvterm), ';;;') AS eligibility_criteria FROM df WHERE dvdecod IN ('Exclusion Criteria', 'Inclusion Criteria') GROUP BY studyid, subjid' as a string.
## [INFO] Calling `workr::RunQuery`
## [INFO] Creating a new temporary DuckDB connection.
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.[INFO] SQL Query complete: 260 rows returned.
## [INFO] Disconnected from temporary DuckDB connection.
## [INFO] 260x4 data.frame saved as `lData$pivot_pd`.
## [INFO] Workflow Step 4 of 5: `dplyr::left_join`
## [INFO] Evaluating 3 parameter(s) for `dplyr::left_join`
## [INFO] x = add_ie: Passing lData$add_ie.
## [INFO] y = pivot_pd: Passing lData$pivot_pd.
## [INFO] by is of length 2: Parameter is a vector. Passing as is.
## [INFO] Calling `dplyr::left_join`
## [INFO] 1000x11 data.frame saved as `lData$premapped`.
## [INFO] Workflow Step 5 of 5: `workr::RunQuery`
## [INFO] Evaluating 2 parameter(s) for `workr::RunQuery`
## [INFO] df = premapped: Passing lData$premapped.
## [INFO] strQuery = SELECT *, CASE WHEN ie_violation = 'Y' AND eligibility_criteria IS NULL THEN 'EDC I/E only' WHEN ie_violation IS NULL AND eligibility_criteria IS NOT NULL THEN 'Eligibility PD only' WHEN ie_violation = 'Y' AND eligibility_criteria IS NOT NULL THEN 'Ineligible, Both Criteria' ELSE 'Neither' END AS Source FROM df WHERE enrollyn = 'Y': No matching data found. Passing 'SELECT *, CASE WHEN ie_violation = 'Y' AND eligibility_criteria IS NULL THEN 'EDC I/E only' WHEN ie_violation IS NULL AND eligibility_criteria IS NOT NULL THEN 'Eligibility PD only' WHEN ie_violation = 'Y' AND eligibility_criteria IS NOT NULL THEN 'Ineligible, Both Criteria' ELSE 'Neither' END AS Source FROM df WHERE enrollyn = 'Y'' as a string.
## [INFO] Calling `workr::RunQuery`
## [INFO] Creating a new temporary DuckDB connection.
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.[INFO] SQL Query complete: 762 rows returned.
## [INFO] Disconnected from temporary DuckDB connection.
## [INFO] 762x12 data.frame saved as `lData$Mapped_EXCLUSION`.
## [INFO] Returning results from final step: 762x12 data.frame`.
## [INFO] Completed `Mapped_EXCLUSION` Workflow
## [INFO] Initializing `Mapped_QUERY` Workflow
## [INFO] Checking data against spec
## [INFO] Workflow Step 1 of 2: `dplyr::select`
## [INFO] Evaluating 4 parameter(s) for `dplyr::select`
## [INFO] .data = Mapped_SUBJ: Passing lData$Mapped_SUBJ.
## [INFO] studyid = studyid: No matching data found. Passing 'studyid' as a string.
## [INFO] subjid = subjid: No matching data found. Passing 'subjid' as a string.
## [INFO] subject_nsv = subject_nsv: No matching data found. Passing 'subject_nsv' as a string.
## [INFO] Calling `dplyr::select`
## [INFO] 762x3 data.frame saved as `lData$Temp_SubjectLookup`.
## [INFO] Workflow Step 2 of 2: `dplyr::left_join`
## [INFO] Evaluating 3 parameter(s) for `dplyr::left_join`
## [INFO] x = Raw_QUERY: Passing lData$Raw_QUERY.
## [INFO] y = Temp_SubjectLookup: Passing lData$Temp_SubjectLookup.
## [INFO] by is of length 2: Parameter is a vector. Passing as is.
## [INFO] Calling `dplyr::left_join`
## [INFO] 27248x6 data.frame saved as `lData$Mapped_QUERY`.
## [INFO] Returning results from final step: 27248x6 data.frame`.
## [INFO] Completed `Mapped_QUERY` Workflow
## [INFO] Initializing `Mapped_COUNTRY` Workflow
## [INFO] Checking data against spec
## [INFO] Workflow Step 1 of 2: `workr::RunQuery`
## [INFO] Evaluating 2 parameter(s) for `workr::RunQuery`
## [INFO] df = Mapped_SUBJ: Passing lData$Mapped_SUBJ.
## [INFO] strQuery = SELECT country as GroupID, COUNT(DISTINCT subjid) as ParticipantCount, COUNT(DISTINCT invid) as SiteCount FROM df GROUP BY country: No matching data found. Passing 'SELECT country as GroupID, COUNT(DISTINCT subjid) as ParticipantCount, COUNT(DISTINCT invid) as SiteCount FROM df GROUP BY country' as a string.
## [INFO] Calling `workr::RunQuery`
## [INFO] Creating a new temporary DuckDB connection.
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.[INFO] SQL Query complete: 3 rows returned.
## [INFO] Disconnected from temporary DuckDB connection.
## [INFO] 3x3 data.frame saved as `lData$Temp_CountryCountsWide`.
## [INFO] Workflow Step 2 of 2: `gsm.mapping::MakeLongMeta`
## [INFO] Evaluating 2 parameter(s) for `gsm.mapping::MakeLongMeta`
## [INFO] data = Temp_CountryCountsWide: Passing lData$Temp_CountryCountsWide.
## [INFO] strGroupLevel = Country: No matching data found. Passing 'Country' as a string.
## [INFO] Calling `gsm.mapping::MakeLongMeta`
## [INFO] 6x4 data.frame saved as `lData$Mapped_COUNTRY`.
## [INFO] Returning results from final step: 6x4 data.frame`.
## [INFO] Completed `Mapped_COUNTRY` Workflow
## [INFO] Initializing `Mapped_SITE` Workflow
## [INFO] Checking data against spec
## [INFO] Workflow Step 1 of 5: `workr::RunQuery`
## [INFO] Evaluating 2 parameter(s) for `workr::RunQuery`
## [INFO] df = Raw_SITE: Passing lData$Raw_SITE.
## [INFO] strQuery = SELECT invid as GroupID, * FROM df: No matching data found. Passing 'SELECT invid as GroupID, * FROM df' as a string.
## [INFO] Calling `workr::RunQuery`
## [INFO] Creating a new temporary DuckDB connection.
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.[INFO] SQL Query complete: 150 rows returned.
## [INFO] Disconnected from temporary DuckDB connection.
## [INFO] 150x10 data.frame saved as `lData$Temp_CTMSSiteWide`.
## [INFO] Workflow Step 2 of 5: `gsm.mapping::MakeLongMeta`
## [INFO] Evaluating 2 parameter(s) for `gsm.mapping::MakeLongMeta`
## [INFO] data = Temp_CTMSSiteWide: Passing lData$Temp_CTMSSiteWide.
## [INFO] strGroupLevel = Site: No matching data found. Passing 'Site' as a string.
## [INFO] Calling `gsm.mapping::MakeLongMeta`
## [INFO] 1350x4 data.frame saved as `lData$Temp_CTMSSite`.
## [INFO] Workflow Step 3 of 5: `workr::RunQuery`
## [INFO] Evaluating 2 parameter(s) for `workr::RunQuery`
## [INFO] df = Mapped_SUBJ: Passing lData$Mapped_SUBJ.
## [INFO] strQuery = SELECT invid as GroupID, COUNT(DISTINCT subjid) as ParticipantCount, COUNT(DISTINCT invid) as SiteCount FROM df GROUP BY invid: No matching data found. Passing 'SELECT invid as GroupID, COUNT(DISTINCT subjid) as ParticipantCount, COUNT(DISTINCT invid) as SiteCount FROM df GROUP BY invid' as a string.
## [INFO] Calling `workr::RunQuery`
## [INFO] Creating a new temporary DuckDB connection.
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.[INFO] SQL Query complete: 143 rows returned.
## [INFO] Disconnected from temporary DuckDB connection.
## [INFO] 143x3 data.frame saved as `lData$Temp_SiteCountsWide`.
## [INFO] Workflow Step 4 of 5: `gsm.mapping::MakeLongMeta`
## [INFO] Evaluating 2 parameter(s) for `gsm.mapping::MakeLongMeta`
## [INFO] data = Temp_SiteCountsWide: Passing lData$Temp_SiteCountsWide.
## [INFO] strGroupLevel = Site: No matching data found. Passing 'Site' as a string.
## [INFO] Calling `gsm.mapping::MakeLongMeta`
## [INFO] 286x4 data.frame saved as `lData$Temp_SiteCounts`.
## [INFO] Workflow Step 5 of 5: `dplyr::bind_rows`
## [INFO] Evaluating 2 parameter(s) for `dplyr::bind_rows`
## [INFO] Temp_CTMSSite = Temp_CTMSSite: Passing lData$Temp_CTMSSite.
## [INFO] Temp_SiteCounts = Temp_SiteCounts: Passing lData$Temp_SiteCounts.
## [INFO] Calling `dplyr::bind_rows`
## [INFO] 1636x4 data.frame saved as `lData$Mapped_SITE`.
## [INFO] Returning results from final step: 1636x4 data.frame`.
## [INFO] Completed `Mapped_SITE` Workflow
## [INFO] Initializing `Mapped_STUDY` Workflow
## [INFO] Checking data against spec
## [INFO] Workflow Step 1 of 9: `workr::RunQuery`
## [INFO] Evaluating 2 parameter(s) for `workr::RunQuery`
## [INFO] df = Raw_STUDY: Passing lData$Raw_STUDY.
## [INFO] strQuery = SELECT studyid as GroupID, * FROM df: No matching data found. Passing 'SELECT studyid as GroupID, * FROM df' as a string.
## [INFO] Calling `workr::RunQuery`
## [INFO] Creating a new temporary DuckDB connection.
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.[INFO] SQL Query complete: 1 rows returned.
## [INFO] Disconnected from temporary DuckDB connection.
## [INFO] 1x16 data.frame saved as `lData$Temp_CTMSStudyWide`.
## [INFO] Workflow Step 2 of 9: `gsm.mapping::MakeLongMeta`
## [INFO] Evaluating 2 parameter(s) for `gsm.mapping::MakeLongMeta`
## [INFO] data = Temp_CTMSStudyWide: Passing lData$Temp_CTMSStudyWide.
## [INFO] strGroupLevel = Study: No matching data found. Passing 'Study' as a string.
## [INFO] Calling `gsm.mapping::MakeLongMeta`
## [INFO] 15x4 data.frame saved as `lData$Temp_CTMSStudy`.
## [INFO] Workflow Step 3 of 9: `workr::RunQuery`
## [INFO] Evaluating 2 parameter(s) for `workr::RunQuery`
## [INFO] df = Raw_STUDY: Passing lData$Raw_STUDY.
## [INFO] strQuery = SELECT studyid as GroupID, num_plan_site as SiteTarget, num_plan_subj as ParticipantTarget FROM df: No matching data found. Passing 'SELECT studyid as GroupID, num_plan_site as SiteTarget, num_plan_subj as ParticipantTarget FROM df' as a string.
## [INFO] Calling `workr::RunQuery`
## [INFO] Creating a new temporary DuckDB connection.
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.[INFO] SQL Query complete: 1 rows returned.
## [INFO] Disconnected from temporary DuckDB connection.
## [INFO] 1x3 data.frame saved as `lData$Temp_CTMSplanned`.
## [INFO] Workflow Step 4 of 9: `workr::RunQuery`
## [INFO] Evaluating 2 parameter(s) for `workr::RunQuery`
## [INFO] df = Raw_SUBJ: Passing lData$Raw_SUBJ.
## [INFO] strQuery = SELECT studyid as GroupID, COUNT(DISTINCT subjid) as ParticipantCount, COUNT(DISTINCT invid) as SiteCount FROM df WHERE enrollyn == 'Y' GROUP BY studyid: No matching data found. Passing 'SELECT studyid as GroupID, COUNT(DISTINCT subjid) as ParticipantCount, COUNT(DISTINCT invid) as SiteCount FROM df WHERE enrollyn == 'Y' GROUP BY studyid' as a string.
## [INFO] Calling `workr::RunQuery`
## [INFO] Creating a new temporary DuckDB connection.
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.[INFO] SQL Query complete: 1 rows returned.
## [INFO] Disconnected from temporary DuckDB connection.
## [INFO] 1x3 data.frame saved as `lData$Temp_StudyCountsWide`.
## [INFO] Workflow Step 5 of 9: `dplyr::left_join`
## [INFO] Evaluating 3 parameter(s) for `dplyr::left_join`
## [INFO] x = Temp_CTMSplanned: Passing lData$Temp_CTMSplanned.
## [INFO] y = Temp_StudyCountsWide: Passing lData$Temp_StudyCountsWide.
## [INFO] by = GroupID: No matching data found. Passing 'GroupID' as a string.
## [INFO] Calling `dplyr::left_join`
## [INFO] 1x5 data.frame saved as `lData$Temp_CountTargetsWide`.
## [INFO] Workflow Step 6 of 9: `gsm.mapping::CalculatePercentage`
## [INFO] Evaluating 5 parameter(s) for `gsm.mapping::CalculatePercentage`
## [INFO] data = Temp_CountTargetsWide: Passing lData$Temp_CountTargetsWide.
## [INFO] strCurrentCol = SiteCount: No matching data found. Passing 'SiteCount' as a string.
## [INFO] strTargetCol = SiteTarget: No matching data found. Passing 'SiteTarget' as a string.
## [INFO] strPercVal = PercentSitesActivated: No matching data found. Passing 'PercentSitesActivated' as a string.
## [INFO] strPercStrVal = SiteActivation: No matching data found. Passing 'SiteActivation' as a string.
## [INFO] Calling `gsm.mapping::CalculatePercentage`
## [INFO] 1x7 data.frame saved as `lData$Temp_CountTargetsWide_addsite`.
## [INFO] Workflow Step 7 of 9: `gsm.mapping::CalculatePercentage`
## [INFO] Evaluating 5 parameter(s) for `gsm.mapping::CalculatePercentage`
## [INFO] data = Temp_CountTargetsWide_addsite: Passing lData$Temp_CountTargetsWide_addsite.
## [INFO] strCurrentCol = ParticipantCount: No matching data found. Passing 'ParticipantCount' as a string.
## [INFO] strTargetCol = ParticipantTarget: No matching data found. Passing 'ParticipantTarget' as a string.
## [INFO] strPercVal = PercentParticipantsEnrolled: No matching data found. Passing 'PercentParticipantsEnrolled' as a string.
## [INFO] strPercStrVal = ParticipantEnrollment: No matching data found. Passing 'ParticipantEnrollment' as a string.
## [INFO] Calling `gsm.mapping::CalculatePercentage`
## [INFO] 1x9 data.frame saved as `lData$Temp_CountTargetsWide_addsitepts`.
## [INFO] Workflow Step 8 of 9: `gsm.mapping::MakeLongMeta`
## [INFO] Evaluating 2 parameter(s) for `gsm.mapping::MakeLongMeta`
## [INFO] data = Temp_CountTargetsWide_addsitepts: Passing lData$Temp_CountTargetsWide_addsitepts.
## [INFO] strGroupLevel = Study: No matching data found. Passing 'Study' as a string.
## [INFO] Calling `gsm.mapping::MakeLongMeta`
## [INFO] 8x4 data.frame saved as `lData$Temp_CountTargetsPercs`.
## [INFO] Workflow Step 9 of 9: `dplyr::bind_rows`
## [INFO] Evaluating 2 parameter(s) for `dplyr::bind_rows`
## [INFO] Temp_CTMSStudy = Temp_CTMSStudy: Passing lData$Temp_CTMSStudy.
## [INFO] Temp_CountTargetsPercs = Temp_CountTargetsPercs: Passing lData$Temp_CountTargetsPercs.
## [INFO] Calling `dplyr::bind_rows`
## [INFO] 23x4 data.frame saved as `lData$Mapped_STUDY`.
## [INFO] Returning results from final step: 23x4 data.frame`.
## [INFO] Completed `Mapped_STUDY` Workflow
# --- Step 2b: Simulate a realistic premature-death cohort (example only) ------
# clindata's real randomization dates sit ~a decade pre-snapshot, so real
# premature deaths land off-scale on the study scatter. Manufacture an
# accrual / Weibull-mortality / censoring cohort instead -- see R/pd_ExampleData.R
# for the full trial-dynamics rationale.
# The simulation returns the mapped frames pd_Classify() needs: Mapped_SUBJ
# (+ rgmn_dt for follow-up), Mapped_Death (+ deathcls), Mapped_AE
# (+ aetoxgr / aerel for Treatment Related), and Mapped_STUDCOMP (non-death
# discontinuations dated inside the window).
sim <- gsm.kri:::pd_SimulatePrematureDeathCohort(
dfSubj = lMapped$Mapped_SUBJ,
nWindowDays = window_days
)
lMapped$Mapped_SUBJ <- sim$Mapped_SUBJ
lMapped$Mapped_Death <- sim$Mapped_Death
lMapped$Mapped_STUDCOMP <- sim$Mapped_STUDCOMP
lMapped$Mapped_AE <- sim$Mapped_AE
# --- Step 3: Run the site / country / patient premature-death metrics --------
metric_names <- c("kri0015", "cou0015", "pat0015")
metrics_wf <- MakeWorkflowList(
strNames = metric_names,
strPath = "workflow/2_metrics",
strPackage = "gsm.kri"
)
lAnalyzed <- RunWorkflows(metrics_wf, c(lMapped, list(lWorkflows = metrics_wf)))
## [INFO] Running 3 Workflows
## [INFO] Initializing `Analysis_cou0015` Workflow
## [INFO] Checking data against spec
## [INFO] Workflow Step 1 of 10: `gsm.core::ParseThreshold`
## [INFO] Evaluating 1 parameter(s) for `gsm.core::ParseThreshold`
## [INFO] strThreshold = Threshold: Passing lMeta$Threshold.
## [INFO] Calling `gsm.core::ParseThreshold`
## Parsed 1,2 to numeric vector: 1, 2[INFO] double of length 2 saved as `lData$vThreshold`.
## [INFO] Workflow Step 2 of 10: `gsm.core::ParseThreshold`
## [INFO] Evaluating 2 parameter(s) for `gsm.core::ParseThreshold`
## [INFO] strThreshold = Flag: Passing lMeta$Flag.
## [INFO] bSort is of length 1: Parameter is a vector. Passing as is.
## [INFO] Calling `gsm.core::ParseThreshold`
## Parsed 0,1,2 to numeric vector: 0, 1, 2[INFO] double of length 3 saved as `lData$vFlag`.
## [INFO] Workflow Step 3 of 10: `paste0`
## [INFO] Evaluating 2 parameter(s) for `paste0`
## [INFO] strPrefix = SELECT * FROM df WHERE death_dy <= : No matching data found. Passing 'SELECT * FROM df WHERE death_dy <= ' as a string.
## [INFO] nWindow = WindowDays: Passing lMeta$WindowDays.
## [INFO] Calling `paste0`
## [INFO] character of length 1 saved as `lData$strDeathQuery`.
## [INFO] Workflow Step 4 of 10: `RunQuery`
## [INFO] Evaluating 2 parameter(s) for `RunQuery`
## [INFO] df = Mapped_Death: Passing lData$Mapped_Death.
## [INFO] strQuery = strDeathQuery: Passing lData$strDeathQuery.
## [INFO] Calling `RunQuery`
## [INFO] Creating a new temporary DuckDB connection.
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.[INFO] SQL Query complete: 45 rows returned.
## [INFO] Disconnected from temporary DuckDB connection.
## [INFO] 45x7 data.frame saved as `lData$Temp_DeathWindow`.
## [INFO] Workflow Step 5 of 10: `gsm.core::Input_Rate`
## [INFO] Evaluating 8 parameter(s) for `gsm.core::Input_Rate`
## [INFO] dfSubjects = Mapped_SUBJ: Passing lData$Mapped_SUBJ.
## [INFO] dfNumerator = Temp_DeathWindow: Passing lData$Temp_DeathWindow.
## [INFO] dfDenominator = Mapped_SUBJ: Passing lData$Mapped_SUBJ.
## [INFO] strSubjectCol = subjid: No matching data found. Passing 'subjid' as a string.
## [INFO] strGroupCol = country: No matching data found. Passing 'country' as a string.
## [INFO] strGroupLevel = GroupLevel: Passing lMeta$GroupLevel.
## [INFO] strNumeratorMethod = Count: No matching data found. Passing 'Count' as a string.
## [INFO] strDenominatorMethod = Count: No matching data found. Passing 'Count' as a string.
## [INFO] Calling `gsm.core::Input_Rate`
## [INFO] 762x6 data.frame saved as `lData$Analysis_Input`.
## [INFO] Workflow Step 6 of 10: `gsm.core::Transform_Rate`
## [INFO] Evaluating 1 parameter(s) for `gsm.core::Transform_Rate`
## [INFO] dfInput = Analysis_Input: Passing lData$Analysis_Input.
## [INFO] Calling `gsm.core::Transform_Rate`
## [INFO] 3x5 data.frame saved as `lData$Analysis_Transformed`.
## [INFO] Workflow Step 7 of 10: `Analyze_Identity`
## [INFO] Evaluating 2 parameter(s) for `Analyze_Identity`
## [INFO] dfTransformed = Analysis_Transformed: Passing lData$Analysis_Transformed.
## [INFO] strValueCol = Score: Passing lMeta$Score.
## [INFO] Calling `Analyze_Identity`
## `Score` column created from `Numerator`.
## [INFO] 3x6 data.frame saved as `lData$Analysis_Analyzed`.
## [INFO] Workflow Step 8 of 10: `gsm.core::Flag`
## [INFO] Evaluating 5 parameter(s) for `gsm.core::Flag`
## [INFO] dfAnalyzed = Analysis_Analyzed: Passing lData$Analysis_Analyzed.
## [INFO] vThreshold = vThreshold: Passing lData$vThreshold.
## [INFO] vFlag = vFlag: Passing lData$vFlag.
## [INFO] nAccrualThreshold = AccrualThreshold: Passing lMeta$AccrualThreshold.
## [INFO] strAccrualMetric = AccrualMetric: Passing lMeta$AccrualMetric.
## [INFO] Calling `gsm.core::Flag`
## ℹ 0 Group(s) have insufficient sample size due to KRI denominator less than 1:
## These group(s) will not have KRI score and flag summarized.
## ℹ Mismatch in vFlagOrder and vFlag values. Aborting Sort and returning unsorted data.
## [INFO] 3x7 data.frame saved as `lData$Analysis_Flagged`.
## [INFO] Workflow Step 9 of 10: `gsm.core::Summarize`
## [INFO] Evaluating 1 parameter(s) for `gsm.core::Summarize`
## [INFO] dfFlagged = Analysis_Flagged: Passing lData$Analysis_Flagged.
## [INFO] Calling `gsm.core::Summarize`
## [INFO] 3x7 data.frame saved as `lData$Analysis_Summary`.
## [INFO] Workflow Step 10 of 10: `list`
## [INFO] Evaluating 6 parameter(s) for `list`
## [INFO] ID = ID: Passing lMeta$ID.
## [INFO] Analysis_Input = Analysis_Input: Passing lData$Analysis_Input.
## [INFO] Analysis_Transformed = Analysis_Transformed: Passing lData$Analysis_Transformed.
## [INFO] Analysis_Analyzed = Analysis_Analyzed: Passing lData$Analysis_Analyzed.
## [INFO] Analysis_Flagged = Analysis_Flagged: Passing lData$Analysis_Flagged.
## [INFO] Analysis_Summary = Analysis_Summary: Passing lData$Analysis_Summary.
## [INFO] Calling `list`
## [INFO] list of length 6 saved as `lData$lAnalysis`.
## [INFO] Returning results from final step: list of length 6`.
## [INFO] Completed `Analysis_cou0015` Workflow
## [INFO] Initializing `Analysis_kri0015` Workflow
## [INFO] Checking data against spec
## [INFO] Workflow Step 1 of 11: `gsm.core::ParseThreshold`
## [INFO] Evaluating 1 parameter(s) for `gsm.core::ParseThreshold`
## [INFO] strThreshold = Threshold: Passing lMeta$Threshold.
## [INFO] Calling `gsm.core::ParseThreshold`
## Parsed 1,2 to numeric vector: 1, 2[INFO] double of length 2 saved as `lData$vThreshold`.
## [INFO] Workflow Step 2 of 11: `gsm.core::ParseThreshold`
## [INFO] Evaluating 2 parameter(s) for `gsm.core::ParseThreshold`
## [INFO] strThreshold = RiskScoreWeight: Passing lMeta$RiskScoreWeight.
## [INFO] bSort is of length 1: Parameter is a vector. Passing as is.
## [INFO] Calling `gsm.core::ParseThreshold`
## Parsed 0,8,16 to numeric vector: 0, 8, 16[INFO] double of length 3 saved as `lData$vRiskScoreWeight`.
## [INFO] Workflow Step 3 of 11: `gsm.core::ParseThreshold`
## [INFO] Evaluating 2 parameter(s) for `gsm.core::ParseThreshold`
## [INFO] strThreshold = Flag: Passing lMeta$Flag.
## [INFO] bSort is of length 1: Parameter is a vector. Passing as is.
## [INFO] Calling `gsm.core::ParseThreshold`
## Parsed 0,1,2 to numeric vector: 0, 1, 2[INFO] double of length 3 saved as `lData$vFlag`.
## [INFO] Workflow Step 4 of 11: `paste0`
## [INFO] Evaluating 2 parameter(s) for `paste0`
## [INFO] strPrefix = SELECT * FROM df WHERE death_dy <= : No matching data found. Passing 'SELECT * FROM df WHERE death_dy <= ' as a string.
## [INFO] nWindow = WindowDays: Passing lMeta$WindowDays.
## [INFO] Calling `paste0`
## [INFO] character of length 1 saved as `lData$strDeathQuery`.
## [INFO] Workflow Step 5 of 11: `RunQuery`
## [INFO] Evaluating 2 parameter(s) for `RunQuery`
## [INFO] df = Mapped_Death: Passing lData$Mapped_Death.
## [INFO] strQuery = strDeathQuery: Passing lData$strDeathQuery.
## [INFO] Calling `RunQuery`
## [INFO] Creating a new temporary DuckDB connection.
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.[INFO] SQL Query complete: 45 rows returned.
## [INFO] Disconnected from temporary DuckDB connection.
## [INFO] 45x7 data.frame saved as `lData$Temp_DeathWindow`.
## [INFO] Workflow Step 6 of 11: `gsm.core::Input_Rate`
## [INFO] Evaluating 8 parameter(s) for `gsm.core::Input_Rate`
## [INFO] dfSubjects = Mapped_SUBJ: Passing lData$Mapped_SUBJ.
## [INFO] dfNumerator = Temp_DeathWindow: Passing lData$Temp_DeathWindow.
## [INFO] dfDenominator = Mapped_SUBJ: Passing lData$Mapped_SUBJ.
## [INFO] strSubjectCol = subjid: No matching data found. Passing 'subjid' as a string.
## [INFO] strGroupCol = invid: No matching data found. Passing 'invid' as a string.
## [INFO] strGroupLevel = GroupLevel: Passing lMeta$GroupLevel.
## [INFO] strNumeratorMethod = Count: No matching data found. Passing 'Count' as a string.
## [INFO] strDenominatorMethod = Count: No matching data found. Passing 'Count' as a string.
## [INFO] Calling `gsm.core::Input_Rate`
## [INFO] 762x6 data.frame saved as `lData$Analysis_Input`.
## [INFO] Workflow Step 7 of 11: `gsm.core::Transform_Rate`
## [INFO] Evaluating 1 parameter(s) for `gsm.core::Transform_Rate`
## [INFO] dfInput = Analysis_Input: Passing lData$Analysis_Input.
## [INFO] Calling `gsm.core::Transform_Rate`
## [INFO] 143x5 data.frame saved as `lData$Analysis_Transformed`.
## [INFO] Workflow Step 8 of 11: `Analyze_Identity`
## [INFO] Evaluating 2 parameter(s) for `Analyze_Identity`
## [INFO] dfTransformed = Analysis_Transformed: Passing lData$Analysis_Transformed.
## [INFO] strValueCol = Score: Passing lMeta$Score.
## [INFO] Calling `Analyze_Identity`
## `Score` column created from `Numerator`.
## [INFO] 143x6 data.frame saved as `lData$Analysis_Analyzed`.
## [INFO] Workflow Step 9 of 11: `gsm.core::Flag`
## [INFO] Evaluating 6 parameter(s) for `gsm.core::Flag`
## [INFO] dfAnalyzed = Analysis_Analyzed: Passing lData$Analysis_Analyzed.
## [INFO] vThreshold = vThreshold: Passing lData$vThreshold.
## [INFO] vFlag = vFlag: Passing lData$vFlag.
## [INFO] vRiskScoreWeight = vRiskScoreWeight: Passing lData$vRiskScoreWeight.
## [INFO] nAccrualThreshold = AccrualThreshold: Passing lMeta$AccrualThreshold.
## [INFO] strAccrualMetric = AccrualMetric: Passing lMeta$AccrualMetric.
## [INFO] Calling `gsm.core::Flag`
## ℹ 0 Group(s) have insufficient sample size due to KRI denominator less than 1:
## These group(s) will not have KRI score and flag summarized.
## ℹ Mismatch in vFlagOrder and vFlag values. Aborting Sort and returning unsorted data.
## [INFO] 143x9 data.frame saved as `lData$Analysis_Flagged`.
## [INFO] Workflow Step 10 of 11: `gsm.core::Summarize`
## [INFO] Evaluating 1 parameter(s) for `gsm.core::Summarize`
## [INFO] dfFlagged = Analysis_Flagged: Passing lData$Analysis_Flagged.
## [INFO] Calling `gsm.core::Summarize`
## [INFO] 143x7 data.frame saved as `lData$Analysis_Summary`.
## [INFO] Workflow Step 11 of 11: `list`
## [INFO] Evaluating 6 parameter(s) for `list`
## [INFO] ID = ID: Passing lMeta$ID.
## [INFO] Analysis_Input = Analysis_Input: Passing lData$Analysis_Input.
## [INFO] Analysis_Transformed = Analysis_Transformed: Passing lData$Analysis_Transformed.
## [INFO] Analysis_Analyzed = Analysis_Analyzed: Passing lData$Analysis_Analyzed.
## [INFO] Analysis_Flagged = Analysis_Flagged: Passing lData$Analysis_Flagged.
## [INFO] Analysis_Summary = Analysis_Summary: Passing lData$Analysis_Summary.
## [INFO] Calling `list`
## [INFO] list of length 6 saved as `lData$lAnalysis`.
## [INFO] Returning results from final step: list of length 6`.
## [INFO] Completed `Analysis_kri0015` Workflow
## [INFO] Initializing `Analysis_pat0015` Workflow
## [INFO] Checking data against spec
## [INFO] Workflow Step 1 of 11: `gsm.core::ParseThreshold`
## [INFO] Evaluating 1 parameter(s) for `gsm.core::ParseThreshold`
## [INFO] strThreshold = Threshold: Passing lMeta$Threshold.
## [INFO] Calling `gsm.core::ParseThreshold`
## Parsed 1 to numeric vector: 1[INFO] double of length 1 saved as `lData$vThreshold`.
## [INFO] Workflow Step 2 of 11: `gsm.core::ParseThreshold`
## [INFO] Evaluating 2 parameter(s) for `gsm.core::ParseThreshold`
## [INFO] strThreshold = RiskScoreWeight: Passing lMeta$RiskScoreWeight.
## [INFO] bSort is of length 1: Parameter is a vector. Passing as is.
## [INFO] Calling `gsm.core::ParseThreshold`
## Parsed 0,16 to numeric vector: 0, 16[INFO] double of length 2 saved as `lData$vRiskScoreWeight`.
## [INFO] Workflow Step 3 of 11: `gsm.core::ParseThreshold`
## [INFO] Evaluating 2 parameter(s) for `gsm.core::ParseThreshold`
## [INFO] strThreshold = Flag: Passing lMeta$Flag.
## [INFO] bSort is of length 1: Parameter is a vector. Passing as is.
## [INFO] Calling `gsm.core::ParseThreshold`
## Parsed 0,2 to numeric vector: 0, 2[INFO] double of length 2 saved as `lData$vFlag`.
## [INFO] Workflow Step 4 of 11: `paste0`
## [INFO] Evaluating 2 parameter(s) for `paste0`
## [INFO] strPrefix = SELECT * FROM df WHERE death_dy <= : No matching data found. Passing 'SELECT * FROM df WHERE death_dy <= ' as a string.
## [INFO] nWindow = WindowDays: Passing lMeta$WindowDays.
## [INFO] Calling `paste0`
## [INFO] character of length 1 saved as `lData$strDeathQuery`.
## [INFO] Workflow Step 5 of 11: `RunQuery`
## [INFO] Evaluating 2 parameter(s) for `RunQuery`
## [INFO] df = Mapped_Death: Passing lData$Mapped_Death.
## [INFO] strQuery = strDeathQuery: Passing lData$strDeathQuery.
## [INFO] Calling `RunQuery`
## [INFO] Creating a new temporary DuckDB connection.
## duckdb keeps downloaded extensions and secrets in a temporary directory:
## ℹ /tmp/RtmpC0VXd6/duckdb
## This is removed when the R session ends.
## • Extensions are re-downloaded each session.
## • Secrets are lost.
## ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
## ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
## ℹ See ?duckdb_storage for details and alternatives.[INFO] SQL Query complete: 45 rows returned.
## [INFO] Disconnected from temporary DuckDB connection.
## [INFO] 45x7 data.frame saved as `lData$Temp_DeathWindow`.
## [INFO] Workflow Step 6 of 11: `gsm.core::Input_Rate`
## [INFO] Evaluating 8 parameter(s) for `gsm.core::Input_Rate`
## [INFO] dfSubjects = Mapped_SUBJ: Passing lData$Mapped_SUBJ.
## [INFO] dfNumerator = Temp_DeathWindow: Passing lData$Temp_DeathWindow.
## [INFO] dfDenominator = Mapped_SUBJ: Passing lData$Mapped_SUBJ.
## [INFO] strSubjectCol = subjid: No matching data found. Passing 'subjid' as a string.
## [INFO] strGroupCol = subjid: No matching data found. Passing 'subjid' as a string.
## [INFO] strGroupLevel = GroupLevel: Passing lMeta$GroupLevel.
## [INFO] strNumeratorMethod = Count: No matching data found. Passing 'Count' as a string.
## [INFO] strDenominatorMethod = Count: No matching data found. Passing 'Count' as a string.
## [INFO] Calling `gsm.core::Input_Rate`
## [INFO] 762x6 data.frame saved as `lData$Analysis_Input`.
## [INFO] Workflow Step 7 of 11: `gsm.core::Transform_Rate`
## [INFO] Evaluating 1 parameter(s) for `gsm.core::Transform_Rate`
## [INFO] dfInput = Analysis_Input: Passing lData$Analysis_Input.
## [INFO] Calling `gsm.core::Transform_Rate`
## [INFO] 762x5 data.frame saved as `lData$Analysis_Transformed`.
## [INFO] Workflow Step 8 of 11: `Analyze_Identity`
## [INFO] Evaluating 2 parameter(s) for `Analyze_Identity`
## [INFO] dfTransformed = Analysis_Transformed: Passing lData$Analysis_Transformed.
## [INFO] strValueCol = Score: Passing lMeta$Score.
## [INFO] Calling `Analyze_Identity`
## `Score` column created from `Numerator`.
## [INFO] 762x6 data.frame saved as `lData$Analysis_Analyzed`.
## [INFO] Workflow Step 9 of 11: `gsm.core::Flag`
## [INFO] Evaluating 6 parameter(s) for `gsm.core::Flag`
## [INFO] dfAnalyzed = Analysis_Analyzed: Passing lData$Analysis_Analyzed.
## [INFO] vThreshold = vThreshold: Passing lData$vThreshold.
## [INFO] vFlag = vFlag: Passing lData$vFlag.
## [INFO] vRiskScoreWeight = vRiskScoreWeight: Passing lData$vRiskScoreWeight.
## [INFO] nAccrualThreshold = AccrualThreshold: Passing lMeta$AccrualThreshold.
## [INFO] strAccrualMetric = AccrualMetric: Passing lMeta$AccrualMetric.
## [INFO] Calling `gsm.core::Flag`
## ℹ 0 Group(s) have insufficient sample size due to KRI denominator less than 1:
## These group(s) will not have KRI score and flag summarized.
## ℹ Mismatch in vFlagOrder and vFlag values. Aborting Sort and returning unsorted data.
## [INFO] 762x9 data.frame saved as `lData$Analysis_Flagged`.
## [INFO] Workflow Step 10 of 11: `gsm.core::Summarize`
## [INFO] Evaluating 1 parameter(s) for `gsm.core::Summarize`
## [INFO] dfFlagged = Analysis_Flagged: Passing lData$Analysis_Flagged.
## [INFO] Calling `gsm.core::Summarize`
## [INFO] 762x7 data.frame saved as `lData$Analysis_Summary`.
## [INFO] Workflow Step 11 of 11: `list`
## [INFO] Evaluating 6 parameter(s) for `list`
## [INFO] ID = ID: Passing lMeta$ID.
## [INFO] Analysis_Input = Analysis_Input: Passing lData$Analysis_Input.
## [INFO] Analysis_Transformed = Analysis_Transformed: Passing lData$Analysis_Transformed.
## [INFO] Analysis_Analyzed = Analysis_Analyzed: Passing lData$Analysis_Analyzed.
## [INFO] Analysis_Flagged = Analysis_Flagged: Passing lData$Analysis_Flagged.
## [INFO] Analysis_Summary = Analysis_Summary: Passing lData$Analysis_Summary.
## [INFO] Calling `list`
## [INFO] list of length 6 saved as `lData$lAnalysis`.
## [INFO] Returning results from final step: list of length 6`.
## [INFO] Completed `Analysis_pat0015` Workflow
# --- Step 4: Build reporting frames (real gsm.reporting pipeline) ------------
reporting_wf <- MakeWorkflowList(
strNames = c("Results", "Metrics", "Bounds", "Groups"),
strPath = "workflow/3_reporting",
strPackage = "gsm.reporting"
)
lReporting <- RunWorkflows(
reporting_wf,
c(lMapped, list(lAnalyzed = lAnalyzed, lWorkflows = metrics_wf))
)
## [INFO] Running 4 Workflows
## [INFO] Initializing `Reporting_Groups` Workflow
## [INFO] Checking data against spec
## [INFO] Workflow Step 1 of 1: `dplyr::bind_rows`
## [INFO] Evaluating 3 parameter(s) for `dplyr::bind_rows`
## [INFO] Study = Mapped_STUDY: Passing lData$Mapped_STUDY.
## [INFO] Site = Mapped_SITE: Passing lData$Mapped_SITE.
## [INFO] Country = Mapped_COUNTRY: Passing lData$Mapped_COUNTRY.
## [INFO] Calling `dplyr::bind_rows`
## [INFO] 1665x4 data.frame saved as `lData$Reporting_Groups`.
## [INFO] Returning results from final step: 1665x4 data.frame`.
## [INFO] Completed `Reporting_Groups` Workflow
## [INFO] Initializing `Reporting_Metrics` Workflow
## [INFO] No spec found in workflow. Proceeding without checking data.
## [INFO] Workflow Step 1 of 1: `gsm.reporting::MakeMetric`
## [INFO] Evaluating 1 parameter(s) for `gsm.reporting::MakeMetric`
## [INFO] lWorkflows = lWorkflows: Passing lData$lWorkflows.
## [INFO] Calling `gsm.reporting::MakeMetric`
## [INFO] 3x20 data.frame saved as `lData$Reporting_Metrics`.
## [INFO] Returning results from final step: 3x20 data.frame`.
## [INFO] Completed `Reporting_Metrics` Workflow
## [INFO] Initializing `Reporting_Results` Workflow
## [INFO] Checking data against spec
## [INFO] Workflow Step 1 of 5: `dplyr::pull`
## [INFO] Evaluating 2 parameter(s) for `dplyr::pull`
## [INFO] .data = Mapped_STUDY: Passing lData$Mapped_STUDY.
## [INFO] var = GroupID: No matching data found. Passing 'GroupID' as a string.
## [INFO] Calling `dplyr::pull`
## [INFO] character of length 23 saved as `lData$GroupID`.
## [INFO] Workflow Step 2 of 5: `unique`
## [INFO] Evaluating 1 parameter(s) for `unique`
## [INFO] x = GroupID: Passing lData$GroupID.
## [INFO] Calling `unique`
## [INFO] character of length 1 saved as `lData$strStudyID`.
## [INFO] Workflow Step 3 of 5: `gsm.reporting::BindResults`
## [INFO] Evaluating 4 parameter(s) for `gsm.reporting::BindResults`
## [INFO] lAnalysis = lAnalyzed: Passing lData$lAnalyzed.
## [INFO] strName = Analysis_Summary: No matching data found. Passing 'Analysis_Summary' as a string.
## [INFO] strStudyID = strStudyID: Passing lData$strStudyID.
## [INFO] dSnapshotDate = dSnapshotDate: No matching data found. Passing 'dSnapshotDate' as a string.
## [INFO] Calling `gsm.reporting::BindResults`
## [INFO] 908x10 data.frame saved as `lData$Results_Summary`.
## [INFO] Workflow Step 4 of 5: `gsm.reporting::CalculateChange`
## [INFO] Evaluating 2 parameter(s) for `gsm.reporting::CalculateChange`
## [INFO] dfResults = Results_Summary: Passing lData$Results_Summary.
## [INFO] dfResultsLongitudinal = Reporting_Results_Longitudinal: No matching data found. Passing 'Reporting_Results_Longitudinal' as a string.
## [INFO] Calling `gsm.reporting::CalculateChange`
## ℹ `dfResultsLongitudinal` not supplied properly, so dfResults will be returned unchanged.
## [INFO] 908x10 data.frame saved as `lData$Reporting_Results_With_Changes`.
## [INFO] Workflow Step 5 of 5: `gsm.kri::FilterByLatestSnapshotDate`
## [INFO] Evaluating 1 parameter(s) for `gsm.kri::FilterByLatestSnapshotDate`
## [INFO] df = Reporting_Results_With_Changes: Passing lData$Reporting_Results_With_Changes.
## [INFO] Calling `gsm.kri::FilterByLatestSnapshotDate`
## [INFO] 908x10 data.frame saved as `lData$Reporting_Results`.
## [INFO] Returning results from final step: 908x10 data.frame`.
## [INFO] Completed `Reporting_Results` Workflow
## [INFO] Initializing `Reporting_Bounds` Workflow
## [INFO] Checking data against spec
## [INFO] Workflow Step 1 of 1: `gsm.reporting::MakeBounds`
## [INFO] Evaluating 2 parameter(s) for `gsm.reporting::MakeBounds`
## [INFO] dfResults = Reporting_Results: Passing lData$Reporting_Results.
## [INFO] dfMetrics = Reporting_Metrics: Passing lData$Reporting_Metrics.
## [INFO] Calling `gsm.reporting::MakeBounds`
## Creating stacked dfBounds data for strMetricsParsed 1,2 to numeric vector: 1, 2Parsed 1,2 to numeric vector: 1, 2Parsed 1 to numeric vector: 1[INFO] 0x0 data.frame saved as `lData$Reporting_Bounds`.
## [INFO] Returning results from final step: 0x0 data.frame`.
## [INFO] Completed `Reporting_Bounds` Workflow
dfResults <- lReporting$Reporting_Results |>
FilterByLatestSnapshotDate()
# --- Step 5: Assemble the listings consumed by the report --------------------
lListings <- list(
Mapped_SUBJ = lMapped$Mapped_SUBJ,
Mapped_Death = lMapped$Mapped_Death,
Mapped_AE = lMapped$Mapped_AE,
Mapped_Randomization = lMapped$Mapped_Randomization,
Mapped_STUDCOMP = lMapped$Mapped_STUDCOMP,
Mapped_EXCLUSION = lMapped$Mapped_EXCLUSION
)
Study: AA-AA-000-0000
Snapshot Date: 2026-08-13
Bucket bars:
Premature death analysis supports early identification of deaths occurring within ≤90 days of randomization, enabling timely detection of potential eligibility concerns and emerging safety risks.
| Total enrolled | Total sites with enrolled participants | Premature Death(s) | Participants Ineligible + Premature Death |
|---|---|---|---|
| 762 | 143 |
45 (5.9%)
22
≤30 days
23
31–90 days
|
11 (24.4%) |
Study discontinuation is taken from study-completion records (
studcomp): a subject is counted here when their record indicates discontinuation within 90 days of randomization for a reason other than death. Deaths within 90 days appear under Death within 90 days; subjects still on study appear under the Alive categories. Discontinuation timing is approximated from the study-completion record date.
Study discontinuation is taken from study-completion records (
studcomp): a subject is counted here when their record indicates discontinuation within 90 days of randomization for a reason other than death. Deaths within 90 days appear under Death within 90 days; subjects still on study appear under the Alive categories. Discontinuation timing is approximated from the study-completion record date.
Treatment Related combines the death classification (
deathcls) with adverse-event data: Yes when the death is classified as an adverse event and the subject has a fatal (CTCAE grade 5) treatment-related (aerel=RELATED) adverse event; No when either the death is classified as an adverse event and the subject has a fatal (grade 5) not treatment-related (aerel=NOT RELATED) adverse event, or the death is not classified as an adverse event and there is no fatal treatment-related adverse event; Unknown otherwise (e.g. an adverse-event death with no fatal adverse-event evidence, contradictory signals, or a missing death classification / adverse-event grade or relatedness). Note: the adverse event is matched by subject, not to the specific event that caused death.
The Eligibility Status summarizes whether an enrolled participant met the study eligibility criteria, derived by combining data from the IE CRF and Protocol Deviations reported in CTMS. It is determined as follows:
- Ineligible: The participant triggered at least one of the eligibility signals. This applies whether they had an EDC I/E violation only, an eligibility protocol deviation only, or met both criteria.
- Eligible: The participant triggered neither of the eligibility signals (they have no EDC I/E violations and no eligibility-related protocol deviations).
- Unknown: The participant has no exclusion record available to evaluate.