Skip to contents

check_content_group_id checks to see if the provided value belongs to one of nine currently accepted content group identifiers.

Usage

check_content_group_id(content_group_id)

Arguments

content_group_id

Code that identifies the content found in EPHT documentation.

Value

list containing exit status code and success/failure message

Data

Users are expected to wrangle, aggregate and otherwise implement the logic expected by EPHT themselves. distiller will not handle that step, though it does provides some helpers: collapse_race(), collapse_ethnicity(), and make_months_worse().

In order for distiller to work properly there are some expectations about the data that must be met:

  • The data must be a dataframe or tibble

  • For all content_group_id The data must have the following columns: (in any order):

    • month: character - acceptable values: "01", "02", "03" ... "12"

    • agegroup: numeric - acceptable values: 1-19

    • county: character - string length of 5, unless unknown, then county = "U"

    • ethnicity: character - acceptable values: "H", "NH", "U"

    • race: character - acceptable values: "W", "B", "O", "U"

    • health_outcome_id: numeric - acceptable values: 1-5

    • sex: character - acceptable values: "M", "F", "U"

    • year: numeric - acceptable values: 2001-9999

    • monthly_count: numeric - acceptable values: >0 and no missing values

  • For content_group_id "CO-ED" and "CO-HOSP" the data must have the additional columns:

    • fire_count: numeric - acceptable values: >0 and no missing values

    • nonfire_count: numeric - acceptable values: >0 and no missing values

    • unknown_count: numeric - acceptable values: >0 and no missing values

Examples

check_content_group_id("AS-HOSP")
#> $code
#> [1] 0
#> 
#> $message
#> Success: content_group_id
#>