A patient profiling report generation method and system based on medical priority scoring

CN122511474BActive Publication Date: 2026-10-20HUNAN TRASEN SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610993355.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-07-06
Publication Date
2026-10-20
Estimated Expiration
2046-07-06

AI Technical Summary

Technical Problem

[0005]针对以上问题,本发明提供一种基于医疗优先级评分的患者画像报告生成方法及系统,用于解决如何在患者医疗文档文字识别文本长度受限场景下,基于文档来源标记和段落优先级评分序列,通过文本压缩和分段摘要形成可质量校验的结构化患者画像报告的问题

Benefits of technology

[0034](1)本发明通过带来源索引的段落集合和段落医疗优先级评分形成段落优先级评分序列,使后续文本压缩具有明确的段落筛选依据,在多源医疗文档文字识别文本中不同段落信息价值差异较大的情况下,减少关键段落与低价值模板文本混合处理的情况,优先保留诊断结论、用药信息、检查结果等高价值内容。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122511474B_ABST
    Figure CN122511474B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of medical text processing and natural language processing, and particularly relates to a patient portrait report generation method and system based on medical priority scoring. The method obtains patient medical document character recognition text and document source markers, generates a paragraph set with source indexes according to sources, file boundaries and paragraph boundaries; identifies medical keywords, medical numerical features, patient identity information and paragraph length features, and generates a paragraph priority scoring sequence; performs cross-file deduplication, low-priority content removal, priority ordering extraction and original text position rearrangement according to the scoring sequence and the source markers, to obtain compressed text; when a segmentation trigger condition is met, structured key information summaries are extracted according to file boundaries or semantic boundaries, a segmented summary set is generated, and a structured patient portrait report is generated in combination with a structured report template; the report is subjected to output quality checking, and when the quality is unqualified, adaptive retry is performed according to a quality deviation value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of medical text processing and natural language processing, and in particular to a method and system for generating patient profile reports based on medical priority scoring. Background Technology

[0002] In the fields of medical text processing and natural language processing, existing solutions for text recognition of patient medical documents typically convert medical records, examination reports, laboratory reports, prescription records, imaging reports, or discharge summaries into text, and then use methods such as text cleaning, keyword extraction, summary generation, or structured template filling to generate medical reports. While these solutions can complete medical text processing and report generation in typical scenarios, they are prone to limitations such as lost file boundaries, unclear order of key paragraphs, and missing report fields in scenarios with long, multi-source medical documents, scattered document sources, and input length limitations.

[0003] Existing solutions often rely on fixed truncation, fixed window segmentation, general deduplication, or manually set fields for processing. When patient medical document text recognition contains duplicate headers and footers, test index values, diagnostic conclusions, medical orders, and different document sources, there is a lack of stable connection between the text compression stage and the subsequent summarization and report generation stages. This can easily lead to the mixing of high-value medical paragraphs with low-value template text, and make it difficult to maintain the document source relationship and semantic boundaries in the segmented summarization results.

[0004] Common shortcomings include insufficient coherence. Specifically, simple truncation methods directly discard text exceeding length limits, easily losing diagnostic conclusions and medical advice; while sliding window methods avoid global truncation, they fail to establish semantic connections across windows; uniform sampling ignores the significant differences in information density between different paragraphs in medical documents (the information density of diagnostic conclusions differs by tens of times from that of headers and footers). None of these methods consider the domain-specific nature of medical documents, nor do they establish a closed-loop feedback mechanism between text compression and quality verification. Therefore, it is necessary to address the issue of generating quality-verifiable structured patient profile reports based on document source tags and paragraph priority scoring sequences, specifically for scenarios where patient medical document text recognition has limited text length. Summary of the Invention

[0005] To address the above problems, this invention provides a method and system for generating patient profile reports based on medical priority scoring. This method solves the problem of how to generate quality-verifiable structured patient profile reports based on document source tags and paragraph priority scoring sequences through text compression and segmented summarization, in scenarios where the length of text recognition data in patient medical documents is limited.

[0006] To address the aforementioned technical problems, this invention provides a method for generating patient profile reports based on medical priority scoring, comprising:

[0007] S100: Obtain the patient's medical document text recognition text and document source marker; perform source normalization and paragraph division on the patient's medical document text recognition text according to the document source marker, file boundary and paragraph boundary, and generate a paragraph set with source index;

[0008] S200. Based on the set of paragraphs with source index, identify medical keywords, medical numerical features, patient identity information and paragraph length features in each paragraph, score the medical priority of each paragraph, and generate a paragraph priority score sequence.

[0009] S300. Based on the paragraph priority scoring sequence and the document source marker, perform cross-file deduplication, low-priority content removal and priority sorting extraction on the text of the patient's medical document. The extracted paragraphs are rearranged according to their original positions to generate compressed text.

[0010] S400. When the compressed text meets the segmentation triggering condition, based on the compressed text and the document source mark, a set of segmented texts is generated according to the file boundary or semantic boundary, and a structured key information summary is extracted from each segmented text to generate a set of segmented summaries.

[0011] S500: Generate a structured patient profile report based on the segmented summary set and the structured report template; perform output quality verification on the structured patient profile report and generate a report quality label; when the report quality label indicates that the output quality is unqualified, perform adaptive retry based on the quality deviation value and output the retried structured patient profile report or low-quality report label.

[0012] Furthermore, the document source marker includes file number, file type, page number information, and paragraph position; the source normalization includes establishing a correspondence between the file number, file type, page number information, and paragraph position and the paragraph text to generate the paragraph set with source index.

[0013] Furthermore, the medical priority scoring of each paragraph includes: matching high-priority medical keywords, matching medium-priority medical keywords, detecting medical numerical features, detecting patient identity information, and correcting paragraph length for each paragraph. The matching results, detection results, and correction results are then summarized to generate a paragraph medical priority score for each paragraph.

[0014] Furthermore, the high-priority medical keywords include diagnostic keywords, treatment keywords, prescription keywords, medical order keywords, and medical history keywords; the medium-priority medical keywords include examination keywords, laboratory keywords, indicator keywords, and abnormality marker keywords; the medical numerical features include numerical expressions with units of measurement, laboratory indicator values, dosage values, percentages, and reference ranges.

