Circle V2 API Docs
    Preparing search index...

    Function makeEpisodeSyncContext

    • Build a fully-typed EpisodeSyncContext for adapter/manager tests, replacing the per-file makeEpisodeCtx helpers that each re-declared the bundle with as unknown as casts. The defaults mirror a 1:1-EMR episode (episode.external_id == the EMR casefile key); pass overrides for the fields a given assertion cares about.

      The episode/patient members are partial stand-ins for full DB rows whose branded id types are string-based even though Kysely returns numbers at runtime — so they need a localized as unknown as here (building the full 30-field rows is impractical). The casts live ONLY in this shared fixture; call sites receive a fully-typed EpisodeSyncContext and never cast. Values mirror runtime (numeric ids), so assertions on patientId see numbers.

      Parameters

      • overrides: MakeEpisodeSyncContextOverrides = {}

      Returns EpisodeSyncContext