% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/scores_ph_meds.R
\name{compute_ph_meds_estuse_flags_all}
\alias{compute_ph_meds_estuse_flags_all}
\alias{compute_ph_p_meds_estuse_flags_all}
\alias{compute_ph_y_meds_estuse_flags_all}
\title{Compute all medication estimated use flags [Parent] [Youth]}
\usage{
compute_ph_meds_estuse_flags_all(
  data,
  rx_config_estuse_flags = ABCDscores::rx_config_estuse_flags,
  rx_config = ABCDscores::rx_config,
  combine = TRUE
)

compute_ph_p_meds_estuse_flags_all(
  data,
  rx_config_estuse_flags = ABCDscores::rx_config_estuse_flags,
  rx_config = ABCDscores::rx_config,
  combine = TRUE
)

compute_ph_y_meds_estuse_flags_all(
  data,
  rx_config_estuse_flags = ABCDscores::rx_config_estuse_flags,
  rx_config = ABCDscores::rx_config,
  combine = TRUE
)
}
\arguments{
\item{data}{tbl, Dataframe containing the columns to be summarized.}

\item{rx_config_estuse_flags}{tbl, Configuration tibble specifying the
estimated use flag mappings to compute. Default is
\code{ABCDscores::rx_config_estuse_flags}.}

\item{rx_config}{tbl, Configuration tibble specifying the medication
category mappings to compute. Default is \code{ABCDscores::rx_config}.}

\item{combine}{logical, If \code{TRUE}, the computed summary scores are
appended to the original data frame. If \code{FALSE}, only the summary scores
are returned. Default is \code{TRUE}.}
}
\value{
tbl. see \code{combine} parameter.
}
\description{
This function computes all medication estimated use flag summary scores
based on the provided configuration in \code{rx_config_estuse_flags} and the
computed medication categories from \code{rx_config}.

It first calls \code{compute_ph_meds_catg_all()} to obtain the medication category
mappings of all \code{estuse} categories. Then, for each row in
\code{rx_config_estuse_flags}, it checks if any of the corresponding medication
category mapping scores (from both OTC and RX medications) match the
specified \code{idx} category index. If a match is found, it assigns a value of
"1" to indicate estimated use; otherwise, it assigns "0". The resulting
estimated use flags are stored in new columns named as specified in the
\code{name} column of \code{rx_config_estuse_flags}.
\itemize{
\item \emph{Summarized variables:} see \code{rx_config} for the list of variables.
}
}
\details{
\subsection{Disclaimer}{

"This product uses publicly available data from the U.S. National Library
of Medicine (NLM), National Institutes of Health, Department of Health and
Human Services; NLM is not responsible for the product and does not endorse
or recommend this or any other product."
}

\subsection{Functions for specific tables}{
\itemize{
\item \code{compute_ph_meds_estuse_flags_all()}: Computes all medication estimated
use flags across all tables.
\item \code{compute_ph_p_meds_estuse_flags_all()}: Computes all medication estimated
use flags for the \code{ph_p_meds} table.
\item \code{compute_ph_y_meds_estuse_flags_all()}: Computes all medication estimated
use flags for the \code{ph_y_meds} table.
}
}
}
\references{
The medical estimated use values and categories are generated
from: Lopez, D. A., Overholtzer, L. N., Rhee, K. E., Buchbinder, N.,
Ruiz-Orozco, G. E., Steinhilber, S., Tognoli, M., Lopez-Flores, A., &
Nagel, B. J. (2025). Classifying and visualizing medication use in the
Adolescent Brain Cognitive Development (ABCD) Study. \emph{medRxiv}.
}
\seealso{
\code{\link[=compute_ph_meds_catg_all]{compute_ph_meds_catg_all()}}, \link{rx_map}
}
