A method and system for mining and analyzing the correlation of clinical comorbidities of discharged patients
By constructing individual diagnosis and treatment narrative graphs and generating temporal transaction sequences, combined with improved generalized sequence pattern algorithms and clustering classification, conservative event sequences and variant branch events are identified. This solves the problems of temporal logic and coarse feature representation in the clinical comorbidity association analysis of discharged patients, and improves the clinical interpretability and individualized guidance value of the mining results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WEST CHINA HOSPITAL SICHUAN UNIV
- Filing Date
- 2026-03-05
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies cannot effectively preserve the chronological order of disease occurrence, the potential causal relationship between diagnosis and treatment interventions and changes in disease status in clinical comorbidity association analysis of discharged patients. This results in the clinical significance of the discovered association rules being ambiguous, the feature representation being coarse-grained and unable to cover key clinical events, and the generated rules being redundant and lacking automated interpretability.
We construct individual diagnosis and treatment narrative graphs, generate time-series transaction sequences and form a sequence database, mine frequent time-series patterns through an improved generalized sequence pattern algorithm, identify conserved event sequences and variant branch events through clustering and classification, construct a generalized clinical pathway graph and generate natural language summaries.
It improves the temporal logic and narrative integrity of clinical comorbidity association mining, enhances the clinical interpretability and individualized guidance value of the mining results, and solves the problems of narrative loss, coarse feature representation and rule redundancy in traditional methods.
Smart Images

