Suppose a primary care clinic (TEN-HC001) and a specialty clinic (TEN-HC002) each use this administrative referral workflow pilot with wholly synthetic patient records. No diagnostic or treatment recommendation is made in this workflow; it is an administrative handoff. Pilot coordinator OP-HC101 (session SES-HC-001, ROLE-V1 at TEN-HC001) prepares a referral record with patient/organization/role binding PAT-HC001/ORG-HC001/ROLE-V1, record version RVR-HC001, view grant VGR-HC001, write grant WGR-HC001, export grant EGR-HC001, FHIR sandbox verification FSV-HC001 and synthetic data verification SDV-HC001.
Authorized initial referrals (A and B). Operator OP-HC102 prepares TEN-HC001's approved referral REF-HC001 on key op:b184-health-refer_A_001. Approver OP-HC103, executor OP-HC104 at TEN-HC001. The executor submits the referral to the authoritative server. Server commits with receipt PRT-HC-A001, audit AUD-HC-A001, reference ACR-REF-HC501 and current record version.
Before any read of the committed result, the requesting actor's session, role, organization, patient binding, record version and current view grant are rechecked. A revoked-grant actor who participated in A cannot read A's receipt or audit; denial is recorded before any result lookup. Separately at TEN-HC002: operator OP-HC105 prepares REF-HC002 on key op:b184-health-refer_B_002. Different approver OP-HC106, executor OP-HC107. Server commits with PRT-HC-B001, AUD-HC-B001, ACR-REF-HC502.
Current first-effect gate. Every referral submission, retry, reconciliation lookup, result read, receipt export or audit access on any b184-health-refer key requires all of the following IMMEDIATELY BEFORE execution:
- (a) Authenticated session with current role at the correct organization.
- (b) Current applicable grant (VIEW for reads, WRITE for submissions, EXPORT for exports).
- (c) Exact approved frozen bytes/digest/revision matching patient and record version.
- (d) Authorized destination organization still approved.
- (e) Current view/write/export grants and synthetic data verification not expired or revoked; FHIR sandbox verification where an integration step is assigned.
- (f) Expiry/revocation recheck.
Failure produces a denial entry before any remote effect.
Reciprocal denied reads and cross-organization tests. TEN-HC002 operator attempting to read or submit against A at TEN-HC001 is denied (wrong organization). TEN-HC001 operator attempting B at TEN-HC002 is denied. A submission with correct A key but wrong destination is denied on mismatch. Changed record hash is denied on payload mismatch. Revoked WRITE GRANT is denied with recorded entry. A revoked-grant actor at TEN-HC001 attempting to read A's committed receipt is denied before any result; different-organization actor denied before any scoped receipt.
Withdrawal before first submission (fw_4a, ACR-R101). Coordinator OP-HC108 prepares REF-HC003 (referral for a synthetic patient to specialty clinic) on key op:b184-health-refer_R_101. The specialty clinic withdraws their participation agreement after referral approval but before first submission because the clinic determined their administrative systems cannot accept the proposed record format. Write grant WGR-HC002 revoked. Quarantined with frozen bytes, not submittable.
First attempt. Executor checks gate: write grant WGR-HC002 revoked. Denied, first entry. Eligible retry. Same key/bytes; still revoked. Second denial. Stale executor. Different executor with cached approval; rejected on current grant check. Third denial.
Baseline read set repeated at every checkpoint. The TEN-HC001 auditor OP-HC103 is separately reauthorized under current own-scope credentials with current view grant. That auditor reads: TEN-HC001 current referral queue; op:b184-health-refer_A_001 original committed record with frozen bytes/digest/revision, correct destination, PRT-HC-A001, AUD-HC-A001, ACR-REF-HC501 and current record version matching baseline; current view/write/export grant register. The same auditor reads op:b184-health-refer_R_101 original frozen bytes with withdrawal fence, current denial count (incrementing 0/1/2/3) and confirmation of no R101 commit, receipt or submitted referral.
The TEN-HC002 auditor OP-HC106 is independently reauthorized under current own-scope credentials with current view grant. That auditor reads: TEN-HC002 current referral queue; op:b184-health-refer_B_002 original committed record with frozen bytes/digest/revision, correct destination, PRT-HC-B001, AUD-HC-B001, ACR-REF-HC502 and current record version matching baseline. Cross-organization reads are denied before any result.
| Stage | TEN-HC001 expected | TEN-HC002 expected |
|---|
| EC-HC-0 (0 denials) | A committed with verified receipt/version; R101 frozen, 0 denials, no commit/receipt | B committed with verified receipt/version |
| EC-HC-1 (1 denial) | R101: 1 denial, 0 commits; A unchanged/verified | B unchanged/verified |
| EC-HC-2 (2 denials) | R101: 2 denials, 0 commits; A unchanged | B unchanged |
| EC-HC-3 (3 denials) | R101: 3 denials, 0 submitted, 0 exposure; A unchanged | B unchanged |
Replay distinct key rule. Exact replay of confirmed A or B with same payload bytes, passing all current checks, returns only the already-confirmed scoped result from the authoritative server. No new referral, duplicate effect or new receipt. Changed bytes or patient binding require a distinct key and fresh approval.
Timeout and reconciliation (ACR-R301). Referral REF-HC004 dispatched on key op:b184-health-refer_R_301. Local receipt times out. Revalidate session, role, TEN-HC001 scope, current grants, record version and destination.
Committed branch: authoritative server holds a matching referral record. Compare exact original frozen payload/digest/revision and scoped remote identity to PRT-HC-R301 and audit before returning any result. Confirm no current pending, queued, scheduled, retry or in-flight dispatch for this key. Verify R101 quarantine unchanged. Return only ACR-REF-R301. No new business receipt or effect.
Absence branch: authoritative server reads confirm no matching referral, no commit, no receipt, no pending, queued or retry work and no in-flight dispatch for this key. Local queue and audit absence is not platform absence; if the authoritative server cannot decisively prove absence, hold for manual reconciliation and no resend. One guarded submission proceeds only after fresh product owner authorization, fresh executor and current grant verification.
Unknown or in-flight branch: holds for the product owner. No blind retry. Hold remains until decisive evidence obtained or manual reconciliation resolves the state.
Configuration test: staged restore. Named pilot owner OP-HC103 checks a verified configuration snapshot in isolated staging at TEN-HC001 with no live credentials or submittable work. Live external result reconciliation precedes resuming any send.
Five comparisons under current independently authorized scope, preserving all newer record versions and withdrawal fences:
- TEN-HC001 referral queue: auditor OP-HC103 (current view grant). Before and after: A committed with original version, R101 quarantined with three denials. Identical.
- TEN-HC002 referral queue: auditor OP-HC106 (current view grant). Before and after: B committed with original version. Identical.
- A original committed record/receipt/audit: OP-HC103 (current TEN-HC001 scope, current view grant). Frozen bytes/revision/receipt identical.
- B original committed record/receipt/audit: OP-HC106 (current TEN-HC002 scope, current view grant). Frozen bytes/revision/receipt identical.
- R101 withdrawal fence and denial log: OP-HC103. Frozen bytes preserved, 3 denials, no commit/receipt. Withdrawal fence intact.
R101 quarantine preserved; the withdrawn R101 key is never reused. Later referral to that specialty requires a distinct operation key with fresh approval, fresh grants and a separate executor. Production resume only after pilot owner checks.
Verified-absence retry (ACR-R201). Referral REF-HC005 dispatched on key op:b184-health-refer_R_201. Authoritative server reads confirm no matching referral, no commit, no receipt, no pending, queued or in-flight work for this key. All current grants, patient binding, organization, record version and destination verified. One guarded submission proceeds. Server commits with PRT-HC-R201, AUD-HC-R201, ACR-REF-R201. Post-commit verification confirms the submitted record matches the original frozen payload. Manual fallback: if the authoritative server becomes unavailable during the verified-absence check, the workflow holds for the pilot owner rather than proceeding.
Residual risks: external API outage may delay reconciliation; customer device caches may retain stale referral status; offline-capable clients may attempt duplicate submissions that the server deduplicates by operation key. No global exactly-once promise across third-party systems. Controlled production retention of clinical records with no irrevocable wipe promise.
Held-out fixture groups. These fixtures are kept out of drafting, tuning and construction examples. Each group has a named responsible role, evaluation conditions and a planned 2/2 gate with no observed result.
| Group | Fixtures | Threshold |
|---|
| HG-HC-01: Wrong patient or organization binding | FX-HC-01, FX-HC-02 | 2/2 mismatch denials (owner: OP-HC103) |
| HG-HC-02: Stale record version submitted | FX-HC-03, FX-HC-04 | 2/2 version conflicts caught (owner: OP-HC103) |
| HG-HC-03: Revoked view/write/export grant | FX-HC-05, FX-HC-06 | 2/2 revoked grants denied (owner: OP-HC106) |
| HG-HC-04: Duplicate or ambiguous reconnect | FX-HC-07, FX-HC-08 | 2/2 dedup or hold applied (owner: OP-HC103) |
| HG-HC-05: Source/schema unavailability and staged restore | FX-HC-09, FX-HC-10 | 2/2 hold or rollback applied (owner: OP-HC103) |
FX-HC-01: A referral submission binds synthetic patient P-001 at TEN-HC001 but the payload references patient P-002. The patient binding check denies the mismatch before submission. FX-HC-02: An operator at TEN-HC002 attempts to read a TEN-HC001 referral using a valid TEN-HC002 session. The organization binding check denies the cross-organization access.
FX-HC-03: A referral uses record version V1 but the authoritative server holds V2 (updated by a concurrent workflow). The version check denies the stale submission. FX-HC-04: A retry attempt references a record version that was superseded during the timeout window. The version recheck catches the stale state.
FX-HC-05: An operator whose write grant was revoked after A's successful commit attempts to submit a new referral. The grant check denies before submission. FX-HC-06: An operator whose export grant was revoked attempts to export A's receipt. The grant check denies before any result is returned.
FX-HC-07: After a timeout on R301, the operator submits a retry but the authoritative server already holds the committed referral from the original dispatch. The dedup check returns the existing result without creating a duplicate. FX-HC-08: A reconnect attempt references the same operation key but with modified payload bytes. The digest mismatch triggers a hold for manual reconciliation rather than automatic submission.
FX-HC-09: The FHIR sandbox server becomes unavailable during a planned integration test. The workflow holds for the pilot owner and falls back to manual review rather than proceeding without verification. FX-HC-10: The pilot owner initiates a staged restore of verified configuration, confirms that all withdrawal fences and newer record versions are preserved, and verifies that no live credentials or submittable work exist in the staging environment before any production resume. Manual disabled-send fallback is available throughout.
This is a hypothetical scenario for illustration. Actual scope, timeline and cost depend on your requirements.