Skip to contents

Checks that a patient_card satisfies the domain invariants: the controlled vocabularies for sex, injury_region, triage and therapy, and life_points inside 1:6.

Usage

validate_patient_card(x, call = rlang::caller_env())

Arguments

x

A patient_card object.

call

The calling environment, used to attribute the error.

Value

The validated x, invisibly on success; otherwise an error of class sandtablR_error_card.

See also

validate_cohort(), which applies the same rules to a whole cohort in one vectorised pass.

Examples

card <- sdt_patient_card(
  "P01", 34, "m", 4L, TRUE, "thorax", "red", "DCS", 1L
)
validate_patient_card(card)