-
Notifications
You must be signed in to change notification settings - Fork 1
Examples of TPMA tasks
ghobro edited this page Jul 29, 2026
·
9 revisions
With actual code or pseudo-code to demo some things you can do with the data.
We can load the rates data two ways
The data which feeds the inputs app is available as a parquet stored on Data Bricks.
We load it using the below
# Load the provider rates data
provider_tpma = spark.read.parquet("/Volumes/udal_lake_mart/newhospitalprogramme/files/inputs_data/dev/provider/rates.parquet")
# view the data
display(provider_tpma)
# there is one row per provider, fyear and strategy / tpma
# if we want to focus on consultant_to_consultant_reduction_adult_surgical in 202425
consultant_to_consultant_reduction_adult_surgical_data_2425 = provider_tpma.filter(
F.col("strategy") == "consultant_to_consultant_reduction_adult_surgical"
).filter(
F.col("fyear") == 202425
)
# the resultant table is just for this tpma in 202425 and the `crude` and `std_rate` columns give the rate, with one row per provider
display(consultant_to_consultant_reduction_adult_surgical_data_2425)
The below code will do the equivalent in R studio without needing to log into UDAL Data Bricks. You need {azkit} to be installed and require the environment variables AZ_STORAGE_EP loaded to run azkit::read_azure_parquet
container <- azkit::get_container("inputs-data")
provider_rates <- azkit::read_azure_parquet(
container,
"v5.2/provider/rates.parquet"
)
consultant_to_consultant_reduction_adult_surgical_2425 <- provider_rates |>
dplyr::filter(
fyear==202425,
strategy=="consultant_to_consultant_reduction_adult_surgical")