The scenario: store a transcription without changing its meaning
A family health application can help someone keep the text from a spectacle prescription alongside other personal records. That convenience creates an engineering obligation: preserve a plus sign, a minus sign or a notation such as DS instead of converting it into a guessed numeric value. The product must also keep an unknown field unknown and identify who entered the record.
The pinned Movo-X implementation treats these entries as patient-supplied transcriptions. This walkthrough follows its API validator, native record model and selected persistence definition. Nine local cases passed using synthetic values: six TypeScript cases and three portable Swift cases. They establish selected software behaviours, not optical correctness or the authenticity of a prescription.
Represent optical notation as bounded text
The selected route allows named fields for right and left sphere, cylinder, axis and addition, plus pupillary distance, prism, prescriber and notes. Values are strings or selected empty/null forms rather than floating-point calculations. A supplemental case preserves spaces around a signed value, split pupil-distance text and prism notation through validation.
The validator deliberately does not interpret an axis string or turn DS into zero. Another fixture with arbitrary copied notation is accepted as text. That observation is a boundary to explain to product reviewers: syntactically accepted text has not been medically interpreted. Neither successful validation nor a saved record authorizes lens ordering, contact-lens conversion or a diagnosis.
Distinguish missing detail from a valid record
The validator permits omitted or null optional fields, limits ordinary text to 200 characters and notes to 1,000, and requires at least one nonblank detail. The selected boundary cases accept the exact limits and refuse the next character. An entirely blank detail set fails; a numeric field fails where text is expected.
An existing case also refuses an invented verification flag and an unknown field. This keeps the public write shape separate from server-owned metadata. The requirement for one detail can be satisfied by a prescriber or note; it is not proof that every optical measurement is present. A screen should not describe that minimal software requirement as a complete clinical prescription.
Use a calendar date with a separate server decision
The selected API requires a date-shaped value, checks its normalized calendar representation and refuses a date after the server’s current UTC day. Existing fixtures include an impossible calendar date and a far-future date. These are input examples rather than a complete date/time-zone acceptance suite.
The inspected database function separately compares the prescription date with current_date and the person’s stored birth date. Native date pickers constrain selected future dates in their own local contexts. Those layers can have different notions of today near a time-zone boundary. Review them together with controlled clocks before promising that every client and database accepts exactly the same boundary day.
Preserve edit identity and require a write request identifier
The route takes person and optional record identifiers from validated path segments. It dispatches list, add, edit and remove operations to the injected API. An existing case refuses a create without a client request identifier. Supplemental cases check an edit and removal, including their selected operation, identifiers and body shape. Malformed record paths and selected unsupported inputs do not reach the injected database.
The edit fixture preserves an explicitly null optional value and spaces in submitted text. The input object remains unchanged. Native editors have their own trimming before submission, so route preservation does not mean every screen preserves outer whitespace. These distinctions belong in the contract rather than in an assumption that all callers send identical bytes.
Keep retry identity separate from optimistic concurrency
The selected iOS editor keeps a request identifier across a retry and changes it when selected input changes. Android derives a selected save-key slot from the record and serialized body. Both views are source-reviewed here; their lifecycle, retry interaction and storage are not exercised by the portable cases.
The inspected SQL uses an idempotency lookup and recording step for mutations and increments a stored version on edit. Its selected edit branch does not compare a submitted expected version. Idempotency and version preconditions solve different problems: replaying one operation safely does not itself prevent a later independent edit from overwriting another. Define the intended concurrent-edit policy explicitly.
Decode known native text without inventing verification
The existing portable Swift case checks signed values, DS notation, a date and an absent measurement. A supplemental case shows that known strings remain strings, null and numeric measurement values are omitted from its text dictionary, and unknown verification/source keys are not promoted into that dictionary. A separate case refuses a missing or malformed required record UUID.
This decoder is tolerant of selected field-shape differences, but omission must not be advertised as a verified empty clinical value. Its presentation dictionary does not retain every server metadata field. Review the screen’s patient-entered label and any provenance needs independently. These Foundation tests do not establish UIKit/SwiftUI presentation, Android decoding or full platform parity.
Authorize the household module independently of record IDs
The selected persistence function requires a trusted session and invokes the person/module guard for measurements, with a write flag for mutations. It scopes edit and remove operations to the selected person. Selected API denial fixtures preserve an injected reproof-required response and private no-store headers, without exercising actual database permission.
The inspected SQL defines encrypted details using row-specific associated data, a per-person record limit and an owning-account closure cleanup trigger. SQL test source describes isolation, retry, edit and erasure fixtures, but those database cases were not run here. Encryption helpers, installed definitions, key custody, physical retention and the complete caregiver policy require their own acceptance evidence.
A practical release package for a transcription feature
Keep the nine local cases as a focused contract set. Add isolated database acceptance for owner and caregiver access, person-write restrictions, request replay, changed input and account closure. Exercise native save, edit, retry and confirmed removal with synthetic records, large text, keyboard access and localized labels. Include near-midnight clock cases and a documented concurrent-edit decision.
For a founder building a medical SaaS or patient application, the useful deliverable is a trustworthy record workflow with clear provenance. This selected implementation preserves notation at important boundaries and separates user-supplied text from server authority. Clinical authenticity, actual optical interpretation, device experience and current production behaviour remain separate release decisions.
Compare the reviewed boundaries
Separate the transcription responsibilities
On smaller screens, scroll across to compare every column. Keyboard users can focus the table and use the arrow keys.
| Layer | Selected evidence | Independent acceptance |
|---|---|---|
| API text shape | Bounds, signs, unknown-key refusal | Clinical authenticity and completeness |
| Native model | Known strings and required UUID | Real screens and multilingual usability |
| Write dispatch | Path identity and retry-key requirement | Durable replay and concurrent-edit policy |
| Persistence source | Module guard and encrypted-row intent | Installed permissions, keys and retention |
Illustrative control flow
Pseudocode summarizing the decision boundary. It is not copied production code or a deployment instruction.
validate_named_bounded_text_and_calendar_date(body)
require_client_request_id_for_write()
dispatch(person_id_from_path, record_id_from_path, body)
# Authoritative permission, replay and persistence remain server decisions.
# Accepted transcription is not a verified optical prescription.About this engineering series
Written by Omer Muneer Qazi from a review of Movo-X implementation and dated engineering records. This article explains source behaviour and historical observations; current production, clinical outcomes and store availability require their own verification. Examples are synthetic and proposed test cases are identified as such.
Explore the Movo-X engineering series → · Related implementation experience →
Discuss a similar engineering problem
Send the workflow, current platform and the decision your team needs to make. I can help define an implementation or review scope with concrete acceptance evidence.
Discuss your project on WhatsApp ↗