Skip to contents

Reads columns clean_human_spec() already produced to flag duplicate specimens, blank collection dates, unreconciled GUIDs and inadequate specimens. See checks_afp() for the return shape.

Usage

checks_hum_spec(hum_spec, reference_date = Sys.Date())

Arguments

hum_spec

A cleaned human-specimen tibble (from clean_human_spec()).

reference_date

Date treated as "today" for future-date checks (default Sys.Date()).

Value

A named list (summary + one tibble per flagged check); see checks_afp().

Examples

hs <- data.frame(id = 1, specimen_id = c("S1"), collection_date = NA)
checks_hum_spec(hs)$summary
#> # A tibble: 2 × 5
#>   check                       domain  severity n_flagged description            
#>   <chr>                       <chr>   <chr>        <int> <chr>                  
#> 1 hum_spec_no_collection_date HumSpec warning          1 Specimens with no coll…
#> 2 hum_spec_duplicates         HumSpec warning          0 Duplicate specimen rec…