Title: | Data Only Package to 'healthyR' |
Version: | 1.2.0 |
Description: | Provides data for functions typically used in the 'healthyR' package. |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
LazyData: | true |
LazyDataCompression: | xz |
BugReports: | https://github.com/spsanderson/healthyR.data/issues |
Depends: | R (≥ 4.1.0) |
Imports: | rlang, utils, janitor, dplyr, stats, httr2, stringr, tidyr |
RoxygenNote: | 7.3.2 |
URL: | https://github.com/spsanderson/healthyR.data |
NeedsCompilation: | no |
Packaged: | 2025-01-13 04:03:38 UTC; steve |
Author: | Steven Sanderson |
Maintainer: | Steven Sanderson <spsanderson@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2025-01-13 04:30:02 UTC |
Get Current Ambulatory Surgery Center Data.
Description
Get the current Ambulatory Surgery Center data.
Usage
current_asc_data(.data, .data_sets = c("Facility", "State", "National"))
Arguments
.data |
The data that results from the |
.data_sets |
The default is: c("Facility","State","National"), which will bring back all of the data in the Ambulatory Surgery Center data sets that are in the file. You can choose from the following:
You can also pass things like c("state","Nation") as behind the scense only
the Ambulatory Surgery Center datasets are available to the function to choose
from and |
Details
This function will obtain the current Ambulatory Surgery Center data
from the output of the current_hosp_data()
function, that is
the required input for the .data
parameter. You can pass in a list of which
of those data sets you would like,
Value
Gets the current ASC data from the current hospital data file.
Author(s)
Steven P. Sanderson II, MPH
See Also
https://data.cms.gov/provider-data/topics/hospitals/
Other Hospital Data:
current_asc_oas_cahps_data()
,
current_comp_death_data()
,
current_hai_data()
,
current_hcahps_data()
,
current_hosp_data()
,
current_hvbp_data()
,
current_ipfqr_data()
,
current_maternal_data()
,
current_medicare_hospital_spending_data()
,
current_oqr_oas_cahps_data()
,
current_outpatient_imaging_efficiency_data()
,
current_payments_data()
,
current_pch_hai_hospital_data()
,
current_pch_hcahps_data()
,
current_pch_oncology_measures_hospital_data()
,
current_pch_outcomes_data()
,
current_timely_and_effective_care_data()
,
current_unplanned_hospital_visits_data
,
current_va_data()
Examples
## Not run:
current_hosp_data() |>
current_asc_data(.data_sets = c("State","National"))
## End(Not run)
Get Current Ambulatory Surgery Center Quality Reporting Data.
Description
Get the current Ambulatory Surgery Center data.
Usage
current_asc_oas_cahps_data(
.data,
.data_sets = c("Facility", "State", "National")
)
Arguments
.data |
The data that results from the |
.data_sets |
The default is: c("Facility","State","National"), which will bring back all of the data sets that are in the Ambulatory Surgery Center OAS CAHPS data sets. You can choose from the following:
You can also pass things like c("state","Nation") as behind the scenes only
the Ambulatory Surgery Center data sets are available to the function to choose
from and |
Details
This function will obtain the current Ambulatory Surgery Center data
from the output of the current_hosp_data()
function, that is
the required input for the .data
parameter. You can pass in a list of which
of those data sets you would like,
Value
Gets the current ASC data from the current hospital data file.
Author(s)
Steven P. Sanderson II, MPH
See Also
https://data.cms.gov/provider-data/topics/hospitals/
Other Hospital Data:
current_asc_data()
,
current_comp_death_data()
,
current_hai_data()
,
current_hcahps_data()
,
current_hosp_data()
,
current_hvbp_data()
,
current_ipfqr_data()
,
current_maternal_data()
,
current_medicare_hospital_spending_data()
,
current_oqr_oas_cahps_data()
,
current_outpatient_imaging_efficiency_data()
,
current_payments_data()
,
current_pch_hai_hospital_data()
,
current_pch_hcahps_data()
,
current_pch_oncology_measures_hospital_data()
,
current_pch_outcomes_data()
,
current_timely_and_effective_care_data()
,
current_unplanned_hospital_visits_data
,
current_va_data()
Examples
## Not run:
current_hosp_data() |>
current_asc_oas_cahps_data(.data_sets = c("State","National"))
## End(Not run)
Get Current Complications and Death Data.
Description
Get the current complications and death data.
Usage
current_comp_death_data(.data, .data_sets = c("Facility", "State", "National"))
Arguments
.data |
The data that results from the |
.data_sets |
The default is: c("Facility","State","National"), which will bring back all of the data sets that are in the Complications and death data sets. You can choose from the following:
You can also pass things like c("state","Nation") as behind the scenes only
the Complications and Death data sets are available to the function to choose
from and |
Details
This function will obtain the current Complications and Death data
from the output of the current_hosp_data()
function, that is
the required input for the .data
parameter. You can pass in a list of which
of those data sets you would like,
Value
Gets the current Complications and Death data from the current hospital data file.
Author(s)
Steven P. Sanderson II, MPH
See Also
https://data.cms.gov/provider-data/topics/hospitals/
Other Hospital Data:
current_asc_data()
,
current_asc_oas_cahps_data()
,
current_hai_data()
,
current_hcahps_data()
,
current_hosp_data()
,
current_hvbp_data()
,
current_ipfqr_data()
,
current_maternal_data()
,
current_medicare_hospital_spending_data()
,
current_oqr_oas_cahps_data()
,
current_outpatient_imaging_efficiency_data()
,
current_payments_data()
,
current_pch_hai_hospital_data()
,
current_pch_hcahps_data()
,
current_pch_oncology_measures_hospital_data()
,
current_pch_outcomes_data()
,
current_timely_and_effective_care_data()
,
current_unplanned_hospital_visits_data
,
current_va_data()
Examples
## Not run:
current_hosp_data() |>
current_comp_death_data(.data_sets = c("State","National"))
## End(Not run)
Get Current Hospital Associated Infection Data.
Description
Get the current hospital associated infection data.
Usage
current_hai_data(.data, .data_sets = c("Facility", "State", "National"))
Arguments
.data |
The data that results from the |
.data_sets |
The default is: c("Facility","State","National"), which will bring back all of the data sets that are in the hospital associated infections data sets. You can choose from the following:
You can also pass things like c("state","Nation") as behind the scenes only
the hospital associated infections data sets are available to the function to choose
from and |
Details
This function will obtain the current hospital associated infections data
from the output of the current_hosp_data()
function, that is
the required input for the .data
parameter. You can pass in a list of which
of those data sets you would like,
Value
Gets the current hospital associated infection data from the current hospital data file.
Author(s)
Steven P. Sanderson II, MPH
See Also
https://data.cms.gov/provider-data/topics/hospitals/
Other Hospital Data:
current_asc_data()
,
current_asc_oas_cahps_data()
,
current_comp_death_data()
,
current_hcahps_data()
,
current_hosp_data()
,
current_hvbp_data()
,
current_ipfqr_data()
,
current_maternal_data()
,
current_medicare_hospital_spending_data()
,
current_oqr_oas_cahps_data()
,
current_outpatient_imaging_efficiency_data()
,
current_payments_data()
,
current_pch_hai_hospital_data()
,
current_pch_hcahps_data()
,
current_pch_oncology_measures_hospital_data()
,
current_pch_outcomes_data()
,
current_timely_and_effective_care_data()
,
current_unplanned_hospital_visits_data
,
current_va_data()
Examples
## Not run:
current_hosp_data() |>
current_hai_data(.data_sets = c("State","National"))
## End(Not run)
Get Current HCAHPS Data.
Description
Get the current hcahps data.
Usage
current_hcahps_data(.data, .data_sets = c("Facility", "State", "National"))
Arguments
.data |
The data that results from the |
.data_sets |
The default is: c("Facility","State","National"), which will bring back all of the data sets that are in the HCAPS data sets. You can choose from the following:
You can also pass things like c("state","Nation") as behind the scenes only
the hcahps data sets are available to the function to choose
from and |
Details
This function will obtain the current HCAPHS data
from the output of the current_hosp_data()
function, that is
the required input for the .data
parameter. You can pass in a list of which
of those data sets you would like,
Value
Gets the current Complications and Death data from the current hospital data file.
Author(s)
Steven P. Sanderson II, MPH
See Also
https://data.cms.gov/provider-data/topics/hospitals/
Other Hospital Data:
current_asc_data()
,
current_asc_oas_cahps_data()
,
current_comp_death_data()
,
current_hai_data()
,
current_hosp_data()
,
current_hvbp_data()
,
current_ipfqr_data()
,
current_maternal_data()
,
current_medicare_hospital_spending_data()
,
current_oqr_oas_cahps_data()
,
current_outpatient_imaging_efficiency_data()
,
current_payments_data()
,
current_pch_hai_hospital_data()
,
current_pch_hcahps_data()
,
current_pch_oncology_measures_hospital_data()
,
current_pch_outcomes_data()
,
current_timely_and_effective_care_data()
,
current_unplanned_hospital_visits_data
,
current_va_data()
Examples
## Not run:
current_hosp_data() |>
current_hcahps_data(.data_sets = c("State","National"))
## End(Not run)
Download Current Hospital Data Files.
Description
Download the current Hospital Data Sets.
Usage
current_hosp_data(path = utils::choose.dir())
Arguments
path |
The location to download and unzip the files |
Details
This function will download the current and the official hospital data sets from the CMS.gov website.
The function makes use of a temporary directory and file to save and unzip the data. This will grab the current Hospital Data Files, unzip them and return a list of tibbles with each tibble named after the data file.
The function returns a list object with all of the current hospital data as a tibble. It does not save the data anywhere so if you want to save it you will have to do that manually.
This also means that you would have to store the data as a variable in order to access the data later on. It does have a given attributes and a class so that it can be piped into other functions.
Value
Downloads the current hospital data sets.
Author(s)
Steven P. Sanderson II, MPH
See Also
https://data.cms.gov/provider-data/topics/hospitals/
Other Hospital Data:
current_asc_data()
,
current_asc_oas_cahps_data()
,
current_comp_death_data()
,
current_hai_data()
,
current_hcahps_data()
,
current_hvbp_data()
,
current_ipfqr_data()
,
current_maternal_data()
,
current_medicare_hospital_spending_data()
,
current_oqr_oas_cahps_data()
,
current_outpatient_imaging_efficiency_data()
,
current_payments_data()
,
current_pch_hai_hospital_data()
,
current_pch_hcahps_data()
,
current_pch_oncology_measures_hospital_data()
,
current_pch_outcomes_data()
,
current_timely_and_effective_care_data()
,
current_unplanned_hospital_visits_data
,
current_va_data()
Examples
## Not run:
current_hosp_data()
## End(Not run)
Download Hospital Data Dictionary
Description
Download the Hospital Data Dictionary
Usage
current_hosp_data_dict(.open_folder = FALSE)
Arguments
.open_folder |
The default is FALSE. If set to TRUE then the folder where the file was saved to will be opened. |
Details
This function will download the current Hospital Data Dictionary for
the official hospital data sets from the CMS.gov website. The function
makes use of utils::choose.dir()
and will ask the user where to save the
file.
Value
Downloads the current hospital data dictionary to a place specified by the user.
Author(s)
Steven P. Sanderson II, MPH
See Also
https://data.cms.gov/provider-data/topics/hospitals/
Examples
## Not run:
current_hosp_data_dict()
## End(Not run)
Get Current Hospital Value Based Purchasing Data.
Description
Get the current hospital hospital value based purchasing data.
Usage
current_hvbp_data(
.data,
.data_sets = c("Outcomes", "Efficiency", "Engagement", "Safety", "TPS")
)
Arguments
.data |
The data that results from the |
.data_sets |
The default is: c("Outcomes","TPS"), which will bring back all of the data sets that are in the hospital VBP data sets. You can choose from the following:
You can also pass things like c("tps","Safety") as behind the scenes only
the hospital vbp data sets are available to the function to choose
from and |
Details
This function will obtain the current hospital VBP data
from the output of the current_hosp_data()
function, that is
the required input for the .data
parameter. You can pass in a list of which
of those data sets you would like,
Value
Gets the current hospital vbp data from the current hospital data file.
Author(s)
Steven P. Sanderson II, MPH
See Also
https://data.cms.gov/provider-data/topics/hospitals/
Other Hospital Data:
current_asc_data()
,
current_asc_oas_cahps_data()
,
current_comp_death_data()
,
current_hai_data()
,
current_hcahps_data()
,
current_hosp_data()
,
current_ipfqr_data()
,
current_maternal_data()
,
current_medicare_hospital_spending_data()
,
current_oqr_oas_cahps_data()
,
current_outpatient_imaging_efficiency_data()
,
current_payments_data()
,
current_pch_hai_hospital_data()
,
current_pch_hcahps_data()
,
current_pch_oncology_measures_hospital_data()
,
current_pch_outcomes_data()
,
current_timely_and_effective_care_data()
,
current_unplanned_hospital_visits_data
,
current_va_data()
Examples
## Not run:
current_hosp_data() |>
current_hvbp_data(.data_sets = c("Outcomes","Safety"))
## End(Not run)
Get Current Inpatient Psychiatric Facility Quality Measure Data.
Description
Get the current Inpatient Psyciatric Facilty data.
Usage
current_ipfqr_data(.data, .data_sets = c("Facility", "State", "National"))
Arguments
.data |
The data that results from the |
.data_sets |
The default is: c("Facility","State","National"), which will bring back all of the data in the Inpatient Psyciatric Facilty data sets that are in the file. You can choose from the following:
You can also pass things like c("state","Nation") as behind the scenes only
the Inpatient Psyciatric Facilty data sets are available to the function to choose
from and |
Details
This function will obtain the current Inpatient Psyciatric Facilty data
from the output of the current_hosp_data()
function, that is
the required input for the .data
parameter. You can pass in a list of which
of those data sets you would like,
Value
Gets the current IPFQR data from the current hospital data file.
Author(s)
Steven P. Sanderson II, MPH
See Also
https://data.cms.gov/provider-data/topics/hospitals/
Other Hospital Data:
current_asc_data()
,
current_asc_oas_cahps_data()
,
current_comp_death_data()
,
current_hai_data()
,
current_hcahps_data()
,
current_hosp_data()
,
current_hvbp_data()
,
current_maternal_data()
,
current_medicare_hospital_spending_data()
,
current_oqr_oas_cahps_data()
,
current_outpatient_imaging_efficiency_data()
,
current_payments_data()
,
current_pch_hai_hospital_data()
,
current_pch_hcahps_data()
,
current_pch_oncology_measures_hospital_data()
,
current_pch_outcomes_data()
,
current_timely_and_effective_care_data()
,
current_unplanned_hospital_visits_data
,
current_va_data()
Examples
## Not run:
current_hosp_data() |>
current_ipfqr_data(.data_sets = c("State","National"))
## End(Not run)
Get Current Maternal Health Data.
Description
Get the current Maternal Health data.
Usage
current_maternal_data(.data, .data_sets = c("Facility", "State", "National"))
Arguments
.data |
The data that results from the |
.data_sets |
The default is: c("Facility","State","National"), which will bring back all of the data in the Maternal Health data sets that are in the file. You can choose from the following:
You can also pass things like c("state","Nation") as behind the scenes only
the Maternal Health data sets are available to the function to choose
from and |
Details
This function will obtain the current Maternal Health data
from the output of the current_hosp_data()
function, that is
the required input for the .data
parameter. You can pass in a list of which
of those data sets you would like,
Value
Gets the current Maternal Health data from the current hospital data file.
Author(s)
Steven P. Sanderson II, MPH
See Also
https://data.cms.gov/provider-data/topics/hospitals/
Other Hospital Data:
current_asc_data()
,
current_asc_oas_cahps_data()
,
current_comp_death_data()
,
current_hai_data()
,
current_hcahps_data()
,
current_hosp_data()
,
current_hvbp_data()
,
current_ipfqr_data()
,
current_medicare_hospital_spending_data()
,
current_oqr_oas_cahps_data()
,
current_outpatient_imaging_efficiency_data()
,
current_payments_data()
,
current_pch_hai_hospital_data()
,
current_pch_hcahps_data()
,
current_pch_oncology_measures_hospital_data()
,
current_pch_outcomes_data()
,
current_timely_and_effective_care_data()
,
current_unplanned_hospital_visits_data
,
current_va_data()
Examples
## Not run:
current_hosp_data() |>
current_maternal_data(.data_sets = c("State","National"))
## End(Not run)
Get Current Medicare Hospital Spending Data.
Description
Get the current Medicare Hospital Spending data.
Usage
current_medicare_hospital_spending_data(
.data,
.data_sets = c("Claim", "Facility", "State", "National")
)
Arguments
.data |
The data that results from the |
.data_sets |
The default is: c("Claim","Facility","State","National"), which will bring back all of the data in the Medicare Hospital Spending data sets that are in the file. You can choose from the following:
You can also pass things like c("state","Nation") as behind the scenes only
the Medicare Hospital Spending data sets are available to the function to choose
from and |
Details
This function will obtain the current Medicare Hospital Spending data
from the output of the current_hosp_data()
function, that is
the required input for the .data
parameter. You can pass in a list of which
of those data sets you would like,
Value
Gets the current Medicare Hospital Spending data from the current hospital data file.
Author(s)
Steven P. Sanderson II, MPH
See Also
https://data.cms.gov/provider-data/topics/hospitals/
Other Hospital Data:
current_asc_data()
,
current_asc_oas_cahps_data()
,
current_comp_death_data()
,
current_hai_data()
,
current_hcahps_data()
,
current_hosp_data()
,
current_hvbp_data()
,
current_ipfqr_data()
,
current_maternal_data()
,
current_oqr_oas_cahps_data()
,
current_outpatient_imaging_efficiency_data()
,
current_payments_data()
,
current_pch_hai_hospital_data()
,
current_pch_hcahps_data()
,
current_pch_oncology_measures_hospital_data()
,
current_pch_outcomes_data()
,
current_timely_and_effective_care_data()
,
current_unplanned_hospital_visits_data
,
current_va_data()
Examples
## Not run:
current_hosp_data() |>
current_maternal_data(.data_sets = c("State","National"))
## End(Not run)
Get Current OAS CAHPS Data.
Description
Get the current OAS CAHPS data.
Usage
current_oqr_oas_cahps_data(
.data,
.data_sets = c("Facility", "State", "National")
)
Arguments
.data |
The data that results from the |
.data_sets |
The default is: c("Claim","Facility","State","National"), which will bring back all of the data in the OAS CAHPS data sets that are in the file. You can choose from the following:
You can also pass things like c("state","Nation") as behind the scenes only
the OAS CAHPS data sets are available to the function to choose
from and |
Details
This function will obtain the current OAS CAHPS data
from the output of the current_hosp_data()
function, that is
the required input for the .data
parameter. You can pass in a list of which
of those data sets you would like,
Value
Gets the current OAS CAHPS data from the current hospital data file.
Author(s)
Steven P. Sanderson II, MPH
See Also
https://data.cms.gov/provider-data/topics/hospitals/
Other Hospital Data:
current_asc_data()
,
current_asc_oas_cahps_data()
,
current_comp_death_data()
,
current_hai_data()
,
current_hcahps_data()
,
current_hosp_data()
,
current_hvbp_data()
,
current_ipfqr_data()
,
current_maternal_data()
,
current_medicare_hospital_spending_data()
,
current_outpatient_imaging_efficiency_data()
,
current_payments_data()
,
current_pch_hai_hospital_data()
,
current_pch_hcahps_data()
,
current_pch_oncology_measures_hospital_data()
,
current_pch_outcomes_data()
,
current_timely_and_effective_care_data()
,
current_unplanned_hospital_visits_data
,
current_va_data()
Examples
## Not run:
current_hosp_data() |>
current_maternal_data(.data_sets = c("State","National"))
## End(Not run)
Get Current Imaging Efficiency Data.
Description
Get the current Imaging Efficiency data.
Usage
current_outpatient_imaging_efficiency_data(
.data,
.data_sets = c("Facility", "State", "National")
)
Arguments
.data |
The data that results from the |
.data_sets |
The default is: c("Claim","Facility","State","National"), which will bring back all of the data in the Imaging Efficiency data sets that are in the file. You can choose from the following:
You can also pass things like c("state","Nation") as behind the scenes only
the Imaging Efficiency data sets are available to the function to choose
from and |
Details
This function will obtain the current Imaging Efficiency data
from the output of the current_hosp_data()
function, that is
the required input for the .data
parameter. You can pass in a list of which
of those data sets you would like,
Value
Gets the current Imaging Efficiency data from the current hospital data file.
Author(s)
Steven P. Sanderson II, MPH
See Also
https://data.cms.gov/provider-data/topics/hospitals/
Other Hospital Data:
current_asc_data()
,
current_asc_oas_cahps_data()
,
current_comp_death_data()
,
current_hai_data()
,
current_hcahps_data()
,
current_hosp_data()
,
current_hvbp_data()
,
current_ipfqr_data()
,
current_maternal_data()
,
current_medicare_hospital_spending_data()
,
current_oqr_oas_cahps_data()
,
current_payments_data()
,
current_pch_hai_hospital_data()
,
current_pch_hcahps_data()
,
current_pch_oncology_measures_hospital_data()
,
current_pch_outcomes_data()
,
current_timely_and_effective_care_data()
,
current_unplanned_hospital_visits_data
,
current_va_data()
Examples
## Not run:
current_hosp_data() |>
current_outpatient_imaging_efficiency_data(.data_sets = c("State","National"))
## End(Not run)
Get Current Payments Data.
Description
Get the current Payments data.
Usage
current_payments_data(.data, .data_sets = c("Facility", "State", "National"))
Arguments
.data |
The data that results from the |
.data_sets |
The default is: c(Facility","State","National"), which will bring back all of the data in the Payments data sets that are in the file. You can choose from the following:
You can also pass things like c("state","Nation") as behind the scenes only
the Payments data sets are available to the function to choose
from and |
Details
This function will obtain the current Payments data
from the output of the current_hosp_data()
function, that is
the required input for the .data
parameter. You can pass in a list of which
of those data sets you would like,
Value
Gets the current Payments data from the current hospital data file.
Author(s)
Steven P. Sanderson II, MPH
See Also
https://data.cms.gov/provider-data/topics/hospitals/
Other Hospital Data:
current_asc_data()
,
current_asc_oas_cahps_data()
,
current_comp_death_data()
,
current_hai_data()
,
current_hcahps_data()
,
current_hosp_data()
,
current_hvbp_data()
,
current_ipfqr_data()
,
current_maternal_data()
,
current_medicare_hospital_spending_data()
,
current_oqr_oas_cahps_data()
,
current_outpatient_imaging_efficiency_data()
,
current_pch_hai_hospital_data()
,
current_pch_hcahps_data()
,
current_pch_oncology_measures_hospital_data()
,
current_pch_outcomes_data()
,
current_timely_and_effective_care_data()
,
current_unplanned_hospital_visits_data
,
current_va_data()
Examples
## Not run:
current_hosp_data() |>
current_payments_data(.data_sets = c("State","National"))
## End(Not run)
Get Current PCH HAI Hospital Data.
Description
Get the current PCH HAI Hospital data.
Usage
current_pch_hai_hospital_data(.data)
Arguments
.data |
The data that results from the |
Details
This function will obtain the current PCH HAI Hospital data
from the output of the current_hosp_data()
function, that is
the required input for the .data
parameter. This function only returns a single
object.
Value
Gets the current PCH HCAHPS data from the current hospital data file.
Author(s)
Steven P. Sanderson II, MPH
See Also
https://data.cms.gov/provider-data/topics/hospitals/
Other Hospital Data:
current_asc_data()
,
current_asc_oas_cahps_data()
,
current_comp_death_data()
,
current_hai_data()
,
current_hcahps_data()
,
current_hosp_data()
,
current_hvbp_data()
,
current_ipfqr_data()
,
current_maternal_data()
,
current_medicare_hospital_spending_data()
,
current_oqr_oas_cahps_data()
,
current_outpatient_imaging_efficiency_data()
,
current_payments_data()
,
current_pch_hcahps_data()
,
current_pch_oncology_measures_hospital_data()
,
current_pch_outcomes_data()
,
current_timely_and_effective_care_data()
,
current_unplanned_hospital_visits_data
,
current_va_data()
Examples
## Not run:
current_hosp_data() |>
current_pch_hai_hospital_data()
## End(Not run)
Get Current PCH HCAHPS Data.
Description
Get the current PCH HCAHPS data.
Usage
current_pch_hcahps_data(.data, .data_sets = c("Facility", "State", "National"))
Arguments
.data |
The data that results from the |
.data_sets |
The default is: c(Facility","State","National"), which will bring back all of the data in the PCH HCAHPS data sets that are in the file. You can choose from the following:
You can also pass things like c("state","Nation") as behind the scenes only
the PCH HCAHPS data sets are available to the function to choose
from and |
Details
This function will obtain the current PCH HCAHPS data
from the output of the current_hosp_data()
function, that is
the required input for the .data
parameter. You can pass in a list of which
of those data sets you would like,
Value
Gets the current PCH HCAHPS data from the current hospital data file.
Author(s)
Steven P. Sanderson II, MPH
See Also
https://data.cms.gov/provider-data/topics/hospitals/
Other Hospital Data:
current_asc_data()
,
current_asc_oas_cahps_data()
,
current_comp_death_data()
,
current_hai_data()
,
current_hcahps_data()
,
current_hosp_data()
,
current_hvbp_data()
,
current_ipfqr_data()
,
current_maternal_data()
,
current_medicare_hospital_spending_data()
,
current_oqr_oas_cahps_data()
,
current_outpatient_imaging_efficiency_data()
,
current_payments_data()
,
current_pch_hai_hospital_data()
,
current_pch_oncology_measures_hospital_data()
,
current_pch_outcomes_data()
,
current_timely_and_effective_care_data()
,
current_unplanned_hospital_visits_data
,
current_va_data()
Examples
## Not run:
current_hosp_data() |>
current_pch_hcahps_data(.data_sets = c("State","National"))
## End(Not run)
Get Current PCH Oncology Measures Data.
Description
Get the current PCH Oncology Measures data.
Usage
current_pch_oncology_measures_hospital_data(.data)
Arguments
.data |
The data that results from the |
Details
This function will obtain the current PCH Oncology Measures data
from the output of the current_hosp_data()
function, that is
the required input for the .data
parameter. This function only returns a single
object.
Value
Gets the current PCH Oncology Measures Hospital data from the current hospital data file.
Author(s)
Steven P. Sanderson II, MPH
See Also
https://data.cms.gov/provider-data/topics/hospitals/
Other Hospital Data:
current_asc_data()
,
current_asc_oas_cahps_data()
,
current_comp_death_data()
,
current_hai_data()
,
current_hcahps_data()
,
current_hosp_data()
,
current_hvbp_data()
,
current_ipfqr_data()
,
current_maternal_data()
,
current_medicare_hospital_spending_data()
,
current_oqr_oas_cahps_data()
,
current_outpatient_imaging_efficiency_data()
,
current_payments_data()
,
current_pch_hai_hospital_data()
,
current_pch_hcahps_data()
,
current_pch_outcomes_data()
,
current_timely_and_effective_care_data()
,
current_unplanned_hospital_visits_data
,
current_va_data()
Examples
## Not run:
current_hosp_data() |>
current_pch_oncology_measures_hospital_data()
## End(Not run)
Get Current PCH Outcomes Data.
Description
Get the current PCH Outcomes data.
Usage
current_pch_outcomes_data(.data, .data_sets = c("Facility", "National"))
Arguments
.data |
The data that results from the |
.data_sets |
The default is: c(Facility","National"), which will bring back all of the data in the PCH HCAHPS data sets that are in the file. You can choose from the following:
You can also pass things like c("state","Nation") as behind the scenes only
the PCH Outcomes data sets are available to the function to choose
from and |
Details
This function will obtain the current PCH Outcomes data
from the output of the current_hosp_data()
function, that is
the required input for the .data
parameter. You can pass in a list of which
of those data sets you would like,
Value
Gets the current PCH Outcomes data from the current hospital data file.
Author(s)
Steven P. Sanderson II, MPH
See Also
https://data.cms.gov/provider-data/topics/hospitals/
Other Hospital Data:
current_asc_data()
,
current_asc_oas_cahps_data()
,
current_comp_death_data()
,
current_hai_data()
,
current_hcahps_data()
,
current_hosp_data()
,
current_hvbp_data()
,
current_ipfqr_data()
,
current_maternal_data()
,
current_medicare_hospital_spending_data()
,
current_oqr_oas_cahps_data()
,
current_outpatient_imaging_efficiency_data()
,
current_payments_data()
,
current_pch_hai_hospital_data()
,
current_pch_hcahps_data()
,
current_pch_oncology_measures_hospital_data()
,
current_timely_and_effective_care_data()
,
current_unplanned_hospital_visits_data
,
current_va_data()
Examples
## Not run:
current_hosp_data() |>
current_pch_outcomes_data(.data_sets = c("Facility", "National"))
## End(Not run)
Get Current Timely & Effective Care Data.
Description
Get the current Timely & Effective Care data.
Usage
current_timely_and_effective_care_data(
.data,
.data_sets = c("Facility", "State", "National")
)
Arguments
.data |
The data that results from the |
.data_sets |
The default is: c(Facility","State","National"), which will bring back all of the data in the Timely & Effective Care data sets that are in the file. You can choose from the following:
You can also pass things like c("state","Nation") as behind the scenes only
the Timely & Effective Care data sets are available to the function to choose
from and |
Details
This function will obtain the current Timely & Effective Care data
from the output of the current_hosp_data()
function, that is
the required input for the .data
parameter. You can pass in a list of which
of those data sets you would like,
Value
Gets the current Timely & Effective Care data from the current hospital data file.
Author(s)
Steven P. Sanderson II, MPH
See Also
https://data.cms.gov/provider-data/topics/hospitals/
Other Hospital Data:
current_asc_data()
,
current_asc_oas_cahps_data()
,
current_comp_death_data()
,
current_hai_data()
,
current_hcahps_data()
,
current_hosp_data()
,
current_hvbp_data()
,
current_ipfqr_data()
,
current_maternal_data()
,
current_medicare_hospital_spending_data()
,
current_oqr_oas_cahps_data()
,
current_outpatient_imaging_efficiency_data()
,
current_payments_data()
,
current_pch_hai_hospital_data()
,
current_pch_hcahps_data()
,
current_pch_oncology_measures_hospital_data()
,
current_pch_outcomes_data()
,
current_unplanned_hospital_visits_data
,
current_va_data()
Examples
## Not run:
current_hosp_data() |>
current_timely_and_effective_care_data(.data_sets = c("State","National"))
## End(Not run)
Get Current Unplanned Hospital Visits Data.
Description
Get the current Unplanned Hospital Visits data.
Usage
current_unplanned_hospital_vists_data(
.data,
.data_sets = c("Facility", "State", "National")
)
Arguments
.data |
The data that results from the |
.data_sets |
The default is: c(Facility","State","National"), which will bring back all of the data in the Unplanned Hospital Visits data sets that are in the file. You can choose from the following:
You can also pass things like c("state","Nation") as behind the scenes only
the Unplanned Hospital Visits data sets are available to the function to choose
from and |
Details
This function will obtain the current Unplanned Hospital Visits data
from the output of the current_hosp_data()
function, that is
the required input for the .data
parameter. You can pass in a list of which
of those data sets you would like,
Value
Gets the current Unplanned Hospital Visits data from the current hospital data file.
Author(s)
Steven P. Sanderson II, MPH
See Also
https://data.cms.gov/provider-data/topics/hospitals/
Other Hospital Data:
current_asc_data()
,
current_asc_oas_cahps_data()
,
current_comp_death_data()
,
current_hai_data()
,
current_hcahps_data()
,
current_hosp_data()
,
current_hvbp_data()
,
current_ipfqr_data()
,
current_maternal_data()
,
current_medicare_hospital_spending_data()
,
current_oqr_oas_cahps_data()
,
current_outpatient_imaging_efficiency_data()
,
current_payments_data()
,
current_pch_hai_hospital_data()
,
current_pch_hcahps_data()
,
current_pch_oncology_measures_hospital_data()
,
current_pch_outcomes_data()
,
current_timely_and_effective_care_data()
,
current_va_data()
Examples
## Not run:
current_hosp_data() |>
current_unplanned_hospital_visits_data(.data_sets = c("State","National"))
## End(Not run)
Get Current Veterans Affairs Data.
Description
Get the current Veterans Affairs data.
Usage
current_va_data(.data, .data_sets = c("Behavioral", "Timely", "Provider"))
Arguments
.data |
The data that results from the |
.data_sets |
The default is: c(Facility","State","National"), which will bring back all of the data in the Veterans Affairs data sets that are in the file. You can choose from the following:
You can also pass things like c("behavioral","Provider") as behind the scenes only
the Veterans Affairs data sets are available to the function to choose
from and |
Details
This function will obtain the current Veterans Affairs data
from the output of the current_hosp_data()
function, that is
the required input for the .data
parameter. You can pass in a list of which
of those data sets you would like,
Value
Gets the current Veterans Affairs data from the current hospital data file.
Author(s)
Steven P. Sanderson II, MPH
See Also
https://data.cms.gov/provider-data/topics/hospitals/
Other Hospital Data:
current_asc_data()
,
current_asc_oas_cahps_data()
,
current_comp_death_data()
,
current_hai_data()
,
current_hcahps_data()
,
current_hosp_data()
,
current_hvbp_data()
,
current_ipfqr_data()
,
current_maternal_data()
,
current_medicare_hospital_spending_data()
,
current_oqr_oas_cahps_data()
,
current_outpatient_imaging_efficiency_data()
,
current_payments_data()
,
current_pch_hai_hospital_data()
,
current_pch_hcahps_data()
,
current_pch_oncology_measures_hospital_data()
,
current_pch_outcomes_data()
,
current_timely_and_effective_care_data()
,
current_unplanned_hospital_visits_data
Examples
## Not run:
current_hosp_data() |>
current_va_data(.data_sets = c("Behavioral"))
## End(Not run)
Fetch Data as Tibble
Description
This function retrieves data from the provided link and returns it as a tibble
with cleaned names. This function is intended to be used with the CMS data API
function get_cms_meta_data
.
Usage
fetch_cms_data(.data_link)
Arguments
.data_link |
A character string containing the URL to fetch data from. |
Details
The function sends a request to the provided URL using httr2::request
and
httr2::req_perform
. If the response status is not 200, it stops with an
error message indicating the failure. The response body is parsed as JSON and
converted into a tibble using dplyr::as_tibble
. The column names are cleaned
using janitor::clean_names
, and any character columns are stripped of leading
and trailing whitespace using stringr::str_squish
.
Value
A tibble containing the fetched data with cleaned names. If an error
occurs, returns NULL
.
See Also
Examples
library(dplyr)
# Example usage:
base_url <- "https://data.cms.gov/data-api/v1/dataset/"
data_identifier <- "9767cb68-8ea9-4f0b-8179-9431abc89f11"
data_url <- paste0(base_url, data_identifier, "/data")
df_tbl <- fetch_cms_data(data_url)
df_tbl |>
head(1) |>
glimpse()
Fetch Provider Data as Tibble or Download CSV
Description
This function retrieves provider data from the provided link and returns it as a tibble with cleaned names or downloads the data as a CSV file if the link ends in .csv. This function is intended to be used with the CMS provider data API.
Usage
fetch_provider_data(.data_link, .limit = 500)
Arguments
.data_link |
A character string containing the URL to fetch data from. |
.limit |
An integer specifying the maximum number of rows to fetch. Default is 500. If set to 0, all records will be returned. |
Details
The function sends a request to the provided URL using httr2::request
and
httr2::req_perform
. If the response status is not 200, it stops with an
error message indicating the failure. If the URL ends in .csv, it uses utils::download.file
to download the CSV file to a directory chosen by the user. Otherwise, the
response body is parsed as JSON and converted into a tibble using
dplyr::as_tibble
. The column names are cleaned using janitor::clean_names
,
and any character columns are stripped of leading and trailing whitespace
using stringr::str_squish
. The default limit for a return on records is 500.
If the limit is set to 0, all records will be returned.
Value
A tibble containing the fetched data with cleaned names, or downloads
a CSV file to the user-selected directory. If an error occurs, returns NULL
.
See Also
Examples
library(dplyr)
# Example usage:
data_url <- "069d-826b"
df_tbl <- fetch_provider_data(data_url, .limit = 1)
df_tbl |>
glimpse()
Retrieve CMS Metadata Links from CMS
Description
This function sends a request to the specified CMS data URL, retrieves the JSON data, and processes it to create a tibble with relevant information about the datasets.
Usage
get_cms_meta_data(
.title = NULL,
.modified_date = NULL,
.keyword = NULL,
.identifier = NULL,
.data_version = "current",
.media_type = "all"
)
Arguments
.title |
This can be a title that is used to search the data. |
.modified_date |
This can be a date in the format of "YYYY-MM-DD" |
.keyword |
This can be a keyword that is used to search the data. |
.identifier |
This can be an identifier that is used to search the data. |
.data_version |
This can be one of three different choices: "current", "archive", or "all". The default is "current" and if you make a choice that does not exist then it will default to "current". |
.media_type |
This can be one of three different choices: "all", "csv", "API", or "other". The default is "all" and if you make a choice that does not exist then it will default to "all". |
Details
The function fetches JSON data from the CMS data URL and extracts relevant fields to create a tidy tibble. It selects specific columns, handles nested lists by unnesting them, cleans column names, and processes dates and media types to make the data more useful for analysis. The columns in the returned tibble are:
-
title
-
description
-
landing_page
-
modified
-
keyword
-
described_by
-
fn
-
has_email
-
identifier
-
start
-
end
-
references
-
distribution_description
-
distribution_title
-
distribution_modified
-
distribution_start
-
distribution_end
-
media_type
-
data_link
Value
A tibble with data links and relevant metadata about the datasets.
Author(s)
Steven P. Sanderson II, MPH
See Also
https://data.cms.gov/data.json
Other Meta Data:
get_provider_meta_data()
Examples
library(dplyr)
# Fetch and process metadata from the CMS data URL
get_cms_meta_data(
.keyword = "nation",
.title = "Market Saturation & Utilization State-County"
) |>
glimpse()
Retrieve Provider Metadata from CMS
Description
This function sends a request to the specified CMS metadata URL, retrieves the JSON data, and processes it to create a tibble with relevant information about the datasets.
Usage
get_provider_meta_data(
.identifier = NULL,
.title = NULL,
.description = NULL,
.keyword = NULL,
.issued = NULL,
.modified = NULL,
.released = NULL,
.theme = NULL,
.media_type = NULL
)
Arguments
.identifier |
A dataset identifier to filter the data. |
.title |
A title to filter the data. |
.description |
A description to filter the data. |
.keyword |
A keyword to filter the data. |
.issued |
A date when the dataset was issued to filter the data. |
.modified |
A date when the dataset was modified to filter the data. |
.released |
A date when the dataset was released to filter the data. |
.theme |
A theme to filter the data. |
.media_type |
A media type to filter the data. |
Details
The function fetches JSON data from the CMS metadata URL and extracts relevant fields to create a tidy tibble. It selects specific columns, handles nested lists by unnesting them, cleans column names, and processes dates and media types to make the data more useful for analysis. The columns in the returned tibble are:
-
identifier
-
title
-
description
-
keyword
-
issued
-
modified
-
released
-
theme
-
media_type
-
download_url
-
contact_fn
-
contact_email
-
publisher_name
Value
A tibble with metadata about the datasets.
See Also
https://data.cms.gov/provider-data/api/1/metastore/schemas/dataset/items
Other Meta Data:
get_cms_meta_data()
Examples
library(dplyr)
# Fetch and process metadata from the CMS data URL
get_provider_meta_data(.identifier = "3614-1eef") |>
glimpse()
Main data file for healthyR
Description
A dataset containing many common items found in an administrative dataset at a hospital.
Usage
data(healthyR_data)
Format
A data frame with 187,721 rows and 17 variables
Details
mrn. Medical Record Number. Unique patient identifier.
visit_id. Unique hospital Visit ID. Tied to an mrn
visit_start_date_time. The starting datetime of a visit_id
visit_end_date_time. The ending datetime of a visit_id
total_charge_amount. The total charge in dollars for a visit_id
total_amount_due. The toal amount of money still due to a visit_id
total_adjustment_amount. The toal amount of money adjusted off of an account for various reasons
payer_grouping. The insurance classification of a visit_id
total_payment_amount. The total amount of money paid on a visit_id
ip_op_flag. A flag that indicates if the patient was admitted or was an outpatient
service_line. The hospital service line for the visit_id
length_of_stay. The total days a visit_id was admitted to the hospital
expected_length_of_stay. The total days a visit_id was expected to be admitted
lnmgth_of_stay_threshold. The threshold of the length_of_stay variable before the visit_id is considered to be an outlier
los_outler_flag. A binary indicator of whether or not a visit_id was above the threshold
readmit_flag. A binary indicator of whether or not a visit_id was admitted in 30 days
readmit_expectation. The readmit rate for the particular visit computed from a benchmark
Check if a URL is valid
Description
This function validates a URL by checking the presence of a scheme and a hostname in the parsed URL.
Usage
is_valid_url(url)
Arguments
url |
A character string representing the URL to be checked. |
Details
The function uses the httr2::url_parse
function to parse the URL
and checks if the parsed URL contains a scheme and a hostname. If either
is missing, the URL is considered invalid.
Value
A logical value: TRUE
if the URL is valid, FALSE
otherwise.
Author(s)
Steven P. Sanderson II, MPH
Examples
is_valid_url("https://www.example.com") # TRUE
is_valid_url("not_a_url") # FALSE