Method for synthesizing electronic medical record data based on semantic processing

By constructing a probabilistic medical knowledge graph and dynamic spatiotemporal path planning, combined with an improved TSDiff model, logically rigorous and multimodal consistent electronic medical record data is generated, solving the problems of logical inconsistency and model rigidity in traditional methods, and realizing high-quality medical record data synthesis.

CN121393706AActive Publication Date: 2026-01-23BEIJING INTELLIGENT DECISION MEDICAL TECH CO LTD

Patent Information

Application Number
CN202511977279.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-25
Publication Date
2026-01-23
Estimated Expiration
2045-12-25

AI Technical Summary

Technical Problem

Existing electronic medical record data synthesis methods have limitations in terms of logical inconsistency and modal fragmentation, lack of medical knowledge graph guidance, and model rigidity, making it difficult to generate high-quality, multimodal, and logically consistent electronic medical record data.

Method used

A probabilistic medical knowledge graph is constructed using Bayesian networks and fuzzy logic. Combined with graph convolutional networks and Monte Carlo tree search, multimodal electronic medical record data is generated. An improved TSDiff model is used for iterative optimization to ensure cross-modal consistency.

Benefits of technology

It significantly improves the medical logic and evolutionary rationality of synthetic disease progression data, generates high-quality, evolvable multimodal electronic medical record data, and solves the problems of logical inconsistency and model rigidity in traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121393706A_ABST
    Figure CN121393706A_ABST
Patent Text Reader

Abstract

The invention discloses an electronic medical record data synthesis method based on semantic processing, and relates to the technical field of medical informatization, and the method comprises the following steps: S1, constructing a probabilistic medical knowledge graph; s2, generating a semantic representation vector; s3, constructing a multi-dimensional dynamic space-time atlas; s4, generating a discrete personalized disease course event sequence with space-time coordinates; s5, taking the discrete personalized disease course event sequence and the corresponding medical entity semantic representation vector as condition input, guiding the improved TSDiff model to execute an iterative denoising process, and outputting a multi-dimensional random disease course trajectory; s6, forming multi-modal electronic medical record data; and S7, performing multi-dimensional quality evaluation on the multi-modal electronic medical record data. According to the method, the limitations of logic inconsistency, modal splitting and model capability solidification in a traditional synthesis method are overcome, and an efficient and accurate solution is provided.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of medical informatization, and in particular to a method for synthesizing electronic medical record data based on semantic processing. BACKGROUND

[0002] With the deep integration of smart medical care and artificial intelligence technology, high-quality and large-scale medical data has become the core production factor driving the intelligentization of medical research and clinical decision-making. In the fields of precision medicine, new drug research and development, disease prediction, and medical AI model training, synthetic electronic medical record data not only effectively alleviates the bottleneck of strong privacy, difficult access, and high labeling cost of real-world data, but also is a key way to ensure algorithm fairness and improve model generalization ability. However, existing methods for synthesizing electronic medical record data are mostly based on simple statistical distribution fitting or rule template filling, and the process is single and the authenticity and diversity of the generated data are insufficient. Although these traditional methods can generate structurally compliant data, they lack the ability to deeply model complex medical logic and control the internal consistency between multi-modal information, making it difficult to meet the high standards of data quality required by modern advanced medical AI applications.

[0003] The main limitations of traditional electronic medical record data synthesis methods are logical inconsistency and modality fragmentation. Existing methods usually rely on isolated data generation techniques, such as generation models for single time series data or text generation based on pre-defined templates, and the process lacks unified knowledge guidance. When generating multi-modal information such as text, test results, and vital signs, traditional methods cannot guarantee the semantic alignment and numerical consistency between different modal data. For example, the generated text medical record describes "the patient has persistent high fever", but the corresponding vital sign time series data shows normal body temperature, which is an internal contradiction between modalities that seriously affects the usability and credibility of the synthetic data. Especially in the face of the dynamics, uncertainty, and complexity of disease development, the generalization ability and logical self-consistency of traditional methods are severely limited.

[0004] In addition, traditional methods often ignore the deep guiding role of medical knowledge graphs and the continuous evolution of model capabilities during data synthesis. For example, in clinical scenarios with a vast medical knowledge system and complex logical relationships, simple random sampling or unguided generation models cannot effectively follow the natural development process and treatment path of diseases, resulting in a lack of medical reasonableness in the generated disease progression evolution. Even if some methods use knowledge graphs or generation models, they fail to establish an effective evaluation feedback mechanism to quantify the quality of the generated data and optimize the generation strategy accordingly, resulting in a solidified model performance that is difficult to achieve efficient, realistic, and self-evolving multi-modal electronic medical record data synthesis.

[0005] Therefore, how to provide a synthesis method of electronic medical record data based on semantic processing is a problem that those skilled in the art urgently need to solve. SUMMARY

[0006] The application provides a synthesis method of electronic medical record data based on semantic processing, which quantifies the uncertainty and fuzziness in medical knowledge by fusing a Bayesian network and fuzzy logic to construct a probabilistic medical knowledge graph; adopts a graph convolution network and a Monte Carlo tree search to perform rigorous logical course path planning in a dynamic spatiotemporal graph and generate a discrete event sequence; uses an improved TSDiff model to guide the generation of a smooth continuous course trajectory from the discrete event sequence, and synchronously generates text, test and vital sign data and other multi-modal data based on the trajectory through a T5 model, ensuring the internal consistency between cross-modal data. By designing a multi-dimensional quality evaluation system including physiological, statistical and fuzzy semantic compliance, and taking the evaluation error as a feedback signal, the state transition function and the generation model are iteratively optimized, which overcomes the limitations of logical inconsistency, modal fragmentation and model capability solidification in traditional synthesis methods, and provides an efficient and accurate solution for generating high-quality and evolvable multi-modal electronic medical record data.

[0007] According to the synthesis method of electronic medical record data based on semantic processing, the method comprises the following steps: S1, collecting multi-source heterogeneous medical knowledge data, extracting medical entities and semantic relationships between the entities, using a Bayesian network to model the conditional probability of the semantic relationships, and using fuzzy logic to fuzzily quantify the state attributes of the medical entities, and constructing a probabilistic medical knowledge graph; S2, inputting the probabilistic medical knowledge graph into a GCN network, aggregating the neighbor information of the nodes through a graph message passing mechanism, and combining the conditional probability weight of the semantic relationship and the fuzzy membership degree of the state attribute to generate a corresponding semantic representation vector for each medical entity; S3, based on all medical entities and corresponding semantic representation vectors, constructing a multi-dimensional dynamic spatiotemporal graph, and setting a state transition probability function of the multi-dimensional dynamic spatiotemporal graph based on the probability distribution in the probabilistic medical knowledge graph and the fuzzy logic; S4, according to a preset virtual patient initial state vector, using a Monte Carlo tree search in the multi-dimensional dynamic spatiotemporal graph to sample a path according to the state transition probability function, and generating a discrete personalized course event sequence with spatiotemporal coordinates; S5, inputting the discrete personalized course event sequence and the corresponding medical entity semantic representation vector as a condition to guide the improved TSDiff model to perform an iterative denoising process, and outputting a multi-dimensional random course trajectory; S6, guided by the multi-dimensional random disease course trajectory, the T5 model synchronously generates natural language text medical records, formatted examination data and vital sign time series data to form multi-modal electronic medical record data; S7, multi-dimensional quality assessment is performed on the multi-modal electronic medical record data to generate evaluation errors, and the evaluation errors are used as feedback signals to iteratively optimize the state transition probability function and the hyperparameters of the improved TSDiff model.

