// --------------------------------------------------------------------------------------------- // THE DESK DESIGNATES SOMEBODY TO MANAGE A PATIENT WHO CANNOT MANAGE THEIR OWN PORTAL. // // Ruled 2026-09-06: at the desk, an email means an invitation and no email means a record with no // account, and there is no "decide later". A patient who cannot or will not use the portal MAY BE // MANAGED BY A RELATED PERSON DESIGNATED AT THE DESK AND ATTESTED LIKE CONSENT; paper is the // practice's policy, never a gate. // // Without this, registering that patient ended with a record nobody could act for - and the person // who cannot use a portal is exactly the person most likely to need somebody acting for them. // // CONTRACT SHARED WITH THE SERVER. `DESIGNATION_VERSION` must match // `utils/relatedPersonDesignation.ts`'s constant in akashic-infrastructure exactly: the server // refuses any other value as stale, on purpose, so an attestation can only ever be evidence that // the receptionist read THIS text. Revise the wording and bump the version in BOTH repos in the // same change - a bump here alone makes every designation fail, and a bump there alone makes this // screen record agreement to text it never showed. // --------------------------------------------------------------------------------------------- export const DESIGNATION_VERSION = 1; export interface DesignationAttestationRequest { agreedVersion: number; } /** * The statement the receptionist is attesting to, in the words the approved drawing uses. * * Taken from `mockups/receptionist/patients.html` rather than written fresh, and the boundary in the * last line is a constraint on the grant rather than a nicety: the designation lets somebody act * ALONGSIDE the patient, never instead of them on the one decision that is theirs. */ export const DESIGNATION_HEADLINE = 'This person will manage the account'; export const DESIGNATION_SUMMARY = [ 'The invitation goes to them, not to the patient. They sign in as themselves and switch into the patient’s record.', 'They will be able to see the patient’s information and speak to their providers on their behalf.', 'They will not be able to make treatment decisions. Consent to treat is the patient’s to give, or attested here at the desk, never theirs.', ] as const; /** * What the receptionist is confirming, on their own name, before the designation is recorded. * * "The patient asked for this" rather than "I am setting this up" - the receptionist is recording * what they were told, not making the decision. That distinction is the difference between an * attestation and the practice handing somebody access to a record and calling it the patient's wish. */ export const DESIGNATION_ATTESTATION_LABEL = 'The patient asked for this person to manage their account, and I have read them the above.'; /** * The attestation block to send with a desk designation. * * It carries the version and nothing else. `staff-attested` is not a value this client may claim and * the witness is not a field it may fill: the server takes both from the authenticated caller, so a * body that could name its own witness never exists to be forged. */ export const buildDesignationAttestation = (): DesignationAttestationRequest => ({ agreedVersion: DESIGNATION_VERSION, });