Input sanity
An 80-cell cartesian gate matrix and single-field bounds catch out-of-range or absent values at the door. Nothing impossible reaches the clinical logic — a refused input returns a clear rejection, not a fabricated answer.
At the heart of ObGynAssist™ sits its flagship FetalGrowth engine: biometry, Doppler and maternal data become a sourced classification through one fixed pipeline — no sampling, no hidden state. The same input yields a byte-identical plan, every line traces back to the rule and guideline that produced it, and all ten modules share this foundation: deterministic, sourced, on-device.
A case enters as a GrowthInput and leaves as a GrowthOutput — never by a different route. Each step has one job, runs in order, and stamps what it did. Nothing is sampled; nothing is guessed.
Single-field bounds. Gestational age, EFW, Doppler PI, short-term variation and AFI are checked against physical limits before anything downstream runs — so impossible or missing values are rejected, not silently carried forward.
Cross-field checks for combinations that can't physically coexist. Hard violations stop the case; soft ones are noted and surfaced afterward. An appropriate-for-GA fetus with abnormal Doppler is not a contradiction — it's the late-onset phenotype the engine is built to catch.
The data layer. Centiles are computed, the 80-cell gate decides the pathway, and every clinical axis — flow, MCA, ductus venosus, CTG, AFI, maternal factors and multi-visit trajectory — is classified into a single state vector.
The gate picks the rule subset to evaluate. Monochorionic pairs see every table; singletons and DCDA twins are routed to the FGR, AGA or LGA table by size category — so only relevant rules are ever considered.
Staging takes the highest-priority match (alphabetical tiebreak guards against table drift); surveillance unions modalities and takes the minimum interval; birth timing takes the most urgent signal. The result records exactly which rule IDs fired.
A bank of consistency modifiers plus the maternal, trajectory and Doppler-cascade chains adapt the raw verdict — periviable ordering, term overrides, severe-preeclampsia crossing and more. Each modifier carries a fixed ID and is appended to the audit trail.
Soft-plausibility notes are appended, then the output is stamped with engineVersion, rulesetSHA and firedRules[] and handed to the formatter — which renders a classification label, an acuity tier, surveillance timing and the citations behind each line.
The pipeline order is fixed in code and documented step by step in the architecture reference. Because the route never branches at random, any output can be replayed from its stamp.
A language model fills gaps with confident invention. The engine does the opposite: when the input is nonsensical, physically impossible or simply insufficient, it declines to classify and says why.
An 80-cell cartesian gate matrix and single-field bounds catch out-of-range or absent values at the door. Nothing impossible reaches the clinical logic — a refused input returns a clear rejection, not a fabricated answer.
Cross-field checks for impossible combinations. Hard violations stop the case outright; soft ones — clinically unusual but physically possible — pass through and are flagged as "also note" advisories alongside the plan.
When staging genuinely requires data that isn't present, the engine asks for it rather than extrapolating. Where a decision is already determinate — at term, for instance — it ships the coherent plan and notes what would refine the staging.
Every refusal is itself a stamped output — carrying the gate ID that fired (INPUT-VALIDATION-REJECTED, GATE-PLAUSIBILITY-REJECTED-<id>) — so a clinician sees a reason, not a blank. Saying "criteria not met for a confident classification — clinician evaluation required" is safer than a plausible-looking number with no basis.
Three fields travel with every result. Together they let anyone reconstruct exactly what the engine decided, and why, long after the fact.
The exact engine configuration that produced the output — currently v1.56.0. Pin it, and a retrospective review knows precisely which logic was in force.
A full-content CryptoKit SHA-256 over every rule's decision fields — not just its ID. Move a delivery window from 34 to 37 weeks and the hash changes, so a moved threshold can never hide.
The ordered list of every rule and modifier that fired. Each ID is defined in exactly one place, so any entry is grep-traceable from the output straight down to the code.
For medico-legal review this is the difference between an opinion and a record: a stamped output can be re-run on the same engine version to reproduce the identical plan, byte for byte, with the full chain of fired rules and their guideline sources visible. No black box, no "it depends on the run."
Before any plan renders, an OutputCoherenceGate verifies structural invariants — the relationships an output must never violate, regardless of which rules fired.
If two parts of an output disagree, the sentinel traps it before a clinician ever sees it — contradictions are caught at the boundary, not in the clinic.
contradictory output → trapped before render
The clinical logic is data, not buried code — five rule tables, each entry wired to a named guideline. The engine reads them; it doesn't improvise around them.
Those tables route through eight pathways and four interchangeable centile standards, reaching the locked phenotype set the synthetic harness exercises.
AGA · SGA · FGR · LGA · DCDA · MCDA · MCMA · Periviable.
WHO (default, CC-BY) · INTERGROWTH-21st · Hadlock 1991 · NICHD.
Locked phenotype set, ~97% reachable in the synthetic harness.
Staging · disposition · urgency · deliver-now · scan interval · delivery window.
Privacy here isn't a policy bolted on top — it's a property of the design. The engine is pure Swift; it computes the whole plan locally, so patient data never has to leave the device to get an answer.
A full sourced plan resolves in under 0.4 ms p95, recomputing in real time — about 250 ms — as you type. No round-trip, no waiting on a server.
Determinism and traceability survive offline. With no external service in the loop, there's no remote model to drift and no transcript leaving the phone.
Built on iOS 17+ with SwiftUI, MVVM and SwiftData. Data minimization is structural — the simplest way to protect data is to never transmit it.
ObGynAssist is a clinical companion and reference tool — App Store category Medical Reference — not a regulated medical device. Its concordance figures are measured on synthetic cases against standard-of-care guideline references, not neonatal outcomes; a prospective clinical-validation study is in design.
So we measured it. See how the engine holds up under grading, mutation, stress and parity — or look at the ten modules the pipeline powers.