[0008] Optionally, the S1 specifically comprises: S11, structured medical knowledge base, clinical guideline text and desensitization medical record text are collected as multi-source heterogeneous medical knowledge data; S12, the multi-source heterogeneous medical knowledge data is processed by using a pre-trained BiLSTM-CRF model to extract diseases, symptoms, drugs and examinations as medical entities, and to extract causal, temporal and treatment relationships between entities as semantic relationships to form an initial knowledge graph containing entities and relationships; S13, for the semantic relationships in the initial knowledge graph, a Bayesian network with diseases as parent nodes is constructed, and a conditional probability table is calculated for each relationship edge in the initial knowledge graph to complete conditional probability modeling; S14, for the medical entities in the initial knowledge graph, a triangular fuzzy membership function is defined, and the fuzzy membership degree of the state value to the fuzzy language variable is calculated to add fuzzy attributes to each entity node in the initial knowledge graph to complete fuzzy quantization; S15, the initial knowledge graph with added probability weights and fuzzy attributes is integrated to construct a final probabilistic medical knowledge graph containing medical entities, semantic relationships, conditional probability tables and fuzzy membership functions.

[0009] Optionally, the S2 specifically comprises: S21, each medical entity in the probabilistic medical knowledge graph is initialized as a node, and each semantic relationship is initialized as an edge connecting the nodes to construct an initial topology structure of the GCN network; S22, for any target node of the initial topology structure of the GCN network, the initial feature vector of the first-order neighbor node is obtained; S23, according to the conditional probability weight of the edge connecting the target node and each neighbor node, the initial feature vector of each neighbor node is weighted to generate a plurality of weighted neighbor feature vectors; S24, according to the fuzzy membership degree of the state attribute of each neighbor node, the weighted neighbor feature vector is secondarily weighted to generate a plurality of fuzzy weighted neighbor feature vectors; S25, aggregate all the fuzzy weighted neighbor feature vectors to generate a neighbor aggregated information vector; fuse the neighbor aggregated information vector with the feature vector of the target node at the previous level to generate an aggregated information vector at the current level of the target node; S26, iteratively perform S22 to S25 until the multi-hop neighbor information of the preset hop number is aggregated, and take the aggregated information vector generated at the last layer as the semantic representation vector of the target node.

[0010] Optionally, the S3 specifically comprises: S31, define a group of atomic medical events based on all medical entities and corresponding semantic representation vectors, and take each atomic medical event as a node of a multi-dimensional dynamic spatiotemporal graph; S32, create a directed edge between any two atomic medical event nodes with causal, temporal or treatment dependent relationship according to the semantic relationship in the probabilistic medical knowledge graph, and construct the topological structure of the graph; S33, attach an initial timestamp and a spatial position label to each atomic medical event node, and attach a time delay parameter to each directed edge to form the spatiotemporal attributes of the multi-dimensional dynamic spatiotemporal graph; S34, set the state transition probability between the two atomic medical event nodes connected by the directed edge based on the conditional probability table corresponding to the directed edge in the probabilistic medical knowledge graph; S35, set the state value range and fuzzy state transition rule of the atomic medical event node based on the fuzzy membership function corresponding to the atomic medical event node in the probabilistic medical knowledge graph; S36, integrate the state transition probability and fuzzy state transition rule of all nodes to generate a global state transition probability function of the multi-dimensional dynamic spatiotemporal graph.

[0011] Optionally, the S4 specifically comprises: S41, map the initial state vector of the virtual patient to the starting node in the multi-dimensional dynamic spatiotemporal graph, and set the timestamp and spatial position label of the starting node; S42, starting from the starting node, calculate the transition probabilities of all reachable next-hop nodes based on the global state transition probability function of the multi-dimensional dynamic spatiotemporal graph, and accumulate and sum to obtain the cumulative transition probability; S43, use the Monte Carlo tree search algorithm, take the cumulative transition probability as the reward value, search for an optimal path in the multi-dimensional dynamic spatiotemporal graph through four steps of selection, expansion, simulation and back propagation, and take the node sequence on the optimal path as a preliminary event sequence; S44, sort and integrate each node in the preliminary event sequence according to the timestamp and spatial position label to generate a discrete personalized disease course event sequence with spatiotemporal coordinates.

[0012] Optionally, the improved TSDiff model comprises an event encoder, a time-aware mask generator, and a trajectory denoiser. The event encoder is configured to receive each medical event in the discrete personalized disease course event sequence, directly concatenate a timestamp, a spatial position coordinate, and a medical entity semantic representation vector of each medical event to form an intermediate fusion vector, input the intermediate fusion vector to a linear projection layer for linear transformation to obtain an initial event representation tensor, and output the initial event representation tensor to the trajectory denoiser. The time-aware mask generator is configured to receive a target time point currently processed by the trajectory denoiser, calculate a time distance between the target time point and a timestamp of each medical event, convert the time distance into a series of mask weights in the interval (0, 1] according to a Gaussian kernel function, generate a time-aware conditional mask consistent with the dimension of the initial event representation tensor, and output the time-aware conditional mask to the trajectory denoiser. The trajectory denoiser comprises multiple layers of Transformer-based decoder blocks. In each layer of the decoder blocks, cross-attention calculation is performed with the current trajectory noise tensor as a query and the initial event representation tensor as keys and values, and the time-aware conditional mask is applied in the calculation process to weight the attention scores, and an event-aware trajectory feature tensor is output. The trajectory denoiser inputs the event-aware trajectory feature tensor into a subsequent feedforward network layer to output a preliminary denoised trajectory tensor. The trajectory denoiser starts from a preset pure Gaussian noise tensor and iteratively denoises the noise tensor in multiple steps. In each iteration, the trajectory denoiser receives the current trajectory noise tensor and outputs a cleaner preliminary denoised trajectory tensor. The preliminary denoised trajectory tensor is used as the input for the next iteration until a preset convergence condition is met, and a multi-dimensional random disease course trajectory is finally output.

[0013] Optionally, the S6 specifically comprises: S61, performing Z-score normalization on each dimension of the multi-dimensional random disease course trajectory, and padding or truncating to a preset length to generate a standard trajectory matrix; S62, inputting the standard trajectory matrix into a pre-trained trajectory-narrative encoder, and the encoder compresses continuous numerical trajectory data into a fixed-length multi-modal medical record representation vector; S63, concatenating the multi-modal medical record representation vector as a soft prompt with a preset learnable task prefix vector to form a unified medical record generation prompt vector; S64, inputting the medical record generation prompt vector into a pre-trained T5 model, and synchronously outputting a natural language text medical record, formatted test data, and vital sign time series data through conditional generation to form multi-modal electronic medical record data.

