Circle V2 API Docs
    Preparing search index...

    Hourly per-integration orchestrator: facility refresh → census inline → fan out one SyncPatientAndCheckTriggers per active patient. Carries no per-patient logic of its own.

    Hierarchy (View Summary)

    • Jobbable<SyncIntegrationJobParams, void>
      • SyncIntegrationJobbable
    Index

    Constructors

    Properties

    config: JobConfig = ...
    serviceName: "SyncIntegrationJobbable"

    Stable, human-readable name for the service. Must be set explicitly on each subclass because this.constructor.name gets mangled by minification in production builds, which breaks tracing/observability span names.

    Accessors

    • get name(): string

      Returns string

    Methods

    • Parameters

      • params: {
            entityId: EntityId;
            fromDate?: string;
            integrationId: IntegrationId;
            toDate?: string;
        }
        • entityId: EntityId
        • OptionalfromDate?: string

          Explicit window for the manual "Fetch episodes" action. Threaded straight to the census, which enumerates every episode in the window and fans out per-episode document syncs (the backfill). Absent on the hourly cron — census then uses its default 7-day window with no per-episode fan-out.

        • integrationId: IntegrationId
        • OptionaltoDate?: string

      Returns string

    • Extract an entityId from params for job_executions tracking. Override in subclasses when applicable.

      Parameters

      • params: {
            entityId: EntityId;
            fromDate?: string;
            integrationId: IntegrationId;
            toDate?: string;
        }
        • entityId: EntityId
        • OptionalfromDate?: string

          Explicit window for the manual "Fetch episodes" action. Threaded straight to the census, which enumerates every episode in the window and fans out per-episode document syncs (the backfill). Absent on the hourly cron — census then uses its default 7-day window with no per-episode fan-out.

        • integrationId: IntegrationId
        • OptionaltoDate?: string

      Returns EntityId

    • Derive a deduplication key from the params. Return null to skip deduplication (every call enqueues).

      Parameters

      • params: {
            entityId: EntityId;
            fromDate?: string;
            integrationId: IntegrationId;
            toDate?: string;
        }
        • entityId: EntityId
        • OptionalfromDate?: string

          Explicit window for the manual "Fetch episodes" action. Threaded straight to the census, which enumerates every episode in the window and fans out per-episode document syncs (the backfill). Absent on the hourly cron — census then uses its default 7-day window with no per-episode fan-out.

        • integrationId: IntegrationId
        • OptionaltoDate?: string

      Returns string | null

    • Parameters

      • params: {
            entityId: EntityId;
            fromDate?: string;
            integrationId: IntegrationId;
            toDate?: string;
        }
        • entityId: EntityId
        • OptionalfromDate?: string

          Explicit window for the manual "Fetch episodes" action. Threaded straight to the census, which enumerates every episode in the window and fans out per-episode document syncs (the backfill). Absent on the hourly cron — census then uses its default 7-day window with no per-episode fan-out.

        • integrationId: IntegrationId
        • OptionaltoDate?: string

      Returns Promise<Safe<void>>

    • Enqueue this job for async processing via Vercel Queues. Checks for deduplication via job_executions before sending.

      Parameters

      • params: {
            entityId: EntityId;
            fromDate?: string;
            integrationId: IntegrationId;
            toDate?: string;
        }
        • entityId: EntityId
        • OptionalfromDate?: string

          Explicit window for the manual "Fetch episodes" action. Threaded straight to the census, which enumerates every episode in the window and fans out per-episode document syncs (the backfill). Absent on the hourly cron — census then uses its default 7-day window with no per-episode fan-out.

        • integrationId: IntegrationId
        • OptionaltoDate?: string
      • Optionaloptions: PerformLaterOptions

      Returns Promise<SendResult>

    • Parameters

      • __namedParameters: {
            entityId: EntityId;
            fromDate?: string;
            integrationId: IntegrationId;
            toDate?: string;
        }
        • entityId: EntityId
        • OptionalfromDate?: string

          Explicit window for the manual "Fetch episodes" action. Threaded straight to the census, which enumerates every episode in the window and fans out per-episode document syncs (the backfill). Absent on the hourly cron — census then uses its default 7-day window with no per-episode fan-out.

        • integrationId: IntegrationId
        • OptionaltoDate?: string

      Returns Promise<void>

    • Run the job with status tracking. Used by the queue handler. Errors propagate (not caught by safe()) so the RetryHandler can decide.

      Parameters

      • params: {
            entityId: EntityId;
            fromDate?: string;
            integrationId: IntegrationId;
            toDate?: string;
        }
        • entityId: EntityId
        • OptionalfromDate?: string

          Explicit window for the manual "Fetch episodes" action. Threaded straight to the census, which enumerates every episode in the window and fans out per-episode document syncs (the backfill). Absent on the hourly cron — census then uses its default 7-day window with no per-episode fan-out.

        • integrationId: IntegrationId
        • OptionaltoDate?: string
      • metadata: MessageMetadata

      Returns Promise<void>

    • Optional hook for subclasses to attach extra non-PII span attributes derived from params. The returned attributes appear on the service.${serviceName} span (and, for jobs, on job.enqueue.* and job.run.* spans too).

      Safe ID-like keys on params (e.g. patientId, templateIds, limit, cursor) are already auto-extracted via toSpanAttributes("service.input", params) — you don't need to enumerate them here. Use this hook for derived/computed attributes (counts, flags, computed names) or for fields you've explicitly verified safe but that aren't in the global allowlist. Hook output overrides auto-extracted attributes on key collision.

      Safe by default: returns {} when not overridden. Only declare keys you've confirmed are non-PII. Never include emails, names, dob, free-text, etc.

      Parameters

      • _params: {
            entityId: EntityId;
            fromDate?: string;
            integrationId: IntegrationId;
            toDate?: string;
        }
        • entityId: EntityId
        • OptionalfromDate?: string

          Explicit window for the manual "Fetch episodes" action. Threaded straight to the census, which enumerates every episode in the window and fans out per-episode document syncs (the backfill). Absent on the hourly cron — census then uses its default 7-day window with no per-episode fan-out.

        • integrationId: IntegrationId
        • OptionaltoDate?: string

      Returns Attributes

    • Optional hook for subclasses to attach extra non-PII span attributes derived from the successful service result. Only called when run resolves successfully; on error, the span is marked via markSpanError instead.

      Safe by default: returns {} when not overridden. Only declare keys you've confirmed are non-PII (e.g. counts, status flags, computed summaries). Never include emails, names, dob, free-text, etc.

      Parameters

      • _result: void

      Returns Attributes

    • Parameters

      • params: unknown

      Returns params is {
          entityId: EntityId;
          fromDate?: string;
          integrationId: IntegrationId;
          toDate?: string;
      }