Skip to contents

Package Overview

Package-level documentation: what the package builds, who it’s for, and how the verify workflow fits together.

hvtiRdatabuild hvtiRdatabuild-package
hvtiRdatabuild: Build and Verify Analytic Datasets for the HVTI CORR Group

Verify: R Build vs. SAS Oracle

Freeze a SAS-built dataset as a checksummed parquet oracle, then compare an R-built dataset against it. Use snapshot_oracle() once per legacy SAS dataset to create the frozen reference; use compare_built() for every R rebuild you want to verify against it.

snapshot_oracle()
Freeze a SAS-built dataset as a checksummed parquet oracle
compare_built()
Compare an R-built dataset against a SAS oracle
print(<built_comparison>)
Print a dataset comparison
str(<built_comparison>)
Structure of a dataset comparison, without identifiers

Pull: Warehouse to R

Read a study’s configuration, open a credentialed warehouse connection, and pull the modules the study declares. The pull is read-only.

read_study_config()
Read and validate a study configuration
dw_connect()
Open a connection to the data warehouse
dw_modules()
List the available warehouse modules
dw_pull()
Pull the enabled warehouse modules for a study
print(<pull_result>)
Print a pull result

Build: Assemble and Derive

Join the pulled modules into a study’s built dataset, run its study-specific derivation code, and carry the cohort’s inclusion and exclusion history through both in order.

build_dataset()
Assemble the patient-level dataset
derive_vars()
Apply study-specific variable derivations
new_cohort_record()
Create an ordered cohort history
append_cohort_stage()
Append an outcome stage to a cohort history
cohort_summary()
Summarize cohort attrition without patient identifiers
print(<build_result>)
Print a built dataset result without patient values
str(<build_result>)
Safely inspect a built dataset result
print(<derive_result>)
Print a derived dataset result without patient values
str(<derive_result>)
Safely inspect a derived dataset result
str(<cohort_record>)
Safely inspect a cohort record

Analysis sets

Write and read declared, checkpointed selections of a study’s built dataset.

write_analysis_set()
Write an analysis set
read_analysis_set()
Read an analysis set

Dataset publication

Turn a mutable draft into an immutable dated release, or withdraw a release without changing its bytes.

publish_dataset()
Publish an immutable dataset release
withdraw_dataset_release()
Withdraw a published dataset release

Master datasets

Snapshot, lift and correct the master datasets studies read.

read_master_config()
Read a master dataset's configuration
snapshot_master()
Snapshot a master dataset to parquet, with its lineage
lift_master()
Lift a master's parquet snapshot into the warehouse as a view
backfill_corrections()
Backfill a master's corrections from its SAS build, and regenerate its view
propose_correction()
Propose a correction to a single cell of a master
decide_correction()
Decide a correction: accept, reject, supersede or bake it