[0014] Optionally, the trajectory-narrative encoder comprises a trajectory encoder, a narrative encoder and a narrative-trajectory alignment fusion layer: The trajectory encoder is configured to receive a multi-dimensional stochastic disease trajectory, perform local feature extraction through a one-dimensional convolutional neural network to generate a trajectory local feature tensor, input the trajectory local feature tensor into a bidirectional long short-term memory network to capture long-range temporal dependencies in the trajectory, and output a trajectory context feature tensor; The narrative encoder is configured to receive a discrete personalized disease event sequence corresponding to the multi-dimensional stochastic disease trajectory, encode each medical event into an initial event representation vector through an event encoder, input the initial event representation vector sequence into a Transformer encoder to capture the context semantic relationship between events, and output a narrative context feature tensor; The narrative-trajectory alignment fusion layer is configured to perform cross-attention calculation by taking the trajectory context feature tensor as a query, the narrative context feature tensor as a key and a value, so that the trajectory feature learns semantic information in the narrative, and generate a narrative-aware trajectory feature tensor; the narrative-aware trajectory feature tensor and the trajectory context feature tensor are connected in residual and normalized, and the final trajectory representation tensor after alignment fusion is output.

[0015] Optionally, the S7 specifically comprises: S71, receiving multi-modal electronic medical record data, deconstructing the multi-modal electronic medical record data into natural language text medical records, formatted test data and vital sign time series data through parsing a pre-defined tokenization format, and restoring the formatted test data and vital sign time series data into structured numerical matrices; S72, based on a pre-set physiological rule base, instantiating the pre-set physiological rule base into a series of computable Boolean logic predicates to detect logical conflicts between vital signs and test results; by counting the number of conflict rules triggered in a unit time window and performing Softmax normalization processing, a quantitative physiological consistency error is calculated; S73, calculating the core statistics mean, variance and quantile of the vital sign time series data, and comparing with the corresponding statistics in the real world medical record database; by calculating the root mean square error between each statistic, and then weighted summing to obtain a statistical distribution alignment error; S74, using a medical semantic similarity model, calculating the difference between the semantic vector of the natural language text medical record and the semantic abstract vector of the multi-dimensional stochastic disease trajectory, and generating a fuzzy semantic compliance error; S75, weighting and summing the physiological consistency error, the statistical distribution alignment error and the fuzzy semantic compliance error to generate a comprehensive quality assessment error; S76, the integrated quality evaluation error is taken as a feedback signal, and the state transition probability function and the hyperparameters of the improved TSDiff model are iteratively optimized through the Adam optimizer, so that a closed-loop model self-evolution system is formed.

[0016] Optionally, the medical semantic similarity model comprises a text encoder, a trajectory encoder, a projection head and a difference calculation layer. The text encoder is configured to receive a natural language text medical record, encode the text through a pre-trained BERT model, extract context semantic information of the text, and generate an original text semantic vector. The trajectory encoder is configured to receive a multi-dimensional random disease course trajectory, encode the trajectory through a Transformer-based time series encoder, capture dynamic time series dependency within the trajectory, and generate an original trajectory abstract vector. The projection head is configured to map the original text semantic vector and the original trajectory abstract vector to a shared multi-modal semantic space respectively, to obtain an aligned text semantic vector and a trajectory semantic vector. The difference calculation layer is configured to calculate the cosine similarity between the aligned text semantic vector and the trajectory semantic vector, and take the complement of the similarity value as a fuzzy semantic compliance error.

[0017] The present application has the following advantages: (1) The present application significantly improves the medical logic and evolution rationality of the synthesized disease course data by constructing a probabilistic medical knowledge graph and a dynamic space-time path planning. Traditional electronic medical record synthesis methods are mostly based on static rules or simple probability models, which are difficult to simulate the uncertainty and individual differences of disease development in real clinical practice. To solve this problem, the present application innovatively combines Bayesian networks and fuzzy logic to model medical knowledge, so that the knowledge graph can quantify the conditional probability of semantic relationships and the fuzzy membership degree of entity states, thereby more truly reflecting the complexity of clinical practice. At the same time, Monte Carlo tree search is used to perform heuristic path sampling in the dynamic space-time graph, which can generate a macro disease course "skeleton" with more rigorous logic and more consistent with the natural development law of the disease, thereby significantly improving the realism and diversity of the synthesized data at the macro level.

[0018] (2) The application solves the core technical problems of semantic inconsistency between multi-modal data and model performance solidification by designing a multi-modal condition generation and closed-loop self-evolution mechanism with disease trajectory as the core. Traditional synthesis methods usually generate each modality data independently, resulting in logical contradictions between text description and numerical indicators, and the model cannot be improved once it is trained. The application first converts the discrete event sequence into a smooth continuous multi-dimensional random disease trajectory using the improved TSDiff model, and then uses this trajectory as a unified condition to guide the T5 model to generate text, test and vital signs data simultaneously, ensuring the high consistency of multi-modal data from the root. In addition, by constructing a multi-dimensional evaluation system including physiology, statistics and fuzzy semantic compliance, and feeding the evaluation error back to the path planning and trajectory generation module for joint optimization, a closed-loop system capable of continuous learning and self-evolution is formed. This method breaks through the limitations of traditional generation models in multi-modal collaboration and capability iteration, providing strong technical support for generating high-quality, high-fidelity and sustainable optimized electronic medical record data. BRIEF DESCRIPTION OF DRAWINGS

[0019] The accompanying drawings are included to provide a further understanding of the application, and constitute a part of the specification, illustrate the application, and are used to explain the application together with the embodiments of the application, and do not constitute a limitation on the application. In the drawings:

[0020] Figure 1 The overall flowchart of the electronic medical record data synthesis method based on semantic processing proposed by the application is shown in the figure. Figure 2 The working principle flowchart of the improved TSDiff model of the electronic medical record data synthesis method based on semantic processing proposed by the application is shown in the figure. DETAILED DESCRIPTION

[0021] The application will now be described in further detail with reference to the drawings. These drawings are simplified schematic diagrams that only schematically illustrate the basic structure of the application, and therefore only show the components related to the application.

[0022] REFERENCE Figure 1 and Figure 2 A synthesis method of electronic medical record data based on semantic processing, comprising the following steps: S1, collect multi-source heterogeneous medical knowledge data, extract medical entities and semantic relationships between entities, model the conditional probability of semantic relationships using Bayesian network, and quantize the state attributes of medical entities using fuzzy logic, and construct a probabilistic medical knowledge graph; S2, input the probabilistic medical knowledge graph into the GCN network, aggregate the neighbor information of the nodes through the graph message passing mechanism, and combine the conditional probability weight of the semantic relationship and the fuzzy membership degree of the state attribute to generate a corresponding semantic representation vector for each medical entity; S3, based on all medical entities and corresponding semantic representation vectors, construct a multi-dimensional dynamic space-time graph, and set a state transition probability function of the multi-dimensional dynamic space-time graph based on the probability distribution in the probabilistic medical knowledge graph and the fuzzy logic; S4, according to the preset initial state vector of the virtual patient, in the multi-dimensional dynamic space-time graph, a path sampling is performed according to the state transition probability function by using the Monte Carlo tree search, to generate a discrete personalized disease course event sequence with space-time coordinates; S5, input the discrete personalized disease course event sequence and the corresponding medical entity semantic representation vector as a condition, guide the improved TSDiff model to perform an iterative denoising process, and output a multi-dimensional random disease course trajectory; S6, taking the multi-dimensional random disease course trajectory as a condition, guiding the T5 model to synchronously generate natural language text medical records, formatted test data and vital sign time series data, to form multi-modal electronic medical record data; S7, perform multi-dimensional quality evaluation on the multi-modal electronic medical record data, generate evaluation errors, and use the evaluation errors as feedback signals to iteratively optimize the state transition probability function and the hyperparameters of the improved TSDiff model.

