Business · Product · Technology · AI

Formatting clinical text without reinterpreting its numbers or turning it into HTML

A Movo-X presentation-layer case covering inline lists, decimal and range preservation, literal markup and the boundary between readability and clinical review.

Work directly with Omer Muneer Qazi · Reviewed 29 November 2026

The scenario: a readable plan arrives as one long line

A clinical application can receive text whose numbered steps are compressed onto one line. Presenting it as a wall of text makes review harder, but an aggressive formatter can create a different problem by mistaking a decimal, unit or range for a list marker. Improving presentation must not become an unreviewed interpretation of the content.

The inspected Movo-X formatter separates selected list patterns into blocks and keeps presentation in a text-rendering component. Three isolated synthetic-text tests were rerun and passed. This chapter describes those formatting properties and source choices, not the clinical correctness of any generated or authored plan.

Keep the formatter’s job narrow

The reviewed helper normalizes line endings and identifies selected formatting patterns. It returns text or typed presentation blocks; it does not call a medical provider, save a record or decide which instruction is appropriate. That narrow responsibility gives the team a manageable boundary to test.

A formatting component should not need to infer the meaning of a medicine, observation or follow-up instruction to improve spacing. If a proposed transformation depends on medical interpretation, it belongs in a different reviewed workflow. The presentation layer can make source wording easier to inspect while keeping the clinical decision with the responsible author or reviewer.

Require evidence of a sequence before splitting inline numbering

The inspected implementation looks for a genuine numbered sequence beginning with the expected starting markers rather than treating every isolated numeral and punctuation mark as a new step. The rerun test checks that a source line containing numbered actions becomes separate ordered blocks with the intended numbering and wording.

That is more precise than applying a broad split to every period. A useful fixture should include both the pattern expected to change and a nearby pattern expected to remain intact. Otherwise a test can prove a pleasant example while missing the ordinary numeric content that the same transformation would damage.

Test decimals, units and ranges as preservation cases

The rerun numeric-content test checks a synthetic string containing decimals, units, a ratio and a range, and verifies the expected unchanged formatting result. It also checks a numbered example in which decimal content remains part of the step. The values are test text, not medical instructions or a treatment recommendation.

This is a regression property for the selected parser. It does not establish preservation for every possible language, notation or document style. If the supported product expands to other numbering systems or formats, add fixtures for those actual requirements instead of assuming that a few English-style cases prove universal text handling.

Preserve structure without treating provider text as HTML

The helper classifies paragraphs, ordered blocks and bullets. The inspected React component renders those blocks through ordinary text children in list and paragraph elements rather than turning provider output into raw HTML. The tests keep markup-like input as literal text data.

Those are related pieces of evidence: parser behaviour was executed in isolation, and the rendering component was reviewed in source. No full browser security assessment was run for this chapter. The design keeps presentation markup under application control while leaving the supplied wording as text; that should remain part of review whenever the component is changed.

Readable output is not a clinically accepted result

A well-spaced paragraph can still contain an incorrect, incomplete or inappropriate statement. The formatter does not validate those meanings, and a successful parser test should not be used as evidence that the text is ready for patient use. Presentation and substantive review are separate stages.

The interface should preserve the provenance and acceptance state supplied by the surrounding workflow. A draft should remain a draft even after it is rendered attractively. If a clinician or other authorized reviewer is required to accept the content, the rendering component should not silently replace that decision with a visual impression of completeness.

Adapt already selected patient-note fields

The selected patient-note adapter maps diagnosis, notes and instructions into assessment, plan and advice sections. Two existing and two supplemental local cases check that derived sections use only selected nonblank string fields, while the original raw fields and input object remain unchanged. The derived values trim outer whitespace; this is not a claim that the added representation preserves every leading or trailing character. An existing structured section can be replaced by the representation derived from those raw fields.

The route source calls its visit adapter before constructing this added representation. Those database/disclosure decisions were not executed by the four note-helper cases. Empty or withheld raw note fields do not become inferred clinical advice. This makes the compatibility responsibility explicit: an older client can retain the raw fields while a newer presentation can consume the selected named sections.

Place disclosure before layout adaptation

A supplemental fixture deliberately adds an invented private-field marker beside an otherwise selected plan. The note adapter leaves that unrelated field on its returned object because it copies the supplied visit properties; it does not become a privacy allow-list simply by adding structured sections. The marker is not copied into the derived plan itself. This fixture does not show that a real database response includes such a field.

The adapter therefore depends on an eligible upstream projection. Authorization, source-field disclosure, layout adaptation and rendering are different gates. A fuller acceptance package should exercise the authoritative visit projection and actual client views separately, rather than treating these string-shaping tests as evidence that every private field is removed or every medical statement is correct.

Build a focused presentation regression set

Start with inline ordered steps, existing line breaks, bullets, paragraphs and numeric-preservation cases. Include markup-like text and the supported locale conventions. Record which examples should change layout and which should remain equivalent in wording. The expected result should be clear enough for another engineer to inspect without interpreting the clinical content.

A later component test can verify the rendered structure and accessibility semantics using suitable synthetic text. The three rerun helper tests are useful, but they do not exercise every browser, screen reader or clinical workflow. Keep those next checks tied to the actual release scope rather than implied by a generic “formatting passed” statement.

A practical delivery milestone

Deliver the transformation boundary, block model, text-rendering contract and a compact preservation-focused fixture set. Keep source wording and any stored record unchanged by the presentation component’s own operations. Document unsupported patterns and the separate review needed for the content itself.

For a CTO or product lead, this makes readability work concrete. The application can improve how information is reviewed while retaining a clear boundary around meaning and authority. The engineering result is a tested presentation rule with known scope, not a claim that a formatter makes clinical information correct.

Compare the reviewed boundaries

Separate responsibilities in clinical-text delivery

On smaller screens, scroll across to compare every column. Keyboard users can focus the table and use the arrow keys.

LayerSelected evidenceSeparate gate
Raw note fieldsOriginal strings preserved by note adapter casesAuthoritative disclosure and signed state
Derived sectionsSelected field mapping and outer trimmingClient compatibility and wording review
Privacy projectionAdapter shown not to be an allow-listExecuted server field selection
RenderingPreviously reviewed formatting/component sourceActual view and clinical acceptance

Illustrative control flow

Pseudocode summarizing the decision boundary. It is not copied production code or a deployment instruction.

blocks = parse_supported_presentation_patterns(source_text)
for block in blocks:
    render_application_owned_list_or_paragraph(block.kind)
    render_as_text(block.wording)

assert selected_numeric_content_is_preserved()
# Formatting does not accept or validate the clinical meaning.

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 ↗
WhatsApp Omer about this project ↗