Repository navigation
Read multi-page PDF reports and dates without a time - #16
Merged
Merged
Conversation
A template field can be limited to page 1 (`first_page_only`), so a footer that repeats a label with a different value on later pages no longer makes the report invalid. The newborn screening preset reads `dob` on page 1 only, accepts `dob` and `collected` with or without a time, and writes PID-7, OBR-7 and SPM-17 to the minute or as a date. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
New synthetic newborn screening reports from the laboratory were all refused with the shipped template:
DOB:prints the date without the time. Thedobfield read the grid value on page 1 and the footer value on page 2, so the pages disagreed (template_mismatch).M/d/yyyyonly, which theM/d/yyyy HH:mmformat refused (field_invalid). The HL7 mapping'sdatetimerules take one input format, so they would also have failed on such values.What changes
first_page_only(defaultfalse): the field is read on page 1 only and its label on later pages is ignored (packie-pdf,packie-config, engine reader, generated TypeScript type). Specified in pdf-reports.md §4.2 and configuration.md §7.7.pdf_newborn_screening_report:dobhasfirst_page_only: true.dobandcollectedaretype: datewith formatsM/d/yyyy HH:mmandM/d/yyyy(datetimerefuses a format without hours).pdf_newborn_screening_to_hl7_oru: PID-7, OBR-7 and SPM-17 are awhenonmatches ":":yyyyMMddHHmmwhen the value has a time, otherwiseyyyyMMdd.Tests and checks
first_page_onlyand reads every field with it.cargo testforpackie-pdf,packie-config,packie-engine,packie-transform,packie-routing: pass.cargo clippy --all-targets -- -D warningsforpackie-pdf,packie-config,packie-engine: clean.tsc --noEmitand the preset tests pass;npm run changelog:checkpasses.hl7_file; the embedded PDFs match the originals byte for byte.Changelog
changelog.d/2026-11-25-pdf-report-pages-and-dates.md;
CHANGELOG.mdregenerated.Dependencies
None.
Remaining limits
🤖 Generated with Claude Code