| name | snf-inventory |
| description | File-level first pass over a folder of nursing-facility PDFs ONLY — page counts, PDF metadata, inferred section boundaries, in-stay vs. out-of-window content dates, and per-file OCR/readability flags. This is narrow triage, not a review — for the complete review use snf-review, and for page-level document-type coverage use snf-document-map. Use when the user says "just tell me what is in this folder", "inventory the records", "how many pages did the facility send", "what is in this HIPAA drop", or "/snf-inventory" — or wants a file-level summary before committing to a full review. |
SNF Inventory
Run the inventory script that lives in the snf-records-review skill on a user-specified directory of PDFs, then summarize the corpus for the user in plain language.
Inputs to collect from the user (via AskUserQuestion if not provided)
- PDF directory — absolute path to a folder of PDFs from a SNF records production. OCR'd PDFs are preferred, but mixed scanned PDFs are expected and must be flagged rather than silently skipped.
- Stay window —
--stay-start and --stay-end dates (YYYY-MM-DD). These define "in-stay" vs. "out-of-window" content dates. If the user doesn't know, use the admission date and today as sensible defaults and flag the assumption.
- Output directory — where to write the inventory JSON sidecars. Default:
<pdf-dir>/../inventory if not specified.
Execution
The inventory script is located at ${CLAUDE_PLUGIN_ROOT}/skills/snf-records-review/scripts/inventory.py. Before invoking it, verify pypdf is installed in the active Python environment. Prefer a virtual environment and python -m pip install -r requirements.txt; avoid system-wide installs on externally managed Python distributions.
Invoke via Bash:
python3 ${CLAUDE_PLUGIN_ROOT}/skills/snf-records-review/scripts/inventory.py \
--in-dir "<pdf-dir>" \
--out-dir "<out-dir>" \
--stay-start <YYYY-MM-DD> \
--stay-end <YYYY-MM-DD>
Output summary for the user
After the script completes, read the combined inventory.json and inventory_summary.json, then produce a concise report:
- Total PDFs, total pages.
- Per-PDF table: filename, pages, earliest in-stay content date, latest in-stay content date, out-of-window date count.
- Red flags to call out explicitly:
- PDFs whose content-date range falls entirely outside the stay window (likely mislabeled or duplicate productions).
- PDFs with no in-stay content dates at all (may be exports, not clinical content).
- PDFs marked
status: error (encrypted, corrupted, or unreadable) — these need human remediation before review.
- PDFs marked
likely_image_only in ocr_quality — these likely need OCR before reliable review.
- PDFs whose page count is suspiciously small (<5 pages) or suspiciously large (>500 pages — candidate for
/snf-review-style splitting).
- Top inferred section labels per PDF — useful for picking parallel reviewer packets.
- Recommended next step: either run
/snf-review for a full parallel-reviewer workflow on the corpus, run split_by_sections.py --dry-run on the largest consolidated charts first, or update case-context/document_index.md via case-context-ledger.
Mandatory next triage for disorganized charts
If any PDF is over 200 pages, any PDF is marked likely_image_only, or the user asks what document types were actually received, run /snf-document-map next. The document-map pass adds the missing layer that inventory alone cannot provide:
- Page-level document-type classification for mixed chart PDFs.
- Original source page locations for every segment and planned review packet.
- Expected-document coverage (
present, possible, not_found, indeterminate_ocr).
- OCR remediation actions and narrow HIPAA follow-up items.
Do not represent an expected record as missing based only on inventory output. Inventory can flag weak OCR and broad section hints; the document map decides whether the corpus is review-ready or whether absence is OCR-indeterminate.
Scope constraints
- This is records inventory and triage support, not medical advice or legal advice.
- Do not extract PHI into the chat response; keep patient identifiers in the inventory JSON files only.
- If the directory contains non-PDF files, note them separately but do not try to process them.
- If a PDF fails to parse (encrypted, corrupted, image-only with no OCR), list it under an "unprocessable" section and suggest
/snf-document-map plus OCR/remediation before /snf-review relies on absence findings.