From e48a70eb2a301c03559cc05aa28de06998b09f5c Mon Sep 17 00:00:00 2001 From: Abhinav Gupta Date: Fri, 16 Oct 2026 16:05:34 +0530 Subject: [PATCH] fix(graph): define raw_doc_text in finalize_output_node to avoid NameError --- src/medical_coding/graph/nodes.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/medical_coding/graph/nodes.py b/src/medical_coding/graph/nodes.py index 835a0bf..9331a54 100644 --- a/src/medical_coding/graph/nodes.py +++ b/src/medical_coding/graph/nodes.py @@ -1049,6 +1049,7 @@ def finalize_output_node(state: PipelineGraphState) -> dict[str, Any]: audit_trail = list(state.get("audit_trail", [])) classified = state.get("classified_diagnoses", []) diag_state: ClinicalDiagnosisState | None = state.get("clinical_diagnosis_state") + raw_doc_text = state.get("raw_text", "") or state.get("clinical_text", "") or state.get("text", "") or "" primary_response: CodedDiagnosisResponse | None = None secondary_responses: list[CodedDiagnosisResponse] = []