← Back to all sparks
T

traumar

INFRA · APIS
Velocity0.0

Calculate Metrics for Trauma System Performance

Trauma registry statistics in R, tightening the numbers it reports against the literature.

trauma-registryhealthcare-qualitystatistical-correctnessdata-validationr-package
Current state
traumar computes trauma-centre performance measures from registry data, including relative mortality metrics, SEQIC quality indicators and predicted survival probability. The recent releases are dominated by correctness rather than coverage: 1.2.5 changed how the denominator for SEQIC indicator 7 is derived so it reflects the definitive care population rather than a raw row count, and 1.2.3 realigned probability_of_survival() with published coefficients. Version 1.2.6 completes a deprecation, turning the old n_decimal argument into an error.
Where it's heading
This is a package whose outputs are reported numbers, and it is behaving accordingly: the notable changes in this window alter results rather than add features. A denominator computed as a row count instead of a filtered population, and a survival calculation not matching the coefficients it cites, are both the kind of defect that quietly propagates into published figures, and both were corrected here. Around that sit in-house validation helpers written deliberately to avoid a new dependency, and a steady tidy-up of tests and tooling.
Prediction
Expect the validation family introduced in 1.2.4 to be applied more widely across the package's entry points, now that it exists and is deliberately kept internal. Further SEQIC indicators being reviewed against their definitions looks likely given indicator 7 needed it, though the entries name no specific one as next.

Recent moves

  1. 3mo ago

    n_decimal deprecation completed; percentages allow negatives

    Finishes the deprecation begun in 1.2.4 by turning n_decimal into an error rather than a warning, and lifts the bounds on pretty_percent() so it accepts negative values and figures outside the zero-to-one range. The validation helpers are also marked internal, confirming they are package machinery rather than part of the public surface.

    View source ↗
  2. 3mo ago

    SEQIC indicator 7 denominator corrected to definitive care

    The denominator for SEQIC indicator 7 was being computed as a plain row count rather than restricted to patients not transferred out, so the indicator was measured against the wrong population. A one-line change that alters every value this indicator has produced, which makes it the most consequential entry in this window despite its size.

    View source ↗
  3. 6mo ago

    In-house validation family added to avoid a dependency

    Introduces an unexported validate_ family covering the package's data checks, written in-house after evaluating existing options, on the explicit reasoning that another dependency was the higher cost. Also begins the n_decimal deprecation that 1.2.6 completes.

    View source ↗
  4. 7mo ago

    Survival probability realigned with published coefficients

    Rewrites probability_of_survival() to follow the coefficients published in the cited literature, keeping the established treatment of patients under 15 and of penetrating injuries consistent with the original method. Presented as a readability change, but it standardises the calculation that most downstream measures depend on.

    View source ↗
  5. 7mo ago

    Binning and survival documentation clarified

    Documentation-only work explaining the binning algorithm behind nonlinear_bins() and its threshold and divisor arguments, and correcting the survival function's return description to state that it is a probability between zero and one rather than a percentage. Useful correction of a misleading description, but no behaviour changes.

    View source ↗
  6. 1y ago

    Internal renaming and a faster CRAN test path

    Renames an internal variable to match the terminology of the source literature, tidies comments, and reworks a test that was at risk of exceeding CRAN's time limit by dropping the bootstrap step. Housekeeping with no effect on results.

    View source ↗