A method and system for generating clinical use records of antimicrobial drugs
Through the Bi-LSTM-CRF model and Transformer encoder layer, detailed antibacterial drug use course records are automatically generated, solving the problems of irregular course records and information omissions in the existing technology, and improving the quality of medical documents and review efficiency.
Patent Information
- Application Number
- CN202411156755.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-08-22
AI Technical Summary
In the prior art, the course of antibacterial drug use records has problems such as omissions in information, missing key content, irregular recording and oversimplification of content, which affects the quality of medical care and increases the work burden of doctors.
Bi-LSTM-CRF model is used to combine the Transformer encoder layer and multi-layer perceptron layer, and pre-process and feature extraction is performed by obtaining the patient's panoramic historical medical data, and the antibacterial drug use course records are generated. The model is optimized using the stochastic gradient descent training algorithm, and the model is automatically Generate detailed course records and add them to the electronic medical record.
It improves the efficiency and accuracy of medical record writing, ensures the quality of medical documents for the use of antibacterial drugs, provides reliable audit materials, reduces the workload of the medical department, and supports real-time medical insurance payment review.
Smart Images

Figure CN118692620B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical data processing, and in particular to a method and system for generating clinical use records of antimicrobial drugs. Background Art
[0002] With the rapid development of hospital information systems and artificial intelligence technology, the deep integration of information technology and the medical and health field has led to the emergence and booming of emerging medical formats such as digital medicine and smart medicine, making it increasingly the development direction of clinical medical work and hospital management. At present, although the electronicization of medical documents including medical records has been basically realized, these medical records still need to be manually input into the system by doctors, which increases the workload of clinicians. In addition, there are often problems such as missing information, missing key content, non-standard records and over-simplified content in the manually input medical records of the use of antimicrobial drugs. Summary of the invention
[0003] In view of the deficiencies in the prior art, the present invention discloses a method for generating a clinical course record of antibiotic use, comprising the following steps:
[0004] S1, obtaining the patient's panoramic historical medical data, which includes the patient's basic information, data related to the clinical use of antibiotics and corresponding medical records, and the data related to the clinical use of antibiotics include but are not limited to the doctor's authority to prescribe antibiotics, details of antibiotic prescriptions, usage and dosage, etiology test results and other laboratory test results, and antibacterial treatment effects;
[0005] S2, preprocessing the patient's panoramic historical medical data, segmenting the text into words / phrases and adding part-of-speech tags to form a medical record training data set;
[0006] S3, using the Bi-LSTM-CRF model to establish a rule for generating medical records of the use of antibiotics, constructing a medical record generation model according to the rule for generating medical records of the use of antibiotics, and using each training sample in the medical record training data set to train the untrained medical record generation model using a stochastic gradient descent training algorithm, wherein the training samples include pre-processed clinical use-related data of antibiotics and corresponding medical records;
[0007] S4, input the collected antibiotic prescription information filled in by the doctor into the trained medical record generation model, generate the antibiotic use medical record text and add it to the electronic medical record document.
[0008] Preferably, the medical record generation model includes a column embedding layer, an encoder layer and a multi-layer perceptron layer, wherein: the column embedding layer is configured to respectively extract each discrete feature and continuous feature in the clinical use-related data of antibiotics, perform feature random mask replacement on the unlabeled data, map each discrete feature and continuous feature into a d-dimensional vector of the same length, and convert it into 4 first d-dimensional embedding vectors; the encoder layer is composed of 6 multi-layer serially superimposed Transformer encoder layers, and is configured to take the 4 first d-dimensional embedding vectors as input, input them into the encoder layer for feature correlation processing, and then output 4 second d-dimensional vectors with the same dimension as the corresponding 4 first d-dimensional vectors; the multi-layer perceptron layer is used to splice the 4 second d-dimensional embedding vectors side by side into a one-dimensional vector of length 4d as the output, and its output layer for predicting features includes two normalized vectors. The exponential function softmax layer is used to predict the required filling data in the medical record; two normalized exponential function softmax layers are used to output the first feature and the second feature respectively; it contains 6 first feature output nodes, of which 5 first feature output nodes are used to output the types of antimicrobial drugs with 5 levels of classification, and 1 first feature output node is used to output the missing category; it contains 4 second feature output nodes, of which 3 second feature output nodes are used to output 3 different dosage ranges, and 1 second feature output node is used to output the missing category; it contains 4 probability output nodes for predicting each mask vector, and the mask vector can be configured to indicate whether the set antimicrobial drug is used or whether there is a set allergy; it contains 1 probability output node for predicting a pseudo-label, and the pseudo-label can be configured as a preliminary judgment of the infectious pathogen or a prediction result of the treatment effect.
[0009] Preferably, the discrete features in the data related to the clinical use of antimicrobial drugs include drug types and routes of administration, the drug types include but are not limited to penicillins, cephalosporins, macrolides, quinolones and aminoglycosides, and the routes of administration include but are not limited to oral, intravenous injection and topical use; the continuous features in the data related to the clinical use of antimicrobial drugs include dosage and duration of administration.
[0010] Preferably, the column embedding layer is specifically configured as follows:
[0011] The characteristics of drug types are It indicates that it has five values corresponding to penicillins, cephalosporins, macrolides, quinolones, and aminoglycosides; the route of administration feature is represented by It has three values corresponding to oral, intravenous injection and external use respectively; the dosage characteristics are expressed by Indicates; medication duration characteristics Represents; the randomly generated mask vector is ,in , the probability of generating 1 is p;
[0012] The result after random mask replacement of features is:
[0013] ,
[0014] ,
[0015] in and are other values obtained by random sampling; each discrete feature and continuous feature is mapped into 4 d-dimensional vectors of the same length:
[0016] ;
[0017] ;
[0018] ;
[0019] .
[0020] Preferably, the encoder layer is further configured as follows: assuming that The input to the Transformer encoder layer is:
[0021] , the input data is processed by the self-attention mechanism and the output is obtained after being processed by the feedforward neural network :
[0022] , FFN is a pre-configured feed-forward neural network, where
[0023] ,
[0024] , , , , , is the learnable parameter matrix, is the dimension of the key vector; after 6 layers of feature correlation processing, the final output is obtained .
[0025] The present invention also discloses a system for generating medical records of clinical use of antibiotics, including a data acquisition module, a data processing module, a model training module and a record generation module, wherein the data acquisition module is used to acquire the patient's panoramic historical medical data, the patient's panoramic historical medical data includes the patient's basic information, data related to the clinical use of antibiotics and the corresponding medical records, the data related to the clinical use of antibiotics includes but is not limited to the doctor's antibiotic prescription authority, antibiotic prescription details, usage and dosage, etiology test results and other laboratory test results, and antibacterial treatment effects; the data processing module is used to pre-process the patient's panoramic historical medical data, segment the text into words / phrases and add parts of speech After labeling, a medical record training data set is formed; a model training module is used to use the Bi-LSTM-CRF model to establish medical record generation rules for the use of antibiotics, and a medical record generation model is constructed according to the medical record generation rules for the use of antibiotics. The training samples in the medical record training data set are used to train the untrained medical record generation model using a stochastic gradient descent training algorithm, and the training samples include pre-processed clinical use of antibiotics related data and corresponding medical records; a record generation module is used to input the collected antibiotic prescription information filled in by the doctor into the trained medical record generation model, generate the medical record text for the use of antibiotics and add it to the electronic medical record document.
[0026] Preferably, the medical record generation model includes a column embedding layer, an encoder layer and a multi-layer perceptron layer, wherein: the column embedding layer is configured to respectively extract each discrete feature and continuous feature in the data related to the clinical use of antibiotics, perform feature random mask replacement on the unlabeled data, map each discrete feature and continuous feature into a d-dimensional vector of the same length, and convert it into 4 first d-dimensional embedding vectors; the encoder layer is composed of 6 multi-layer serially superimposed Transformer encoder layers, and is configured to take the 4 first d-dimensional embedding vectors as input, input them into the encoder layer for feature correlation processing, and then output 4 second d-dimensional vectors with the same dimension as the corresponding 4 first d-dimensional vectors; the multi-layer perceptron layer is used to splice the 4 second d-dimensional embedding vectors side by side into a one-dimensional vector of length 4d as the output, and its output layer for predicting features includes two normalized exponential functions Several softmax layers are used to predict the required filling data in the medical record of antibiotic use; two normalized exponential function softmax layers are used to output the first feature and the second feature respectively; it contains 6 first feature output nodes, of which 5 first feature output nodes are used to output the types of antibiotics with 5-level classification respectively, and 1 first feature output node is used to output the missing category; it contains 4 second feature output nodes, of which 3 second feature output nodes are used to output 3 different dosage ranges respectively, and 1 second feature output node is used to output the missing category; it contains 4 probability output nodes for predicting each mask vector, and the mask vector can be configured to indicate whether the set antibiotic is used or whether there is a set allergy; it contains 1 probability output node for predicting a pseudo label, and the pseudo label can be configured as a preliminary judgment of the infectious pathogen or a prediction result of the treatment effect.
[0027] Preferably, the discrete features in the data related to the clinical use of antimicrobial drugs include drug types and routes of administration, the drug types include but are not limited to penicillins, cephalosporins, macrolides, quinolones and aminoglycosides, and the routes of administration include but are not limited to oral, intravenous injection and topical use; the continuous features in the data related to the clinical use of antimicrobial drugs include dosage and duration of administration.
[0028] The present invention also discloses a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the method for generating a clinical use record of an antimicrobial drug as described in any of the above are implemented.
[0029] The present invention also discloses a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of any of the above-mentioned methods for generating a clinical use record of antimicrobial drugs.
[0030] The method and system for generating medical records of clinical use of antibiotics disclosed in the present invention collects panoramic historical medical data of patients, forms a medical record training data set through preprocessing and annotation, uses a Bi-LSTM-CRF model to establish medical record generation rules for the use of antibiotics, builds a medical record generation model based on the medical record generation rules for the use of antibiotics, and uses the medical record training data set for model training. After the doctor inputs the medical order information of antibiotics, the model can automatically generate the medical record text of the use of antibiotics based on the real-time captured patient-related medical data and add it to the electronic medical record document, thereby ensuring the quality of medical documents for the use of antibiotics and providing real-time captured audit materials and reliable basis for the medical insurance payment review of antibiotics.
[0031] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0033] Figure 1 The present invention is a schematic diagram of the steps of a method for generating a medical record of the clinical use of antimicrobial drugs disclosed in one embodiment of the present invention.
[0034] Figure 2 This is a structural block diagram of a system for generating clinical use medical records of antimicrobial drugs disclosed in another embodiment of the present invention. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0036] Unless otherwise defined, the technical or scientific terms used herein shall have the common meanings understood by persons with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the patent application specification and claims of the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, words such as "one" or "a" do not indicate a quantity limitation, but indicate the existence of at least one.
[0037] With the rapid development of hospital information systems and artificial intelligence technology, the deep integration of information technology and the medical and health field has led to the emergence and boom of emerging medical formats such as digital medicine and smart medicine, making it increasingly the development direction of clinical medical work and hospital management. Nowadays, the electronicization of medical documents, including medical records, has been basically realized, but it is still a huge challenge to generate comprehensive and accurate medical records based on the current actual situation of patients and the tests and medication orders prescribed by doctors, especially the medical records of antibiotics involving the complex triangle relationship of "microorganisms-patients-antimicrobial drugs". At present, there are common problems in the medical records of antibiotic use, such as missing information, missing key content, non-standard records and over-simplified content, which not only affects the improvement of medical quality, but also aggravates the workload of clinicians, making it difficult for them to fully devote their precious time and energy to core clinical diagnosis and treatment.
[0038] To overcome the above problems, this embodiment discloses a method for generating a clinical course record of antibiotic use, as shown in the attached Figure 1 As shown, the following steps are included.
[0039] Step S1, obtaining the patient's panoramic historical medical data, wherein the patient's panoramic historical medical data includes the patient's basic information, data related to the clinical use of antibiotics and corresponding medical records, wherein the data related to the clinical use of antibiotics includes but is not limited to the doctor's authority to prescribe antibiotics, details of antibiotic prescriptions, usage and dosage, results of etiological tests and other laboratory tests, and the effect of antimicrobial treatment.
[0040] This embodiment uses medical knowledge base technology to intelligently generate clear and detailed text records on the clinical use of antibiotics record interface based on the results of the patient's current test items, information on antibiotics that have been used, prescriptions for antibiotics currently issued, and the therapeutic purposes of these drugs. At the same time, it allows doctors to make necessary personalized adjustments, such as filling in keywords or modifying specific content, which improves the efficiency and accuracy of medical record writing.
[0041] The process of establishing the medical knowledge base includes steps such as medical knowledge expression, medical knowledge extraction, medical knowledge fusion, medical knowledge reasoning, and medical knowledge quality assessment. The medical knowledge expression includes data integration capability improvement and downstream knowledge reasoning; the medical knowledge extraction includes entity, relationship, and attribute extraction; the medical knowledge fusion includes data cleaning, merging, and processing of knowledge from different sources under a unified framework specification.
[0042] Furthermore, the medical knowledge fusion also includes the construction of a medical knowledge graph framework and the organization and application of medical big data, which specifically includes the acquisition of authoritative data, natural language word segmentation, and data interface development, etc. In this embodiment, multi-threading technology is used to perform preliminary classification and segmentation of data according to the degree of infection and the purpose of medication, and then a panoramic historical medical data set of patients is established for subsequent processes.
[0043] Step S2, preprocessing the patient's panoramic historical medical data, segmenting the text into words / phrases and adding part-of-speech tags to form a medical record training data set.
[0044] Specifically, the acquired panoramic historical medical data of patients is preprocessed, and the processed data is subjected to word segmentation in natural language processing. Among them, preprocessing is a key step to ensure the quality of data analysis and the effect of subsequent model training, including data desensitization to protect patient privacy and noise data cleaning to improve data accuracy. The preprocessed data effectively protects the privacy rights and interests of patients, avoids the risk of data leakage, and greatly reduces the redundancy and noise in the data, providing a reliable data source for subsequent models. At the same time, the medical data containing text is segmented, and the continuous text is divided into meaningful words or phrases, and each word or phrase in the text after segmentation is added with part-of-speech tags such as nouns, verbs, adjectives, etc., to help the model better identify key information in the text and understand the structure and meaning of the text. The training set generated after this process can support subsequent complex and tedious natural language processing tasks, so that the model can learn richer information during the training process and improve the generalization ability and accuracy of the model.
[0045] Step S3, use the Bi-LSTM-CRF model to establish rules for generating medical records of antibiotic use, build a medical record generation model based on the rules for generating medical records of antibiotic use, and use the training samples in the medical record training data set to train the untrained medical record generation model using a stochastic gradient descent training algorithm, wherein the training samples include preprocessed clinical use-related data of antibiotics and corresponding medical records.
[0046] Specifically, the dependency syntactic analysis and dependency lexical analysis in natural language processing technology are used to analyze the text input by doctors to obtain the syntactic structure of the sentence and classify and recognize the text. The dependency syntactic analysis and dependency lexical analysis are the needs of language understanding on the one hand, and syntactic analysis and lexical analysis are important parts of language understanding on the other hand, they also provide support for other natural language processing tasks.
[0047] This embodiment uses the Bi-LSTM-CRF model to analyze the grammatical structure and semantic information of the text information input by the doctor. The Bi-LSTM-CRF model is a model widely used in natural language processing (NLP), especially in sequence labeling tasks such as named entity recognition (NER) and part-of-speech tagging (POS Tagging). This model combines the advantages of the bidirectional long short-term memory network Bi-LSTM and the conditional random field (CRF), which is significantly helpful for improving the accuracy and efficiency of sequence labeling. Among them, Bi-LSTM is a variant of the LSTM long short-term memory network. It realizes bidirectional processing through two independent LSTM layers, can capture long-term dependencies in the sequence, and considers past and future information at the same time, thereby improving the context-awareness of the model; CRF is a statistical modeling method for sequence labeling problems, which can consider the dependencies between labels and select the globally optimal label sequence.
[0048] This embodiment trains and verifies the Bi-LSTM-CRF model, so that the Bi-LSTM-CRF model can analyze the text data input by the doctor based on the collected patient medical data, and automatically output the medical entity label sequence assigned to each word or phrase in the text, such as antimicrobial drug information, antimicrobial drug use records, etc., and establish various rules for automatically generating antimicrobial drug use medical records. The rules include but are not limited to: generating different modes of antimicrobial drug use medical records according to different clinical use purposes of antimicrobial drugs. When the purpose of medication is surgical prevention, the antimicrobial drug use medical record is accompanied by basic surgical information. When the purpose of medication is treatment, the antimicrobial drug use medical record is accompanied by the patient's microbial sampling. For medication records without microbial sampling, fill in the reason for not sampling. The antimicrobial drug use medical records of patients with multiple antimicrobial drug records in a short period of time are merged. For medical orders that are issued beyond authority, the name and work number of the authorized doctor are attached. Special-level antimicrobial drugs need to obtain the review opinion of the review doctor.
[0049] For example, when the Bi-LSTM-CRF model captures that the patient's medication purpose is surgical prevention, its output should include the patient's basic surgical information; when the Bi-LSTM-CRF model captures that the patient's medication purpose is treatment, its output should include the patient's microbial sampling situation. If the microbial sampling situation is not captured, the reason for not sampling should be included. This can be achieved by combining CRF's capture of dependencies with additional logic or API interaction.
[0050] The Bi-LSTM-CRF model formula is configured as:
[0051] .
[0052] Where x is the input medical data sequence, y is the output antimicrobial drug use course record sequence, T is the sequence length, N is the number of tags, is the characteristic function The corresponding weight, Z is the normalization constant. The input medical data sequence x includes basic patient information, microbial sampling records, positive bacteria records, surgical information, etc.; the output antimicrobial drug use course record sequence y includes antimicrobial drug information, the patient's recent condition, antimicrobial drug use records, antimicrobial drug use effects, recent positive bacteria records, and reliability, etc.
[0053] Specifically, the model is trained using the labeled medical record training data, and part of the data in the medical record training data set is selected as the training set and part of the data is selected as the validation set to input into the Bi-LSTM-CRF model to train and validate the model, and the stochastic gradient descent algorithm SGD is selected to adjust the model parameters. The hyperparameters adjusted during the training process include the learning rate, the number of layers, etc. For example, at the beginning of the training, the parameters of the model are initialized, the weight is set to 0, the bias is set to 0, and the learning rate is set to 0.01 and the number of training rounds is 1000. During the training process, a sample is randomly selected from the medical record training data set in each round, and the model will automatically generate the predicted value of the medical record of the use of antimicrobial drugs for this sample. According to the gap between the predicted value and the actual medical record, the weight and bias gradients and the compensation function can be calculated. The learning rate plays a key role in this process. It will be adjusted based on the performance of the model on the validation set. When the performance of the model on the validation set is poor, the learning rate is appropriately reduced to avoid overfitting, and the weight and bias of the model are updated by multiplying the learning rate by the gradient to continuously optimize the model. The above process is repeated until the specified 1000 rounds of training are completed. At the same time, after the model training is completed, the performance of the model is comprehensively evaluated using evaluation indicators including accuracy, recall rate and F1 value, and the stability and reliability of the model are further verified through cross-validation and visual analysis.
[0054] Furthermore, in order to improve the accuracy of the model and enhance the generalization ability and flexibility of the model, the patient's medical history data can be continuously monitored through a real-time feedback mechanism, including but not limited to the patient's disease symptom description, treatment process details, microbiological examination results, doctors and other professionals' understanding and experience of medical records, etc., to continuously optimize and adjust the Bi-LSTM-CRF model. Among them, since the medical history data has time series characteristics, a compensation function based on time interval can be designed:
[0055] , in the formula, is the weight after time interval compensation, is the initial weight, is a decay factor between 0 and 1 that controls the degree of weight decay over time, and t is the time interval. For example, more recent data can be given a higher weight to reflect current medical conditions and trends.
[0056] Furthermore, the medical record generation model is constructed based on the rules for generating medical records for the use of antibiotics. It combines the collected patient medical data with the rule-compliant data output by the Bi-LSTM-CRF model to automatically map and generate professional medical records for the use of antibiotics. Different rules correspond to different mapping relationships and medical record generation models. This automated process is encapsulated in the inpatient intervention system module and seamlessly integrated into the hospital's electronic medical record system. When the doctor completes the subjective part and saves the antibiotic prescription, the engine is automatically triggered to quickly generate the corresponding medical record for the use of antibiotics, and immediately displays it in the medical record document of the electronic medical record, providing strong support for the doctor's clinical decision-making and the patient's health management.
[0057] In this embodiment, the medical record generation model includes a column embedding layer, an encoder layer and a multi-layer perceptron layer. The medical record generation model is explained here by taking the clinical use-related data of antibiotics containing 2 discrete features and 2 continuous features as an example, wherein the discrete features include drug types and administration routes, and the drug types include but are not limited to penicillins, cephalosporins, macrolides, quinolones and aminoglycosides, and the administration routes include but are not limited to oral, intravenous injection and topical use; the continuous features in the clinical use-related data of antibiotics include medication dosage and medication duration.
[0058] Specifically, the column embedding layer is configured to respectively extract each discrete feature and continuous feature in the data related to the clinical use of antimicrobial drugs, perform feature random mask replacement on the unlabeled data, map each discrete feature and continuous feature into a d-dimensional vector of the same length, and convert them into 4 first d-dimensional embedding vectors.
[0059] Before column embedding, a random mask vector with a length of 4 and containing only the values 0 and 1 is randomly generated, and random mask replacement is performed by randomly sampling other features in the unlabeled dataset, replacing the feature value corresponding to each mask 1 in the random mask vector with other values, such as replacing 50mg in the original data dosage with 40mg, and replacing "cephalosporins" in the original data drug type with "quinolones". Among them, the probability of generating 1 in the random mask vector is a hyperparameter, such as 0.3, etc., to flexibly adapt to different task requirements and dynamically adjust and optimize the training effect of the model.
[0060] Specifically, the column embedding layer is configured to: use It is represented by {1,2,3,4,5}, which correspond to penicillins, cephalosporins, macrolides, quinolones, and aminoglycosides, respectively; the route of administration is represented by It is represented by {1,2,3}, corresponding to oral, intravenous injection, and external use respectively; the dosage characteristics are represented by Indicates; medication duration characteristics Indicates that the randomly generated mask vector is:
[0061] ,in , the probability of generating 1 is p; the result after random mask replacement of features is:
[0062] ,
[0063] ,
[0064] in and are other values obtained by random sampling.
[0065] For example, there is an original sample data: [drug type: cephalosporins, route of administration: intravenous injection, dosage: 50 mg, duration of administration: 7 days]. Assume that the drug type feature is Indicates that the value is {1,2,3,4,5}; the drug route feature is Indicated by, the value is {1,2,3}; the dosage characteristics are Indicates that the duration of medication is characterized by Represents; randomly generated mask vector
[0066] ,in , the probability of generating 1 is p. At this time, the eigenvalues of the original data are: =2, =2, =5, =7, the feature vector is [2,2,5,7]. When the generated random mask vector is [1,1,0,0], =5, =1, =3, =9, after random mask replacement, the replaced feature vector is [5,1,5,7], that is, =5, =1, =5, = 7. The above random mask replacement can prevent the model from overfitting and enhance the robustness and generalization ability of the model.
[0067] After obtaining the replaced feature vector, a column embedding operation is performed on the replaced feature vector to embed each feature into a d-dimensional vector. For missing values, discrete features are converted into an embedding vector separately, and continuous features are replaced with 0 and mapped into an embedding vector with all values 0. In this embodiment, each discrete feature and continuous feature is mapped into 4 d-dimensional vectors of the same length:
[0068] ;
[0069] ;
[0070] ;
[0071] .
[0072] Through vector embedding, high-dimensional data is compressed into a lower-dimensional space while retaining key information and features, thereby simplifying the complexity of data processing. At the same time, since all features are mapped into d-dimensional vectors of the same length, subsequent encoder operations are convenient.
[0073] The encoder layer is composed of 6 multi-layer serially stacked Transformer encoder layers, and is configured to take the 4 first d-dimensional embedding vectors as input, input them into the encoder layer for feature correlation processing, and then output 4 second d-dimensional vectors with the same dimensions as the corresponding 4 first d-dimensional vectors.
[0074] Specifically, the encoder layer receives four embedding vectors output by the column embedding layer as input, and processes the input vectors using the unique architecture of each transformer encoder. It calculates the degree of correlation between each vector and other vectors through the self-attention mechanism, and generates corresponding weights for each vector, so that each vector can pay attention to the information of other vectors, thereby fully considering the correlation between input features.
[0075] Specifically, assuming that The input of the Transformer encoder layer is
[0076] , the input data is processed by the self-attention mechanism and the output is obtained after being processed by the feedforward neural network :
[0077] , FFN is a pre-configured feed-forward neural network, where
[0078] ,
[0079] , , , , , is the learnable parameter matrix, is the dimension of the key vector; after 6 layers of feature correlation processing, the final output is obtained .
[0080] In the process of multi-layer serial superposition, the embedding vector is input into each layer of transformer encoder for processing layer by layer, and features are further extracted through self-attention calculation and feedforward neural network, and 4 d-dimensional embedding vectors are output. Different from the input embedding vector, the output embedding vector at this time has fully considered the correlation of features. After multi-layer processing by the encoder, the final output 4 d-dimensional embedding vectors have rich semantic information and take into account the correlation of features.
[0081] The multi-layer perceptron layer is used to splice four second d-dimensional embedded vectors side by side into a one-dimensional vector of 4d length as an output. Its output layer for predicting features includes two normalized exponential function softmax layers for predicting the required filling data in the medical record of the use of antibiotics; the two normalized exponential function softmax layers are used to output the first feature and the second feature respectively; the number of first feature output nodes is 6, of which 5 first feature output nodes are used to output the types of antibiotics with 5 levels of classification respectively, and 1 first feature output node is used to output the missing category; the number of second feature output nodes is 4, of which 3 second feature output nodes are used to output 3 different dosage ranges respectively, and 1 second feature output node is used to output the missing category; 4 probability output nodes are included for predicting each mask vector, and the mask vector can be configured to indicate whether the set antibiotic is used or whether a set allergy exists; and 1 probability output node is included for predicting a pseudo-label, and the pseudo-label can be configured as a preliminary judgment of the infectious pathogen or a prediction result of the treatment effect.
[0082] Specifically, the multilayer perceptron concatenates the four d-dimensional vectors obtained by the encoder layer into
[0083] , with a length of 4d.
[0084] For the softmax layer of the red feature, its output is:
[0085] .
[0086] For the softmax layer of the orange feature, the output is:
[0087] .
[0088] For the 4 probability output nodes predicting the mask vector of 0 / 1, the output is:
[0089] .
[0090] For a probability output node predicting a pseudo-label, the output is:
[0091] .
[0092] Among them, v is the concatenation vector of the four d-dimensional vectors obtained by the encoder layer, , , , is the weight matrix, , , , is the bias vector, The probability values output for different types of antimicrobial drugs, The probability values output for different dose ranges, is the probability value of whether the corresponding antibacterial drug is used or whether the corresponding allergy exists. is the probability that the pseudo label is true.
[0093] Step S4, input the collected antibiotic prescription information filled in by the doctor into the trained medical record generation model, generate the antibiotic use medical record text and add it to the electronic medical record document.
[0094] Specifically, when doctors record medical advice information, the medical record generation model automatically generates detailed and accurate medical records of antibiotic use according to certain formats and specifications based on the results of data analysis. The generated medical records of antibiotic use can clearly reflect the trajectory of the patient's condition, treatment steps and results, and also have obvious advantages in terms of information accuracy.
[0095] Furthermore, this embodiment stores the generated antimicrobial drug use course records, which is convenient for medical staff to access and manage at any time, promoting the circulation and sharing of medical information. At the same time, the system's built-in data backup and recovery mechanism provides a solid guarantee for the security and integrity of the data.
[0096] The method for generating a medical record of clinical use of antibiotics disclosed in this embodiment trains and verifies a model by collecting panoramic historical medical data of patients. After preprocessing, word segmentation and part-of-speech tagging, the collected medical data forms a medical record training data set and is input into a Bi-LSTM-CRF model and a medical record generation model, so that the medical record generation model can map a professional medical record text of medical record of clinical use of antibiotics according to the collected patient medical data, the medical record generation rules of medical record of antibiotic use established by the Bi-LSTM-CRF model and the extracted information data that conforms to the rules. When the doctor fills in the medical order information of antibiotics, the model automatically generates a medical record and adds it to the electronic medical record document to standardize and complete the medical record of clinical use of antibiotics, automatically and accurately record the use of each dose of antibiotics, and at the same time help doctors accurately evaluate the effect of antibacterial treatment, adjust the medication plan in time, protect the rights and interests of patients, and reduce the workload of medical departments for medical record quality inspection. After the doctor enters the antibiotic prescription information, the model can automatically generate the antibiotic use medical record text based on the real-time captured patient-related medical data and add it to the electronic medical record document, ensuring the quality of the medical document on antibiotic use and providing real-time capture of audit information and reliable basis for the medical insurance payment review of antibiotics.
[0097] This embodiment also discloses a system for generating clinical use records of antimicrobial drugs, as shown in the attached Figure 2 As shown, it includes a data acquisition module 1, a data processing module 2, a model training module 3 and a record generation module 4. The data acquisition module 1 is used to obtain the patient's panoramic historical medical data, which includes the patient's basic information, clinical use of antibiotics and related data and corresponding medical records. The clinical use of antibiotics includes but is not limited to the doctor's prescription authority for antibiotics, details of antibiotic prescriptions, usage and dosage, etiology test results and other laboratory test results, and antibacterial treatment effects. The data processing module 2 is used to pre-process the patient's panoramic historical medical data, segment the text into words / phrases and add part-of-speech tags to form a medical record training data set. The model training module 3 is used to use the Bi-LSTM-CRF model to establish a medical record generation rule for the use of antibiotics, build a medical record generation model according to the medical record generation rule for the use of antibiotics, and use the training samples in the medical record training data set to select the stochastic gradient descent training algorithm for the untrained medical record generation model. The training samples include the pre-processed clinical use of antibiotics and the corresponding medical records. The record generation module 4 is used to input the collected antibiotic prescription information filled in by the doctor into the trained medical record generation model, generate the antibiotic use medical record text and add it to the electronic medical record document.
[0098] In this embodiment, the medical record generation model includes a column embedding layer, an encoder layer and a multi-layer perceptron layer, wherein:
[0099] The column embedding layer is configured to extract each discrete feature and continuous feature from the data related to the clinical use of antimicrobial drugs, perform feature random mask replacement on the unlabeled data, map each discrete feature and continuous feature into a d-dimensional vector of the same length, and convert them into four first d-dimensional embedding vectors;
[0100] The encoder layer is composed of 6 multi-layer serially stacked Transformer encoder layers, and is configured to take the 4 first d-dimensional embedding vectors as input, input them into the encoder layer for feature correlation processing, and then output 4 second d-dimensional vectors having the same dimensions as the corresponding 4 first d-dimensional vectors;
[0101] The multi-layer perceptron layer is used to splice four second d-dimensional embedded vectors side by side into a one-dimensional vector of 4d length as an output. Its output layer for predicting features includes two normalized exponential function softmax layers for predicting the required filling data in the medical record of the use of antibiotics; the two normalized exponential function softmax layers are used to output the first feature and the second feature respectively; the number of first feature output nodes is 6, of which 5 first feature output nodes are used to output the types of antibiotics with 5 levels of classification respectively, and 1 first feature output node is used to output the missing category; the number of second feature output nodes is 4, of which 3 second feature output nodes are used to output 3 different dosage ranges respectively, and 1 second feature output node is used to output the missing category; 4 probability output nodes are included for predicting each mask vector, and the mask vector can be configured to indicate whether the set antibiotic is used or whether a set allergy exists; and 1 probability output node is included for predicting a pseudo-label, and the pseudo-label can be configured as a preliminary judgment of the infectious pathogen or a prediction result of the treatment effect.
[0102] In this embodiment, the discrete features in the data related to the clinical use of antimicrobial drugs include drug types and routes of administration. The drug types include but are not limited to penicillins, cephalosporins, macrolides, quinolones and aminoglycosides, and the routes of administration include but are not limited to oral, intravenous injection and topical use; the continuous features in the data related to the clinical use of antimicrobial drugs include dosage and duration of use.
[0103] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and similar parts between the various embodiments can be referenced to each other. For the system for generating clinical use medical records of antimicrobial drugs disclosed in the embodiment, since it corresponds to the method for generating clinical use medical records of antimicrobial drugs disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the aforementioned method part.
[0104] In other embodiments, a computer device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the various steps of the method for generating a clinical use medical record of antimicrobial drugs as described in the above embodiments when executing the computer program. The server may include, but is not limited to, a processor and a memory. It will be understood by those skilled in the art that the schematic diagram is merely an example of a server and does not constitute a limitation on the server, and may include more or fewer components than shown in the figure, or a combination of certain components, or different components.
[0105] If the system for generating clinical use medical records of antimicrobial drugs is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned embodiments of the method for generating clinical use medical records of antimicrobial drugs can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electric carrier signals and telecommunication signals.
[0106] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
[0107] In conclusion, the above is only a preferred embodiment of the present invention, and all equivalent changes and modifications made according to the scope of the patent application of the present invention should fall within the scope of the patent of the present invention.
Claims
1. A method for generating clinical use records of antimicrobial drugs, characterized in that: The steps include: S1, obtaining the patient's panoramic historical medical data, which includes the patient's basic information, data related to the clinical use of antibiotics and corresponding medical records, and the data related to the clinical use of antibiotics include but are not limited to the doctor's authority to prescribe antibiotics, details of antibiotic prescriptions, usage and dosage, etiology test results and other laboratory test results, and antibacterial treatment effects; S2, preprocessing the patient's panoramic historical medical data, segmenting the text into words / phrases and adding part-of-speech tags to form a medical record training data set; S3, using the Bi-LSTM-CRF model to establish a rule for generating medical records of the use of antibiotics, constructing a medical record generation model according to the rule for generating medical records of the use of antibiotics, and using each training sample in the medical record training data set to train the untrained medical record generation model using a stochastic gradient descent training algorithm, wherein the training samples include pre-processed clinical use-related data of antibiotics and corresponding medical records; the discrete features in the clinical use-related data of antibiotics include drug types and administration routes, the drug types include but are not limited to penicillins, cephalosporins, macrolides, quinolones and aminoglycosides, and the administration routes include but are not limited to oral, intravenous injection and topical use; the continuous features in the clinical use-related data of antibiotics include dosage and duration of use; The medical record generation model includes a column embedding layer, an encoder layer and a multi-layer perceptron layer, wherein: The column embedding layer is configured to extract each discrete feature and continuous feature from the clinical use-related data of antimicrobial drugs, perform feature random mask replacement on the unlabeled data, map each discrete feature and continuous feature into a d-dimensional vector of the same length, and convert them into four first d-dimensional embedding vectors; The encoder layer is composed of 6 multi-layer serially stacked Transformer encoder layers, and is configured to take the 4 first d-dimensional embedding vectors as input, input them into the encoder layer for feature correlation processing, and then output 4 second d-dimensional vectors having the same dimensions as the corresponding 4 first d-dimensional vectors; The multi-layer perceptron layer is used to splice four second d-dimensional embedded vectors side by side into a one-dimensional vector of 4d length as an output, and its output layer for predicting features includes two normalized exponential function layers for predicting the required filling data in the medical record; the two normalized exponential function layers are used to output the first feature and the second feature respectively; it contains 6 first feature output nodes, of which 5 first feature output nodes are used to output the types of antibacterial drugs with 5 levels of classification respectively, and 1 first feature output node is used to output the missing category; it contains 4 second feature output nodes, of which 3 second feature output nodes are used to output 3 different dosage ranges respectively, and 1 second feature output node is used to output the missing category; it contains 4 probability output nodes for predicting each mask vector, and the mask vector can be configured to indicate whether the set antibacterial drug is used or whether the set allergy exists; it contains 1 probability output node for predicting a pseudo-label, and the pseudo-label can be configured as a preliminary judgment of the infectious pathogen or a prediction result of the treatment effect; S4, input the collected antibiotic prescription information filled in by the doctor into the trained medical record generation model, generate the antibiotic use medical record text and add it to the electronic medical record document.
2. The method for generating clinical use records of antimicrobial drugs according to claim 1, characterized in that: The column embedding layer is specifically configured as follows: The characteristics of drug types are It indicates that it has five values corresponding to penicillins, cephalosporins, macrolides, quinolones, and aminoglycosides; the route of administration feature is represented by It has three values corresponding to oral, intravenous injection and external use respectively; the dosage characteristics are expressed by Indicates; medication duration characteristics Represents; the randomly generated mask vector is ,in , the probability of generating 1 is p; The result after random mask replacement of features is: , , in and are other values obtained by random sampling; each discrete feature and continuous feature is mapped into 4 d-dimensional vectors of the same length: ; ; ; 。 3. The method for generating clinical use records of antimicrobial drugs according to claim 2, characterized in that: The encoder layer is further specifically configured as follows: Assume The input of the Transformer encoder layer is , the input data is processed by the self-attention mechanism and the output is obtained after being processed by the feedforward neural network : , FFN is a pre-configured feed-forward neural network, where , , , , , , is the learnable parameter matrix, is the dimension of the key vector; After 6 layers of feature correlation processing, the final output is obtained .
4. A system for generating clinical use records of antimicrobial drugs, characterized in that: include: A data acquisition module is used to acquire the patient's panoramic historical medical data, which includes the patient's basic information, data related to the clinical use of antibiotics, and corresponding medical records. The data related to the clinical use of antibiotics includes but is not limited to the doctor's authority to prescribe antibiotics, details of antibiotic prescriptions, usage and dosage, etiology test results and other laboratory test results, and antibacterial treatment effects; A data processing module is used to pre-process the patient's panoramic historical medical data, segment the text into words / phrases and add part-of-speech tags to form a medical record training data set; A model training module is used to establish a rule for generating medical records of the use of antibiotics using a Bi-LSTM-CRF model, to construct a medical record generation model according to the rule for generating medical records of the use of antibiotics, and to train an untrained medical record generation model using a stochastic gradient descent training algorithm using each training sample in a medical record training data set, wherein the training samples include pre-processed clinical use-related data of antibiotics and corresponding medical records; the discrete features in the clinical use-related data of antibiotics include drug types and routes of administration, wherein the drug types include but are not limited to penicillins, cephalosporins, macrolides, quinolones and aminoglycosides, and the routes of administration include but are not limited to oral, intravenous injection and topical use; the continuous features in the clinical use-related data of antibiotics include dosage and duration of administration; The medical record generation model includes a column embedding layer, an encoder layer and a multi-layer perceptron layer, wherein: The column embedding layer is configured to extract each discrete feature and continuous feature from the clinical use-related data of antimicrobial drugs, perform feature random mask replacement on the unlabeled data, map each discrete feature and continuous feature into a d-dimensional vector of the same length, and convert them into four first d-dimensional embedding vectors; The encoder layer is composed of 6 multi-layer serially stacked Transformer encoder layers, and is configured to take the 4 first d-dimensional embedding vectors as input, input them into the encoder layer for feature correlation processing, and then output 4 second d-dimensional vectors having the same dimensions as the corresponding 4 first d-dimensional vectors; The multi-layer perceptron layer is used to splice four second d-dimensional embedded vectors side by side into a one-dimensional vector of 4d length as an output, and its output layer for predicting features includes two normalized exponential function layers for predicting the required filling data in the medical record; the two normalized exponential function layers are used to output the first feature and the second feature respectively; it contains 6 first feature output nodes, of which 5 first feature output nodes are used to output the types of antibacterial drugs with 5 levels of classification respectively, and 1 first feature output node is used to output the missing category; it contains 4 second feature output nodes, of which 3 second feature output nodes are used to output 3 different dosage ranges respectively, and 1 second feature output node is used to output the missing category; it contains 4 probability output nodes for predicting each mask vector, and the mask vector can be configured to indicate whether the set antibacterial drug is used or whether the set allergy exists; it contains 1 probability output node for predicting a pseudo-label, and the pseudo-label can be configured as a preliminary judgment of the infectious pathogen or a prediction result of the treatment effect; The record generation module is used to input the collected antibiotic prescription information filled in by the doctor into the trained medical record generation model, generate the antibiotic use medical record text and add it to the electronic medical record document.
5. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 3 are implemented.
6. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of any method described in claims 1-3 are implemented.
Citation Information
Patent Citations
Hospital medical record information coding method, device, server and system
CN107833605A
Reasonable medication monitoring system
CN110797103A
Clinical medical record automatic generation method and device
CN114242196A
Antibacterial drug clinical application monitoring method, device and equipment
CN115171918A
Medical medicament recommendation method and device, computer equipment and storage medium
CN116153457A