[0015] Furthermore, the cross-file deduplication includes: based on the document source marker, counting duplicate text lines and duplicate paragraphs in multiple files, removing redundant copies of duplicate text lines and duplicate paragraphs that have a frequency that reaches a preset duplication threshold and do not contain high-priority medical keywords, and generating deduplicated text.

[0016] Furthermore, the removal of low-priority content includes: removing page number lines, separator lines, consecutive blank lines, and template headers and footers from the deduplicated text to generate text after removing low-priority content.

[0017] Furthermore, the priority sorting extraction includes: selecting candidate retention paragraphs from high to low according to the medical priority score of each paragraph in the paragraph priority scoring sequence, until the cumulative text length of the candidate retention paragraphs reaches the target length budget; rearranging the candidate retention paragraphs according to their original positions; when the length of the rearranged text exceeds the target length budget, performing intelligent truncation according to the retention strategy of the head, key middle and tail, to generate the compressed text.

[0018] Furthermore, the segmentation triggering condition includes the compressed text length exceeding a compression triggering threshold; the generation of segmented text sets according to file boundaries or semantic boundaries includes: when the compressed text corresponds to multiple document sources, generating the segmented text set according to the file boundaries; when the length of a single file text exceeds the segment summary character budget, generating the segmented text set according to semantic boundaries; when the segmented text summary extraction fails, retaining a preset fragment of the segmented text as a substitute summary.

[0019] Further, the output quality verification includes: extracting the response character length ratio, key field completeness rate, and structural validity index of the structured patient profile report to generate an output quality characterization factor; generating the quality deviation value based on the difference between the output quality characterization factor and the output quality characterization factor threshold; generating a retry strategy level according to the quality deviation value, and performing a retry with the same parameters, an input reduction retry, or a simplified prompt retry according to the retry strategy level; when the retried structured patient profile report still indicates unqualified output quality, outputting the low-quality report mark.

[0020] This invention also provides a patient profile report generation system based on medical priority scoring, comprising:

[0021] The text receiving module is used to acquire the text of the patient's medical documents and the document source markers;

[0022] The source index module, connected to the text receiving module, is used to perform source normalization and paragraph division on the patient's medical document text recognition text according to the document source mark, file boundary and paragraph boundary, and generate a paragraph set with source index;

[0023] The medical priority scoring module, connected to the source index module, is used to identify medical keywords, medical numerical features, patient identity information and paragraph length features in each paragraph based on the paragraph set with source index, to score the medical priority of each paragraph, and generate a paragraph priority scoring sequence.

[0024] The text compression module, connected to the medical priority scoring module, is used to perform cross-file deduplication, low-priority content removal, and priority sorting extraction on the text of the patient's medical document based on the paragraph priority scoring sequence and the document source mark. The extracted paragraphs are rearranged according to their original positions to generate compressed text.

[0025] The segmented summary extraction module, connected to the text compression module, is used to generate a set of segmented texts based on the compressed text and the document source mark, according to the file boundary or semantic boundary, when the compressed text meets the segmentation triggering condition, and to extract structured key information summaries from each segmented text to generate a set of segmented summaries.

[0026] The report fusion generation module is connected to the segmented summary extraction module and is used to generate a structured patient profile report based on the segmented summary set and the structured report template.

[0027] The response quality verification module is connected to the report fusion generation module and is used to perform output quality verification on the structured patient profile report and generate report quality labels.

[0028] An adaptive retry control module, connected to the response quality verification module, is used to perform adaptive retry based on the quality deviation value when the report quality label indicates that the output quality is unqualified, and output the retried structured patient profile report or low-quality report label.

[0029] The innovative aspects of this invention include:

[0030] (1) The paragraph set with source index formed by document source markup, file boundary and paragraph boundary is combined with the paragraph medical priority score of medical keywords, medical numerical features, patient identity information and paragraph length features to form a paragraph priority score sequence that can be called by subsequent text compression.

[0031] (2) The paragraph priority scoring sequence and document source mark are used together as the basis for text compression. After cross-file deduplication, removal of low-priority content and priority sorting extraction, the extracted paragraphs are rearranged according to their original positions to form compressed text.

[0032] (3) Connect the segmentation trigger conditions, file boundary or semantic boundary segmentation, structured key information summary extraction and structured report template mapping of the compressed text, and control adaptive retry through report quality labels and quality deviation values ​​to form a quality verification link for structured patient profile reports.

[0033] Beneficial effects

[0034] (1) This invention forms a paragraph priority scoring sequence by using a paragraph set with source index and a paragraph medical priority score, so that subsequent text compression has a clear paragraph selection basis. In the case of large differences in the information value of different paragraphs in multi-source medical document text recognition text, it reduces the situation of mixing key paragraphs with low-value template text and prioritizes the retention of high-value content such as diagnostic conclusions, medication information, and examination results.

[0035] (2) This invention overcomes the technical defects of existing fixed truncation and general deduplication that easily destroy the source relationship and paragraph order of medical documents by jointly constraining cross-file deduplication, low-priority content removal, priority sorting extraction and original text position rearrangement through paragraph priority scoring sequence and document source markup. This invention preserves the source relationship and original text order of medical documents in the compressed text and supports the structured integration of multi-source documents.

[0036] (3) The present invention forms a set of segmented summaries through file boundaries or semantic boundaries, and performs hierarchical adaptive retry (same parameter retry, input reduction retry, prompt simplification retry) based on report quality labels and quality deviation values, so that the structured patient profile report has a corresponding regeneration path when the field integrity, response length and structural legality are abnormal, which significantly improves the robustness and report quality of the system in the scenario of ultra-long multi-source medical documents.

[0037] (4) The present invention uses a replacement summary degradation mechanism to retain the original text preset fragments as replacement summaries when segmented summary extraction fails (model call failure, empty output, structure cannot be parsed or summary length is lower than the lower limit), thus avoiding the problem of losing key information of the entire report due to the failure of local summary.

