pdfOQ: Operational Qualification (OQ) report to a pdf file

View source: R/pdfOQ.R

pdfOQR Documentation

Operational Qualification (OQ) report to a pdf file

Description

Generate a self-contained PDF report that documents whether the NonCompart noncompartmental analysis engine (as used through ncar) reproduces pre-specified reference results on the user's own machine, within a pre-specified relative tolerance. It is intended as Operational Qualification (OQ) evidence, in the spirit of the WinNonlin computational-engine verification. The report uses only base R, NonCompart, and the package's own pdf helpers, so it requires no LaTeX, pandoc, or other external tools.

Usage

pdfOQ(fileName = "ncar-OQ-Report.pdf", cases = NULL, tol = 0.001,
      refDir = system.file("OQ", package = "ncar"), performedBy = "",
      paper = "auto", sigField = FALSE)

Arguments

fileName

file name to save the PDF report

cases

a list of OQ case definitions. If NULL, the built-in set of eight WinNonlin-referenced scenarios is used (Theophylline and Indometacin, extravascular / IV bolus / IV infusion, each with linear-up-linear-down and linear-up-log-down AUC). Each case is a list with elements id, desc, dataset, key, colTime, colConc, args (a list of further tblNCA arguments), and ref (the reference csv file name in refDir).

tol

acceptance tolerance: a parameter passes when the symmetric relative difference abs(R - W) / ((abs(R) + abs(W))/2) between the computed value R and the reference value W is at most tol. An absolute fallback is used when both values are essentially zero.

refDir

directory holding the reference csv files. Defaults to the OQ folder installed with ncar.

performedBy

name of the person performing the qualification, printed in the report header. Defaults to the login name.

paper

paper size: "letter", "a4", or "auto" (the default), which selects "letter" in a United States locale and "a4" elsewhere. The report uses 1 inch margins on every side and places the signature (approval) page first.

sigField

if TRUE, add Adobe Acrobat Reader signature fields to the finished report (via addSigField) so it can be signed with one click in Acrobat Reader.

Details

For each case the function runs tblNCA on the (frozen) input data, maps the CDISC PPTESTCD result columns to WinNonlin parameter names using the internal RptCfg table, matches comparable parameters to the reference table (robust to % vs . naming), and compares every parameter for every subject. A case passes only when all of its comparisons pass.

The bundled reference values are WinNonlin 6.4 NCA outputs. These establish concordance with the de-facto reference implementation (Tier B); they are not, by themselves, an independent verification. Independent (Tier A) anchors (hand-calculated edge cases, published textbook values) are a planned addition.

Value

Invisibly returns a list with elements fileName, qualified (logical), tol, nCases, nFailCases, and results (a per-case list with status, comparison counts, maximum relative difference, and any failed comparisons). A PDF file is written to fileName.

Author(s)

Kyun-Seop Bae <k@acr.kr>

See Also

pdfIQ, pdfNCA, tblNCA

Examples

#pdfOQ()
#res <- pdfOQ(fileName = "MyEngine-OQ.pdf", performedBy = "Jane Doe")
#res$qualified
#res$results[[1]]$maxRD

ncar documentation built on July 20, 2026, 5:07 p.m.