[0023] In the embodiment, the S1 specifically includes: S11, collect structured medical knowledge base, clinical guideline text and desensitization medical record text as multi-source heterogeneous medical knowledge data; S12, process the multi-source heterogeneous medical knowledge data by using a pre-trained BiLSTM-CRF model, extract diseases, symptoms, drugs and examinations as medical entities, and extract causal, time sequence and treatment relationships between entities as semantic relationships, to form an initial knowledge graph containing entities and relationships; S13, for the semantic relationship in the initial knowledge graph, a Bayesian network with disease as the parent node is constructed, the conditional probability weight is given to each relationship edge of the initial knowledge graph by calculating the conditional probability table of the child node under the parent node, the conditional probability modeling is completed, including entity linking of the diagnosis, symptoms, examination description in the electronic medical record data and the medical entities in the initial knowledge graph to generate a case matrix; for each disease node in the initial knowledge graph, the disease node is taken as the parent node, and the symptom node and the examination node connected with the disease node are taken as the child node to construct the topology structure of the Bayesian network; for each parent node, the case subset corresponding to the parent node is selected from the case matrix; in the case subset, the number of occurrence of each child node and the total number of the case subset are counted; the ratio of the number of occurrence of the child node to the total number of the case subset is calculated to generate the conditional probability table; the relationship edge in the initial knowledge graph is traversed; the corresponding probability value is searched from the conditional probability table according to the parent node and the child node of the relationship edge; the probability value is taken as the probability weight attribute of the relationship edge, and is written into the initial knowledge graph to complete the conditional probability modeling; S14, for the medical entities in the initial knowledge graph, a triangular fuzzy membership function is defined, the fuzzy attribute is added to each entity node of the initial knowledge graph by calculating the fuzzy membership of the state value to the fuzzy language variable to complete the fuzzification and quantization, including obtaining the clinical indicators of the medical entities, defining the fuzzy language variable for each clinical indicator, and determining the normal reference value range of the clinical indicator; according to the expert experience, the set of the fuzzy language variable is defined, the numerical interval is allocated to each fuzzy language variable, and the parameters of the triangular fuzzy membership function are set for each fuzzy language variable; for the triangular fuzzy membership function, the left boundary, the peak point and the right boundary are set as three parameters; it is ensured that the numerical intervals of the adjacent fuzzy language variables overlap with each other; the corresponding relationship between each fuzzy language variable and the fuzzy membership function parameters is stored; patient data containing the numerical values of the clinical indicators are collected; the numerical values in the patient data are input into the corresponding fuzzy membership function; the fuzzy membership of the numerical value to each fuzzy language variable is calculated; the fuzzy language variable with the highest fuzzy membership is selected; the selected fuzzy language variable is taken as the fuzzy attribute of the entity; the fuzzy attribute is added to the corresponding entity node of the initial knowledge graph to complete the fuzzification and quantization; S15, the initial knowledge graph with the added probability weight and fuzzy attribute is integrated to construct the final probabilistic medical knowledge graph containing medical entities, semantic relationships, conditional probability tables and fuzzy membership functions.

[0024] The step is to construct and enhance the knowledge graph by systematically integrating multi-source data, and finally form a medical knowledge network capable of probabilistic reasoning and fuzzy decision-making. A data base is constructed by collecting multi-source heterogeneous medical knowledge data. A pre-trained BiLSTM-CRF model is used to extract medical entities and semantic relationships to form an initial knowledge graph, realizing the conversion of text to structured knowledge. A Bayesian network with disease as the parent node is constructed, and the conditional probability weight is assigned to the relationship edge by calculating the conditional probability, so that the graph has the ability of uncertain reasoning. A triangular fuzzy membership function is defined, and fuzzy attributes are added to entity nodes by calculating fuzzy membership, realizing the fuzzy description of continuous clinical indicators. The probability weight and fuzzy attribute are integrated to construct the final probabilistic medical knowledge graph, forming a complete knowledge system supporting intelligent reasoning.

[0025] In the embodiment, S2 specifically includes: S21, initializing each medical entity in the probabilistic medical knowledge graph as a node, and initializing each semantic relationship as an edge connecting the nodes to construct the initial topological structure of the GCN network; S22, for any target node of the initial topological structure of the GCN network, obtaining the initial feature vector of the first-order neighbor node; S23, according to the conditional probability weight of the edge connecting the target node and each neighbor node, performing element-by-element weighting processing on the initial feature vector of each neighbor node to generate a plurality of weighted neighbor feature vectors; S24, according to the fuzzy membership of the state attribute of each neighbor node, performing element-by-element secondary weighting processing on the weighted neighbor feature vector to generate a plurality of fuzzy weighted neighbor feature vectors; S25, summing up all the fuzzy weighted neighbor feature vectors to generate a neighbor aggregation information vector; and fusing the neighbor aggregation information vector and the feature vector of the target node at the last level to generate an aggregation information vector at the current level of the target node; S26, iteratively performing S22 to S25 until the multi-hop neighbor information of the preset hop number is aggregated, and taking the aggregation information vector generated at the last layer as the semantic representation vector of the target node.

[0026] The step updates the node representation layer by layer by fusing the probabilistic relationship of the knowledge graph and the fuzzy information of the entity state, and finally generates an entity vector containing rich multi-hop semantic information. The GCN network topology structure is read by reading the probabilistic medical knowledge graph, the initial feature vector of the first-order neighbor node of the target node is obtained, the neighbor feature vector is weighted by using the conditional probability weight of the edge, the neighbor node is twice weighted by using the fuzzy membership degree, and the neighbor aggregation information vector is generated by aggregating all the weighted neighbor vectors; the neighbor aggregation information vector and the feature of the target node itself are fused to generate the current layer aggregation information vector. Through iterative aggregation of multi-hop neighbor information, the semantic representation vector of the target node is finally generated.

[0027] In the embodiment, the S3 specifically includes: S31, based on all medical entities and corresponding semantic representation vectors, a set of atomic medical events is defined, and each atomic medical event is taken as a node of a multi-dimensional dynamic space-time graph; S32, according to the semantic relationship in the probabilistic medical knowledge graph, a directed edge is created between any two atomic medical event nodes with causal, time sequence or treatment dependent relationship, and the topology structure of the graph is constructed, including calling a pre-defined medical event relationship ontology library, matching the semantic relationship in the probabilistic medical knowledge graph with the causal, time sequence and treatment dependent relationship templates in the ontology library, creating a directed edge between the atomic medical event node pairs connected by the matched semantic relationship, and constructing the topology structure of the graph; S33, an initial time stamp and a spatial position label are attached to each atomic medical event node, and a time delay parameter is attached to each directed edge, forming the space-time attributes of the multi-dimensional dynamic space-time graph; S34, based on the conditional probability table corresponding to the directed edge in the probabilistic medical knowledge graph, the state transition probability between the two atomic medical event nodes connected by the directed edge is set; S35, based on the fuzzy membership function corresponding to the atomic medical event node in the probabilistic medical knowledge graph, the state value range and the fuzzy state transition rule of the atomic medical event node are set, including reading the fuzzy membership function metadata of the atomic medical event node, instantiating a set of fuzzy states according to the state definition parameters in the metadata, taking the value range of the instantiated fuzzy state set as the state value range of the atomic medical event node, and automatically generating the fuzzy state transition rule of the atomic medical event node according to the rule template in the metadata, combining the fuzzy state set of the source node and the target node; S36, integrate the state transition probability of all nodes and the fuzzy state transition rule, generate the global state transition probability function of the multi-dimensional dynamic space-time graph, including combining the source node state transition probability, the source node fuzzy membership degree, and the target node fuzzy membership degree of each node transition event, constructing an input feature vector; inputting the input feature vector into a multi-layer perception machine for processing, outputting an adjusted transition probability value; collecting the adjusted transition probability of all outgoing edges of the source node, performing Softmax normalization processing, and generating the global state transition probability function of the multi-dimensional dynamic space-time graph.

