mcaid_covgrp_f: Medicaid member coverage group information

mcaid_covgrp_fR Documentation

Medicaid member coverage group information

Description

mcaid_covgrp_f builds a SQL query to return Medicaid member coverage group information.

Usage

mcaid_covgrp_f(
  server,
  from_date = Sys.Date() - months(12),
  to_date = Sys.Date() - months(6),
  join = FALSE,
  df_join_name
)

Arguments

server

SQL server connection created using odbc package

from_date

Begin date for Medicaid coverage period, "YYYY-MM-DD", defaults to 12 months prior to today's date

to_date

End date for Medicaid coverage period, "YYYY-MM-DD", defaults to 6 months prior to today's date

join

True/false value to denote whether returned data should be joined to an existing data frame, defaults to FALSE

Details

LARGELY FOR INTERNAL USE This function builds and sends a SQL query to return a Medicaid member cohort with coverage group information for a specified coverage date range. If requested, the function will also join the returned data to a specified data frame in R, joining on Medicaid member ID. Given that members can have multiple values for a coverage group variable in a given date range (e.g. in new adult coverage for 1st 6 months and then older adults coverage for next 6 months), the function will return a 0/1 value overall for the requested date range. For example, if a member had new adult coverage at any point during the date range a "1" will be returned.

Examples

## Not run: 
elig_test_covgrp <- mcaid_covgrp_f(server = db.claims51, from_date = "2016-04-01", to_date = "2017-03-31")
elig_test_covgrp <- mcaid_covgrp_f(server = db.claims51, from_date = "2016-04-01", to_date = "2017-03-31", join = T,
df_join_name = elig_test)

## End(Not run)


PHSKC-APDE/claims_data documentation built on April 22, 2024, 6:29 p.m.