Circle V2 API Docs
    Preparing search index...

    Class ChartPreprocessingRunner

    Classifies one chart: a single structured call, no persistence and no chart loading.

    Thin on purpose. What it adds over calling the prompt directly is everything BaseRunner.run() wraps around execute() — the root trace, the Safe envelope so one unclassifiable chart cannot throw out of a bulk loop, structured logging, and entity_id/patient_id span tagging from RunnerContext. Those are the properties that matter once this runs over the whole corpus.

    Token usage is not recorded: BasePrompt.invoke() returns only its output, so RunnerRun.usage stays zeroed here as it does for every other prompt-only path in this package. Per-call cost during the pilot comes from the LangSmith trace.

    Hierarchy

    Index

    Constructors

    Properties

    runnerName: "chart-preprocessing.classify"

    Stable, human-readable name for the runner. Must be set explicitly on each subclass so we don't break the logger and trace span names when minified.

    Accessors

    • get logger(): BaseLogger

      Returns BaseLogger

    • get name(): string

      Returns string

    Methods

    • Primary entry point for the runner. Subclass must implement this method to provide the runner's logic. The optional ctx carries cross-cutting concerns (cancellation via ctx.signal, request/user identity); simple runners may ignore it.

      Parameters

      Returns Promise<
          {
              authoredAt: string
              | null;
              dateOfService: string | null;
              summary: string;
              tags: {
                  rationale: string;
                  tag:
                      | "admission"
                      | "diagnosis"
                      | "insurance"
                      | "biopsychosocial"
                      | "asam_assessment"
                      | "level_of_care_determination"
                      | "history_and_physical"
                      | "psychiatric_evaluation"
                      | "nursing_intake"
                      | "screening_instrument"
                      | "alcohol_withdrawal_assessment"
                      | "benzodiazepine_withdrawal_assessment"
                      | "opioid_withdrawal_assessment"
                      | "treatment_plan"
                      | "safety_plan"
                      | "continuing_care_plan"
                      | "progress_note"
                      | "group_note"
                      | "individual_therapy_note"
                      | "family_session_note"
                      | "case_management_note"
                      | "restraint_seclusion"
                      | "consent_form"
                      | "discharge_summary"
                      | "discharge_instructions"
                      | "transfer_note"
                      | "program_history"
                      | "appointment"
                      | "utilization_review"
                      | "vital_signs"
                      | "lab_result"
                      | "glucose_log"
                      | "clinical_orders"
                      | "medication_administration_record"
                      | "medication_reconciliation"
                      | "other";
              }[];
          },
      >

    • Add a component's token usage to this run's total, surfaced as RunnerRun.usage. Call it for every agent / prompt the runner invokes; anything not recorded is invisible to cost reporting.

      Parameters

      Returns void

    • Parameters

      Returns Promise<
          RunnerRun<
              {
                  authoredAt: string
                  | null;
                  dateOfService: string | null;
                  summary: string;
                  tags: {
                      rationale: string;
                      tag:
                          | "admission"
                          | "diagnosis"
                          | "insurance"
                          | "biopsychosocial"
                          | "asam_assessment"
                          | "level_of_care_determination"
                          | "history_and_physical"
                          | "psychiatric_evaluation"
                          | "nursing_intake"
                          | "screening_instrument"
                          | "alcohol_withdrawal_assessment"
                          | "benzodiazepine_withdrawal_assessment"
                          | "opioid_withdrawal_assessment"
                          | "treatment_plan"
                          | "safety_plan"
                          | "continuing_care_plan"
                          | "progress_note"
                          | "group_note"
                          | "individual_therapy_note"
                          | "family_session_note"
                          | "case_management_note"
                          | "restraint_seclusion"
                          | "consent_form"
                          | "discharge_summary"
                          | "discharge_instructions"
                          | "transfer_note"
                          | "program_history"
                          | "appointment"
                          | "utilization_review"
                          | "vital_signs"
                          | "lab_result"
                          | "glucose_log"
                          | "clinical_orders"
                          | "medication_administration_record"
                          | "medication_reconciliation"
                          | "other";
                  }[];
              },
          >,
      >

    • Optional hook for subclasses to record the root LangSmith span's INPUTS — what was asked, rather than the metadata facets you filter runs by.

      Returns {} by default, which is what every runner recorded before this hook existed: a root span you had to open a child span to understand. Unlike traceMetadata this is the place free text legitimately belongs, so only override it on surfaces where the payload is acceptable in the trace, and keep it to what a human reading the run needs.

      Parameters

      Returns Record<string, unknown>

    • Optional hook for subclasses to attach non-PII metadata to the root LangSmith span. Merged on top of the auto-extracted metadata and ctx.metadata Safe by default: returns {} when not overridden. Never include emails, names, dob, free-text, etc.

      Parameters

      Returns Record<string, unknown>