[0028] This step lays the foundation for subsequent medical event evolution reasoning by constructing a multi-dimensional dynamic space-time graph that integrates probability and fuzzy logic. The medical entities and their semantic representation vectors are defined as atomic medical event nodes. According to the semantic relationship, directed edges are created between nodes with causal, temporal, or treatment-dependent relationships, and the graph topology is constructed. Initial time stamps and spatial location labels are added to the nodes, and time delay parameters are added to the edges, forming the space-time attributes of the graph. The state transition probability between nodes is set according to the conditional probability table. The state value range and fuzzy state transition rule of the node are set according to the fuzzy membership function. The global state transition probability function of the graph is generated by integrating the state transition probability of all nodes and the fuzzy state transition rule, realizing the dynamic integration of probability and fuzzy rules.

[0029] In this embodiment, S4 specifically includes: S41, mapping the virtual patient initial state vector to the starting node in the multi-dimensional dynamic space-time graph, and setting the time stamp and spatial location label of the starting node, including calculating the cosine similarity between the virtual patient initial state vector and the semantic representation vector of all atomic medical event nodes in the multi-dimensional dynamic space-time graph, selecting the atomic medical event node with the highest similarity score as the starting node, and setting the time stamp and spatial location label of the starting node; S42, starting from the starting node, based on the global state transition probability function of the multi-dimensional dynamic space-time graph, calculating the transition probability of all reachable next-hop nodes, and accumulating the sum to obtain the cumulative transition probability; S43, using the Monte Carlo tree search algorithm, taking the cumulative transition probability as the reward value, searching for an optimal path in the multi-dimensional dynamic space-time graph through four steps of selection, expansion, simulation, and back propagation, and taking the node sequence on the optimal path as the preliminary event sequence; S44, sorting and integrating each node in the preliminary event sequence according to the time stamp and spatial location label, generating a discrete personalized disease course event sequence with space-time coordinates.

[0030] The step generates a personalized disease course event sequence with a space-time coordinate for the virtual patient by intelligent path searching in a multi-dimensional dynamic space-time graph. The cosine similarity between the initial state vector of the virtual patient and the semantic representation vector of all nodes is calculated to select the node with the highest similarity as the starting node, realizing accurate positioning of the patient state to the graph node. Starting from the starting node, the transition probability of all reachable next-hop nodes is calculated according to the global state transition probability function and summed up to provide a quantitative basis for path searching. The Monte Carlo tree search algorithm is used to search for the optimal path in the graph by selecting, expanding, simulating and back-propagating steps, and a preliminary event sequence with maximum probability is obtained. The nodes in the preliminary event sequence are sorted and integrated according to the time stamp and spatial position label to generate a discrete personalized disease course event sequence that conforms to the real space-time logic.

[0031] In the embodiment, the improved TSDiff model includes an event encoder, a time-aware mask generator and a trajectory denoiser. The event encoder is configured to receive each medical event in the discrete personalized disease course event sequence, directly concatenate the time stamp, spatial position coordinates and medical entity semantic representation vector of each medical event to form an intermediate fusion vector, input the intermediate fusion vector into a linear projection layer for linear transformation to obtain an initial event representation tensor, and output the initial event representation tensor to the trajectory denoiser. The time-aware mask generator is configured to receive a target time point currently processed by the trajectory denoiser, calculate the time distance between the target time point and the time stamp of each medical event, convert the time distance into a series of mask weights in the interval (0, 1] according to a Gaussian kernel function, generate a time-aware conditional mask consistent with the dimension of the initial event representation tensor, and output to the trajectory denoiser. The trajectory denoiser includes multiple layers of Transformer-based decoder blocks. In each layer of the decoder block, the current trajectory noise tensor is taken as the query, and the initial event representation tensor is taken as the key and value to calculate the original attention score. The original attention score is subjected to Softmax normalization to generate a preliminary attention weight. The time-aware conditional mask tensor and the preliminary attention weight are multiplied element by element to generate a final modulated attention weight. The final modulated attention weight is multiplied with the value tensor to output an event-aware trajectory feature tensor. The event-aware trajectory feature tensor is input into a feedforward network layer. The feedforward network layer projects the event-aware trajectory feature tensor by a first linear layer to generate an intermediate feature tensor. The intermediate feature tensor is subjected to nonlinear transformation by a RELU nonlinear activation function to generate an activated feature tensor. The activated feature tensor is subjected to dimension reduction projection by a second linear layer to output a preliminary denoised trajectory tensor. The trajectory denoiser starts from a pure Gaussian noise tensor, takes the preliminary denoised trajectory tensor output by each layer as the input of the next layer, and iteratively denoises for multiple steps until a preset convergence condition is met, and outputs a multi-dimensional random disease course trajectory.

[0032] This step aims to build an end-to-end generation model to ensure that the generated trajectory is smooth and continuous in space and time, and accurately aligns with the spatiotemporal and semantic constraints of medical events. The event encoder integrates the multi-modal information of each medical event to form a unified initial event representation tensor, providing a semantic basis for trajectory generation. The time-aware mask generator dynamically adjusts the attention weight according to the temporal distance, enabling the trajectory denoiser to focus on more relevant events in time during the generation process. The trajectory denoiser iteratively fuses event information and temporal constraints through multiple decoder blocks, gradually refining the pure Gaussian noise into a preliminary denoised trajectory tensor that meets the preset conditions. Finally, the entire model outputs one or more multi-dimensional random disease course trajectories that are smooth and continuous, and consistent with the spatiotemporal coordinates and semantic constraints of the discrete individualized disease course event sequence through multiple iterative denoising steps.

[0033] In this embodiment, S6 specifically includes: S61, Z-score normalization is performed on each dimension of the multi-dimensional random disease course trajectory, and the trajectory is padded or truncated to a preset length to generate a standard trajectory matrix; S62, the standard trajectory matrix is input into the pre-trained trajectory-narrative encoder, and the encoder compresses the continuous numerical trajectory data into a fixed-length multi-modal medical record representation vector; S63, the multi-modal medical record representation vector is used as a soft prompt and spliced with a preset learnable task prefix vector to form a unified medical record generation prompt vector, including splicing the multi-modal medical record representation vector as a soft prompt with the learnable task prefix vector along the feature dimension to form a fusion prompt vector; the fusion prompt vector is input into a linear projection layer to obtain a medical record generation prompt vector through linear transformation; S64, the medical record generation prompt vector is input into the pre-trained T5 model, and through conditional generation, the natural language text medical record, formatted test data and vital sign time series data are simultaneously output to form multi-modal electronic medical record data.