Figure CN122158169A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer technology, and in particular relates to a method and system for mining and analyzing the associations of clinical comorbidities in discharged patients. Background Technology
[0002] In the field of medical information technology, knowledge discovery based on electronic medical record data has become a core support for optimizing clinical treatment plans and improving the quality of patient management. Among these, the mining of clinical comorbidity associations in discharged patients is of great practical significance for revealing disease evolution patterns, predicting complication risks, and developing personalized follow-up strategies. Currently, the mainstream technical paradigm for comorbidity association analysis based on electronic medical records is "transactional-frequent pattern mining." Its core process is to extract disease diagnosis entities (such as ICD-10 codes) related to the current hospitalization from the electronic medical record, treat each patient's hospitalization process as an independent transaction, and the disease set as an itemset within the transaction. Then, using classic association rule mining algorithms such as the Apriori algorithm and the FP-Growth algorithm, frequently occurring disease combinations and association rules in the form of "disease A + disease B → disease C" are discovered.
[0003] However, this traditional paradigm, derived from basket analysis in the retail market, reveals several fundamental flaws when directly transplanted into the highly complex and temporally logical clinical setting: First, this paradigm compresses the dynamic, diachronic inpatient treatment process into a static, disordered set of diseases, obliterating the clinical narrative and missing the chronological order of disease occurrence, the potential causal relationship between treatment interventions and changes in disease status, and the path of disease progression. This results in the clinical significance of the discovered association rules being ambiguous, failing to provide temporally logical guidance for personalized medicine. Second, the feature representation granularity is extremely coarse, using only disease diagnostic entities as the basic... First, the features cannot characterize the active state and severity of the disease, nor can they cover key non-disease clinical events such as surgical procedures, examination results, and drug treatments. This not only easily leads to false associations caused by common reasons for hospitalization and standard treatment packages, but also misses a lot of information that is crucial to understanding the evolution of comorbidities, thus limiting the depth of knowledge discovery. Second, association rule algorithms generate a massive amount of redundant, trivial, or common-sense rules. The selection of clinically meaningful rules relies entirely on manual review by domain experts, which is highly subjective, inefficient, and lacks automated high-level abstraction and inductive mechanisms. It is impossible to condense the original rules into clinical narrative patterns that are easy to understand and apply. Summary of the Invention
[0004] Therefore, it is necessary to provide a method and system for mining and analyzing the associations of clinical comorbidities in discharged patients to address the above-mentioned technical problems. This aims to improve the temporal logic and narrative integrity of clinical comorbidity association mining, and enhance the clinical interpretability and individualized guidance value of the mining results.
[0005] Firstly, this application provides a method for mining and analyzing the associations of clinical comorbidities in discharged patients, including:
[0006] Based on the discharge medical certificate, an individual medical narrative graph, including temporal and causal relationships, is constructed for each patient; the individual medical narrative graph is processed to generate a temporal transaction sequence for each patient, and the temporal transaction sequences of all patients are collected to form a sequence database;
[0007] Based on the sequence database, multiple sets of original time series frequent patterns are obtained through parsing using an improved generalized sequence pattern algorithm, and a set of original time series frequent patterns is constructed.
[0008] Clustering and classification are performed on each pattern in the original time-series frequent pattern set to obtain multiple clusters. Multi-sequence alignment is then performed on the original time-series frequent patterns within each cluster to identify conserved event sequences and variant branch events. A generalized clinical pathway map is constructed, and information is extracted from the generalized clinical pathway map to generate corresponding natural language summaries.
[0009] In one embodiment, based on the discharge medical certificate text, an individual medical narrative graph, including temporal and causal relationships, is constructed for each patient, including:
[0010] Obtain predefined fine-grained event patterns, including disease entity patterns, diagnosis and treatment action entity patterns, and clinical status entity patterns;
[0011] Generate corresponding structured queries based on fine-grained event patterns;
[0012] The text of the discharge medical certificate and the structured query are input into a pre-trained multi-task machine reading comprehension model, which outputs a set of medical event triples. Each triple in the set of medical event triples includes a subject, a relation, and an object.
[0013] Obtain pre-defined clinical relation mapping rules. These rules define the correspondence between relations in triples and graph structure edge types, including temporal edges, causal treatment edges, and state evolution edges.
[0014] Based on the clinical relation mapping rules, each triplet is transformed into a corresponding graph structure element, which includes nodes and edges.
[0015] Based on the structural elements of each graph, an individual diagnosis and treatment narrative graph corresponding to each patient is constructed.
[0016] In one embodiment, the individual medical narrative graph is processed to generate a time-series transaction sequence for each patient, and the time-series transaction sequences of all patients are aggregated to form a sequence database, including:
[0017] Retrieve predefined clinical milestone event types, including admission events, surgical events, key treatment initiation events, transfer events, and discharge events;
[0018] The individual treatment narrative graph is traversed to identify the clinical milestone event nodes corresponding to the clinical milestone event types, and the nodes representing the final outcome are determined from the individual treatment narrative graph. The nodes representing the final outcome are used as the backtracking starting point.
[0019] Starting from the backtracking point, the process proceeds backward along the temporal and causal treatment edges of the individual treatment narrative graph, collecting each event node visited during the traversal to form the original event list.
[0020] A clinical stage labeling system was constructed, which includes labels for medical history summary, admission assessment period, core treatment period, recovery observation period, and pre-discharge preparation period.
[0021] The event nodes in the original event list are aggregated based on the clinical milestone event nodes. The time window is divided with the timestamps of two adjacent clinical milestone event nodes as the boundary. Clinical milestone event nodes that fall within the same time window and meet the preset event correlation threshold are grouped into the same time series transaction, resulting in multiple time series transactions.
[0022] Each time-series transaction is assigned a corresponding clinical stage label based on the clinical stage labeling system, resulting in labeled time-series transactions.
[0023] Arrange multiple labeled time-series transactions in the forward chronological order of each labeled time-series transaction to generate a time-series transaction sequence corresponding to each patient.
[0024] Summarize the time-series transaction sequences corresponding to each patient and construct a sequence database.
[0025] In one embodiment, based on a sequence database, an improved generalized sequence pattern algorithm is used for parsing to obtain multiple sets of original frequent time-series patterns, constructing a set of original frequent time-series patterns, including:
[0026] Construct a clinical event ontology and obtain preset mining parameters; the clinical event ontology contains a hierarchical structure of event types, and the mining parameters include minimum support threshold and maximum allowable gap;
[0027] Based on mining parameters and an improved generalized sequence pattern algorithm, candidate pattern matching is performed on each time-series transaction sequence in the sequence database to obtain multiple candidate patterns. Among them, the improved generalized sequence pattern algorithm integrates flexible time gap constraints and hierarchical relaxation matching mechanism. The hierarchical relaxation matching mechanism matches abstract events with specific events by calling the clinical event ontology.
[0028] The support of each candidate pattern in the sequence database is calculated, and the candidate patterns with support not lower than the minimum support threshold are determined as the original time series frequent patterns;
[0029] By aggregating the original frequent time series patterns, a set of original frequent time series patterns is constructed.
[0030] In one embodiment, the patterns in the original time-series frequent pattern set are clustered to obtain multiple clusters. Multiple sequence alignment is then performed on the original time-series frequent patterns within each cluster to identify conserved event sequences and variant branch events. A generalized clinical pathway map is constructed, and information is extracted from the generalized clinical pathway map. A corresponding natural language summary is then generated based on this information, including:
[0031] Retrieve a predefined list of common background events, which includes routine clinical monitoring events;
[0032] Clean each original time series frequent pattern in the original time series frequent pattern set, and remove the events belonging to the common background event list from each original time series frequent pattern to obtain the cleaned original time series frequent patterns.
[0033] Feature extraction is performed on each cleaned original time series frequent pattern to obtain the corresponding numerical feature vector. The dimensions of the numerical feature vector include pattern length, key event type distribution, key event sequence relationship and pattern support.
[0034] Calculate the similarity between any two numerical feature vectors, and use a hierarchical clustering algorithm based on the similarity to cluster and classify each original time series frequent pattern to obtain multiple classification clusters;
[0035] Multi-sequence global alignment is performed on each original time-series frequent pattern within each taxonomic cluster to identify conserved event sequences that share patterns and variant branch events that differ from each other.
[0036] A directed acyclic graph is constructed based on conserved event sequences with shared patterns and variant branch events with differences. The directed acyclic graph is then used as a generalized clinical pathway graph.
[0037] Obtain a pre-defined natural language summary template, which includes a core event description slot, a branch event probability slot, and a statistical information display slot.
[0038] Extract core event information, branch event probability information, and corresponding patient group statistics from the generalized clinical pathway map. Fill the corresponding slots in the natural language summarization template with the core event information, branch event probability information, and patient group statistics to generate the corresponding natural language summary.
[0039] In one embodiment, a directed acyclic graph (DAG) is constructed based on conserved event sequences with shared patterns and differentiated branching events. This DAG is then used as a generalized clinical pathway graph, including:
[0040] Map the conservative event sequence of pattern sharing to the core path nodes in the directed acyclic graph, and set the connection relationship of each core path node according to the time order of the conservative event sequence of pattern sharing.
[0041] The occurrence count of each variant branch event with differences in the original time series frequent patterns within the classification cluster is counted, and the occurrence frequency of each variant branch event is calculated. The occurrence frequency is the ratio of the occurrence count to the total number of original time series frequent patterns within the classification cluster.
[0042] Branch nodes are created in a directed acyclic graph based on the type and frequency of the mutated branch events that have differences, and the corresponding occurrence probability is determined based on the frequency of occurrence of each mutated branch event that has differences.
[0043] The weight of the connecting edge between any two nodes in a directed acyclic graph is set based on the probability of occurrence of mutated branch events with differences; where the connecting edge includes the edge between the branch node and the core path node and the edge between the branch nodes.
[0044] Obtain patient population data corresponding to the sequence database. Based on the patient population data, calculate statistical information, including the proportion of patients supported by the path, the average length of hospital stay, and the incidence of outcomes.
[0045] By associating statistical information with the corresponding core path nodes, branch nodes, and connecting edges in the directed acyclic graph, a generalized clinical pathway graph is obtained.
[0046] In one embodiment, the support is calculated using the following formula:
[0047]
[0048] in, Indicate candidate pattern Support level; Represents sequence database The total number of time-series transaction sequences; Represents sequence database The Middle A sequence of time-series transactions; This indicates a pattern matching indicator function, which is used when a candidate pattern... With time-series transaction sequences During matching, the function takes the value of When there is a mismatch, the value is taken as ; Indicate candidate pattern The clinical level weight, with a value range of 100%. ; Indicate candidate pattern In time-series transaction sequences The actual time interval between the matched events; This indicates the preset maximum allowable time interval; This represents the natural exponential function.
[0049] Secondly, this application also provides a system for mining and analyzing the associations of clinical comorbidities in discharged patients, including:
[0050] The diagnosis and treatment narrative modeling module is used to construct an individual diagnosis and treatment narrative graph for each patient, including temporal and causal relationships, based on the discharge medical certificate text; process the individual diagnosis and treatment narrative graph to generate a temporal transaction sequence for each patient, and collect the temporal transaction sequences of all patients to form a sequence database;
[0051] The time series pattern mining module is used to analyze the sequence database using an improved generalized sequence pattern algorithm to obtain multiple sets of original time series frequent patterns and construct a set of original time series frequent patterns.
[0052] The clinical pathway generalization module is used to cluster and classify the patterns in the original time-series frequent pattern set to obtain multiple clusters. It then performs multi-sequence alignment on the original time-series frequent patterns within each cluster to identify conserved event sequences and variant branch events, constructs a generalized clinical pathway graph, extracts information from the generalized clinical pathway graph, and generates corresponding natural language summaries based on the information.
[0053] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the first aspect.
[0054] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the first aspect.
[0055] The aforementioned method and system for mining and analyzing the associations of clinical comorbidities in discharged patients first construct an individual medical narrative graph, including temporal and causal relationships, based on the discharge medical certificate text. This addresses the problem of traditional static itemsets obscuring clinical narratives and improves the logical completeness and temporal accuracy of the medical data representation. Second, the individual medical narrative graph is processed to generate temporal transaction sequences and form a sequence database, providing a standardized data foundation for subsequent pattern mining and improving data adaptability. Furthermore, based on the sequence database, an improved generalized sequence pattern algorithm is used to analyze and mine frequent patterns in the original temporal sequence, solving the problems of rigid matching and numerous spurious associations in traditional algorithms, thus improving the accuracy and clinical relevance of comorbidity pattern mining. Finally, the frequent patterns in the original temporal sequence are clustered and classified, and multiple sequence alignments are used to identify conserved event sequences and variant branch events. A generalized clinical path graph is constructed and a natural language summary is generated, solving the problems of rule redundancy and poor interpretability, and improving the readability and clinical application value of comorbidity evolution patterns. Attached Figure Description
[0056] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0057] Figure 1 A flowchart illustrating a method for mining and analyzing the associations of clinical comorbidities in discharged patients, as provided in an exemplary embodiment of the present invention;
[0058] Figure 2 A flowchart of a method for constructing a generalized clinical pathway map is provided as an exemplary embodiment of the present invention;
[0059] Figure 3 This is a schematic diagram of a system for mining and analyzing the associations of clinical comorbidities in discharged patients, provided as an exemplary embodiment of the present invention. Detailed Implementation
[0060] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0061] In one embodiment, such as Figure 1As shown, a method for mining and analyzing the associations of clinical comorbidities in discharged patients is provided. This embodiment illustrates the application of this method to a terminal. It is understood that this method can also be applied to a server, and to a system including both a terminal and a server, and can be implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0062] S101: Based on the discharge medical certificate text, construct an individual medical narrative graph for each patient, including temporal and causal relationships; process the individual medical narrative graph to generate a temporal transaction sequence for each patient, and aggregate the temporal transaction sequences of all patients to form a sequence database.
[0063] Specifically, for each patient's discharge certificate text, natural language processing (NLP) techniques can be used to extract clinical event entities, such as key diagnostic and treatment elements like disease diagnosis, surgical procedures, examination and test results, and drug treatment. An individual treatment narrative graph is then constructed based on event timestamps and clinical semantic relationships. This graph uses nodes to represent various clinical events and directed edges to represent the temporal sequence and causal relationships between events. Causal relationships are determined based on predefined treatment guidelines in the clinical knowledge graph and implicit conditional logic expressions in the text, such as semantic patterns like "due to... leading to..." and "postoperative symptoms...". Subsequently, the individual treatment narrative graph undergoes topological sorting and path encoding to transform the graph structure into a linearized temporal sequence of events. Each element in the sequence represents a subset of clinical events occurring within a specific time window, while retaining the time interval information between events. By aggregating the temporal transaction sequences of multiple patients, a sequence database can be formed. This database not only includes disease diagnosis information but also covers non-disease clinical events that reflect the disease activity status and severity, significantly improving the granularity and richness of feature representation and laying a data foundation for subsequent mining of clinically significant temporal association patterns.
[0064] S102: Based on the sequence database, multiple sets of original time series frequent patterns are obtained through parsing using an improved generalized sequence pattern algorithm, and a set of original time series frequent patterns is constructed.
[0065] Specifically, an improved generalized sequence pattern algorithm can be derived by optimizing the classic algorithm for the characteristics of clinical sequence data. For example, during the candidate sequence generation stage, a time constraint parameter can be introduced to limit the maximum allowable time interval between events, filtering out spurious cross-stage associations caused by differences in hospital stay duration. In the support calculation stage, a subsequence matching strategy based on maximum interval constraints can be adopted, allowing reasonable clinical variation gaps in the matching process to accommodate individual differences in the rate of disease progression among different patients. Furthermore, the algorithm can introduce a minimum time interval threshold to ensure that the identified temporal patterns have clinical coherence rather than accidental temporal adjacency. By iteratively scanning the sequence database, this algorithm can progressively expand the length of frequent sequences, outputting multiple sets of original temporal frequent patterns that meet the minimum support and minimum confidence thresholds. These patterns, in sequence form, represent the regular co-occurrence of diseases and diagnostic events over time, such as temporal patterns with clear clinical causal chains, like "acute myocardial infarction → emergency PCI → administration of β-blockers within 24 hours post-procedure → recovery of cardiac function." Compared to the flattened expression of traditional association rules "A+B→C," this better reflects the dynamic decision-making logic and pathophysiological evolution of clinical diagnosis and treatment, significantly improving the clinical interpretability of the mining results.
[0066] S103: Cluster the patterns in the original time series frequent pattern set to obtain multiple clusters, and perform multi-sequence alignment on the original time series frequent patterns in each cluster to identify conserved event sequences and variant branch events, construct a generalized clinical pathway map, extract information from the generalized clinical pathway map, and generate corresponding natural language summaries based on the information.
[0067] Specifically, to address the issues of pattern redundancy, fragmentation, and lack of high-level abstraction in the original time-series frequent pattern set, hierarchical clustering can be performed on the original time-series frequent patterns based on sequence edit distance and semantic similarity metrics. Frequent patterns describing similar clinical scenarios are grouped into the same cluster, with each cluster corresponding to a set of treatment pathway variants for a specific comorbidity combination. Subsequently, multi-sequence alignment can be performed on the original time-series frequent patterns within each cluster. By dynamically programming, the optimal alignment path among multiple sequences can be found, identifying event subsequences that appear conservatively in all or most sequences as conservative event sequences. These conservative sequences represent the standard treatment guidelines or the inevitable stage of the natural progression of the disease in that clinical scenario. Similarly, variant event subsequences that appear only in some sequences can be identified as variant branch events. These variant branches reflect clinical diversity such as the occurrence of complications, differences in individual treatment responses, or the selection of alternative treatment options.
[0068] Based on conserved event sequences and variant branch events, a generalized clinical pathway map can be constructed. This map uses the conserved sequence as the core backbone and variant branches as bypass nodes, forming a backbone-branch hybrid model with a topological structure that can simultaneously represent the common patterns and individualized variation spaces in the diagnosis and treatment of comorbidities. Key statistical information can be extracted from the generalized clinical pathway map, such as the incidence rate of each conserved node, the conditional transition probability of variant branches, and the time distribution characteristics of pathway completion. Based on predefined natural language generation templates and clinical terminology standards, this structured information is transformed into a natural language summary for clinicians. The summary content can include a description of the typical diagnosis and treatment process for the comorbidity combination, key decision node prompts, common variant situations, and prognostic risk warnings. It can be directly applied to clinical decision support systems, complication early warning models, and personalized follow-up strategy formulation, significantly improving the clinical applicability and knowledge transformation efficiency of comorbidity association mining technology.
[0069] The aforementioned method first transforms the dynamic diagnosis and treatment process into structured sequence data by constructing an individual diagnosis and treatment narrative graph that includes temporal and causal relationships. This overcomes the narrative loss problem caused by the static compression of traditional paradigms, preserving the temporal logic and causal connections of disease evolution. Second, it mines frequent temporal patterns based on an improved generalized sequence pattern algorithm, breaking through the limitation of traditional association rules that only focus on disease co-occurrence, and achieving deep analysis of the temporal dependencies of diagnosis and treatment events. Finally, it identifies conserved event sequences and variant branches through clustering classification and multiple sequence alignment, constructs generalized clinical pathways, and generates natural language summaries, improving the automation level and clinical interpretability of knowledge discovery.
[0070] In one embodiment, based on the discharge medical certificate text, an individual medical narrative graph, including temporal and causal relationships, is constructed for each patient, including:
[0071] Obtain predefined fine-grained event patterns, including disease entity patterns, diagnosis and treatment action entity patterns, and clinical status entity patterns;
[0072] Generate corresponding structured queries based on fine-grained event patterns; input the discharge medical certificate text and structured queries into a pre-trained multi-task machine reading comprehension model, and output a set of medical event triples, where each triple in the set of medical event triples includes a subject, a relation, and an object;
[0073] Obtain pre-defined clinical relation mapping rules. These rules define the correspondence between relations in triples and graph structure edge types, including temporal edges, causal treatment edges, and state evolution edges.
[0074] Based on the clinical relationship mapping rules, each triple is transformed into a corresponding graph structure element, which includes nodes and edges. Based on each graph structure element, an individual diagnosis and treatment narrative graph corresponding to each patient is constructed.
[0075] Specifically, the fine-grained event model is a standardized framework built upon the core elements and logical connections of the entire clinical diagnosis and treatment process. The disease entity model can encompass specific disease names and key attribute dimensions, including onset time attribution, severity grading, and disease course classification. Onset time attribution clarifies whether the disease was pre-existing, newly acquired upon admission, or secondary to hospitalization. Severity grading can be divided into mild, moderate, and severe levels according to clinical practice guidelines. Disease course classification clarifies whether the disease is acute or chronic. The diagnosis and treatment action entity model can cover core types of clinical interventions, such as medication use, surgical procedures, examinations, and other treatment methods. Medication use must be associated with the specific drug name, route of administration, and core dosage range; surgical procedures must include the procedure name, site of administration, and key surgical parameters; examinations must specify the examination item name and corresponding result attributes, such as positive / negative interpretation and normal range references for numerical results; and other treatment methods can include non-pharmacological and non-surgical interventions such as radiotherapy and rehabilitation training. The clinical status entity model can focus on changes in a patient's status and outcomes, including symptoms and signs, results, and adverse reactions. Symptoms and signs should be recorded in terms of the time of onset and severity. Results can be clearly defined as remission, cure, ineffectiveness, worsening, or death. Adverse reactions should be assessed in relation to the triggering factors and their severity.
[0076] Based on fine-grained event patterns, corresponding structured queries can be generated following an attribute-relationship-target logical framework, ensuring that each query accurately locates the specific information in the discharge medical certificate text corresponding to the event pattern. For example, for the disease entity pattern, the generated query should include specific descriptions such as "What are the patient's past medical histories, and is their course of illness acute or chronic?" For the treatment action entity pattern, the query can cover content such as "What medications were used to treat a certain disease, and what were the routes of administration?" For the clinical status entity pattern, the query can include directional descriptions such as "What symptoms did the patient have upon admission, and did these symptoms improve during hospitalization?" The generated structured queries all use standardized sentence structures to ensure compatibility with the input of subsequent multi-task machine reading comprehension models.
[0077] Furthermore, discharge certificate text and structured queries can be input into a multi-task machine reading comprehension model. This model, based on the Transformer architecture, can be trained through two stages: pre-training and fine-tuning. The pre-training stage uses general text and publicly available clinical corpora to construct a training dataset, learning general language features and clinically specific expression patterns. The fine-tuning stage uses discharge certificate text annotated with fine-grained event triples as training samples to optimize the model's response to clinically specific queries. During input processing, the discharge certificate text can be first transformed into a vector form recognizable by the model through word segmentation, part-of-speech tagging, and semantic encoding. The structured queries can be processed according to the same encoding rules and then fused with the text vectors to form joint input features. Subsequently, through a multi-task learning mechanism, the model can simultaneously complete event boundary identification, attribute extraction, and relationship determination, outputting a set of clinical event triples. The subject of each triple is a clinical event instance (which can be a disease, treatment action, or clinical state), the relationship is a clinical logical association connecting the subject and the object (such as "used for treatment", "occurred after", "state transitioned to", etc.), and the object is another clinical event instance or attribute value that has a logical association with the subject. For example, triples such as "insulin-used for treatment-diabetes" can reflect the core associations in the clinical scenario.
[0078] Indicatively, the clinical relationship mapping rules are a bidirectional mapping system built upon authoritative clinical knowledge bases, treatment guidelines, and clinical pathway guidelines. Its core function is to transform abstract relationships within triples into graph edge types with clear semantics, ensuring that the graph model faithfully reflects clinical temporal and causal logic. During rule construction, the possible relationship types within triples can be comprehensively reviewed and categorized first, and then the corresponding graph edge types are defined based on the essence of clinical logic. For example, relationships representing the chronological order of events (such as "occurred after...") are mapped to temporal edges. Relationships representing the influence or treatment relationship between diagnostic / treatment interventions and diseases / states (such as "used for treatment") are mapped to causal-treatment edges. Relationships representing the evolution of the same clinical concept into different states (such as "state changes to" or "worsens to") are mapped to state evolution edges. Furthermore, each mapping rule must be validated by clinical experts to ensure unambiguous correspondence between relationships and edge types.
[0079] Furthermore, based on clinical relation mapping rules, each triple can be transformed into a corresponding graph structure element according to the principle of "one event, one node; one relation, one edge." During node construction, the subject and object (both clinical event instances) in each triple each correspond to an independent node. The node's label information includes the event type (disease, treatment action, or clinical state) and the event's core attributes (such as disease severity, drug administration route, symptom outcome, etc.), ensuring that the node possesses complete clinical semantic information. During directed edge construction, the clinical relation mapping rules can be queried based on the relations in the triple to determine the corresponding edge type, and the edge direction can be defined according to clinical logic. Specifically, the direction of a temporal edge can be from the earlier event node to the later event node. The direction of a causal treatment edge can be from the treatment action node to the disease or state node it affects. The direction of a state evolution edge can be from the initial state node to the evolved state node. In addition, during the transformation process, if multiple triples involve the same event instance, only one node can be retained to avoid graph structure redundancy.
[0080] Based on the structural elements of the graph, an adjacency list construction algorithm can be used. First, an empty adjacency list data structure is initialized to store the associations between nodes and edges. Then, all transformed nodes are added sequentially to the node set of the adjacency list, and a unique identifier is assigned to each node. Subsequently, all directed edges can be traversed, and the start, end, and type information of each edge can be entered into the corresponding entry in the adjacency list, forming an index of associations between nodes. During the construction process, temporal consistency checks can ensure that temporal edges do not have circular dependencies (i.e., the time sequence of diagnostic and treatment events is logically consistent), and causal rationality checks can ensure that the associations of causal treatment edges conform to clinical pathophysiological mechanisms or diagnostic and treatment guidelines. If contradictions are found, they can be corrected based on the clinical knowledge base. The final individual diagnostic and treatment narrative graph completely preserves the clinical events, event attributes, and temporal and causal relationships between events during the patient's hospitalization in a structured manner, providing a structured data foundation for the subsequent generation of temporal transaction sequences.
[0081] In one embodiment, the individual medical narrative graph is processed to generate a time-series transaction sequence for each patient, and the time-series transaction sequences of all patients are aggregated to form a sequence database, including:
[0082] Retrieve predefined clinical milestone event types, including admission events, surgical events, key treatment initiation events, transfer events, and discharge events;
[0083] The individual treatment narrative graph is traversed to identify the clinical milestone event nodes corresponding to the clinical milestone event types. The node representing the final outcome is determined from the individual treatment narrative graph and used as the backtracking starting point. Starting from the backtracking starting point, the traversal is performed in reverse along the temporal edge and causal treatment edge in the individual treatment narrative graph. Each event node visited during the traversal is collected to form the original event list.
[0084] A clinical stage labeling system is constructed, which includes labels for past medical history summary, admission assessment period, core treatment period, recovery observation period, and pre-discharge preparation period. Event nodes in the original event list are aggregated based on clinical milestone event nodes. Time windows are divided with the timestamps of two adjacent clinical milestone event nodes as boundaries. Clinical milestone event nodes that fall within the same time window and meet the preset event correlation threshold are grouped into the same time series transaction, resulting in multiple time series transactions.
[0085] Each time-series transaction is assigned a corresponding clinical stage label based on the clinical stage labeling system, resulting in labeled time-series transactions. Multiple labeled time-series transactions are arranged in forward chronological order to generate a time-series transaction sequence for each patient. The time-series transaction sequences for each patient are then aggregated to construct a sequence database.
[0086] Specifically, clinical milestone event types can be constructed based on the phased characteristics and key decision-making nodes of clinical diagnosis and treatment. Among them, admission events can be defined as the set of events related to the patient's first diagnostic and treatment assessment after admission, including core elements such as admission registration time and initial consultation records. Surgical events can cover various invasive procedures, with the surgery start time as the core marker, while also incorporating preoperative preparation and postoperative monitoring-related events. Key treatment initiation events can refer to the first implementation of a treatment plan that plays a decisive role in disease outcome, such as the initiation of targeted drug therapy, the start of a chemotherapy cycle, or the first implementation of renal replacement therapy. Transfer events can include the transfer of patients between different departments (such as general wards and ICU, internal medicine and surgery) during hospitalization, with the execution time of the transfer order as the key identifier. Discharge events are centered on the time of discharge order issuance or the patient's actual discharge time, including related events such as discharge assessment and medication recommendations. Furthermore, all of the above milestone event types are determined by mapping clinical practice guidelines to actual treatment procedures to ensure accurate segmentation of key stages in the diagnosis and treatment process.
[0087] Subsequently, a breadth-first search algorithm can be used to sequentially visit each node in the individual treatment narrative graph. During the traversal, node labels can be matched with predefined clinical milestone event types to identify all clinical milestone event nodes that meet the type definitions, and the timestamp information corresponding to each node can be recorded, such as based on explicit time descriptions in the discharge certificate text or inferences from clinical logic. Simultaneously, nodes representing the final outcome can be selected from the individual treatment narrative graph. These nodes must meet the characteristics reflecting the final outcome of the patient's hospitalization, such as "discharge" status nodes, "disease outcome as cured / relieved / death" clinical status nodes, etc., and these nodes are determined as the backtracking starting point. Starting from the backtracking starting point, a reverse breadth-first traversal can be performed along the temporal edges and causal treatment edges in the individual treatment narrative graph. By selecting these two types of edges as traversal paths, temporal edges ensure that events are reconstructed in reverse chronological order, while causal treatment edges trace the logical connection between treatment interventions and changes in disease status. The combination of both ensures that the traversal process can completely reconstruct the evolution chain of clinical events. During the traversal, an access marker can be added to each accessed event node to avoid duplicate collection and record the original association between nodes. All accessed event nodes are organized in traversal order to form an original event list, and the order of events in the list corresponds inversely to the actual order of occurrence in clinical practice.
[0088] Specifically, by aggregating event nodes in the original event list based on clinical milestone event nodes, multiple consecutive time windows can be divided, with the timestamps corresponding to two adjacent clinical milestone event nodes as boundaries. Each time window corresponds to a continuous stage in the clinical diagnosis and treatment process. For event nodes within each time window, the event correlation between any two event nodes is calculated. The event correlation can be determined by a weighted combination of semantic correlation and temporal proximity, calculated as follows:
[0089]
[0090] in, Indicates an event and The correlation score, This is a weighting coefficient, ranging from 0 to 1, set based on clinical expert experience, used to balance the importance of semantic relevance and temporal proximity. The similarity score represents the semantic similarity between two events. It is calculated by querying the hierarchical relationship of event types and association rules in the clinical event ontology. If the two events serve the same diagnostic and treatment goal or have a direct causal relationship, the similarity score is higher. The time decay factor is represented by the timestamps of the two events. and The difference is calculated such that the smaller the time interval, the closer the decay factor is to 1, and the larger the time interval, the smaller the decay factor, ensuring that events that are close in time have a higher correlation weight. Subsequently, event nodes with a correlation score not lower than a preset event correlation threshold within the time window can be grouped into the same time-series transaction. For isolated event nodes with a correlation score lower than the threshold, if they have a high correlation with events in adjacent time windows, they are grouped into adjacent time-series transactions; otherwise, they constitute a separate time-series transaction, ultimately resulting in multiple time-series transactions.
[0091] Specifically, the clinical stage labeling system can be designed based on the logical evolution of the diagnosis and treatment process and the needs of clinical management. Each label corresponds to a clinical stage with a clear functional positioning. Specifically, the past medical history summary label identifies the set of events related to the patient's pre-existing underlying diseases, previous surgical history, and long-term medication history; the admission assessment period label corresponds to the stage from admission to the initiation of core treatment, and can cover events such as initial physical examination, laboratory tests, imaging examinations, and preliminary diagnosis; the core treatment period label targets the stage centered on surgery, key drug therapy, or other core interventions, and can include events such as the treatment implementation process, intraoperative monitoring, and immediate post-treatment assessment; the recovery observation period label corresponds to the stage from the end of core treatment to discharge, focusing on events such as monitoring the patient's recovery, screening for complications, and adjusting the treatment plan; and the pre-discharge preparation period label can be used to identify events directly related to discharge, such as discharge assessment, rehabilitation guidance, medication regimen development, and follow-up plan arrangements. Subsequently, a dual determination mechanism of "core event-driven + stage feature matching" can be adopted to assign corresponding clinical stage labels to each time-series event based on the clinical stage labeling system. For example, first identify the core events in each time-series transaction (i.e., the event nodes that play a decisive role in the characteristics of the transaction; for example, the core event of a transaction containing surgical events is surgical procedures). If the core event belongs to a certain clinical milestone event type, the corresponding clinical stage label is directly assigned (e.g., if the core event is a surgical event, the core treatment period label is assigned). If there is no clear core milestone event in the transaction, the type distribution characteristics of all event nodes within the transaction can be extracted and matched with the typical event type distribution corresponding to each label in the clinical stage label system. The label with the highest matching degree is assigned to the transaction (e.g., if the event is mainly about examination and testing, or preliminary diagnosis, the admission assessment period label is matched).
[0092] Specifically, based on the start timestamp of the time window corresponding to each transaction, the original event list can be reversed and rearranged into a forward order consistent with the actual clinical occurrence, generating a time-series transaction sequence for each patient. Each transaction in the sequence contains an event set, a clinical stage label, and time window information. By aggregating the time-series transaction sequences for all patients, a sequence database can be constructed. The database uses a structured storage format, with the patient's unique identifier as an index to associate the corresponding time-series transaction sequences. This ensures efficient retrieval of sequence data during subsequent pattern mining while preserving the clinical semantics and temporal characteristics of each transaction, providing standardized data support for mining clinically significant comorbidity patterns.
[0093] In one embodiment, based on a sequence database, multiple sets of original frequent time-series patterns are obtained through parsing using an improved generalized sequence pattern algorithm, constructing a set of original frequent time-series patterns, including:
[0094] Construct a clinical event ontology and obtain preset mining parameters; the clinical event ontology contains a hierarchical structure of event types, and the mining parameters include minimum support threshold and maximum allowable gap;
[0095] Based on mining parameters and an improved generalized sequence pattern algorithm, candidate pattern matching is performed on each time-series transaction sequence in the sequence database to obtain multiple candidate patterns. Among them, the improved generalized sequence pattern algorithm integrates flexible time gap constraints and hierarchical relaxation matching mechanism. The hierarchical relaxation matching mechanism matches abstract events with specific events by calling the clinical event ontology.
[0096] The support of each candidate pattern in the sequence database is calculated, and the candidate patterns with support not lower than the minimum support threshold are determined as the original time series frequent patterns;
[0097] By aggregating the original frequent time series patterns, a set of original frequent time series patterns is constructed.
[0098] Specifically, the clinical event ontology is a structured clinical event classification system, organizing event types in a hierarchical structure. The bottom layer consists of specific clinical event instances, while the upper layers represent abstract event categories. For example, "atorvastatin" belongs to the subcategory of "statins," which in turn belongs to the subcategory of "lipid-lowering drugs," which further belongs to the category of "cardiovascular system drugs." The hierarchical depth of the event ontology is determined by the generalization degree of the clinical event; a deeper hierarchy represents a more specific event, while a shallower hierarchy represents a more abstract event. This hierarchical structure provides the core basis for subsequent hierarchical relaxation matching and clinical hierarchy weight calculation. The preset mining parameters can include a minimum support threshold and a maximum allowable gap. The minimum support threshold is used to screen statistically significant candidate patterns, while the maximum allowable gap is used to define the time range of clinical event associations. These parameters are reasonably set by technical personnel based on clinical experience such as the treatment cycle of common diseases and the onset time of intervention measures.
[0099] Specifically, the improved generalized sequence pattern algorithm integrates flexible time gap constraints and a hierarchical relaxation matching mechanism. The hierarchical relaxation matching mechanism matches abstract events with concrete events by invoking the clinical event ontology, prioritizing subclass events over parent class events. For example, if an abstract event in a candidate pattern (e.g., "cardiovascular disease") has a direct or indirect inheritance relationship with a concrete event in a time-series transaction sequence (e.g., "acute myocardial infarction"), a successful match can be determined. This mechanism effectively improves the pattern's generality and clinical coverage. The flexible time gap constraint allows adjacent events in the candidate pattern to have reasonable intervals within the time-series transaction sequence, rather than requiring strict continuity. During the matching process, the actual time gaps between events matched by the pattern in each sequence can be recorded, providing basic data for subsequent support calculations.
[0100] Furthermore, the support level of each candidate pattern in the sequence database can be calculated using the following formula:
[0101]
[0102] in, Indicate candidate pattern The support level is the core indicator for determining whether a candidate pattern is a primary time-series frequent pattern. Represents sequence database The total number of time-series transaction sequences, i.e. the total number of discharged patients participating in the correlation mining analysis; Represents sequence database The Middle Each time-series transaction sequence corresponds to the time-series transaction arrangement result with clinical stage labels for a single discharged patient; This indicates a pattern matching indicator function, which is used when a candidate pattern... With time-series transaction sequences During matching, the function takes the value of When there is a mismatch, the value is taken as ; Indicate candidate pattern The clinical level weight is determined by the level depth of the clinical event ontology. The more abstract the event level, the higher the weight value, with a range of values. ; Indicate candidate pattern In time-series transaction sequences The actual time interval between the matched events is specifically the difference in clinical timestamps corresponding to the matched events; This indicates the preset maximum allowable time interval; This represents the natural exponential function, used to apply a non-linear penalty to the portion exceeding the maximum permissible time interval, in order to align with the objective characteristic in clinical time series that "the further apart the events are, the weaker the correlation." After calculation, candidate patterns with support not lower than the minimum support threshold can be identified as frequent patterns in the original time series, thus ensuring that the final patterns possess both statistical significance and clinical relevance.
[0103] By aggregating various original time-series frequent patterns, a set of original time-series frequent patterns can be constructed. Each pattern in the set is a sequence with time-series characteristics and clinical hierarchical information. Compared with traditional association rules, it can better reflect the dynamic evolution logic of clinical diagnosis and treatment, and provide a high-quality basic pattern library for subsequent pattern induction and clinical pathway generation.
[0104] In one embodiment, clustering is performed on each pattern in the original set of frequent time-series patterns to obtain multiple clusters. Multiple sequence alignment is then performed on the original frequent time-series patterns within each cluster to identify conserved event sequences and variant branch events. A generalized clinical pathway map is constructed, and information is extracted from the generalized clinical pathway map. A corresponding natural language summary is then generated based on this information, including:
[0105] Retrieve a predefined list of common background events, which includes routine clinical monitoring events;
[0106] Clean each original time series frequent pattern in the original time series frequent pattern set, and remove the events belonging to the common background event list from each original time series frequent pattern to obtain the cleaned original time series frequent patterns.
[0107] Feature extraction is performed on each of the cleaned original time series frequent patterns to obtain corresponding numerical feature vectors. The dimensions of the numerical feature vectors include pattern length, key event type distribution, key event sequence relationship, and pattern support. The similarity between any two numerical feature vectors is calculated, and hierarchical clustering algorithm is used to cluster and classify each of the original time series frequent patterns based on the similarity to obtain multiple classification clusters.
[0108] Multiple sequence global alignment is performed on each original time series frequent pattern within each taxonomic cluster to identify conserved event sequences with shared patterns and variant branch events with differences. A directed acyclic graph is constructed based on the conserved event sequences with shared patterns and variant branch events with differences, and the directed acyclic graph is determined as a generalized clinical pathway graph.
[0109] Obtain a pre-defined natural language summary template, which includes core event description slots, branch event probability slots, and statistical information display slots; extract core event information, branch event probability information, and corresponding patient group statistical information from the generalized clinical pathway diagram, and fill the core event information, branch event probability information, and patient group statistical information into the corresponding slots of the natural language summary template to generate the corresponding natural language summary.
[0110] Specifically, the list of common background events can be constructed based on clinical expert consensus and treatment guidelines. It includes all routine clinical monitoring events that are not clinically specific, such as routine blood tests, vital sign monitoring, and routine biochemical tests performed on all hospitalized patients. These events occur in the treatment of all patients and have no practical value in distinguishing different comorbidity evolution patterns. However, including them in the list can eliminate noise interference in subsequent analysis, ensuring that pattern summarization focuses on core treatment events directly related to the comorbidity. For example, each original frequent time-series pattern in the original time-series pattern set can be cleaned by traversing each event node in the pattern and matching the event node with events in the common background event list. If an event node belongs to an event in the common background event list, it is removed from the pattern, resulting in the cleaned original frequent time-series patterns. This process, by eliminating irrelevant events, can improve the accuracy of subsequent clustering analysis, avoid misjudgments of pattern similarity due to the prevalence of routine monitoring events, and ensure that the cleaned patterns retain only the core event sequences reflecting the comorbidity evolution and treatment interventions.
[0111] Subsequently, features can be extracted from each cleaned original temporal frequent pattern to obtain the corresponding numerical feature vectors. The pattern length represents the number of temporal transactions contained in the pattern, reflecting the stage complexity of the corresponding diagnosis and treatment process. The key event type distribution can be encoded using Boolean values to identify whether the pattern contains clinically distinguishable event types such as surgical procedures, specific drug treatments, and complication occurrences. The sequence relationship of key events can be encoded using sequence coding to identify the logical order of core events in the pattern; for example, the sequence code for "acute myocardial infarction → PCI surgery" is 1, and the reverse is 0, to capture the temporal features of the pattern. The pattern support can be the previously calculated support, reflecting the prevalence of the pattern in the clinical population. Furthermore, all the above feature dimensions can be normalized to the [0,1] interval to ensure balanced weighting of each feature in subsequent similarity calculations. Illustratively, cosine similarity can be used as a metric to calculate the similarity between any two numerical feature vectors; the closer the value is to 1, the higher the feature overlap between the two patterns. Based on the similarity results, agglomerative hierarchical clustering algorithm is used to cluster and classify the original time-series frequent patterns. In the initial state, each pattern is an independent cluster. The clusters with the highest similarity are iteratively merged until the similarity between clusters is lower than the preset threshold. Finally, multiple classification clusters are obtained. The patterns in each cluster are highly similar in core event sequences, temporal logic and clinical significance, corresponding to a prototype pattern of a comorbidity evolution.
[0112] Specifically, a variant of the Needleman-Wunsch algorithm adapted to clinical event characteristics can be used to perform multi-sequence global alignment of each original time-series frequent pattern within each cluster. This algorithm can dynamically programmatically find the optimal alignment path between multiple sequences. During alignment, it not only supports complete matching of event types but also hierarchical relaxed matching by invoking the clinical event ontology. For example, atorvastatin and statins can be considered as matches to accommodate the differences in the abstract levels of clinical events. Illustratively, event subsequences shared in all or most patterns can be identified as conservative event sequences. These sequences represent the standard treatment path or the inevitable stage of the natural progression of the disease in that clinical scenario. For example, "acute chest pain → electrocardiogram → PCI surgery" is a typical conservative event sequence for patients with coronary heart disease. Simultaneously, event subsequences appearing only in some patterns can be identified as variant branch events. These events reflect clinical diversity such as the occurrence of complications, differences in individual treatment responses, or the selection of alternative treatment options. For example, contrast-induced nephropathy after PCI and the use of ticagrelor afterward are both variant branch events.
[0113] Specifically, a directed acyclic graph (DAG) can be constructed based on conserved event sequences with shared patterns and differentiated variant branch events. For example, firstly, conserved event sequences are mapped to core path nodes in the graph, and the connections between these core path nodes are set according to the chronological order of the events, forming the backbone structure of the path. Then, branch nodes are created based on the type and frequency of variant branch events. The weights of the edges connecting nodes are set based on the probability of occurrence of the variant branch event within the classification cluster. The probability of occurrence is calculated as the ratio of the number of occurrences of the variant branch event to the total number of frequent patterns in the original time series within the classification cluster. The edge weights directly reflect the clinical probability of this branch. Furthermore, patient population statistics corresponding to the sequence database (such as the proportion of patients supported by the path, average length of hospital stay, and outcome incidence) can be associated with the corresponding core path nodes, branch nodes, and connecting edges in the graph. For example, the proportion of patients supporting the core node "PCI surgery" can be labeled, and the probability of occurrence can be labeled on the connecting edges of the branch node "contrast-induced nephropathy," further enhancing the clinical practical value of the path graph.
[0114] Finally, a natural language summary template can be obtained. This template is a semi-structured framework designed based on clinical narrative logic, containing three types of preset slots: core event description slots, branch event probability slots, and statistical information display slots. Core event description slots are used to fill in the clinical diagnosis and treatment process corresponding to conservative event sequences; branch event probability slots are used to fill in the probability of occurrence of variant branch events; and statistical information display slots are used to fill in key statistical indicators of the patient population. Therefore, core event information, branch event probability information, and corresponding patient population statistical information can be extracted from the generalized clinical pathway diagram and filled into the corresponding slots of the template to generate a corresponding natural language summary. For example, "This model describes a patient with a history of hypertension and diabetes who was admitted to the hospital due to acute chest pain. After being diagnosed with acute coronary syndrome by electrocardiogram, the patient underwent PCI surgery. Postoperatively, 90% of the patients received dual antiplatelet therapy, 10% of the patients developed contrast-induced nephropathy, and the average length of hospital stay was 7 days." This summary can transform the structured pathway diagram into coherent clinical narrative text, significantly reducing the cognitive load of clinical experts and can be directly applied to clinical decision support and treatment pathway optimization.
[0115] In one embodiment, such as Figure 2 As shown, a directed acyclic graph (DAG) is constructed based on conserved event sequences with shared patterns and differentiated branching events. This DAG is then used as a generalized clinical pathway graph, including:
[0116] S201: Map the pattern-shared conservative event sequence to core path nodes in a directed acyclic graph, and set the connection relationship of each core path node according to the time order of the pattern-shared conservative event sequence.
[0117] S202: Count the number of occurrences of each variant branch event with differences in the original time series frequent patterns within the classification cluster, and calculate the occurrence frequency of each variant branch event. The occurrence frequency is the ratio of the number of occurrences to the total number of original time series frequent patterns within the classification cluster.
[0118] S203: Create branch nodes in a directed acyclic graph based on the type and frequency of the mutated branch events with differences, and determine the corresponding probability of occurrence based on the frequency of occurrence of each mutated branch event with differences.
[0119] S204: Set the weight of the connection edge between any two nodes in a directed acyclic graph based on the occurrence probability of mutated branch events with differences; where the connection edge includes the edge between branch node and core path node and the edge between branch node;
[0120] S205: Obtain patient population data corresponding to the sequence database. Based on the patient information in the patient population data that supports each core path node, branch node and corresponding connection relationship, calculate statistical information, including the proportion of patients supporting the path, average length of hospital stay and incidence of outcome. Associate the statistical information with the corresponding core path node, branch node and connection edge in the directed acyclic graph to obtain the generalized clinical path graph.
[0121] Specifically, the conserved event sequence represents the common patterns in the evolution of this type of comorbidity. The pattern-sharing conserved event sequence can be mapped to core path nodes in a directed acyclic graph, providing a stable foundation for the integration of subsequent branch variations. Each conserved event corresponds to an independent core path node, with the node label containing the event type, core attributes, and the frequency of occurrence of the event within the cluster. The connections between the core path nodes are set according to the chronological order of the pattern-sharing conserved event sequence, with directed temporal edges pointing from earlier-occurring event nodes to later-occurring event nodes, ensuring the temporal consistency of the core path and the coherence of clinical logic.
[0122] Furthermore, the occurrence count of each differing variant event within the original time-series frequent patterns can be counted. This involves iterating through all original time-series frequent patterns within the cluster, matching and counting the variant events in each pattern, and recording the occurrence count of each variant event. The frequency of each variant event can then be calculated using the following formula: , For mutation branch events The frequency of occurrence The number of times the event occurs within the classification cluster. This represents the total number of frequent patterns in the original temporal sequence within the classification cluster. This frequency value reflects the prevalence of variant branch events in the evolution of this type of comorbidity, providing a quantitative basis for subsequent calculations of occurrence probability and edge weights. Based on the types and frequencies of the differing variant branch events, branch nodes in a directed acyclic graph can be created. The types of variant branch events can include complication occurrence, alternative treatment selection, and differences in disease outcome. Different types of events correspond to different branch node labels, such as contrast-induced nephropathy and ticagrelor treatment. Furthermore, the occurrence probability can be determined based on the occurrence frequency of each differing variant branch event. If multiple variant branch events exist under the same core path node, the occurrence frequency of each branch can be normalized to obtain the occurrence probability of each branch, i.e.:
[0123]
[0124] in, For mutation branch events The probability of its occurrence, This is the set of all mutation branch events under this core path node. This probability value reflects the conditional likelihood of the mutation branch appearing after the corresponding core event occurs, ensuring that the sum of the probabilities of all branches under the same core node is 1, which conforms to the probability axiom.
[0125] Specifically, the weights of edges connecting any two nodes in a directed acyclic graph (DAG) can be set based on the probability of occurrence of variant branch events with differences. For edges between branch nodes and core path nodes, the weight can directly use the probability of occurrence of the variant branch event. For example, the weight of the edge between the core node "PCI surgery" and the branch node "contrast-induced nephropathy" is 0.1, representing a 10% probability of developing contrast-induced nephropathy post-surgery. For edges between branch nodes, the weight can be a conditional probability, i.e., the probability of the next branch event occurring after the previous one. For example, the weight of the edge between the branch nodes "contrast-induced nephropathy" and "hemodialysis" is 0.3, representing a 30% probability of undergoing hemodialysis after developing contrast-induced nephropathy. These edge weight settings allow the path graph to not only include the temporal relationship of events but also reflect the possibility of clinical event transfer, thereby enhancing the clinical decision-making value of the path graph.
[0126] Specifically, it can also obtain patient group data corresponding to the sequence database and calculate statistical information. The formula for calculating the proportion of patients supported by the path can be... , For path The proportion of patients who support the treatment To support the number of patients in this pathway, This represents the total number of discharged patients participating in the analysis. The average length of hospital stay can be the arithmetic mean of the length of hospital stay for all patients under this pathway. The outcome incidence rate is the ratio of the number of patients with a specific outcome (such as cure, death, or complications) under this pathway to the number of patients supporting this pathway. These statistics quantify the clinical significance and prognostic characteristics of the pathway at the population level. Subsequently, the statistical information can be correlated to the corresponding core pathway nodes, branch nodes, and connecting edges in the directed acyclic graph. For example, the proportion of patients supporting the pathway can be labeled next to core pathway nodes, the outcome incidence rate of the branch can be labeled next to branch nodes, and the weight (i.e., occurrence probability or conditional probability) of the connecting edges can be labeled. Finally, a generalized clinical pathway graph after correlation can be output. This graph includes both the logical structure of comorbidity evolution and integrates population statistical data, intuitively presenting the common patterns and individual variations in clinical diagnosis and treatment, providing clinical experts with a decision-making basis that is both logical and data-driven.
[0127] Based on the same inventive concept, this application also provides a system for mining and analyzing the association relationships of clinical comorbidities in discharged patients, used to implement the aforementioned method for mining and analyzing the association relationships of clinical comorbidities in discharged patients. The solution provided by this system is similar to the solution described in the above method. Therefore, the specific limitations of one or more embodiments of a system for mining and analyzing the association relationships of clinical comorbidities in discharged patients provided below can be found in the limitations of the method for mining and analyzing the association relationships of clinical comorbidities in discharged patients described above, and will not be repeated here.
[0128] In one exemplary embodiment, such as Figure 3 As shown, a system 300 for mining and analyzing the associations of clinical comorbidities in discharged patients is provided, including:
[0129] The diagnosis and treatment narrative modeling module 301 is used to construct an individual diagnosis and treatment narrative graph for each patient, including temporal and causal relationships, based on the discharge medical certificate text; process the individual diagnosis and treatment narrative graph to generate a temporal transaction sequence for each patient, and collect the temporal transaction sequences of all patients to form a sequence database;
[0130] The time series pattern mining module 302 is used to analyze the sequence database using an improved generalized sequence pattern algorithm to obtain multiple sets of original time series frequent patterns and construct an original time series frequent pattern set.
[0131] The clinical pathway generalization module 303 is used to perform clustering and classification on each pattern in the original time-series frequent pattern set to obtain multiple classification clusters. It also performs multi-sequence alignment on the original time-series frequent patterns in each classification cluster to identify conserved event sequences and variant branch events, construct a generalized clinical pathway graph, extract information from the generalized clinical pathway graph, and generate corresponding natural language summaries based on the information.
[0132] In one exemplary embodiment, the present invention also provides a computer device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the method for mining and analyzing the associations of clinical comorbidities in discharged patients according to this application. A multi-core processor is preferred to improve the system's parallel processing capabilities. The memory provides sufficient temporary storage space to support program execution and data processing. The memory capacity should be large enough to accommodate large amounts of data and computational tasks.
[0133] In one exemplary embodiment, the present invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the method for mining and analyzing the associations of clinical comorbidities in discharged patients according to the present application. The computer-readable storage medium may include: a read-only memory, a random access memory, a solid-state drive, or an optical disk, etc.
[0134] The above-described embodiments are merely illustrative of several implementation methods of the embodiments of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the embodiments of this application, and these modifications and improvements all fall within the protection scope of the embodiments of this application.
Claims
1. A method for mining and analyzing the associations of clinical comorbidities in discharged patients, characterized in that, The method includes: Based on the discharge medical certificate, an individual medical narrative graph, including temporal and causal relationships, is constructed for each patient; the individual medical narrative graph is processed to generate a temporal transaction sequence for each patient, and the temporal transaction sequences of all patients are collected to form a sequence database; Based on the sequence database, multiple sets of original time series frequent patterns are obtained by parsing using an improved generalized sequence pattern algorithm, and a set of original time series frequent patterns is constructed. Clustering and classification are performed on each pattern in the original time-series frequent pattern set to obtain multiple clusters. Multi-sequence alignment is then performed on the original time-series frequent patterns within each cluster to identify conserved event sequences and variant branch events. A generalized clinical pathway map is constructed, and information from the generalized clinical pathway map is extracted. A corresponding natural language summary is then generated based on the information.
2. The method according to claim 1, characterized in that, The process of constructing an individualized medical narrative graph for each patient, including temporal and causal relationships, based on the discharge medical certificate text, includes: Obtain predefined fine-grained event patterns, including disease entity patterns, treatment action entity patterns, and clinical state entity patterns; Generate corresponding structured queries based on the fine-grained event patterns; The discharge certificate text and the structured query are input into a pre-trained multi-task machine reading comprehension model, and a set of diagnosis and treatment event triples is output. Each triple in the set of diagnosis and treatment event triples includes a subject, a relation, and an object. Obtain a pre-defined clinical relationship mapping rule, which is used to define the correspondence between the relationships in the triples and the graph structure edge types, including temporal edges, causal treatment edges, and state evolution edges; Each triple is transformed into a corresponding graph structure element according to the clinical relationship mapping rule, and the graph structure element includes nodes and edges; Based on the graph structure elements, construct an individual diagnosis and treatment narrative graph corresponding to each patient.
3. The method according to claim 1, characterized in that, The process of processing the individual medical narrative graph to generate a temporal transaction sequence for each patient, and then aggregating the temporal transaction sequences of all patients to form a sequence database, includes: Obtain predefined clinical milestone event types, including admission events, surgical events, key treatment initiation events, departmental transfer events, and discharge events; The individual treatment narrative graph is traversed to identify the clinical milestone event nodes corresponding to the clinical milestone event types, and the node representing the final outcome is determined from the individual treatment narrative graph. The node representing the final outcome is used as the backtracking starting point. Starting from the backtracking starting point, a reverse traversal is performed along the temporal edge and causal treatment edge of the individual diagnosis and treatment narrative graph, collecting each event node visited during the traversal process to form an original event list; A clinical stage labeling system is constructed, which includes labels for medical history summary, admission assessment period, core treatment period, recovery observation period, and pre-discharge preparation period. The event nodes in the original event list are aggregated based on the clinical milestone event nodes. Time windows are divided with the timestamps of two adjacent clinical milestone event nodes as boundaries. Clinical milestone event nodes that fall within the same time window and meet the preset event correlation threshold are grouped into the same time series transaction to obtain multiple time series transactions. Based on the clinical stage labeling system, a corresponding clinical stage label is assigned to each of the time-series transactions to obtain labeled time-series transactions; Arrange the multiple labeled time-series transactions in the forward chronological order of each labeled time-series transaction to generate a time-series transaction sequence corresponding to each patient. The sequence database is constructed by summarizing the time-series transaction sequences corresponding to each patient.
4. The method according to claim 1, characterized in that, Based on the sequence database, multiple sets of original frequent time series patterns are obtained through parsing using an improved generalized sequence pattern algorithm, constructing a set of original frequent time series patterns, including: Construct a clinical event ontology and obtain preset mining parameters; the clinical event ontology contains a hierarchical structure of event types, and the mining parameters include a minimum support threshold and a maximum allowable gap; Based on the mining parameters and the improved generalized sequence pattern algorithm, candidate pattern matching is performed on each time-series transaction sequence in the sequence database to obtain multiple candidate patterns; wherein, the improved generalized sequence pattern algorithm integrates flexible time gap constraints and hierarchical relaxation matching mechanism; the hierarchical relaxation matching mechanism matches abstract events with specific events by calling the clinical event ontology; The support of each candidate pattern in the sequence database is calculated, and the candidate patterns with support not lower than the minimum support threshold are determined as the original time series frequent patterns. The original time series frequent patterns are collected to construct the original time series frequent pattern set.
5. The method according to claim 1, characterized in that, The process involves clustering and classifying the patterns in the original time-series frequent pattern set to obtain multiple clusters. Multiple sequence alignment is then performed on the original time-series frequent patterns within each cluster to identify conserved event sequences and variant branch events. A generalized clinical pathway map is constructed, and information is extracted from the generalized clinical pathway map. Based on this information, a corresponding natural language summary is generated, including: Obtain a predefined list of public background events, which includes routine clinical monitoring events; Each original time-series frequent pattern in the original time-series frequent pattern set is cleaned by removing events belonging to the common background event list from each original time-series frequent pattern to obtain the cleaned original time-series frequent pattern. Feature extraction is performed on each of the original time-series frequent patterns after cleaning to obtain the corresponding numerical feature vectors. The dimensions of the numerical feature vectors include pattern length, key event type distribution, key event sequence relationship, and pattern support. Calculate the similarity between any two numerical feature vectors, and use a hierarchical clustering algorithm to cluster and classify each of the original time-series frequent patterns based on the similarity to obtain multiple classification clusters; For each of the original time-series frequent patterns within each of the aforementioned taxonomic clusters, a multi-sequence global alignment process is performed to identify conserved event sequences that share patterns and variant branch events that exhibit differences. A directed acyclic graph is constructed based on the conserved event sequences shared by the pattern and the variant branch events that have differences, and the directed acyclic graph is determined as the generalized clinical pathway graph. Obtain a pre-set natural language summarization template, which includes a core event description slot, a branch event probability slot, and a statistical information display slot; Extract the core event information, branch event probability information, and corresponding patient group statistics from the generalized clinical pathway graph, and fill the core event information, branch event probability information, and patient group statistics into the corresponding slots of the natural language summarization template to generate the corresponding natural language summary.
6. The method according to claim 5, characterized in that, The construction of a directed acyclic graph (DAG) based on the conserved event sequences shared by the pattern and the differing variant branch events, and the determination of the DAG as the generalized clinical pathway graph, includes: The conservative event sequence shared by the pattern is mapped to the core path nodes in the directed acyclic graph, and the connection relationship of each core path node is set according to the time order of the conservative event sequence shared by the pattern. The occurrence frequency of each variant branch event with differences is counted in the original time-series frequent patterns within the classification cluster, and the occurrence frequency of each variant branch event is calculated. The occurrence frequency is the ratio of the occurrence frequency to the total number of original time-series frequent patterns within the classification cluster. Branch nodes in the directed acyclic graph are created based on the type and frequency of the differing mutation branch events, and the corresponding occurrence probability is determined based on the frequency of each differing mutation branch event. The weight of the connecting edge between any two nodes in the directed acyclic graph is set based on the probability of occurrence of the mutated branch events with differences; wherein, the connecting edge includes the edge between the branch node and the core path node and the edge between the branch node and the branch node. Obtain patient group data corresponding to the sequence database, and calculate statistical information based on patient information that supports each core path node, branch node and corresponding connection relationship in the patient group data. The statistical information includes the proportion of patients supporting the path, the average length of hospital stay and the incidence of outcome. The statistical information is associated with the corresponding core path nodes, branch nodes, and connecting edges in the directed acyclic graph to obtain the generalized clinical path graph.
7. The method according to claim 4, characterized in that, The support level is calculated using the following formula: in, Indicate candidate pattern The aforementioned support level; Represents the sequence database The total number of time-series transaction sequences; Represents the sequence database The Middle A sequence of time-series transactions; This indicates a pattern matching indicator function, which is used when a candidate pattern... With time-series transaction sequences During matching, the function takes the value of When there is a mismatch, the value is taken as ; Indicate candidate pattern The clinical level weight, with a value range of 100%. ; Indicate candidate pattern In time-series transaction sequences The actual time interval between the matched events; This indicates the preset maximum allowable time interval; This represents the natural exponential function.
8. A system for mining and analyzing the associations of clinical comorbidities in discharged patients, characterized in that, The system includes: The diagnosis and treatment narrative modeling module is used to construct an individual diagnosis and treatment narrative graph for each patient, including temporal and causal relationships, based on the discharge medical certificate text; process the individual diagnosis and treatment narrative graph to generate a temporal transaction sequence for each patient, and collect the temporal transaction sequences of all patients to form a sequence database; The time series pattern mining module is used to analyze the sequence database using an improved generalized sequence pattern algorithm to obtain multiple sets of original time series frequent patterns and construct a set of original time series frequent patterns. The clinical pathway generalization module is used to perform clustering and classification processing on each pattern in the original time-series frequent pattern set to obtain multiple classification clusters, and to perform multi-sequence alignment processing on the original time-series frequent patterns in each classification cluster to identify conserved event sequences and variant branch events, construct a generalized clinical pathway graph, extract information from the generalized clinical pathway graph, and generate corresponding natural language summaries based on the information.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.