Business · Product · Technology · AI

Derive patient queue notices from scoped snapshot transitions

A Movo-X native case tracing per-encounter snapshot comparison, call and recall detection, position-one notices, process-local suppression and separate notification acceptance.

Work directly with Omer Muneer Qazi · Reviewed 29 November 2026

The scenario: communicate a queue change that already happened

A patient queue interface receives a new snapshot and decides whether a change deserves attention. That decision should follow encounter identity and state, while the clinic’s authoritative queue remains responsible for the underlying call. The alert is a presentation consequence of observed data, not a new queue command.

Five existing Android JVM cases and one portable Swift case passed against selected Movo-X transition helpers with synthetic lists. They cover the selected call, recall, position and removal behaviours. Repository application and notification integration were inspected separately. This chapter explains the decision boundaries without treating a returned alert object as evidence that a patient heard a call.

Compare the same encounter across two snapshots

The Android helper builds its previous-ticket lookup by encounter ID, then inspects each current ticket. That makes a family member’s queue entry independent from another entry in the same household. The existing family case moves one synthetic person toward the front while another becomes called and verifies that only the called encounter is returned.

The helper consumes lists supplied by its caller. It does not authorize the household, verify the snapshot’s tenant scope or reject every malformed duplicate ID. Those responsibilities belong to the authoritative response and repository contract. Include cross-clinic households, removed access and duplicate-ID policy in broader acceptance rather than deriving those guarantees from a small diff function.

Identify the first observed call with a state transition

The existing Android waiting-to-called case returns a your-turn alert for the same encounter when its current status becomes called. An unchanged-list case returns no new alerts. These are useful deterministic expectations: routine refresh should not manufacture a new notice when the selected observed state is identical.

The selected source also treats a called current ticket with no previous ticket as a first observed call. Whether a freshly loaded already-called ticket should notify is a product policy that needs explicit acceptance. This helper does not establish how recently the clinic called, how many intermediate states were missed or whether the first snapshot was delayed.

Represent recall with an observable call identity

The Android recall case retains called status but changes the nonnull calledAt value and expects a recall alert. It also checks a different alert key from a selected first-call result. The key combines encounter identity, alert type and the represented call value. This makes a particular local call observation distinguishable from another selected observation.

The helper compares changed values; it does not prove that the incoming call value is chronologically newer or fresh. Its fixture uses synthetic call markers rather than a real clock. Keep repository ordering, snapshot freshness and source authority in the acceptance plan, especially during reconnects, server restores or delayed responses. A changed marker is evidence of a local comparison result.

Keep position-one notices separate from call notices

The existing Android position case moves a waiting encounter from position two to position one and expects a you-are-next notice. This is distinct from called status. The selected branch checks current waiting state and position one against the earlier position, rather than estimating a wait duration or reserving the next service event.

Position can change for operational reasons, and a patient may leave and later return to the same position. The interaction between repeated observations and the caller’s suppression policy needs its own acceptance. The selected case establishes one transition, not a promise of immediate service or that every future return to position one will generate another device notice.

Document the platform transition policies explicitly

The selected Swift case checks waiting-to-called, identical called state, a changed called fixture and removal from the new list. It returns a called change for the relevant observed updates and a finished encounter result when the old entry disappears. That is an in-app change model with a different shape from Android’s local notification types.

The inspected Swift source also considers a room-label change while called; the selected fixture changes both room and call time and therefore does not isolate the room-only branch. Android’s helper has its own criteria. Record these policies individually rather than claiming identical platform behaviour or treating disappearance as proof of a completed consultation.

Apply snapshots and suppress local duplicates at the correct layer

The inspected Android repository checks its generation before applying a fetched snapshot, skips an identical version, stores the new snapshot and then computes alerts. The container skips this local fallback when its push registrar is marked registered and otherwise tracks observed alert keys in a process-local set. Account-data wiping clears that set. These are selected source connections, not executed integration in this batch.

A registered flag reflects the registrar’s selected acceptance state; it does not prove provider delivery. A process-local set also does not establish durable exactly-once notification across restarts. Current account preference, source ordering, cancellation and repeated-entry policies need integration tests alongside these pure transition cases.

Accept the notification experience independently

The inspected Android notifier maps the local alert to queue-channel text, checks OS posting availability and builds a notification. Its selected source includes a separate public notification representation and a tap intent. None of those Android APIs, lock-screen surfaces or device settings was exercised by the transition fixtures.

Use controlled accounts and devices to verify permission denial, foreground/background behaviour, account opt-out, late pushes, local-fallback overlap and tapping the resulting notice. Review visible content, sound and accessibility independently. Successful diff computation is useful engineering evidence, but it is upstream of actual notification display and any patient response.

A queue-notice engineering handover

Retain the six scoped cases with source and fixture records. Add initial-snapshot, out-of-order call markers, room-only changes, repeated position-one visits and account-reset schedules. Verify repository reconciliation and alert suppression under those schedules, then accept the real notification experience with controlled data.

For a CTO, the architecture is clear: the service owns queue state, the repository accepts a snapshot, a scoped comparison identifies an observed change and presentation layers decide how to surface it. The selected tests support the comparison layer. Reliable delivery, authorization and correct clinical operations require their own evidence at the other layers.

Compare the reviewed boundaries

Queue state, observed changes and notifications are separate layers

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

LayerSelected evidenceSeparate acceptance
Encounter comparisonFive synthetic Android transition casesSnapshot authority, ordering and duplicate IDs
In-app change modelOne selected Swift call/removal caseRoom-only and platform-specific policies
Local fallbackInspected repository/container sourcePreference, restart and push-overlap schedules
Patient noticeInspected notifier source onlyActual device display, sound and interaction

Illustrative control flow

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

accepted_snapshot = reconcile_authoritative_snapshot(response)
changes = compare_by_encounter(previous_tickets, accepted_snapshot.tickets)
for observed_change in changes:
    apply_selected_local_suppression_and_presentation_policy(observed_change)
# A diff result is distinct from a queue command, provider delivery or audible notice.

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 ↗