[0038] (5) This invention preserves the complete file boundaries and paragraph position relationships during text compression and segmentation summarization by using document source marking and source indexing mechanisms, so that the structured patient profile report can distinguish diagnostic information and examination results from different document sources and avoid confusion of multi-source information.

[0039] (6) The present invention provides a traceable failure cause location for subsequent manual review or the next round of system processing through the association and storage mechanism of low quality report mark with quality deviation value and retry strategy level, thereby improving the maintainability and auditability of the system. Attached Figure Description

[0040] Figure 1 A flowchart illustrating a method for generating patient profile reports based on medical priority scoring, provided in an embodiment of this application;

[0041] Figure 2 This is a structural block diagram of a patient profile report generation system based on medical priority scoring, provided in an embodiment of this application. Detailed Implementation

[0042] To enable those skilled in the art to better understand the technical solution, the present invention will be described in detail below with reference to embodiments. The description in this part is only exemplary and explanatory, and should not be used to limit the scope of protection of the present invention in any way.

[0043] Example 1: Refer to Figure 1 This is a flowchart illustrating a method for generating patient profile reports based on medical priority scoring, provided by an embodiment of the present invention. The process may include at least steps S100-S500:

[0044] S100: Obtain the patient's medical document text recognition text and document source marker; perform source normalization and paragraph division on the patient's medical document text recognition text according to the document source marker, file boundary and paragraph boundary, and generate a paragraph set with source index;

[0045] S200. Based on the set of paragraphs with source index, identify medical keywords, medical numerical features, patient identity information and paragraph length features in each paragraph, score the medical priority of each paragraph, and generate a paragraph priority score sequence.

[0046] S300. Based on the paragraph priority scoring sequence and the document source marker, perform cross-file deduplication, low-priority content removal and priority sorting extraction on the text of the patient's medical document. The extracted paragraphs are rearranged according to their original positions to generate compressed text.

[0047] S400. When the compressed text meets the segmentation triggering condition, based on the compressed text and the document source mark, a set of segmented texts is generated according to the file boundary or semantic boundary, and a structured key information summary is extracted from each segmented text to generate a set of segmented summaries.

[0048] S500: Generate a structured patient profile report based on the segmented summary set and the structured report template; perform output quality verification on the structured patient profile report and generate a report quality label; when the report quality label indicates that the output quality is unqualified, perform adaptive retry based on the quality deviation value and output the retried structured patient profile report or low-quality report label.

[0049] S100: Obtain the patient's medical document text recognition text and document source marker; perform source normalization and paragraph division on the patient's medical document text recognition text according to the document source marker, file boundaries, and paragraph boundaries; and generate a paragraph set with source index:

[0050] After the patient profile report generation system receives a medical document processing request, the text receiving module reads the text recognition results and document source markers from the patient's medical document. The text recognition results are derived from the text recognition results of scanned copies, photographs, or electronic medical documents. The document source markers indicate the file, file type, page number, and paragraph position of the text. Instead of directly concatenating multiple texts into a single long text, the system first preserves the source relationships of each text segment to avoid losing file boundaries during subsequent compression and segmentation summarization.

[0051] After receiving the patient's medical document text from the text receiving module, the source index module first normalizes the file number and file type of each document. If the same patient uploads outpatient medical records, examination reports, laboratory reports, prescriptions, and discharge summaries, the system establishes document source tags according to the upload batch, file name, or file type identifier. If a document lacks a file type, the system retains the document's file number and page number information, and sets the file type to an unmarked state. This state does not participate in medical priority scoring, but it will be passed to subsequent steps along with the paragraph source index.

[0052] During paragraph segmentation, the source index module first segments the patient's medical document text based on file boundaries, and then forms paragraph text within the same file based on paragraph boundaries. Paragraph boundaries can be formed by line breaks, heading separators, page number boundaries, table recognition boundaries, or semantic pauses. In one implementation, consecutive blank lines and obvious page number lines are not directly included in the scoring as valid paragraphs, but their position is preserved during the paragraph segmentation stage for S300 to remove low-priority content. For line breaks that occur during text recognition, the system merges adjacent short lines within the same page; the merging criteria are that adjacent short lines are within the same file number and page number information, and that no period, colon, or item end marker appears at the end of the line.

[0053] When a continuous paragraph spans multiple pages within the same file, the source index module does not simply cut the text according to page numbers. Instead, it connects the paragraphs based on their position and sentence-end markers. If the text at the end of the previous page does not form a complete semantic unit, and the text at the beginning of the next page does not contain a new heading or item name, the two parts of text are merged into a single paragraph, and both page numbers are retained in the source index. This resulting paragraph is processed as a single object during subsequent scoring, but the original file and page number position can still be traced back to in the report generation processing record.

[0054] In the collection of paragraphs with source indexes, each paragraph object contains paragraph text, file number, file type, page number information, and paragraph position. These are not simply record fields; the paragraph text is processed in S200 for medical keyword and numerical feature identification; the file number and file type are processed in S300 for cross-file deduplication; and the page number information and paragraph position are rearranged in their original positions in S300 and participate in file boundary segmentation in S400. If a paragraph is empty or contains only whitespace characters, the source index module marks it as an invalid paragraph, and invalid paragraphs are not included in the S200 scoring.

[0055] S200. Based on the set of paragraphs with source index, identify medical keywords, medical numerical features, patient identity information and paragraph length features in each paragraph, score the medical priority of each paragraph, and generate a paragraph priority score sequence.

[0056] After receiving the collection of paragraphs with source indices generated by S100, the medical priority scoring module scores the paragraph text as the scoring object and uses the source index as an auxiliary constraint. The scoring process does not prioritize the overall patient status; instead, it calculates a medical priority score for each paragraph in the medical document. This score is used in the subsequent compression stage to select the text retention order. Therefore, before scoring, the system filters out invalid paragraphs marked by S100 and retains the position of each valid paragraph.