[0034] This step aims to convert abstract numerical trajectories into structured and content-rich multi-modal electronic medical records. By normalizing and unifying the length of the trajectory, a standard trajectory matrix is generated, eliminating the dimensional differences of different physiological indicators and meeting the input requirements of the model. The trajectory-narrative encoder compresses the standard trajectory matrix into a fixed-length multi-modal medical record representation vector, realizing the conversion from continuous numerical values to high-dimensional semantic features. The multi-modal medical record representation vector is spliced with a learnable task prefix vector and projected through a linear projection to form a unified medical record generation prompt vector, which integrates specific medical record content and general task instructions for subsequent generation tasks.

[0035] In this embodiment, S7 specifically includes: S71, receiving multi-modal electronic medical record data, and decomposing into three modal sub-data of natural language text medical record, formatted test data and vital sign time series data; S72, based on a preset physiological rule base, dynamically evaluating the consistency of the vital sign time series data and the formatted test data, and calculating a physiological consistency error; S73, comparing the statistical distribution of the vital sign time series data with the corresponding distribution in the real world medical record database, and calculating a statistical distribution alignment error; S74, using a medical semantic similarity model, calculating the difference between the semantic vector of the natural language text medical record and the semantic abstract vector of the multi-dimensional random disease trajectory, and generating a fuzzy semantic compliance error; S75, weighting and summing the physiological consistency error, the statistical distribution alignment error and the fuzzy semantic compliance error to generate a comprehensive quality evaluation error; S76, taking the comprehensive quality evaluation error as a feedback signal, and iteratively optimizing the state transition probability function and the hyperparameters of the improved TSDiff model through the Adam optimizer, to form a closed-loop model self-evolution system.

[0036] This step aims to establish a closed-loop feedback mechanism to realize the self-evolution of the model. By decomposing the multi-modal electronic medical record data, independent data sources are provided for multi-dimensional evaluation. Based on the physiological rule base, dynamic consistency evaluation is performed to quantify the internal logical rationality of the generated data. Comparing the generated data with the real world distribution ensures its statistical authenticity. Using the semantic similarity model to calculate the difference, the consistency of the generated text and the original trajectory in macro semantics is evaluated. By weighting and summing the errors, a comprehensive quality evaluation error is formed, realizing the comprehensive quantification of the generation quality. Taking this error as a feedback signal to optimize the model hyperparameters, a closed-loop self-evolution system that can continuously improve itself is constructed.

[0037] In this embodiment, the medical semantic similarity model includes a text encoder, a trajectory encoder, a projection head and a difference calculation layer; The text encoder is used to receive the natural language text medical record, encode it through the pre-trained BERT model, extract the context semantic information of the text, and generate the original text semantic vector; The trajectory encoder is used to receive the multi-dimensional random disease trajectory, encode it through the Transformer-based time series encoder, capture the dynamic time series dependency relationship inside the trajectory, and generate the original trajectory abstract vector; The projection head is configured to map the original text semantic vector and the original trajectory summary vector into a same shared multi-modal semantic space respectively, to obtain an aligned text semantic vector and a trajectory semantic vector. The difference calculation layer is configured to calculate a cosine similarity between the aligned text semantic vector and the trajectory semantic vector, and take a complement of the similarity value as a fuzzy semantic compliance error.

[0038] This step aims to build a cross-modal semantic alignment bridge to evaluate the consistency of the generated content. Through the text encoder, the natural language medical record is converted into a semantic vector containing rich context information, realizing the deep understanding of the clinical narrative. Through the trajectory encoder, the multi-dimensional time series data is abstracted into a summary vector that can capture the dynamic evolution law, realizing the pattern recognition of numerical trajectory. The projection head is used to map the heterogeneous vectors into a unified semantic space, eliminating the representation gap between modalities. By calculating the semantic distance between vectors, the fuzzy text and trajectory relationship is quantified into an accurate compliance error, realizing the effective measurement of cross-modal logical consistency.

[0039] Embodiment 1: In order to verify the feasibility of the present application in personalized disease course prediction and electronic medical record generation, the method of the present application is applied to the diabetes intelligent management system of the endocrinology department of a certain third-grade class-A hospital (hereinafter referred to as "hospital M"). In the traditional disease course management system, methods based on linear regression or conventional time series models are usually used to predict future indicators of patients. These methods not only have difficulty in capturing the nonlinear state transition and complex event influence in the disease course, but also cannot generate a multi-modal medical record consistent with the predicted trajectory, resulting in low prediction accuracy and lack of clinical reference value in the generated electronic medical record. In order to solve the above problems, hospital M decided to use the personalized disease course trajectory generation and multi-modal medical record construction method based on state transition and conditional diffusion proposed by the present application.

[0040] In the implementation process, hospital M first integrated the patient's electronic health records, including historical vital sign time series data, test results, medication records and diagnosis events, and after data cleaning, time alignment and anonymization and other preprocessing operations, a high-quality multi-modal patient data set was formed. At the same time, the endocrinology department expert team of hospital M labeled the key disease course nodes as the gold standard for model training and evaluation.

[0041] Hospital M accurately learns the state transition probability function of individuals by constructing continuous state space and discrete event space, using an improved Graphormer model, and fusing external spatio-temporal memory and on-chain knowledge graph, laying a foundation for capturing the dynamic evolution law of the disease course. Then, through the deep fusion of the improved TSDiff model with "time-aware conditional mask, event-cross attention embedding, and event anchor denoising", the discrete personalized disease course events are taken as strong conditional constraints to generate multiple smooth, continuous, and physiologically logical multi-dimensional random disease course trajectories, realizing accurate mapping from discrete events to continuous trajectories.

[0042] In the core generation phase, the present application first encodes the multi-dimensional random disease course trajectory into a multi-modal medical record representation vector, and uses a pre-trained multi-modal large language model to output natural language text medical records, formatted test data, and vital sign time series data that are strictly aligned in value and time sequence through conditional generation, forming a logically self-consistent multi-modal electronic medical record. Subsequently, the system performs multi-dimensional quality assessment on the generated multi-modal electronic medical record, calculates the dynamic physiological consistency, statistical distribution alignment degree, and fuzzy semantic compliance error, and uses this assessment error as a feedback signal to iteratively optimize the hyperparameters of the state transition probability function and the conditional diffusion model, forming a closed-loop model self-evolution system.

[0043] During the implementation process, the technical team of Hospital M found that compared with traditional linear regression methods and conventional time series models, the present application significantly improves the accuracy of disease course prediction and the usability of generated medical records. Traditional methods cannot effectively utilize discrete event information, and the generated prediction results are single, while the present application method effectively realizes accurate prediction of future disease course and automatic generation of high-quality electronic medical records through state transition learning, conditional diffusion generation, and multi-modal synchronous construction.

[0044] To further verify the actual performance of the present application method, Hospital M compared the present application method with traditional methods in detail, and the specific performance data is shown in Table 1: Table 1 Performance comparison table of Hospital M diabetes intelligent management system

