Abstract:Objective To develop a rule-local lightweight large language model (LLM) workflow for structuring thoraciccardiac clinical histories while retaining source evidence and reducing model use. Methods This study included 466 medical history documents from 99 patients at Shanghai Chest Hospital between April 11, 2025, and March 20, 2026. Rule-based procedures were used to perform candidate localization, numerical value and unit processing, date recognition, and explicit negation determination. Only ambiguous de-identified short text windows were referred to Qwen2.5-1.5B-Instruct Q4_K_M for adjudication, with three-class labels, few-shot examples, and JSON (JavaScript Object Notation) constraints used to standardize the output. Performance was assessed using an internal explicit assertion reference set and an independent evaluation with patient-level isolation.. Results The workflow produced 6, 030 evidence records across 37 fields. On the internal reference set, context rules achieved an accuracy of 0.900 and a macro-F1 of 0.928, compared with 0.892 and 0.598 for few-shot single-instance LLM inference. In the independent evaluation, rules plus selective LLM achieved an accuracy of 0.903 and a macro-F1 of 0.842, with an LLM call rate of 31.7% and a manual-review rate of 8.3%. Conclusion The workflow combines rules for deterministic information with a local lightweight LLM for localized semantic classification. It reduces model use while retaining evidence across notes and may support post-structuring of thoracic–cardiac clinical histories.