[0057] When scoring a single paragraph, the medical priority scoring module first performs medical keyword matching. Medical keywords are divided into high-priority and medium-priority medical keywords based on their information value. High-priority medical keywords include diagnostic keywords, treatment keywords, prescription keywords, medical order keywords, and medical history keywords; medium-priority medical keywords include examination keywords, test keywords, indicator keywords, and abnormality marker keywords. During matching, the system uses the paragraph text as the matching scope and employs a combination of term matching and phrase matching to count the hit results. When the same keyword appears repeatedly in the same paragraph, it can be counted as one hit, or it can be accumulated within a preset limit, the specific rules of which are configured by the medical keyword database.

[0058] Medical numerical feature detection is performed after keyword matching. Medical numerical features include numerical expressions with units of measurement, test indicator values, dosage values, percentages, and reference ranges. During detection, the medical priority scoring module reads the numbers, units, and contextual keywords in the paragraph to identify, for example, drug dosages, test results, imaging measurements, positive rates, and reference intervals. If a paragraph contains only numbers without medical units or medical indicator names, the system does not directly record it as a medical numerical feature but retains it as plain numerical text. This processing reduces interference from page numbers, serial numbers, or dates on paragraph scoring.

[0059] Patient identification information detection is used to identify name, gender, age, hospital number, outpatient number, and patient ID. The detection results are primarily used to retain paragraphs that can confirm patient identity or document ownership. If patient identification information differs between different files, the medical priority scoring module does not merge or correct the identification information in this step; instead, it adds an identity conflict status to the paragraphs with discrepancies. This status is entered into S300 along with the paragraph priority scoring sequence. S300 will not directly delete paragraphs with identity conflict statuses due to duplication during text retention.

[0060] Paragraph length features are used to correct for biases caused by keyword and numerical detection. Paragraphs that are too short may only contain titles, page numbers, or fragmented information; even if a single keyword is hit, a high score should not be awarded solely based on that hit. Paragraphs that are too long may contain complete medical histories, examination descriptions, or medical orders; their information content needs to be preserved during scoring. In one implementation, the system categorizes paragraph length into short, regular, and long paragraphs, applying a deduction to short paragraphs and a bonus to long paragraphs. If a long paragraph contains no medical keywords or numerical features, it will not be included in the high-scoring paragraph category solely based on its length.

[0061] The medical priority score for each paragraph is formed by summarizing the results of medical keyword matching, medical numerical feature detection, patient identity information detection, and paragraph length correction. The medical priority scoring module preserves the original order of paragraphs by position and simultaneously establishes a sorting index based on the score, generating a paragraph priority score sequence. This sequence includes a paragraph identifier, the paragraph's medical priority score, and a source index reference relationship. When the S300 calls this sequence, it does not need to re-identify keywords; instead, it directly performs cross-file deduplication, low-priority content removal, and priority sorting extraction based on the score and source index.

[0062] S300. Based on the paragraph priority scoring sequence and the document source marker, perform cross-file deduplication, low-priority content removal, and priority sorting extraction on the patient's medical document text. The extracted paragraphs are rearranged according to their original positions to generate compressed text.

[0063] After receiving the paragraph priority score sequence output by S200, the multi-stage text compression module first reads the source index and medical priority score of each paragraph. The triggering condition for this step can be given by the text length control parameter, such as when the total length of the patient's medical document text recognition exceeds the maximum input character threshold, or when the system configuration requires compression of multi-source medical documents. The compression process is not a one-time truncation of the entire text, but rather performed in the following order: cross-file deduplication, removal of low-priority content, priority-ordered extraction, and rearrangement of the original text positions.

[0064] In one specific implementation, the system's preset compression parameters include: a maximum input character threshold of 96,000 characters (approximately 72,000 tokens, corresponding to the common length of a medium-sized medical record document set), a target length budget of 80,000 characters, a compression trigger threshold of 120,000 characters, a segment summary character budget of 24,000 characters, a maximum output token count for segment summaries of 8,192, and a maximum output token count for the final report generation of 32,768. During the intelligent truncation stage, the header retention rate is 35%, the key middle section retention rate is 35%, the tail retention rate is 25%, and the remaining 5% budget is used for scaling margin. These parameters are configured based on the aggregated length distribution of multiple electronic medical records, examination reports, prescription records, and discharge records, as well as the input context window (typically 128K~200K tokens) of current mainstream large language models (such as DeepSeek, GLM, Qwen, etc.), and can be adjusted according to the actual deployed model specifications and document size.

[0065] During cross-file deduplication, the multi-stage text compression module counts duplicate text lines and paragraphs across multiple files based on document source tags. For duplicate text lines, the system first compares the standardized text content and then combines file number and paragraph position to count the frequency of occurrence. If the frequency of a duplicate text line or paragraph reaches a preset duplication threshold, and the duplicate content does not contain high-priority medical keywords, redundant copies are removed, and only the first occurrence or the earliest source copy is retained. If the duplicate content contains high-priority medical keywords related to diagnosis, prescription, medical orders, or medical history, the system retains copies from different sources and uses this duplication status as a source reference for subsequent report fusion.

[0066] Low-priority content removal is performed based on the deduplicated text. The multi-stage text compression module identifies page number lines, separator lines, consecutive blank lines, and template headers and footers from the deduplicated text. Page number lines typically consist of page numbers, page number markers, or fixed page number formats; separator lines typically consist of consecutive horizontal lines, consecutive symbols, or residual characters from table borders; template headers and footers can be identified from text that appears frequently in the same or multiple files and has a low paragraph priority score. When removing the above content, the system retains its original paragraph position and prevents this text from being included in the priority sorting and extraction.

[0067] The priority sorting and extraction stage primarily relies on the paragraph priority score sequence. The multi-stage text compression module selects candidate paragraphs to be retained based on their medical priority scores from highest to lowest, and accumulates the text length of the candidate paragraphs. When the accumulated text length reaches the target length budget, the selection of lower-scoring paragraphs stops. If multiple paragraphs have the same score, the system prioritizes retaining paragraphs containing medical numerical features, patient identity information, or high-priority medical keywords. If the above conditions are still the same, the paragraph that appears earlier in the original text is added to the candidate paragraph set.

