Circle V2 API Docs
    Preparing search index...
    triggeredChartReviewJobSpecSchema: ZodObject<
        {
            entityId: ZodPipe<ZodNumber, ZodTransform<EntityId, number>> & zIdInnerType<
                ZodNumber,
            >;
            key: ZodString;
            patientId: ZodPipe<ZodString, ZodTransform<PatientId, number>> & zIdInnerType<
                ZodString,
            >;
            templateIds: ZodTuple<
                [
                    ZodPipe<ZodString, ZodTransform<AuditTemplateId, number>> & zIdInnerType<
                        ZodString,
                    >,
                ],
                null,
            >;
            triggerId: ZodPipe<ZodString, ZodTransform<ChartReviewTriggerId, string>> & zIdInnerType<
                ZodString,
            >;
            ttlHours: ZodNumber;
        },
        $strip,
    > = ...

    Canonical shape of a triggered chart-review job the sync pipeline carries from the sweep to the queue. key is the v1-format idempotency key — the cross-app dedup contract (see trigger-keys.helpers.ts). Branded ids parse from the JSON primitives off the queue wire. This schema is the single source of truth: downstream jobbables import it rather than redefining their own.

    templateIds is a one-element tuple, not a list: a spec carries exactly ONE template because the per-template fan-out (and its dedup) now happens here in the sweep, so the key recorded in job_executions matches the key this service checks. Kept as an array (rather than a scalar templateId) so the queue wire shape — and SyncEpisode's chartReviewJobs field — stays unchanged; the tuple type just guarantees templateIds[0] is always present.