The gsm.core package provides the analytical foundation for a standardized Risk Based Quality Monitoring (RBQM) framework for clinical trials that pairs a flexible data pipeline with robust reports like the one shown below.
This README provides a high-level overview of gsm.core; see the package website for additional details.
The gsm.core package is a successor package to {gsm}, which has been deprecated as of March 2025. The contents of {gsm} have been split out among 4 packages as follows:
- gsm.core: A package containing the analytics functionality and utility functions to run workflows.
-
{gsm.mapping}: A package that provides workflows to apply the necessary data transformation from raw/source datasets to appropriate domains. -
{gsm.kri}: A package that provides workflows to generate metrics and functionality to visualize and report on these metrics. -
{gsm.reporting}: A package that provides workflows to generate the reporting data model needed to generate reports.
Background
The gsm.core package lays the framework to perform risk assessments primarily focused on detecting differences in quality at the site-level. “High quality” is defined as the absence of errors that matter. We interpret this as focusing on detecting potential issues related to critical data or process across the major risk categories of safety, efficacy, disposition, treatment, and general quality, where each category consists of one or more risk assessment(s). Each risk assessment will analyze the data to flag sites with potential issues and provide a visualization to help the user understand the issue. Some relevant references are provided below.
Process Overview
The gsm.core package is the foundation of a data pipeline for RBM using R. The package, along with {gsm.mapping}, {gsm.kri} and {gsm.reporting} provides a framework that allows users to assess and visualize site-level risk in clinical trial data. The packages currently provide assessments for the following domains:
- Adverse Event Reporting Rate
- Serious Adverse Event Reporting Rate
- Non-important Protocol Deviation Rate
- Important Protocol Deviation Rate
- Grade 3+ Lab Abnormality Rate
- Study Discontinuation Rate
- Treatment Discontinuation Rate
- Query Rate
- Outstanding Query Rate
- Outstanding Data Entry Rate
- Data Change Rate
- Screen Failure Rate
All gsm.core assessments use a standardized 6 step data pipeline:
-
Input_Rate - Converts
rawdata toinputdata. -
Transform - Converts
inputdata totransformeddata. -
Analyze - Converts
transformeddata toanalyzeddata. -
Threshold - Uses
analyzeddata to create one or more numericthresholds. -
Flag - Uses
analyzeddata and numericthresholdsto createflaggeddata. -
Summarize - Selects key columns from
flaggeddata to createsummarydata.
To learn more about gsm.core’s data pipeline, visit the Data Pipeline article.
Reporting
Detailed RMarkdown/HTML reporting is built into gsm.core, and provides a detailed overview of all risk assessments for a given trial. For example, an AE risk assessment looks like this:
Full reports for a sample trial run with {clindata} are provided below:
Getting Started
Interested in using {gsm}? Key resources are provided in response to the FAQs below.
How do I calculate a metric?
See the “Process Overview” section above and then check out these articles:
- Step-by-Step Analysis Workflow Vignette walks users the step-by-step process for creating metrics (KRIs, QTLs, etc) in {gsm}.
- Adverse Event KRI Cookbook Example provides hands-on examples of how to customize KRI metrics related to Adverse events.
How do I evaluate a study?
The {gsm} workflow process allows creation of reusable pipelines for study (or even cross-study) data snapshots including data mapping, calculation of multiple metrics and creation of reports. See the articles below for details and examples.
- Data Model Vignette explains the data pipeline used to calculate multiple metrics and generate study-level reports.
- Adverse Event Workflow Example demonstrates how to create a configurable workflow using YAML to define the analysis pipeline.
- Reporting Workflow Example demonstrates a complete workflow from raw data to KRI reports using standard metrics.
How do I customize my study?
The {gsm} framework is designed to be highly modular and customizable. The sections above show examples of customized metrics and workflows. It’s also straightforward to add entire custom modules that add new mappings, metrics and reports. See the vignette below for details.
- gsm Extensions Vignette describes how to extend {gsm.core} by creating new ‘modules’, including metrics, reports and shiny apps that can be run using the standard gsm pipeline.
Quality Control
Since {gsm.core} is designed for use in a GCP framework, we have conducted extensive quality control as part of our development process. Our quality‑control framework includes the following components:
Testing & Qualification
- Unit Tests - Written for all core functions to verify individual component behavior.
- Workflow/Qualification Tests - System-wide functional, performance, and usability testing confirming that core workflows execute as expected.
- Regression Testing - Extensive QC and testing performed before each release to prevent regressions.
- Code Examples - Cookbook articles and roxygen2 examples demonstrate proper function usage.
Documentation & Specifications
- Function Documentation - Comprehensive roxygen2 documentation maintained for all functions.
- Data Specifications - Machine-readable specifications for all KRIs, automatically integrated into function documentation.
-
Contributor Guidelines - Step-by-step processes for code development and releases provided in
CONTRIBUTING.mdand required to be followed for contributions.
Development Practices
- Code Review - All changes reviewed and approved via GitHub Pull Requests by QC programmers.
- Continuous Integration - Automated workflows via GitHub Actions. Full list of GitHub Actions utilized can be found in the GitHub Actions Workflows section of the gsm.utils package.
- Package Checks - Standard R package checks must pass before PRs are merged.
Qualification Framework
{gsm.core} utilizes {qcthat} package that provides a structured qualification process by:
- Linking package requirements (documented as GitHub issues) to qualification and unit tests
- Generating automated qualification reports showing requirement coverage and test results for every PR and release.
- Documenting the computing environment for full traceability
- Integrating with GitHub Actions workflows
This comprehensive approach ensures all requirements are properly tested and verified before each release.
Additional detail, including links to functional documentation and vignettes, is available in the package website.