Skip to contents

This function will iterate through the provided input table to identify the count of patients who have the at least one occurrence of the concept defined in the user-provided concept set and the proportion of patients who have the concept based on the user-defined denominator cohort.

Usage

check_ecp(ecp_tbl, omop_or_pcornet = "omop", check_string = "ecp")

Arguments

ecp_tbl

tabular input || required

The primary input table that contains descriptive information about the checks to be executed by the function. It should include definitions for the concepts that should be identified and the denominator cohort to be used for the computation. see ?ecp_input_omop or ?ecp_input_pcornet for examples of the input structure

omop_or_pcornet

string || defaults to omop

A string, either omop or pcornet, indicating the CDM format of the data

check_string

string || defaults to ecp

An abbreviated identifier that will be used to label all output from this module

Value

This function will return a table with the total patient count, the count of patients with a particular concept, the proportion of total patients with the concept, plus some additional descriptive metadata

Examples

# First create input file with desired checks to be executed
# You can access examples for both OMOP & PCORnet here:
ndq::ecp_input_omop
#> # A tibble: 5 × 10
#>   check_id check_description cohort_definition cohort_schema cohort_table schema
#>   <chr>    <chr>             <chr>             <chr>         <chr>        <chr> 
#> 1 hemoglo… Hemoglobin Lab    All patients in … cdm           person       cdm   
#> 2 sodium   Sodium Lab        All patients in … cdm           person       cdm   
#> 3 flu      Influenza Lab     All patients in … cdm           person       cdm   
#> 4 height   Height            All patients in … cdm           person       cdm   
#> 5 weight   Weight            All patients in … cdm           person       cdm   
#> # ℹ 4 more variables: table <chr>, concept_field <chr>, conceptset_name <chr>,
#> #   filter_logic <lgl>
ndq::ecp_input_pcornet
#> # A tibble: 5 × 11
#>   check_id check_description cohort_definition cohort_schema cohort_table schema
#>   <chr>    <chr>             <chr>             <chr>         <chr>        <chr> 
#> 1 hemoglo… Hemoglobin Labs   All patients in … cdm           demographic  cdm   
#> 2 sodium   Sodium Labs       All patients in … cdm           demographic  cdm   
#> 3 flu      Influenza Labs    All patients in … cdm           demographic  cdm   
#> 4 height   Height            All patients in … cdm           demographic  cdm   
#> 5 weight   Weight            All patients in … cdm           demographic  cdm   
#> # ℹ 5 more variables: table <chr>, concept_field <chr>, vocabulary_field <lgl>,
#> #   conceptset_name <chr>, filter_logic <lgl>

# Use this as your input to the ECP function
## To execute the check at the patient level:
if (FALSE) { # \dontrun{
my_ecp_rslt <- check_ecp(ecp_tbl = ndq::ecp_input_omop,
                         omop_or_pcornet = 'omop',
                         check_string = 'ecp')
} # }