etl_qa_final_results: Final QA results for ETL QA pipeline

View source: R/etl_qa_run_pipeline.R

etl_qa_final_resultsR Documentation

Final QA results for ETL QA pipeline

Description

This function processes the initial results from etl_qa_initial_results into a format suitable for reporting and visualization. It is the third step run by etl_qa_run_pipeline.

Usage

etl_qa_final_results(initial_qa_results, config)

Arguments

initial_qa_results

A list containing the initial QA results.

config

An S3 object of class "qa_data_config" containing configuration settings.

Details

This is an internal function accessible only by use of :::, for example, apde:::etl_qa_final_results(...).

Value

A list containing formatted and combined results that consists of:

missingness

Structured summary of the proportion of missing data per variable and time point

values

Combined table with the frequency of categorical variables and simple statistics for numeric and date / datetime variables

chi_standards

Comparison of CHI (Community Health Indicator) variables values with those expected based on rads.data::misc_chi_byvars

Examples

## Not run: 

# Step 1: generate a config object 
myconfig <- etl_qa_setup_config(
  data_source_type = 'rads',
  data_params = list(
    function_name = 'get_data_birth',
    time_var = 'chi_year',
    time_range = c(2021, 2022),
    cols = c('chi_age', 'race4', 'birth_weight_grams', 'birthplace_city', 
             'num_prev_cesarean', 'mother_date_of_birth'),
    version = 'final', 
    kingco = FALSE, 
    check_chi = TRUE
  ), 
  output_directory = 'C:/temp/'
)

# Step 2: prep the initial results
initial_results <- etl_qa_initial_results(config = myconfig)

# Step 3: prep the final results
final_results <- etl_qa_final_results(initial_qa_results = initial_results, 
                                      config = myconfig)

# Peek at the tables
head(final_results$missingness)
head(final_results$values)
head(final_results$chi_standards)


## End(Not run)


PHSKC-APDE/apde documentation built on April 14, 2025, 10:46 a.m.