submission_manifest.RdReads back every file actually present in path and reports what shipped:
file name, size in bytes, an MD5 checksum, and (for .xpt files) the
record and variable counts read straight out of the transport file itself
— not the counts write_submission() thinks it wrote. This is the
artefact that proves what shipped; run it independently of
write_submission() to audit a folder someone else assembled.
submission_manifest(path)A submission_manifest tibble with columns file, size_bytes,
checksum, records, variables.
Limits: the listing is one level deep (files directly in path,
not sub-folders), the checksum is MD5 — an integrity check, not a
tamper-proof signature, and not reproducible across runs, because a v5
transport file stamps its own creation date and time into the header — and records/variables are NA for anything
that is not a readable .xpt, including the Define-XML. Nothing here
checks the content of the files against the spec; that is
check_submission()'s job.
datasets <- data.frame(dataset = "DM", label = "Demographics", class = "SDTM")
variables <- data.frame(
dataset = "DM", variable = "USUBJID", label = "Unique Subject Identifier",
type = "character", length = 20, format = NA_character_, order = 1
)
spec <- submission_spec(datasets, variables)
out <- file.path(tempdir(), "submitpack-manifest-demo")
write_submission(list(DM = data.frame(USUBJID = c("A", "B"))), spec, path = out)
#>
#> ── All variables in dataset are found in `metadata` ──
#>
#> ── All variables in dataset are ordered ──
#>
#> ✔ Wrote DM (2 record(s), 1 variable(s))
#> ✔ Submission written to /tmp/RtmpZEJqch/submitpack-manifest-demo (1 file(s))
submission_manifest(out)
#>
#> ── submitpack manifest ─────────────────────────────────────────────────────────
#> ℹ 1 file(s) in /tmp/RtmpZEJqch/submitpack-manifest-demo | 960 bytes total
#> # A tibble: 1 × 5
#> file size_bytes checksum records variables
#> <chr> <dbl> <chr> <int> <int>
#> 1 dm.xpt 960 49e059e08b2a6b43fed36162824c4d1b 2 1