Skip to content

feat(ios): order a hundred analytes by what is furthest from its range, filter them, and derive what a sheet did not print - #238

Merged
ma3u merged 1 commit into
mainfrom
ios/order-filter-derived
Sep 20, 2026
Merged

ma3u merged 1 commit into
mainfrom
ios/order-filter-derived

Conversation

@ma3u

@ma3u ma3u commented Sep 20, 2026

Copy link
Copy Markdown
Owner

A hundred and one analytes in a list is a list nobody reads to the end, and the seven that sit outside a published range are the seven worth seeing.

Order and filter

Three orders, with the choice at the top of the screen: furthest from its published band, most measured, by name. The first is the default.

Four filter chips, one per place, each carrying how many sit there. The counts are of everything rather than of what is showing, so turning a filter on does not change the numbers beside the filters. An empty selection means all of them: a filter that can hide everything is one people get stuck in.

Deliberately not "high risk" and "risk", which is what was asked for. A risk is a statement about a person, and that is the line section 5 of #186 draws. The order is exactly the same; the claim is one the app can show its working for.

Values worked out from other values

Derived at read time and never stored, so they follow the values they came from rather than drifting from them.

Derived From Band
Non-HDL cholesterol total − HDL ESC/EAS 2019, already in the table
Remnant cholesterol total − HDL − LDL none quoted
Triglycerides / HDL both, same unit none quoted
LDL / HDL both, same unit none quoted
ApoB / ApoA1 both, same unit none quoted

Two rules, both tested:

  • Only from one report. A triglyceride from March over an HDL from September is a ratio of nothing.
  • Only within one unit. Triglycerides over HDL is a different number in mg/dL and in mmol/L, by about a factor of two, so what it was computed in travels with it.

A figure the laboratory printed itself is never replaced by a computed one.

Why the ratios carry no code

LOINC's nearest terms are a molar ratio where this is computed in whatever the sheet printed (55607-6), HDL over LDL the other way round (16616-5), and a percentile rather than a ratio (9340-1). A code that is nearly right is wrong.

Their UCUM unit is {ratio}, not 1. A bare 1 as a unit spelling makes every stray number on a page a measurement, and it did: a page footer reading Seite 1 von 2 started arriving as a value, which two existing tests caught.

Gates

Gate Result
swift test 239 tests, 42 suites
Scripts/run-ui-tests.sh 22 tests, 0 failures
AnalyteParity 1105 codings, 66 units
epa-ingest Vitest 160 tests
check-localization.sh 241 strings, every prose string has German

Installed on the phone.

Refs #186.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LFMtTkqc3btcaWNur2A93P

…e, filter them, and work out what a sheet did not print

A hundred and one analytes in a list is a list nobody reads to the end, and
the seven that sit outside a published range are the seven worth seeing.

**Order.** Furthest from its published band first, then most measured, then by
name, with the choice at the top of the screen and the first of the three as
the default.

**Filter.** Four chips, one per place, each carrying how many sit there. The
counts are of everything rather than of what is showing, so turning a filter
on does not change the numbers beside the filters, and an empty selection
means all of them: a filter that can hide everything is one people get stuck
in.

Deliberately not "high risk" and "risk", which is what was asked for. A risk
is a statement about a person and that is the line §5 of #186 draws. The order
is the same; the claim is one the app can show its working for.

**Values worked out from other values**, derived at read time and never
stored, so they follow the values they came from rather than drifting from
them:

- non-HDL cholesterol, total minus HDL, which is the one of these with a
  published band of its own already
- remnant cholesterol, total minus HDL minus LDL
- triglycerides over HDL, LDL over HDL, apolipoprotein B over A1

Two rules. Only from one report, because a triglyceride from March over an HDL
from September is a ratio of nothing. And only within one unit, because
triglycerides over HDL is a different number in mg/dL and in mmol/L by about a
factor of two, so what it was computed in travels with it. A figure the
laboratory printed itself is never replaced by a computed one.

The ratios carry no LOINC code and say why. LOINC's nearest terms are a molar
ratio where this is computed in whatever the sheet printed, HDL over LDL the
other way round, and a percentile rather than a ratio. A code that is nearly
right is wrong.

Their UCUM unit is `{ratio}` rather than `1`. A bare `1` as a unit spelling
makes every stray number on a page a measurement, and it did: a page footer
reading `Seite 1 von 2` started arriving as a value.

Refs #186.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LFMtTkqc3btcaWNur2A93P
@ma3u
ma3u merged commit 55dde5a into main Sep 20, 2026
@ma3u
ma3u deleted the ios/order-filter-derived branch September 20, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant