An electronic medical record data synthesis method based on semantic processing
By constructing a probabilistic medical knowledge graph and dynamic spatiotemporal path planning, combined with an improved TSDiff model, the problems of logical inconsistency and modal fragmentation in electronic medical record data synthesis were solved, generating high-quality, realistic multimodal electronic medical record data and realizing the model's self-evolution capability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING INTELLIGENT DECISION MEDICAL TECH CO LTD
- Filing Date
- 2025-12-25
- Publication Date
- 2026-04-17
AI Technical Summary
Existing electronic medical record data synthesis methods have limitations in terms of logical inconsistencies and modal fragmentation, lack of deep guidance from medical knowledge graphs, and rigid model capabilities, making it difficult to generate high-quality, multimodal, realistic data with self-evolution capabilities.
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.
It significantly improves the medical logic and evolutionary rationality of synthetic disease progression data, generates high-quality, evolvable multimodal electronic medical record data, solves the problems of logical inconsistency and modal fragmentation in traditional methods, and realizes the self-optimization capability of the model.
Smart Images

Figure CN121393706B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical information technology, and in particular to a method for synthesizing electronic medical record data based on semantic processing. Background Technology
[0002] With the deep integration of smart healthcare and artificial intelligence technologies, high-quality, large-scale medical data has become a core production factor driving intelligent medical research and clinical decision-making. In fields such as precision medicine, new drug development, disease prediction, and medical AI model training, synthesized electronic medical record data can not only effectively alleviate the bottlenecks of strong privacy, difficulty in acquisition, and high annotation costs of real-world data, but is also a key way to ensure algorithmic fairness and improve model generalization ability. However, most existing electronic medical record data synthesis methods are based on simple statistical distribution fitting or rule template filling, with a simplistic process and insufficient authenticity and diversity of the generated data. Although these traditional methods can generate structurally compliant data, they lack the ability to deeply model complex medical logic and control the inherent consistency between multimodal 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 (EMR) data synthesis methods lie in logical inconsistencies and modal fragmentation. Existing methods typically rely on isolated data generation techniques, such as generation models for single time-series data or text generation based on predefined templates, lacking unified knowledge guidance. When generating multimodal information including text, test results, and vital signs, traditional methods struggle to guarantee semantic alignment and numerical consistency between different modalities. For example, the generated text medical record might describe "the patient has a persistent high fever," but the corresponding vital sign time-series data shows a normal temperature. This inherent contradiction between modalities severely impacts the usability and reliability of the synthesized data. Especially when facing the dynamic, uncertain, and complex nature of disease development and the interplay of multiple factors, the generalization ability and logical consistency of traditional methods are severely limited.
[0004] Furthermore, traditional methods often overlook the profound guiding role of medical knowledge graphs and the continuous evolution of model capabilities during data synthesis. For example, in clinical scenarios with vast medical knowledge systems and complex logical relationships, simple random sampling or unguided generative models cannot effectively follow the natural progression of diseases and treatment pathways, resulting in a lack of medical rationality in the generated disease progression. Even when some methods employ knowledge graphs or generative models, they fail to establish an effective evaluation and feedback mechanism to quantify the quality of generated data and, based on this, optimize the generation strategy. This leads to the solidification of model performance, making it difficult to achieve efficient, realistic, and self-evolving multimodal electronic medical record data synthesis.
[0005] Therefore, how to provide a method for synthesizing electronic medical record data based on semantic processing is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0006] This invention proposes a method for synthesizing electronic medical record data based on semantic processing. It constructs a probabilistic medical knowledge graph by fusing Bayesian networks and fuzzy logic to quantify the uncertainty and fuzziness in medical knowledge. Using graph convolutional networks and Monte Carlo tree search, it performs logically rigorous disease progression planning within a dynamic spatiotemporal graph, generating discrete event sequences. An improved TSDiff model guides these discrete event sequences to generate smooth, continuous disease progression trajectories. Based on these trajectories, a T5 model is used to simultaneously generate multimodal data, including text, diagnostic tests, and vital signs, ensuring cross-modal consistency. By designing a multidimensional quality assessment system encompassing physiological, statistical, and fuzzy semantic compliance, and using assessment errors as feedback signals to iteratively optimize the state transition function and generation model, this invention overcomes the limitations of traditional synthesis methods, such as logical inconsistencies, modal fragmentation, and model capability rigidity. It provides an efficient and accurate solution for generating high-quality, evolvable multimodal electronic medical record data.
[0007] A method for synthesizing electronic medical record data based on semantic processing according to an embodiment of the present invention includes the following steps:
[0008] 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.
[0009] 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.
[0010] 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.
[0011] 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.
[0012] 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.
[0013] 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.
[0014] 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.
[0015] Optionally, S1 specifically includes:
[0016] S11. Collect structured medical knowledge bases, clinical guideline texts, and desensitized medical record texts as multi-source heterogeneous medical knowledge data;
[0017] 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.
[0018] 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.
[0019] 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.
[0020] 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.
[0021] Optionally, S2 specifically includes:
[0022] 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.
[0023] S22. For any target node in the initial topology of the GCN network, obtain the initial feature vectors of its first-order neighbor nodes.
[0024] 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.
[0025] 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.
[0026] 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.
[0027] 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.
[0028] Optionally, S3 specifically includes:
[0029] 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.
[0030] 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.
[0031] 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.
[0032] 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.
[0033] 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.
[0034] 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.
[0035] Optionally, S4 specifically includes:
[0036] 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.
[0037] 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.
[0038] 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, and the node sequence on the optimal path is used as the preliminary event sequence.
[0039] 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.
[0040] Optionally, the improved TSDiff model includes an event encoder, a time-aware mask generator, and a trajectory denoiser:
[0041] 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.
[0042] 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.
[0043] The trajectory denoiser comprises multiple layers of Transformer-based decoder blocks. In each decoder block, cross-attention calculation is performed using the current trajectory noise tensor as the query and the initial event representation tensor as the key and value. During the calculation, a time-aware conditional mask is applied to weight the attention score, and the event-aware trajectory feature tensor is output. The trajectory denoiser inputs the event-aware trajectory feature tensor into subsequent feedforward network layers and outputs a preliminary denoised trajectory tensor.
[0044] 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. This preliminary denoised trajectory tensor is used as the input for the next iteration until the preset convergence condition is met, and finally outputs a multidimensional random disease trajectory.
[0045] Optionally, S6 specifically includes:
[0046] 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.
[0047] 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.
[0048] 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.
[0049] 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.
[0050] Optionally, the trajectory-narrative encoder includes a trajectory encoder, a narrative encoder, and a narrative-trajectory alignment and fusion layer:
[0051] 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.
[0052] 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.
[0053] 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.
[0054] Optionally, S7 specifically includes:
[0055] 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.
[0056] 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; by counting the number of conflicting rules triggered within a unit time window and performing Softmax normalization, the quantitative physiological consistency error is calculated.
[0057] 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.
[0058] 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.
[0059] S75. Weighted summation of physiological consistency error, statistical distribution alignment error and fuzzy semantic conformity error to generate a comprehensive quality assessment error;
[0060] 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.
[0061] Optionally, the medical semantic similarity model includes a text encoder, a trajectory encoder, a projection head, and a difference calculation layer;
[0062] 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.
[0063] 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.
[0064] 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;
[0065] 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.
[0066] The beneficial effects of this invention are:
[0067] (1) This invention significantly improves the medical logic and evolutionary rationality of synthesized disease progression data by constructing a probabilistic medical knowledge graph and dynamic spatiotemporal 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 in disease development in real clinical practice. To solve this problem, this invention innovatively integrates Bayesian networks and fuzzy logic to perform dual modeling of medical knowledge, enabling the knowledge graph to quantify the conditional probability of semantic relationships and the fuzzy membership degree of entity states, thereby more realistically reflecting the complexity of clinical practice. At the same time, Monte Carlo tree search is used to perform heuristic path sampling in the dynamic spatiotemporal graph. Compared with simple random walks, it can generate a more logically rigorous macroscopic disease progression "skeleton" that is more in line with the natural development law of diseases, thereby significantly improving the realism and diversity of synthesized data at the macroscopic level.
[0068] (2) This invention effectively solves the core technical problems of semantic inconsistency between multimodal data and model performance solidification by designing a multimodal condition generation and closed-loop self-evolution mechanism centered on disease course trajectories. Traditional synthesis methods usually generate each modality of data independently, which often leads to logical contradictions between text descriptions and numerical indicators, and the model cannot improve itself once it is trained. This invention first uses an improved TSDiff model to transform discrete event sequences into smooth and continuous multidimensional random disease course trajectories, and then uses this trajectory as a unified condition to guide the T5 model to generate text, test, and vital sign data synchronously, thus ensuring a high degree of consistency of multimodal data from the root. In addition, by constructing a multidimensional evaluation system that includes physiological, statistical, and fuzzy semantic conformity, and feeding the evaluation error back to the path planning and trajectory generation modules for joint optimization, a closed-loop system that can continuously learn and self-evolve is formed. This method breaks through the limitations of traditional generative models in multimodal collaboration and capability iteration, and provides strong technical support for generating high-quality, high-fidelity, and continuously optimized electronic medical record data. Attached Figure Description
[0069] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0070] Figure 1 This is an overall flowchart of a method for synthesizing electronic medical record data based on semantic processing proposed in this invention;
[0071] Figure 2 This is a flowchart illustrating the working principle of the improved TSDiff model for a semantic processing-based electronic medical record data synthesis method proposed in this invention. Detailed Implementation
[0072] The invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0073] refer to Figure 1 and Figure 2 A method for synthesizing electronic medical record data based on semantic processing includes the following steps:
[0074] 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.
[0075] 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.
[0076] 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.
[0077] 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.
[0078] 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.
[0079] 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.
[0080] 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.
[0081] In this embodiment, S1 specifically includes:
[0082] S11. Collect structured medical knowledge bases, clinical guideline texts, and desensitized medical record texts as multi-source heterogeneous medical knowledge data;
[0083] 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.
[0084] S13. For the semantic relationships in the initial knowledge graph, construct a Bayesian network with diseases as parent nodes. By calculating the conditional probability table of child nodes under the condition of the parent node, assign conditional probability weights to each relation edge in the initial knowledge graph to complete conditional probabilistic modeling. This includes linking the diagnoses, symptoms, and examination descriptions in the electronic medical record data with the medical entities in the initial knowledge graph to generate a case matrix; for each disease node in the initial knowledge graph, construct a Bayesian network topology by taking the disease node as the parent node and the symptom nodes and examination nodes connected to the disease node as child nodes; for each parent node, select the corresponding case subset from the case matrix; in the case subset, count the number of occurrences of each child node to the total number of case subsets; calculate the ratio of the number of occurrences of child nodes to the total number of case subsets to generate a conditional probability table; traverse the relation edges in the initial knowledge graph; find the corresponding probability value from the conditional probability table based on the parent and child nodes of the relation edge; and write the probability value as the probability weight attribute of the relation edge into the initial knowledge graph to complete conditional probabilistic modeling.
[0085] S14. For medical entities in the initial knowledge graph, define a triangular fuzzy membership function. By calculating the fuzzy membership degree of state values with respect to fuzzy linguistic variables, fuzzy attributes are added to each entity node in the initial knowledge graph, completing fuzzification and quantification. This includes obtaining clinical indicators of medical entities, defining fuzzy linguistic variables for each clinical indicator, and determining the normal reference range of clinical indicators. Based on expert experience, define a set of fuzzy linguistic variables, assign numerical intervals to each fuzzy linguistic variable, and set parameters for the triangular fuzzy membership function for each fuzzy linguistic variable. For the triangular fuzzy membership function, set three parameters: left boundary, peak point, and right boundary. Ensure that the numerical intervals of adjacent fuzzy linguistic variables overlap. Store the correspondence between each fuzzy linguistic variable and the fuzzy membership function parameters. Collect patient data containing clinical indicator values. Input the values from the patient data into the corresponding fuzzy membership function. Calculate the fuzzy membership degree of the values with respect to each fuzzy linguistic variable. Select the fuzzy linguistic variable with the highest fuzzy membership degree. Use the selected fuzzy linguistic variable as the fuzzy attribute of the entity. Attach the fuzzy attribute to the corresponding entity node in the initial knowledge graph, completing fuzzification and quantification.
[0086] 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.
[0087] This step systematically integrates multi-source data to construct and enhance a knowledge graph, ultimately forming a medical knowledge network capable of probabilistic reasoning and fuzzy decision-making. A data foundation is built by collecting heterogeneous medical knowledge data from multiple sources. A pre-trained BiLSTM-CRF model is used to extract medical entities and semantic relationships, forming an initial knowledge graph and realizing the transformation from text to structured knowledge. A Bayesian network with diseases as parent nodes is constructed, and conditional probability weights are assigned to relation edges by calculating conditional probabilities, enabling the graph to possess uncertain reasoning capabilities. A triangular fuzzy membership function is defined, and fuzzy attributes are added to entity nodes by calculating fuzzy membership degrees, achieving a fuzzy description of continuous clinical indicators. Probabilistic weights and fuzzy attributes are integrated to construct the final probabilistic medical knowledge graph, forming a complete knowledge system supporting intelligent reasoning.
[0088] In this embodiment, S2 specifically includes:
[0089] 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.
[0090] S22. For any target node in the initial topology of the GCN network, obtain the initial feature vectors of its first-order neighbor nodes.
[0091] S23. Based on the conditional probability weights of the edges connecting the target node and each neighbor node, perform element-wise weighting on the initial feature vector of each neighbor node to generate multiple weighted neighbor feature vectors.
[0092] S24. Based on the fuzzy membership degree of the state attribute of each neighbor node, perform element-wise secondary weighting on the weighted neighbor feature vector to generate multiple fuzzy weighted neighbor feature vectors.
[0093] S25. Sum all the fuzzy weighted neighbor feature vectors to generate a neighbor aggregate information vector; fuse the neighbor aggregate information vector with the feature vector of the previous layer of the target node to generate the aggregate information vector of the current layer of the target node.
[0094] 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.
[0095] This step iteratively updates node representations layer by layer by fusing probabilistic relationships from the knowledge graph with fuzzy information about entity states, ultimately generating entity vectors rich in multi-hop semantic information. The probabilistic medical knowledge graph is read to construct the GCN network topology, obtaining the initial feature vectors of the target node's first-order neighbors. These neighbor feature vectors are then weighted using the conditional probability weights of edges, and further weighted using the fuzzy membership degrees of neighbor nodes. All weighted neighbor vectors are aggregated to generate a neighbor aggregation information vector. This neighbor aggregation information vector is then fused with the target node's own features to generate the current layer's aggregation information vector. Through iterative aggregation of multi-hop neighbor information, the semantic representation vector of the target node is finally generated.
[0096] In this embodiment, S3 specifically includes:
[0097] 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.
[0098] 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 dependency relationships, and construct the topology of the graph. This includes calling a predefined medical event relationship ontology library, matching the semantic relationships in the probabilistic medical knowledge graph with the causal, temporal, and treatment dependency relationship templates in the ontology library, creating a directed edge between the atomic medical event node pairs connected by the successfully matched semantic relationships, and constructing the topology of the graph.
[0099] 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.
[0100] 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.
[0101] S35. Based on the fuzzy membership function corresponding to the atomic medical event node in the probabilistic medical knowledge graph, set the state value range and fuzzy state transition rules of the atomic medical event node, including reading the metadata of the fuzzy membership function 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 rules of the atomic medical event node according to the rule template in the metadata and the fuzzy state sets of the source node and the target node.
[0102] S36. Integrate the state transition probabilities and fuzzy state transition rules of all nodes to generate a global state transition probability function for the multidimensional dynamic spatiotemporal graph. This includes constructing an input feature vector by combining the source node's state transition probability, the source node's fuzzy membership degree, and the target node's fuzzy membership degree for each node's transition event; inputting the input feature vector into a multilayer perceptron for processing and outputting adjusted transition probability values; collecting the adjusted transition probabilities of all outgoing edges of the source node and performing Softmax normalization to generate the global state transition probability function for the multidimensional dynamic spatiotemporal graph.
[0103] This step lays the foundation for subsequent medical event evolution reasoning by constructing a multidimensional dynamic spatiotemporal graph that integrates probability and fuzzy logic. Medical entities and their semantic representation vectors are defined as atomic medical event nodes. Directed edges are created between nodes exhibiting causal, temporal, or treatment-dependent relationships based on semantic relations, constructing the graph topology. Initial timestamps and spatial location labels are added to nodes, and time delay parameters are added to edges, forming the spatiotemporal attributes of the graph. State transition probabilities between nodes are set according to a conditional probability table. The state value range of nodes and fuzzy state transition rules are set according to fuzzy membership functions. The state transition probabilities and fuzzy state transition rules of all nodes are integrated to generate a global state transition probability function for the graph, achieving dynamic fusion of probability and fuzzy rules.
[0104] In this embodiment, S4 specifically includes:
[0105] 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. This includes calculating the cosine similarity between the initial state vector of the virtual patient and the semantic representation vector of all atomic medical event nodes in the multidimensional dynamic spatiotemporal graph, selecting the atomic medical event node with the highest similarity score as the starting node, and setting the timestamp and spatial location label of the starting node.
[0106] 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.
[0107] 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, and the node sequence on the optimal path is used as the preliminary event sequence.
[0108] 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.
[0109] This step generates a personalized disease progression event sequence with spatiotemporal coordinates for a virtual patient through intelligent path search in a multidimensional dynamic spatiotemporal graph. The cosine similarity between the initial state vector of the virtual patient and the semantic representation vectors of all nodes is calculated, and the node with the highest similarity is selected as the starting node, achieving precise localization from the patient's state to the graph nodes. Starting from the starting node, the transition probabilities of all reachable next-hop nodes are calculated based on the global state transition probability function and summed to provide a quantitative basis for path search. A Monte Carlo tree search algorithm is used, with the cumulative transition probability as the reward value, to search for the optimal path in the graph through selection, expansion, simulation, and backpropagation steps, resulting in a preliminary event sequence with maximized probability. The nodes in the preliminary event sequence are sorted and integrated according to timestamps and spatial location labels to generate a discrete personalized disease progression event sequence that conforms to real spatiotemporal logic.
[0110] In this embodiment, the improved TSDiff model includes an event encoder, a time-aware mask generator, and a trajectory denoiser:
[0111] 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.
[0112] 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.
[0113] The trajectory denoising unit comprises multiple Transformer-based decoder blocks. In each decoder block, the original attention score is calculated using the current trajectory noise tensor as the query and the initial event representation tensor as the key and value. Softmax normalization is performed on the original attention score to generate preliminary attention weights. The time-aware conditional mask tensor is multiplied element-wise with the preliminary attention weights to generate the final modulated attention weights. The final modulated attention weights are multiplied with the value tensor to output the event-aware trajectory feature tensor. The event-aware trajectory feature tensor is input into a feedforward network layer. The feedforward network layer performs an up-dimensional projection on the event-aware trajectory feature tensor through a first linear layer to generate an intermediate feature tensor. The intermediate feature tensor is then nonlinearly transformed using the ReLU nonlinear activation function to generate an activation feature tensor. Finally, the activation feature tensor is subjected to a down-dimensional projection through a second linear layer to output the preliminary denoised trajectory tensor.
[0114] The trajectory denoiser starts with a pure Gaussian noise tensor, uses the initial denoised trajectory tensor output from each layer as the input to the next layer, and performs multiple iterations of denoising until the preset convergence condition is met, outputting a multidimensional random pathological trajectory.
[0115] This step aims to construct an end-to-end generative model, ensuring that the generated trajectories are spatiotemporally smooth and continuous, and accurately aligned with the spatiotemporal and semantic constraints of medical events. The event encoder integrates multimodal information from each medical event, forming a unified initial event representation tensor, providing a semantic foundation for trajectory generation. The time-aware mask generator dynamically adjusts attention weights based on temporal proximity, enabling the trajectory denoiser to focus on events that are more temporally relevant during generation. The trajectory denoiser iteratively fuses event information and temporal constraints through multi-layered decoder blocks, gradually refining pure Gaussian noise into a preliminary denoised trajectory tensor that meets preset conditions. Finally, the entire model, through multi-step iterative denoising, outputs one or more smooth, continuous, multidimensional random disease trajectories that conform to the spatiotemporal coordinates and semantic constraints of discrete personalized disease event sequences.
[0116] In this embodiment, S6 specifically includes:
[0117] 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.
[0118] 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.
[0119] S63. The multimodal medical record representation vector is used as a soft cue and concatenated with a pre-defined learnable task prefix vector to form a unified medical record generation cue vector. This includes concatenating the multimodal medical record representation vector as a soft cue with the learnable task prefix vector along the feature dimension to form a fused cue vector; and inputting the fused cue vector into a linear projection layer to obtain the medical record generation cue vector through linear transformation.
[0120] 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.
[0121] This step aims to transform abstract numerical trajectories into structured and content-rich multimodal electronic medical records. By normalizing and standardizing the length of the trajectories, a standard trajectory matrix is generated, eliminating dimensional differences among various physiological indicators and meeting model input requirements. A trajectory-narrative encoder is used to compress the standard trajectory matrix into a fixed-length multimodal medical record representation vector, achieving the transformation from continuous numerical values to high-dimensional semantic features. The multimodal medical record representation vector is concatenated with a learnable task prefix vector and linearly projected to form a unified medical record generation prompt vector, integrating specific medical record content with general task instructions for subsequent generation tasks.
[0122] In this embodiment, S7 specifically includes:
[0123] S71. Receive multimodal electronic medical record data and deconstruct it into three modalities: natural language text medical records, formatted test data, and vital sign time series data.
[0124] S72. Based on a preset physiological rule base, perform dynamic consistency assessment on vital sign time series data and formatted test data, and calculate physiological consistency error;
[0125] S73. Compare the statistical distribution of vital signs time series data with the corresponding distribution in the real-world medical record database, and calculate the statistical distribution alignment error.
[0126] 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.
[0127] S75. Weighted summation of physiological consistency error, statistical distribution alignment error and fuzzy semantic conformity error to generate a comprehensive quality assessment error;
[0128] 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.
[0129] This step aims to establish a closed-loop feedback mechanism to achieve model self-evolution. By deconstructing multimodal electronic medical record data, an independent data source is provided for multi-dimensional evaluation. Dynamic consistency evaluation based on a physiological rule base quantifies the inherent logical rationality of the generated data. Comparing the generated data with real-world distributions ensures its statistical authenticity. A semantic similarity model is used to calculate differences, evaluating the macro-semantic consistency between the generated text and the original trajectory. By weighted summing of various errors, a comprehensive quality assessment error is formed, achieving a comprehensive quantification of the generated quality. This error is used as a feedback signal to optimize the model hyperparameters, constructing a closed-loop self-evolving system capable of continuous self-improvement.
[0130] In this embodiment, the medical semantic similarity model includes a text encoder, a trajectory encoder, a projection head, and a difference calculation layer;
[0131] 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.
[0132] 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.
[0133] 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;
[0134] 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.
[0135] This step aims to build a cross-modal semantic alignment bridge to assess the consistency of generated content. A text encoder transforms natural language medical records into semantic vectors rich in contextual information, achieving a deep understanding of clinical narratives. A trajectory encoder abstracts multidimensional time-series data into summary vectors capable of capturing dynamic evolution patterns, enabling pattern recognition of numerical trajectories. A projection head maps heterogeneous vectors to a unified semantic space, eliminating the representational gap between modalities. By calculating the semantic distance between vectors, ambiguous text-trajectory relationships are quantified into precise conformity errors, achieving an effective measure of cross-modal logical consistency.
[0136] Example 1:
[0137] To verify the feasibility of this invention in personalized disease progression prediction and electronic medical record generation, the method was applied to the diabetes intelligent management system of the endocrinology department of a tertiary hospital (hereinafter referred to as "Hospital M"). Traditional disease progression management systems typically use methods based on linear regression or conventional time series models to predict future patient indicators. These methods not only struggle to capture nonlinear state transitions and the influence of complex events during the disease progression, but also fail to generate multimodal medical records consistent with the predicted trajectory, resulting in low prediction accuracy and electronic medical records lacking clinical reference value. To address these issues, Hospital M decided to adopt the personalized disease progression trajectory generation and multimodal medical record construction method based on state transition and conditional diffusion proposed in this invention.
[0138] During implementation, Hospital M first integrated patients' electronic health records, including historical vital sign time-series data, test results, medication records, and diagnostic events. After preprocessing operations such as data cleaning, time alignment, and anonymization, a high-quality multimodal patient dataset was formed. Simultaneously, Hospital M's endocrinology expert team annotated key disease progression points as the gold standard for model training and evaluation.
[0139] Hospital M constructs a continuous state space and a discrete event space, and utilizes an improved Graphormer model that integrates external spatiotemporal memory and on-chain knowledge graphs to accurately learn the state transition probability function of individuals, laying the foundation for capturing the dynamic evolution of disease progression. Next, by deeply integrating an improved TSDiff model that incorporates "time-aware conditional masking, event-cross-attention embedding, and event-anchored denoising," discrete personalized disease progression events are used as strong constraints to generate multiple smooth, continuous, and physiologically logical multidimensional random disease progression trajectories, achieving a precise mapping from discrete events to continuous trajectories.
[0140] In the core generation stage, this invention first encodes multidimensional random disease trajectories into multimodal medical record representation vectors. Then, using a pre-trained multimodal large-scale language model, it conditionally generates and simultaneously outputs natural language text medical records and formatted test data and vital sign time-series data that are strictly aligned numerically and temporally, forming a logically self-consistent multimodal electronic medical record. Subsequently, the system performs multidimensional quality assessments on the generated multimodal electronic medical records, calculating errors in dynamic physiological consistency, statistical distribution alignment, and fuzzy semantic conformity. This assessment error is used as a feedback signal to iteratively optimize the hyperparameters of the state transition probability function and the conditional diffusion model, constructing a closed-loop model self-evolution system.
[0141] During implementation, the technical team at Hospital M discovered that, compared to traditional linear regression methods and conventional time series models, the method of this invention significantly improved the accuracy of disease progression prediction and the usability of generated medical records. Traditional methods cannot effectively utilize discrete event information, and the generated prediction results are singular. In contrast, the method of this invention, through state transition learning, conditional diffusion generation, and multimodal synchronous construction, effectively achieves accurate prediction of future disease progression and automated generation of high-quality electronic medical records.
[0142] To further verify the actual performance of the method of the present invention, Hospital M conducted a detailed comparative test between the method of the present invention and the traditional method. The specific performance data is shown in Table 1:
[0143] Table 1. Performance Comparison of Hospital M Diabetes Intelligent Management System
[0144]
[0145] As shown in Table 1, the performance of the intelligent diabetes management system was comprehensively improved after applying the method of this invention. The mean absolute error of key indicator prediction decreased from 1.85 in the traditional method to 0.62, and the prediction error of key event occurrence time decreased from 12.5 days to 3.8 days, significantly improving prediction accuracy. The semantic similarity between the generated medical records and the gold standard increased from 0.71 to 0.94, and the consistency error between the generated numerical data and the trajectory decreased from 0.28 to 0.04, effectively ensuring the clinical usability of the generated medical records. The average time for doctors to review and correct medical records decreased from 8.2 minutes to 2.1 minutes, effectively reducing the workload of doctors. Through closed-loop optimization, the model prediction error reduction rate increased from 5.2% to 18.9%, demonstrating strong self-evolution capabilities. The adoption rate of personalized patient management plans increased from 65.3% to 89.5%, and the average number of patients managed by doctors per day increased from 40 to 70, significantly improving the efficiency of diagnosis and treatment management. The satisfaction rate of system-assisted decision-making also significantly improved, from 78.0% to 95.5%.
[0146] Through the method of this invention, Hospital M has successfully achieved accurate prediction of patient disease course and automatic construction of high-quality multimodal electronic medical records, effectively improving the scientific nature and timeliness of personalized management, significantly enhancing the intelligence and automation level of endocrinology management, significantly reducing the workload of doctors, enhancing the stability and robustness of prediction models, and providing strong technical support for the intelligent management of chronic diseases.
[0147] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
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 of claim 1, wherein the semantic processing is based on a semantic network. 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 of claim 1, wherein the semantic processing-based synthesis of electronic medical record data is characterized by, 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 of claim 1, wherein the semantic processing-based synthesis of electronic medical record data is based on a semantic processing of the electronic medical record data. 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 of claim 1, wherein the semantic processing-based synthesis of electronic medical record data is based on a semantic processing of the electronic medical record data. 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 of claim 7, wherein the semantic processing is based on a semantic network. 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 of claim 1, wherein the semantic processing-based synthesis of electronic medical record data is based on a semantic processing of the electronic medical record data. 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 of claim 9, wherein the semantic processing is based on a semantic network. 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 for calculating the cosine similarity between the aligned text semantic vector and the trajectory semantic vector, and taking the complement of the similarity value as the fuzzy semantic coincidence degree error.
Citation Information
Patent Citations
Intelligent electronic medical record generation method based on portable robot
CN120633608A
All-specialized collaborative diagnosis and treatment method and system based on medical agent middleware
CN120977551A