[0045] As can be seen from Table 1, after applying the method of the present application, the performance of the diabetes intelligent management system is comprehensively improved. The average absolute error of the key indicators prediction is reduced from 1.85 of the traditional method to 0.62, the prediction error of the time of occurrence of the key event is reduced from 12.5 days to 3.8 days, and the accuracy of the prediction is significantly improved. The semantic similarity between the generated medical record and the gold standard is improved from 0.71 to 0.94, the consistency error of the generated numerical data and the trajectory is reduced from 0.28 to 0.04, effectively ensuring the clinical usability of the generated medical record. The average time of doctor's medical record review and correction is reduced from 8.2 minutes to 2.1 minutes, effectively reducing the workload of the doctor. Through closed-loop optimization, the decline rate of the model prediction error is increased from 5.2% to 18.9%, showing strong self-evolution ability. The adoption rate of the patient's personalized management plan is increased from 65.3% to 89.5%, and the number of patients managed by the doctor per day is increased from 40 to 70, significantly improving the efficiency of diagnosis and treatment management. The satisfaction of the system assisted decision-making is also significantly improved, from the original 78.0% to 95.5%.

[0046] Through the method of the present application, the hospital M successfully realizes the accurate prediction of the patient's course of disease and the automatic construction of high-quality multi-modal electronic medical record, effectively improves the scientificity and timeliness of personalized management, greatly improves the intelligent and automated level of endocrinology management, significantly reduces the workload of the doctor, enhances the stability and robustness of the prediction model, and provides strong technical support for the intelligent management of chronic diseases.

[0047] The above only describes the preferred specific embodiments of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can make equivalent replacement or change according to the technical solution and the inventive concept of the present application within the technical range disclosed by the present application, which should be covered within the protection scope of the present application.

Claims

1. A method for synthesizing electronic medical record data based on semantic processing, characterized in that, Includes the following steps: S1. Collect multi-source heterogeneous medical knowledge data, extract medical entities and semantic relationships between entities, use Bayesian networks to perform conditional probabilistic modeling of semantic relationships, and use fuzzy logic to fuzzify and quantify the state attributes of medical entities to construct a probabilistic medical knowledge graph. S2. Input the probabilistic medical knowledge graph into the GCN network, aggregate the neighbor information of the nodes through the graph message passing mechanism, and combine the conditional probability weight of semantic relations and the fuzzy membership degree of state attributes to generate a corresponding semantic representation vector for each medical entity. S3. Based on all medical entities and their corresponding semantic representation vectors, construct a multidimensional dynamic spatiotemporal graph, and based on the probability distribution and fuzzy logic in the probabilistic medical knowledge graph, set the state transition probability function of the multidimensional dynamic spatiotemporal graph. S4. Based on the preset virtual patient initial state vector, Monte Carlo tree search is used in the multidimensional dynamic spatiotemporal map to perform path sampling according to the state transition probability function, and a discrete personalized disease course event sequence with spatiotemporal coordinates is generated. S5. Using discrete personalized disease course event sequences and their corresponding medical entity semantic representation vectors as conditional inputs, guide the improved TSDiff model to perform an iterative denoising process and output a multidimensional random disease course trajectory. S6. Using multidimensional random disease trajectory as a condition, guide the T5 model to synchronously generate natural language text medical records, formatted test data and vital sign time series data to form multimodal electronic medical record data. S7. Perform multi-dimensional quality assessment on multimodal electronic medical record data, generate assessment error, and use the assessment error as a feedback signal to iteratively optimize the state transition probability function and the hyperparameters of the improved TSDiff model.

2. The method for synthesizing electronic medical record data based on semantic processing according to claim 1, characterized in that, S1 specifically includes: S11. Collect structured medical knowledge bases, clinical guideline texts, and desensitized medical record texts as multi-source heterogeneous medical knowledge data; S12. Use a pre-trained BiLSTM-CRF model to process multi-source heterogeneous medical knowledge data, extract diseases, symptoms, drugs, and examinations as medical entities, and extract causal, temporal, and treatment relationships between entities as semantic relationships to form an initial knowledge graph containing entities and relationships. S13. For the semantic relationships in the initial knowledge graph, construct a Bayesian network with diseases as the parent node. By calculating the conditional probability table of the child nodes under the condition of the parent node, assign conditional probability weights to each relation edge of the initial knowledge graph to complete the conditional probabilistic modeling. S14. For medical entities in the initial knowledge graph, define a triangular fuzzy membership function. By calculating the fuzzy membership degree of the state value with respect to the fuzzy linguistic variable, fuzzy attributes are added to each entity node of the initial knowledge graph to complete the fuzzification and quantization. S15. Integrate the initial knowledge graph with added probability weights and fuzzy attributes to construct the final probabilistic medical knowledge graph containing medical entities, semantic relationships, conditional probability tables, and fuzzy membership functions.

3. The method for synthesizing electronic medical record data based on semantic processing according to claim 1, characterized in that, S2 specifically includes: S21. Initialize each medical entity in the probabilistic medical knowledge graph as a node, and initialize each semantic relation as an edge connecting the nodes to construct the initial topology of the GCN network. S22. For any target node in the initial topology of the GCN network, obtain the initial feature vectors of its first-order neighbor nodes. S23. Based on the conditional probability weights of the edges connecting the target node and each neighbor node, the initial feature vector of each neighbor node is weighted to generate multiple weighted neighbor feature vectors. S24. Based on the fuzzy membership degree of the state attribute of each neighbor node, perform a second weighting on the weighted neighbor feature vector to generate multiple fuzzy weighted neighbor feature vectors. S25. Perform aggregation operation on all fuzzy weighted neighbor feature vectors to generate a neighbor aggregation information vector; fuse the neighbor aggregation information vector with the feature vector of the previous layer of the target node to generate the aggregation information vector of the current layer of the target node. S26. Iterate through S22 to S25 until the multi-hop neighbor information with the preset number of hops is aggregated. Use the aggregated information vector generated in the last layer as the semantic representation vector of the target node.

4. The method for synthesizing electronic medical record data based on semantic processing according to claim 1, characterized in that, S3 specifically includes: S31. Based on all medical entities and their corresponding semantic representation vectors, define a set of atomic medical events and use each atomic medical event as a node in a multidimensional dynamic spatiotemporal graph. S32. Based on the semantic relationships in the probabilistic medical knowledge graph, create a directed edge between any two atomic medical event nodes that have causal, temporal, or treatment-dependent relationships, and construct the topological structure of the graph. S33. Add an initial timestamp and spatial location label to each atomic medical event node, and add a time delay parameter to each directed edge to form the spatiotemporal attributes of a multidimensional dynamic spatiotemporal graph. S34. Based on the conditional probability table corresponding to the directed edge in the probabilistic medical knowledge graph, set the state transition probability between two atomic medical event nodes connected by the directed edge. S35. Based on the fuzzy membership function corresponding to atomic medical event nodes in the probabilistic medical knowledge graph, set the state value range and fuzzy state transition rules for atomic medical event nodes. S36. Integrate the state transition probabilities of all nodes with the fuzzy state transition rules to generate a global state transition probability function for a multidimensional dynamic spatiotemporal graph.