[0068] After the candidate paragraphs are selected, the multi-stage text compression module does not directly output the text in the order of the score ranking. Instead, it rearranges the original text positions based on the file number, page number, and paragraph position of each candidate paragraph. After rearrangement, paragraphs within the same file maintain their original order, while different files are arranged according to the file order in the document source tags. The resulting text retains the paragraphs with higher scores while maintaining the basic narrative order of the medical document. The S400 can continue to use source relationships when segmenting according to file boundaries or semantic boundaries.

[0069] If the length of the rearranged text still exceeds the target length budget, the multi-stage text compression module performs intelligent truncation. Intelligent truncation processes the rearranged text according to a strategy that preserves the header, key middle section, and footer. The header area typically contains patient identification information and document introductory notes; the key middle section consists of paragraphs containing high-priority medical keywords and medical numerical features; the footer area typically contains conclusions, opinions, suggestions, or medical orders. The system truncates these areas according to a preset ratio or a preset character budget, prioritizing stopping at paragraph boundaries; if stopping at a paragraph boundary is not possible, a truncation marker is retained. The final compressed text, along with the paragraph source index, is then passed to S400.

[0070] S400. When the compressed text meets the segmentation triggering condition, based on the compressed text and the document source marker, a set of segmented texts is generated according to file boundaries or semantic boundaries, and a structured key information summary is extracted from each segmented text to generate a set of segmented summaries:

[0071] After receiving the compressed text generated by S300, the segmented summary extraction module first reads the text length and source index of the compressed text. Segmentation triggering conditions include the compressed text length exceeding a compression triggering threshold. If the compressed text does not exceed the compression triggering threshold, in one implementation, the system treats the compressed text as a single segmented text and enters the summary extraction process, forming a set of segmented summaries containing a structured key information summary; if the compressed text exceeds the compression triggering threshold, it enters file boundary or semantic boundary segmentation processing.

[0072] When compressed text corresponds to multiple document sources, the segmented summary extraction module prioritizes generating segmented text sets according to file boundaries. File boundaries are determined by the file number and file type in the document source marker. Segments belonging to the same file number are grouped into the same segment; if the text length of the same file exceeds the segment summary character limit, it is further segmented within that file according to semantic boundaries. Semantic boundaries can be formed by paragraph titles, report item names, examination item separators, time points in medical records, or the position of conclusion paragraphs. The system avoids assigning the same test item name, result value, and reference range to different segments during segmentation.

[0073] When the compressed text corresponds to only one document source, but the text length still exceeds the segment summary character budget, the segment summary extraction module generates a set of segmented texts according to semantic boundaries. For medical records, semantic boundaries can be formed by the chief complaint, present illness, past medical history, treatment process, medication records, and medical advice; for examination or test reports, semantic boundaries can be formed by the examination items, test items, results, conclusions, and opinions. In one implementation, if stable semantic boundaries cannot be identified, the system divides the text into multiple segments according to paragraph position, and retains the file number and paragraph position at the beginning of each segment, so that the source of the summary can be identified when subsequent reports are merged.

[0074] Structured key information summary extraction uses segmented text as the processing unit. The segmented summary extraction module reads the patient's basic information, medical history, examination and test results, medication and treatment information, conclusions and recommendations, and key medical points from the segmented text according to the structured summary fields. For segments containing medical numerical features, the summary extraction retains the indicator name, value, unit, and anomaly marker; for segments containing prescriptions or medical orders, the summary extraction retains the drug name, dosage, usage, and dosage. If a segmented text does not contain a certain summary field, the system retains that field as an empty field and does not use other segmented content to fill it.

[0075] When the extraction of a summary from a text segment fails, the segment extraction module does not discard that segment. The system retains a preset fragment of that segment as a replacement summary and associates this replacement summary with the original segment's file number, page number information, and paragraph position. Extraction failures include model call failure, empty output, unparseable output structure, or summary length falling below a preset lower limit. After the replacement summary enters the segment summary set, it is marked as summary content requiring source verification during the S500 report fusion process.

[0076] The segmented summary set consists of multiple structured key information summaries, each retaining the corresponding document source tag and segmentation order. This set is not a simple list of summary texts, but rather a direct input to the subsequent report fusion generation module. The S500 will perform template mapping based on the field names, source relationships, and field statuses in the segmented summary set, and will invoke source tags and summary statuses for handling in case of field conflicts or missing fields.

[0077] S500. Generate a structured patient profile report based on the segmented summary set and the structured report template; perform output quality verification on the structured patient profile report and generate a report quality label; when the report quality label indicates that the output quality is unqualified, perform adaptive retry based on the quality deviation value and output the retried structured patient profile report or low-quality report label:

[0078] After receiving the segmented summary set output by the S400, the report fusion generation module reads the structured report template. The structured report template specifies the field organization method for the structured patient profile report. Fields may include basic patient information, medical history, examination and test results, medication and treatment information, conclusions and recommendations, and key medical points. The report fusion generation module maps the structured key information summaries from the segmented summary set to the structured report template according to field names. When the same field comes from multiple segments, the system merges them according to document source tags, segment order, and whether the field is not empty.

[0079] During report fusion, the patient basic information field prioritizes reading the segmented summary containing patient identity information. If patient identity information is consistent across multiple document sources, it is merged into the same patient basic information. If there are inconsistencies in name, age, hospital number, outpatient number, or patient ID, the system does not automatically overwrite the earlier source field but retains the conflicting field and its source marker in the structured patient profile report. Examination and test results fields are merged by item name; fields containing numerical values ​​and units retain the numerical value, unit, and anomaly marker. Medication and treatment information fields are merged by drug name, dosage, and usage. Conclusion and recommendation fields are organized according to the order of document source.

[0080] After the structured patient profile report is generated, the response quality verification module performs output quality verification on the report. Output quality verification includes the response character length ratio, key field completeness rate, and structural validity index. The response character length ratio is calculated by comparing the actual character length of the structured patient profile report with the preset minimum valid response character length; the key field completeness rate is calculated by comparing the number of non-empty key fields with the number of key fields in the structured report template; the structural validity index is obtained by determining whether the report can be parsed into a preset structured object. In one implementation, the structured object uses an object representation format to carry fields and values; if parsing fails, the structural validity index is marked as unqualified.

