Repository navigation
i18n(labs): read a fullwidth reference range - #1655
Merged
MBombeck merged 6 commits intoNov 28, 2026
Merged
Conversation
A report printed in Chinese or Japanese sets its digits, decimal dot, range dash and unit in the fullwidth block, which matched no number at all: the window was stored and the reading was then judged against no band. The fold is opt-in at the range parser rather than inside foldForMatch, so label matching keeps the tolerances it has today. The qualitative and date readers are the same call site and a follow-up, kept out to keep this small.
A Japanese report prints a range with 〜 (U+301C), which sits outside the fullwidth block the fold maps onto ASCII.
Add the 54 keys the medication detail page, the efficacy result and the tile comparison line introduced while the locale was in review, and drop 32 keys that those changes retired from every other locale. Name the two tile comparison concepts in the glossary for zh-CN.
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.
What this does
Reads a printed reference range whose digits are fullwidth:
3.5~5.0and<5.0now parse as3.5..5and as a ceiling of5, instead of as text.A lab sheet printed in Chinese (or exported from a Chinese HIS) writes the
range with fullwidth digits, a fullwidth full stop and a fullwidth wave dash.
The reader only folded the decimal comma and the ASCII tilde, so the most
common Chinese layout returned no range at all.
How
foldForMatchgains a fullwidth-ASCII fold (U+FF01–U+FF5E → U+0020–U+007E,U+3000 → space) before the existing normalisation, so every consumer of the
folded form gets it, not just the range parser.
~(U+FF5E) and〜(U+301C) both map to
~, and.maps to..Evidence
Real Node 24 run of the parser over the shapes a Chinese lab sheet prints:
3.5~5.03.5..5<5.053.5~5.0 mmol/L3.5..5, unit keptpass=33 fail=0over the existing range-parser fixtures, which is theregression guard for the shapes that already worked (ASCII, German, en dash).
Not covered, on purpose:
≦5.0and5.0以下still do not parse.The first is a mathematical symbol the sheet rarely uses, the second is a
phrase the prose table (
RANGE_PROSE) would need a Chinese entry for. Bothare follow-ups, not regressions.
Checks
tsc --noEmit: cleanpass=33 fail=0