Circle V2 API Docs
    Preparing search index...
    getRetrievalScope: QueryProcedure<
        {
            input: { runId: string };
            meta: object;
            output: {
                runId: FormRunId;
                scope:
                    | {
                        includeEmr: boolean;
                        selectedDocumentIds: PatientChartId[];
                        selectedSessionIds: SessionId[];
                    }
                    | null;
            };
        },
    > = ...

    The retrieval bound a run was kicked off with, for pre-filling the re-run drawer.

    A query of its own rather than a field on getStatus: that endpoint is the review screen's five-second poll and already carries a KNOWN COST note about its payload, while this is read once, when a drawer opens. It costs no extra database work either — canAccessFormRun has already fetched the run row and put it in context.

    null for every run created before the column existed (and every v1 run). The drawer treats that as "nothing known" and falls back to its own defaults, which is exactly today's behaviour.

    Deliberately NOT the chosen contacts. Those are rows in patient_charts_contacts and are PHI-adjacent; they have their own read path and their own reason to be gated, and duplicating them into a jsonb cell would put the same identities in two places that can disagree.