% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cvd_risk.R
\name{cvd_risk_qrisk3}
\alias{cvd_risk_qrisk3}
\title{QRISK3 10-year risk (UK QRISK3-2017)}
\usage{
cvd_risk_qrisk3(data, ..., patid = NULL, na_warn_prop = 0.2, verbose = TRUE)
}
\arguments{
\item{data}{A data frame with variables required by \code{QRISK3::QRISK3_2017()}.}

\item{...}{Passed to \code{QRISK3::QRISK3_2017()}.}

\item{patid}{Optional vector of patient IDs (default: \code{1:nrow(data)}).}

\item{na_warn_prop}{Proportion (0-1) to flag high missingness warnings (default 0.2).
Only used when \code{verbose = TRUE}.}

\item{verbose}{Logical; if TRUE, prints progress and a short summary.}
}
\value{
A tibble with columns \code{model}, \code{year}, \code{risk}.
}
\description{
Wrapper around \code{QRISK3::QRISK3_2017()} that auto-generates a \code{patid}
if one is not supplied. Adds input validation and quiet failure to NA on backend error.
}
\examples{
\donttest{
  if (requireNamespace("QRISK3", quietly = TRUE)) {
    df <- data.frame(
      gender = 1L, age = 55L,
      atrial_fibrillation = 0L, atypical_antipsy = 0L,
      regular_steroid_tablets = 0L, erectile_disfunction = 0L,
      migraine = 0L, rheumatoid_arthritis = 0L,
      chronic_kidney_disease = 0L, severe_mental_illness = 0L,
      systemic_lupus_erythematosis = 0L, blood_pressure_treatment = 0L,
      diabetes1 = 0L, diabetes2 = 0L,
      weight = 80, height = 175,
      ethnicity = 1L, heart_attack_relative = 0L,
      cholesterol_HDL_ratio = 4.2, systolic_blood_pressure = 130,
      std_systolic_blood_pressure = 7, smoke = 0L, townsend = 0
    )
    cvd_risk_qrisk3(df)
  }
}

}
\references{
\insertRef{hippisleycox2017qrisk3}{HealthMarkers}
}
