elig_timevar_collapse: Collapse elig_timevar tables

View source: R/elig_timevar_collapse.R

elig_timevar_collapseR Documentation

Collapse elig_timevar tables

Description

elig_timevar_collapse collapses elig_timevar tables

Usage

elig_timevar_collapse(
  conn,
  server = c("phclaims", "hhsaw"),
  source = c("mcaid", "apcd"),
  dual = F,
  cov_time_day = T,
  last_run = F,
  ids = NULL,
  tpl = F,
  bsp_group_name = F,
  full_benefit = F,
  cov_type = F,
  mco_id = F,
  med_covgrp = F,
  pharm_covgrp = F,
  med_medicaid = F,
  med_medicare = F,
  med_commercial = F,
  pharm_medicaid = F,
  pharm_medicare = F,
  pharm_commercial = F,
  geo_add1 = F,
  geo_add2 = F,
  geo_city = F,
  geo_state = F,
  geo_zip = F,
  geocode_vars = F,
  geo_zip_code = F,
  geo_county = F,
  geo_ach = F
)

Arguments

conn

SQL server connection created using odbc package.

server

Which server do you want to run the query against? NB. Currently only Medicaid data is available on HHSAW.

source

Which claims data source do you want to pull from?

dual

Collapse over the dual eligiblity flag.

cov_time_day

Recalculate coverage time in the new period. Default is TRUE.

last_run

Bring in the last run date.

ids

Restrict to specified IDs. Use format c("<id1>", "<id2>") or pass a vector.

tpl

Collapse over the third party liability flag (Medicaid only).

bsp_group_name

Collapse over the bsp_group_name field (Medicaid only)

full_benefit

Collapse over the full_benefit field (Medicaid only).

cov_type

Collapse over the cov_type field (Medicaid only).

mco_id

Collapse over the mco_id field (Medicaid only)

med_covgrp

Collapse over the med_covgrp field (APCD only).

pharm_covgrp

Collapse over the pharm_covgrp field (APCD only).

med_medicaid

Collapse over the med_medicaid field (APCD only).

med_medicare

Collapse over the med_medicare field (APCD only).

med_commercial

Collapse over the med_commercial field (APCD only).

pharm_medicaid

Collapse over the pharm_medicaid field (APCD only).

pharm_medicare

Collapse over the pharm_medicare field (APCD only).

pharm_commercial

Collapse over the pharm_commercial field (APCD only).

geo_add1

Collapse over the geo_add1 field (Medicaid only).

geo_add2

Collapse over the geo_add2 field (Medicaid only).

geo_city

Collapse over the geo_city field (Medicaid only).

geo_state

Collapse over the geo_state field (Medicaid only).

geo_zip

Collapse over the geo_zip field (Medicaid only).

geocode_vars

Bring in all geocded data elements (geo_zip_centroid, geo_street_centroid, geo_county_code, geo_tractce10, geo_hra_code, geo_school_code). Default is FALSE.

geo_zip_code

Collapse over the geo_zip_code field (APCD only).

geo_county

Collapse over the geo_countyfield (APCD only).

geo_ach

Collapse over the geo_ach field (APCD only).

Details

Standard time-varying eligibility (elig_timevar) tables have new lines (i.e., new from_date and to_date values) for a change in any time-varying element. This function allows users to generate a new time-varying eligibility table (elig_timevar) that creates a new line only for desired data elements. All fields that define what the new table is collapsed over are set to FALSE by default. NB. Function does not yet support Medicare or combined Medicaid/Medicare tables.

Examples

## Not run: 
new_timevar <- elig_timevar_collapse(conn = db_claims51, source = "mcaid",
full_benefit = T, geo_add1 = T, geo_city = T, geo_zip = T, geocode_vars = T)
new_timevar2 <- elig_timevar_collapse(conn = db_claims51, source = "apcd",
ids = c("123", "456", "789"), med_covgrp = T, geo_county = T)

## End(Not run)


PHSKC-APDE/Medicaid documentation built on April 24, 2024, 6:09 p.m.