The scenario: linked records must remain coherent after their identifiers change
A shared referral can contain a document, an attachment reference, a medicine entry and a dose that points back to that medicine. Replacing every identifier independently would make those records difficult to connect. Returning internal family identifiers unchanged would create a different exposure boundary. The projection needs a consistent vocabulary within the particular share.
The pinned Movo-X implementation derives selected opaque identifiers from a server key, the share identifier and the internal identifier. Two existing and three supplemental TypeScript cases exercise selected app/web projections with invented data and injected service responses. They verify useful transformations without claiming that every possible record is safe to share or that a live permission system was executed.
Use one share-scoped mapping for repeated references
The selected opaque-ID helper uses an HMAC input that includes both the share and the normalized internal UUID. Repeated selected identifiers therefore map consistently inside the same share. The supplemental reference fixture includes lowercase and uppercase forms of the same UUID and verifies that both become the same mapped reference.
Changing the share or test key changes the observed output in that fixture. That supports the selected scope separation and stable mapping, not a cryptographic proof of collision resistance, key handling or resistance to every correlation technique. A real key was neither read nor generated for deployment; the harness uses a fixed synthetic value.
Preserve the request identity while replacing selected internal identities
The recursive transformation leaves the selected share identifier intact when an entire UUID string matches it. Other entire UUID strings pass through the opaque mapping. That allows the outward request identity to remain usable while references inside the shared material receive the selected representation.
The existing app-view fixture checks the request identity, the remapped episode identifier and consistency between a dose item reference and its medicine entry. Its attachment URL is built using the projected attachment identifier. These assertions are about connected output fields. They do not demonstrate that an attacker cannot infer identity from the content, timing or other contextual information.
Null explicitly named identity fields before walking nested data
The source maintains an explicit set of field names for person, account, household, clinic and related record identities. A matching key is replaced with null. Other arrays and objects are walked recursively so the selected rules apply below the top level as well.
A supplemental fixture checks named identity fields nested in an array, a mapped nested record identifier and preservation of null, numeric and Boolean values. It also checks that the supplied object is unchanged after projection. This is a bounded transformation contract, not a schema-wide discovery mechanism: new field names and new response shapes need review rather than an assumption that recursion knows their meaning.
Reduce structured display names without promising to sanitize arbitrary prose
The selected displayName rule trims a string and retains its first whitespace-delimited component. Existing app/web fixtures check selected author fields in notes, dose recording and conversation material. The supplemental nested fixture checks the same named-field rule alongside identity projection.
A separate supplemental case deliberately includes ordinary synthetic prose and a string containing an embedded UUID. Those strings remain unchanged while displayName is reduced. The helper matches selected structured keys and whole UUID strings; it is not a general narrative-redaction engine. That distinction matters when someone describes the result: a transformed referral is not automatically anonymous clinical text.
Keep selected clinical content and its sharing policy separate from identifier mapping
The referral wrapper constructs an episode-shaped view and applies the selected transformation before linking shared photos/files. The inspected wrapper deliberately supplies an empty allergy list for the reviewer representation. Content selection, original-attachment availability and conversation sharing are related decisions but are not all enforced by the identifier helper itself.
A reviewer can legitimately need meaningful clinical content, and that content can carry context beyond structured identifiers. The question is what the sharing workflow authorizes and intentionally includes. This batch tests selected projection fields; it does not assess clinical completeness, recipient identity, consent adequacy or whether a particular real record should be shared.
Apply the boundary to web and conversation routes as well as the main view
The second existing fixture supplies shaped data through injected web and app conversation handlers. It checks selected projected fields across those responses, including conversation attachment references matching the referral mapping and author display names using the same selected rule. No browser login or live record is involved.
That gives stronger evidence than testing a standalone helper alone, while remaining narrower than full delivery acceptance. An actual database can return a different shape, and a currently deployed handler can be a different revision. Keep the pinned source, injected response and observed output together; do not use route-shaped fixtures as proof of current production authorization.
Treat attachment references and attachment capability as separate checks
The selected projection creates outward URLs using projected attachment identifiers. This keeps a document reference internally coherent with the shared-view representation. The route source separately requires a ticket header and checks the requested opaque attachment identity against the authoritative response before serving selected bytes.
Those ticket and file paths are separate acceptance work; the five projection cases here do not consume a real single-use ticket or verify a database lock. A correct-looking URL and coherent references are useful presentation results, but neither establishes that the reader can or should retrieve an object. Watermark rendering and permitted content also retain their own evidence.
A referral-projection engineering handover
Retain the five scoped cases with their synthetic keys, share identifiers and expected cross-record references. Add fixtures whenever an outward schema gains a new identity-bearing field or linked collection. Review intended clinical narrative sharing separately from structured field transformation, then exercise authorization and ticket consumption in a permitted integration environment.
For a CTO, the result is an inspectable data boundary: one share has coherent references, named identity fields have explicit treatment, selected display names are reduced and ordinary text is not silently relabeled as anonymized. The pinned implementation supports these precise claims while current deployment, permission enforcement, clinical suitability and broader privacy assurance remain separate work.
Compare the reviewed boundaries
Referral transformation claims have different boundaries
On smaller screens, scroll across to compare every column. Keyboard users can focus the table and use the arrow keys.
| Input or rule | Selected output | What it does not prove |
|---|---|---|
| Same UUID in one share | Consistent mapped references | Complete security or anonymity |
| Another share or synthetic key | Different observed mapped value | No possible contextual correlation |
| Named identity fields | Null at inspected nested locations | Automatic handling of future schemas |
| Structured displayName | First whitespace-delimited component | Arbitrary text redaction |
| Ordinary prose/embedded UUID | Preserved in the supplemental fixture | Identity-free clinical narrative |
Illustrative control flow
Pseudocode summarizing the decision boundary. It is not copied production code or a deployment instruction.
projected = transform_under_one_share_key(source)
assert projected.dose.itemId == projected.medicine.id
assert source_is_unchanged()
# Named fields and whole UUID strings have selected rules.
# Clinical prose, permissions and attachment capabilities need separate review.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 ↗