tx_appointment: Subset Rows of Clients who have Clinic Appointment/Medication...

View source: R/tx_appointment.R

tx_appointmentR Documentation

Subset Rows of Clients who have Clinic Appointment/Medication Pick-up within a Particular Period

Description

tx_appointment generates the line-list of clients who have clinic appointment/medication refill for the specified state(s) and/or facilit(ies). The default is to generate the appointment list for all the states/facilities.

Usage

tx_appointment(
  data,
  from = NULL,
  to = NULL,
  states = NULL,
  facilities = NULL,
  active = FALSE,
  remove_duplicates = FALSE
)

Arguments

data

An NDR dataframe imported using the read_ndr().

from

The start date in ISO8601 format (i.e. "yyyy-mm-dd"). The default is to start at the beginning of the current Fiscal Year (i.e. 1st of October).

to

The end date written in ISO8601 format (i.e. "yyyy-mm-dd"). The default is the date of analysis.

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").

active

TRUE or FALSE. To determine whether the appointment should be for only active patients or irrespective of their status.

remove_duplicates

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

Value

tx_appointment

Examples

# Determine clients who have medication refill in Q2 of FY21
tx_appointment(ndr_example,
  from = "2021-06-01",
  to = "2021-09-30"
)

# Determine clients who have medication refill in July 2021
tx_appointment(ndr_example,
  from = "2021-07-01",
  to = "2021-07-31",
)

# Determine clients with medication refill in "Okun" state for a particular facility
tx_appointment(ndr_example,
  from = "2021-01-01",
  states = "Okun",
  facilities = "Facility1"
)

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