[0081] The response quality verification module generates output quality characterization factors based on the response character length ratio, key field completeness rate, and structural validity indicators. It then calculates the difference between the output quality characterization factor and its threshold to obtain a quality deviation value. If the output quality characterization factor reaches the threshold, the report quality label indicates that the output quality is acceptable, and the structured patient profile report is output as the final report. If the output quality characterization factor is below the threshold, the report quality label indicates that the output quality is unacceptable, and the quality deviation value is sent to the adaptive retry control module.

[0082] The adaptive retry control module generates a retry strategy level based on the quality deviation value. When the quality deviation value is small, the system performs a retry with the same parameters, that is, it regenerates the structured patient profile report using the segmented summary set and the structured report template. When the quality deviation value is in the middle range, the system performs an input reduction retry, that is, it prioritizes retaining summary fields containing high-priority medical keywords, medical numerical features, and patient identity information from the segmented summary set, and reduces the input of low-priority empty fields. When the quality deviation value is large, the system performs a prompt-simplified retry, that is, it reduces the complexity of the report generation constraints, retains the key fields in the structured report template, and re-calls the report fusion generation module to generate the report.

[0083] The retried structured patient profile report re-enters the response quality verification module. If the retried report quality label indicates that the output quality is acceptable, the retried structured patient profile report is output; if the number of retries reaches the preset upper limit (set to 3 times in one implementation) and the retried structured patient profile report still indicates that the output quality is unacceptable, a low-quality report mark is output. The low-quality report mark is associated with the report quality label, quality deviation value, and the retry strategy level already executed. Subsequent manual review or the next round of system processing can use this mark to locate the reason for the unacceptable output quality. This mark does not change the paragraph source index, compressed text, and segmented summary set already formed in S100 to S400.

[0084] Example 2: Figure 2 This diagram illustrates a structural block diagram of a patient profile report generation system based on medical priority scoring according to an embodiment of the present invention. Figure 2 As shown, the structure may include:

[0085] The text receiving module 01 is used to acquire the text of the patient's medical documents and document source tags. After the system receives a request to generate a patient profile report, the text receiving module reads the text of the patient's medical documents from the medical document upload interface, medical document management system, or text recognition service, and simultaneously reads the document source tags corresponding to each medical document. The text of the patient's medical documents includes text content formed by text recognition from medical records, examination reports, test reports, prescription records, imaging reports, or discharge records. The document source tags are used to indicate the file number, file type, page number information, and paragraph position to which the text belongs. In the case of multiple medical documents uploaded by the same patient at one time, the text receiving module does not directly merge the texts into a single text, but maintains an independent source relationship for each text according to the order of file reception, so that subsequent modules have a source basis to call when performing source unification, cross-file deduplication, and file boundary segmentation. When the text of a medical document is empty, the document number is missing, or the page number information is incomplete, the text receiving module retains the read text content and the existing source markers, and adds an anomaly marker to the missing items; the input containing the anomaly markers is still passed to the source index module, which processes it when dividing paragraphs and unifying sources.

[0086] Source index module 02, connected to the text receiving module, is used to perform source normalization and paragraph division on the patient medical document text recognition based on the document source marker, file boundaries, and paragraph boundaries, generating a set of paragraphs with source indexes. After receiving the patient medical document text recognition and document source markers output by the text receiving module, the source index module first distinguishes different document sources based on file number and file type, and then identifies paragraph boundaries within the same document source based on page number information, line break markers, title separators, table boundaries, or semantic pause positions. For line-break text generated by text recognition, the source index module merges adjacent short lines by combining paragraph position and sentence end markers. When the text at the end of the previous page does not form a complete semantic unit and the text at the beginning of the next page does not contain a new title or item name, the cross-page text is merged into the same paragraph, and the corresponding page number information is retained in the source index. Each paragraph object in the paragraph set with source index retains the paragraph text, file number, file type, page number information, and paragraph position. The paragraph text is processed by the medical priority scoring module for keyword and numerical feature recognition; the file number and file type are processed by the text compression module for cross-file deduplication; and the page number information and paragraph position are processed by the text compression module for rearrangement of the original text positions. If the paragraph text contains only whitespace characters, page number symbols, or unresolved fragments, the source index module adds an invalid paragraph mark to the paragraph, and invalid paragraphs are not considered for medical priority scoring.

[0087] The medical priority scoring module 03, connected to the source index module, is used to identify medical keywords, medical numerical features, patient identity information, and paragraph length features in each paragraph based on the paragraph set with source indexes, and to score the medical priority of each paragraph, generating a paragraph priority scoring sequence. After reading the paragraph set with source indexes, the medical priority scoring module uses the paragraph text of valid paragraphs as the scoring object and calls the medical keyword library, medical numerical feature recognition rules, and patient identity information recognition rules to extract paragraph features. For medical keywords, the medical priority scoring module matches them according to high-priority and medium-priority medical keywords; high-priority medical keywords include diagnostic keywords, treatment keywords, prescription keywords, medical order keywords, and medical history keywords, while medium-priority medical keywords include examination keywords, laboratory keywords, indicator keywords, and abnormality marker keywords. For medical numerical features, the medical priority scoring module identifies numerical expressions with units of measurement, laboratory indicator values, dosage values, percentages, and reference ranges within the paragraph text; numerical expressions that only appear as ordinary numbers, dates, or page numbers but lack medical units, medical indicator names, or contextual medical terms are not included in the scoring as medical numerical features.

[0088] After completing keyword matching and numerical feature detection within the same paragraph, the medical priority scoring module continues to read patient identity information and paragraph length features. Patient identity information includes name, gender, age, hospital number, outpatient number, and patient ID. When inconsistent patient identity information appears in different document sources, the medical priority scoring module does not overwrite existing identity fields but instead adds an identity conflict status to the corresponding paragraph. Paragraph length features are used to correct excessively short and long paragraphs. Excessively short paragraphs typically appear as titles, page numbers, or fragmented identification information, while excessively long paragraphs typically contain continuous medical history, examination descriptions, or medical orders. The medical priority scoring module summarizes the medical keyword matching results, medical numerical feature detection results, patient identity information detection results, and paragraph length correction results into a paragraph medical priority score and generates a paragraph priority score sequence according to the paragraph source index. This paragraph priority score sequence is provided to the text compression module to control the order in which text is retained during subsequent cross-file deduplication, low-priority content removal, and priority-based extraction.

