tx_curr: Subset Clients who are Currently on Treatment

View source: R/tx_curr.R

tx_currR Documentation

Subset Clients who are Currently on Treatment

Description

tx_curr pulls up the line-list of clients who are active on treatment using the calculated current_status column. You can specify the state(s) and/or facilit(ies) of interest using the region or site arguments.

Usage

tx_curr(
  data,
  states = NULL,
  facilities = NULL,
  status = "default",
  remove_duplicates = FALSE
)

Arguments

data

An NDR dataframe imported using the read_ndr().

states

The name(s) of the State(s) of interest. The default utilizes all the states in the dataframe. If specifying more than one state, combine the states using the c() e.g. c("State 1", "State 2").

facilities

The name(s) of the facilit(ies) of interest. Default is to utilize all the facilities contained in the dataframe. If specifying more than one facility, combine the facilities using the c() e.g. c("Facility 1", "Facility 2").

status

Determines how the number of active clients is calculated. The options are to either to use the NDR current_status_28_days column or the derived current_status column ("calculated").

remove_duplicates

Boolean argument. It specifies if duplicate patient entries in the facilities should be removed or kept

Value

TX_CURR

Examples

# Calculated active clients using the derived current status
tx_curr(ndr_example)

# Calculate the active clients using the NDR `current_status_28_days` column
tx_curr(ndr_example, status = "default")

# generate the TX_CURR for two states (e.g. "Arewa" and "Okun" in the ndr_example file)
tx_curr(ndr_example,
  states = c("Okun", "Arewa")
)

# determine the active clients in two facilities ("Facility1", and "Facility2) in "Abaji"
tx_curr(ndr_example,
  states = "Abaji",
  facilities = c("Facility1", "Facility2")
)

tidyndr documentation built on April 8, 2022, 9:06 a.m.