5. The method for synthesizing electronic medical record data based on semantic processing according to claim 1, characterized in that, S4 specifically includes: S41. Map the initial state vector of the virtual patient to the starting node in the multidimensional dynamic spatiotemporal graph, and set the timestamp and spatial location label of the starting node. S42. Starting from the initial node, calculate the transition probability of all reachable next-hop nodes based on the global state transition probability function of the multidimensional dynamic spatiotemporal graph, and sum them up to obtain the cumulative transition probability. S43. Using the Monte Carlo tree search algorithm, with the cumulative transition probability as the reward value, an optimal path is searched in the multidimensional dynamic spatiotemporal graph through four steps: selection, expansion, simulation and backpropagation. The node sequence on the optimal path is used as the initial event sequence. S44. For each node in the preliminary event sequence, sort and integrate them according to the timestamp and spatial location label to generate a discrete personalized disease course event sequence with spatiotemporal coordinates.

6. The method for synthesizing electronic medical record data based on semantic processing according to claim 1, characterized in that, The improved TSDiff model includes an event encoder, a time-aware mask generator, and a trajectory denoiser: The event encoder is used to receive each medical event in the discrete personalized disease course event sequence, directly concatenate the timestamp, spatial location coordinates and medical entity semantic representation vector of each medical event to form an intermediate fusion vector, input the intermediate fusion vector into the linear projection layer for linear transformation to obtain the initial event representation tensor, and output the initial event representation tensor to the trajectory denoiser. The time-aware mask generator is used to receive the target time point currently being processed by the trajectory denoiser, calculate the time distance between the target time point and the timestamp of each medical event, and convert the time distance into a series of mask weights in the interval (0,1] according to the Gaussian kernel function, generate a time-aware conditional mask consistent with the dimension of the initial event representation tensor, and output it to the trajectory denoiser. The trajectory denoiser contains multiple layers of Transformer-based decoder blocks. In each decoder block, the current trajectory noise tensor is used as the query and the initial event representation tensor is used as the key and value. Cross-attention calculation is performed, and a time-aware conditional mask is applied to weight the attention score during the calculation process to output the event-aware trajectory feature tensor. The trajectory denoiser inputs the event-aware trajectory feature tensor into the subsequent feedforward network layer and outputs a preliminary denoised trajectory tensor. The trajectory denoiser starts with a preset pure Gaussian noise tensor and performs multiple iterations of denoising. In each iteration, the trajectory denoiser receives the current trajectory noise tensor and outputs a cleaner preliminary denoised trajectory tensor. The initial denoised trajectory tensor is used as the input for the next iteration until the preset convergence condition is met, and finally the multidimensional random disease trajectory is output.

7. The method for synthesizing electronic medical record data based on semantic processing according to claim 1, characterized in that, S6 includes the following steps: S61. Perform Z-score normalization on each dimension of the multidimensional random disease trajectory and fill or truncate it to a preset length to generate a standard trajectory matrix. S62. Input the standard trajectory matrix into the pre-trained trajectory-narrative encoder. The encoder compresses the continuous numerical trajectory data into a fixed-length multimodal medical record representation vector. S63. The multimodal medical record representation vector is used as a soft cue and concatenated with the preset learnable task prefix vector to form a unified medical record generation cue vector. S64. Input the medical record generation prompt vector into the pre-trained T5 model, and generate it conditionally. Simultaneously output natural language text medical records, formatted test data and vital sign time series data to form multimodal electronic medical record data.

8. The method for synthesizing electronic medical record data based on semantic processing according to claim 7, characterized in that, The trajectory-narrative encoder includes a trajectory encoder, a narrative encoder, and a narrative-trajectory alignment and fusion layer: The trajectory encoder is used to receive multidimensional random disease trajectory, extract local features through a one-dimensional convolutional neural network, and generate a trajectory local feature tensor; the trajectory local feature tensor is input into a bidirectional long short-term memory network to capture long-range time dependencies in the trajectory and output a trajectory context feature tensor. The narrative encoder is used to receive discrete personalized disease course event sequences corresponding to multidimensional random disease course trajectories. Each medical event is encoded into an initial event representation vector by the event encoder. The sequence of initial event representation vectors is input into the Transformer encoder to capture the contextual semantic relationships between events and output a narrative context feature tensor. The narrative-trajectory alignment fusion layer is used to perform cross-attention calculation with the trajectory context feature tensor as the query and the narrative context feature tensor as the key and value, so that the trajectory features learn the semantic information in the narrative and generate a narrative-aware trajectory feature tensor; the narrative-aware trajectory feature tensor and the trajectory context feature tensor are residually connected and normalized to output the final trajectory representation tensor after alignment and fusion.

9. The method for synthesizing electronic medical record data based on semantic processing according to claim 1, characterized in that, S7 includes the following steps: S71. Receive multimodal electronic medical record data, and deconstruct the multimodal electronic medical record data into three sub-data modes: natural language text medical record, formatted test data, and vital sign time series data by parsing the predefined tokenized format. Then, restore the formatted test data and vital sign time series data into a structured numerical matrix. S72. Based on a preset physiological rule base, the preset physiological rule base is instantiated into a series of computable Boolean logic predicates to detect logical conflicts between vital signs and test results. The quantitative physiological consistency error is calculated by statistically analyzing the number of conflict rules triggered within a unit time window and performing Softmax normalization. S73. Calculate the mean, variance, and quantiles of the core statistics for generating vital sign time series data, and compare them with the corresponding statistics in the real-world medical record database; obtain the statistical distribution alignment error by calculating the root mean square error between each statistic and then weighting and summing them. S74. Using a medical semantic similarity model, calculate the difference between the semantic vector of the natural language text medical record and the semantic summary vector of the multidimensional random disease trajectory, and generate fuzzy semantic conformity error. S75. Weighted summation of physiological consistency error, statistical distribution alignment error and fuzzy semantic conformity error to generate a comprehensive quality assessment error; S76. Using the comprehensive quality assessment error as a feedback signal, the Adam optimizer iteratively optimizes the state transition probability function and the hyperparameters of the improved TSDiff model, forming a closed-loop model self-evolution system.

10. The method for synthesizing electronic medical record data based on semantic processing according to claim 9, characterized in that, The medical semantic similarity model includes a text encoder, a trajectory encoder, a projection head, and a difference calculation layer; The text encoder is used to receive natural language text medical records, encode them using a pre-trained BERT model, extract the contextual semantic information of the text, and generate the original text semantic vector. The trajectory encoder is used to receive multidimensional random disease trajectory, encode it through a Transformer-based temporal encoder, capture the dynamic temporal dependencies within the trajectory, and generate the original trajectory summary vector. The projection head is used to map the original text semantic vector and the original trajectory summary vector to a shared multimodal semantic space, respectively, to obtain aligned text semantic vectors and trajectory semantic vectors; The difference calculation layer is used to calculate the cosine similarity between the aligned text semantic vector and the trajectory semantic vector, and uses the complement of the similarity value as the fuzzy semantic conformity error.

Citation Information

Patent Citations

  • Electronic medical record intelligent evaluation method based on complex quality control indexes

    CN120564931A

  • Intelligent electronic medical record generation method based on portable robot

    CN120633608A

  • Smart medical record generation method and system for realizing non-sensitive experience

    CN120913733A

  • All-specialized collaborative diagnosis and treatment method and system based on medical agent middleware

    CN120977551A

  • Electronic medical record automatic generation system

    CN121122552A

Cited By

  • Electronic medical record intelligent quality control method and system based on medical knowledge graph

    CN121545652A

  • A method and system for intelligent quality control of electronic medical records based on medical knowledge graphs

    CN121545652B

  • Clinical aid decision-making method and system based on integrated time sequence multi-modal data

    CN121839006A