[0089] The text compression module 04, connected to the medical priority scoring module, is used to perform cross-file deduplication, low-priority content removal, and priority sorting extraction on the text of the patient's medical documents based on the paragraph priority scoring sequence and the document source marker. The extracted paragraphs are rearranged according to their original positions to generate compressed text. After receiving the paragraph priority scoring sequence, the text compression module simultaneously reads the file number, file type, and paragraph position from the document source marker. During cross-file deduplication, the text compression module counts duplicate text lines and paragraphs from multiple document sources based on the file number. For duplicate text lines and paragraphs that have a frequency reaching a preset duplication threshold and do not contain high-priority medical keywords, redundant copies are removed, and the text that appears for the first time or has a relatively early source position is retained. For duplicate content containing keywords related to diagnosis, treatment, prescription, medical orders, or medical history, the text compression module retains text copies from different document sources, enabling the subsequent report fusion generation module to identify the source relationship of this content in different medical documents.

[0090] After cross-file deduplication, the text compression module removes low-priority content from the deduplicated text. Low-priority content includes page number lines, delimiter lines, consecutive blank lines, and template headers and footers. For header / footer or template description text, the text compression module identifies content based on repetition frequency, paragraph medical priority score, and source location. If this type of text also contains high-priority medical keywords, it is not removed as low-priority content but instead enters the candidate retention paragraph sorting process. During priority sorting extraction, the text compression module selects candidate retention paragraphs from high to low according to the paragraph medical priority score of each paragraph in the paragraph priority score sequence until the cumulative text length of the candidate retention paragraphs reaches the target length budget. The selected candidate retention paragraphs are not directly output according to the score order but are rearranged according to the original document order, page number information, and paragraph position. If the rearranged text length still exceeds the target length budget, the text compression module performs intelligent truncation according to the retention strategy of the header, key middle, and tail, generating compressed text. The compressed text, along with the document source mark, is passed to the segmented summary extraction module.

[0091] The segmented summary extraction module 05, connected to the text compression module, is used to generate a set of segmented texts based on the compressed text and the document source marker, according to file boundaries or semantic boundaries, when the compressed text meets the segmentation triggering conditions. It then extracts structured key information summaries from each segmented text to generate a segmented summary set. After receiving the compressed text output by the text compression module, the segmented summary extraction module first reads the text length and source index of the compressed text. When the text length of the compressed text exceeds the compression triggering threshold, the segmented summary extraction module enters segmentation processing. When the compressed text does not exceed the compression triggering threshold, in one embodiment, the compressed text is used as a single segmented text to extract structured key information summaries. For compressed texts corresponding to multiple document sources, the segmented summary extraction module prioritizes forming a set of segmented texts according to file boundaries. For cases where the text length of a single file exceeds the segment summary character budget, the file is further segmented according to semantic boundaries, which are determined by the medical record title, examination items, test items, report conclusions, medical advice, or paragraph relationships.

[0092] When extracting structured key information summaries from each segment of text, the segment summary extraction module reads the patient's basic information, medical history, examination and test results, medication and treatment information, conclusions and recommendations, and key points of medical treatment according to the structured summary fields. Segment texts containing medical numerical features retain the indicator name, value, unit, and anomaly marker; segment texts containing prescriptions or medical orders retain the drug name, dosage, usage, and quantity. If the extraction of a segment text fails, the segment summary extraction module retains a preset fragment of that segment text as a substitute summary and associates this substitute summary with the original segment's file number, page number, and paragraph position. The structured key information summaries formed from each segment text constitute a segment summary set, which is then passed to the report fusion generation module and used as input for the structured report template mapping.

[0093] The report fusion generation module 06, connected to the segmented summary extraction module, is used to generate a structured patient profile report based on the segmented summary set and the structured report template. After receiving the segmented summary set, the report fusion generation module reads the field structure from the structured report template and maps the structured key information summaries from the segmented summary set to the template positions according to the field names. The patient basic information field prioritizes the summaries containing patient identity information; the examination and test results field is grouped by item name, value, unit, and abnormality marker; the medication and treatment information field is grouped by drug name, dosage, usage, and dosage; and the conclusion and suggestion field is organized according to the document source order. For similar fields appearing in multiple segmented summaries, the report fusion generation module merges them based on the document source marker and segment order. For fields with conflicting patient identity information, examination conclusions, or medication information, the original fields are not automatically overwritten; instead, the conflicting fields and their source markers are retained. After the structured patient profile report is generated, it is transmitted to the response quality verification module for subsequent output quality verification.

[0094] The response quality verification module 07, connected to the report fusion generation module, is used to perform output quality verification on the structured patient profile report and generate a report quality label. After receiving the structured patient profile report, the response quality verification module performs field and structure verification on the report content according to the structured report template. Output quality verification includes response character length ratio, key field completeness rate, and structure validity index. The response character length ratio is formed by comparing the actual character length of the structured patient profile report with the preset minimum effective response character length; the key field completeness rate is formed by comparing the number of non-empty key fields with the number of key fields in the structured report template; the structure validity index is formed based on whether the structured patient profile report can be parsed into a preset structured object. If the structured patient profile report has missing fields, failed structure parsing, or a response character length lower than the preset minimum effective response character length, the response quality verification module generates a report quality label indicating unqualified output quality and transmits the report quality label and the corresponding quality deviation value to the adaptive retry control module. If the verification result meets the output quality requirements, the response quality verification module outputs the report quality label indicating qualified output quality along with the structured patient profile report.

[0095] The adaptive retry control module 08, connected to the response quality verification module, is used to perform adaptive retry based on the quality deviation value when the report quality label indicates that the output quality is unqualified, and outputs a retried structured patient profile report or a low-quality report marker. After receiving the report quality label and quality deviation value from the response quality verification module, the adaptive retry control module generates a retry strategy level based on the quality deviation value. When the quality deviation value is in a small range, the adaptive retry control module calls the report fusion generation module to perform a retry with the same parameters; when the quality deviation value is in an intermediate range, it performs an input reduction retry based on the segmented summary set, retaining the summary fields containing high-priority medical keywords, medical numerical features, and patient identity information; when the quality deviation value is in a large range, it performs a simplified retry with prompts, retaining the key fields in the structured report template and regenerating the structured patient profile report. The retried structured patient profile report re-enters the response quality verification module for output quality verification. If the report quality label after the retry indicates that the output quality is qualified, the adaptive retry control module outputs the retried structured patient profile report; if the output quality is still unqualified after the number of retries reaches the preset upper limit, the adaptive retry control module outputs a low-quality report mark and saves the low-quality report mark in association with the quality deviation value and the level of the retry strategy already executed.

Claims

1. A method for generating patient profile reports based on medical priority scoring, characterized in that, include: S100: Obtain the patient's medical document text recognition text and document source marker; perform source normalization and paragraph division on the patient's medical document text recognition text according to the document source marker, file boundary and paragraph boundary, and generate a paragraph set with source index; S200. Based on the set of paragraphs with source indexes, perform high-priority medical keyword matching, medium-priority medical keyword matching, medical numerical feature detection, patient identity information detection, and paragraph length correction; based on the matching results, detection results, and correction results, score the medical priority of each paragraph and generate a paragraph priority score sequence. The high-priority medical keywords include diagnostic keywords, treatment keywords, prescription keywords, medical order keywords, and medical history keywords; the medium-priority medical keywords include examination keywords, laboratory test keywords, indicator keywords, and abnormality marker keywords. S300. Based on the paragraph priority scoring sequence and the document source marker, perform cross-file deduplication, low-priority content removal, and priority extraction sorted by score on the patient medical document text recognition text. The priority extraction sorted by score includes: selecting candidate retention paragraphs from high to low according to the paragraph medical priority score of each paragraph in the paragraph priority scoring sequence until the cumulative text length of the candidate retention paragraphs reaches the target length budget, and rearranging the extracted paragraphs according to the original text position to generate compressed text. S400. When the compressed text meets the segmentation triggering condition, based on the compressed text and the document source mark, a set of segmented texts is generated according to the file boundary or semantic boundary, and a structured key information summary is extracted from each segmented text to generate a set of segmented summaries. S500: Generate a structured patient profile report based on the segmented summary set and the structured report template; perform output quality verification on the structured patient profile report and generate a report quality label; when the report quality label indicates that the output quality is unqualified, perform adaptive retry based on the quality deviation value and output the retried structured patient profile report or low-quality report label.

2. The method according to claim 1, characterized in that, The document source marker includes file number, file type, page number information, and paragraph position; the source normalization includes establishing a correspondence between the file number, file type, page number information, and paragraph position and the paragraph text to generate the paragraph set with source index.

3. The method according to claim 1, characterized in that, The cross-file deduplication includes: based on the document source marker, counting duplicate text lines and duplicate paragraphs in multiple files, removing redundant copies of duplicate text lines and duplicate paragraphs that have a frequency that reaches a preset duplication threshold and do not contain high-priority medical keywords, and generating deduplicated text.

4. The method according to claim 3, characterized in that, The removal of low-priority content includes: removing page number lines, separator lines, consecutive blank lines, and template headers and footers from the deduplicated text to generate text after removing low-priority content.

5. The method according to claim 1, characterized in that, The segmentation triggering conditions include the compressed text length exceeding a compression triggering threshold; the generation of segmented text sets according to file boundaries or semantic boundaries includes: when the compressed text corresponds to multiple document sources, generating the segmented text set according to the file boundaries; when the length of a single file text exceeds the segment summary character budget, generating the segmented text set according to semantic boundaries; when the segmented text summary extraction fails, retaining a preset fragment of the segmented text as a substitute summary.

6. The method according to claim 1, characterized in that, The output quality verification includes: extracting the response character length ratio, key field completeness rate, and structural validity index of the structured patient profile report to generate an output quality characterization factor; generating a quality deviation value based on the difference between the output quality characterization factor and its threshold; generating a retry strategy level based on the quality deviation value, and performing retry with the same parameters, input reduction retry, or prompt simplified retry according to the retry strategy level; and outputting a low-quality report marker when the retried structured patient profile report still indicates unqualified output quality.

7. A patient profile report generation system based on medical priority scoring, applied to the method of any one of claims 1 to 6, characterized in that, include: The text receiving module is used to acquire the text of the patient's medical documents and the document source markers; The source index module, connected to the text receiving module, is used to perform source normalization and paragraph division on the patient's medical document text recognition text according to the document source mark, file boundary and paragraph boundary, and generate a paragraph set with source index; The medical priority scoring module, connected to the source index module, is used to identify medical keywords, medical numerical features, patient identity information and paragraph length features in each paragraph based on the paragraph set with source index, to score the medical priority of each paragraph, and generate a paragraph priority scoring sequence. The text compression module, connected to the medical priority scoring module, is used to perform cross-file deduplication, low-priority content removal, and priority sorting extraction on the text of the patient's medical document based on the paragraph priority scoring sequence and the document source mark. The extracted paragraphs are rearranged according to their original positions to generate compressed text. The segmented summary extraction module, connected to the text compression module, is used to generate a set of segmented texts based on the compressed text and the document source mark, according to the file boundary or semantic boundary, when the compressed text meets the segmentation triggering condition, and to extract structured key information summaries from each segmented text to generate a set of segmented summaries. The report fusion generation module is connected to the segmented summary extraction module and is used to generate a structured patient profile report based on the segmented summary set and the structured report template. The response quality verification module is connected to the report fusion generation module and is used to perform output quality verification on the structured patient profile report and generate report quality labels. An adaptive retry control module, connected to the response quality verification module, is used to perform adaptive retry based on the quality deviation value when the report quality label indicates that the output quality is unqualified, and output the retried structured patient profile report or low-quality report label.

Citation Information

Patent Citations

  • Multi-modal mixed document OCR (Optical Character Recognition) and structured extraction method

    CN121121756A

  • Document interpretation and report generation method and device, equipment and medium

    CN121354154A