Medical record structuring method, device and storage medium
By converting the medical record template into a tree structure and generating regular expressions, the problem of the inability of customized templates to handle personalized medical record descriptions is solved, achieving better structuring effect and versatility.
Patent Information
- Application Number
- CN202210257490.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-16
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-03-16
AI Technical Summary
Existing medical record structuring technology cannot effectively handle doctors' personalized medical record descriptions when using customized templates, resulting in poor structuring effects. Moreover, predefined templates cannot cover all clinical situations and have insufficient versatility and scalability.
Convert the medical record template into a tree structure, generate a regular expression for each leaf node, and perform matching by traversing the actual medical record, and recombine the regular expression in combination with the parent node path to achieve accurate positioning and extraction, forming structured information.
It improves the effect of medical record structuring, can handle doctors' personalized descriptions and cover more clinical situations, and enhances the versatility and scalability of structuring.
Smart Images

Figure CN114927180B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of natural language processing, and specifically proposes a medical record structuring method, device and storage medium, which can realize keyword extraction and structured analysis of hospital text electronic medical records to form a structured information table. Background Art
[0002] Medical record structurization refers to converting the electronic medical records of patients generated by the hospital (usually text described in natural language) into a structured form, so as to facilitate computer statistical modeling and analysis to support practical applications such as clinical research, clinical decision support, and medical record quality control.
[0003] Medical record structuring technology can be divided into pre-structuring and post-structuring according to different implementation methods. Pre-structuring of medical records means that by improving the interactive mode of the electronic medical record editor, doctors can directly input and save medical records according to a fixed information structure in the customized medical record template input interface through input methods such as clicking and template definition. Pre-structuring of medical records is a traditional structuring technology. Since structured templates are directly used to limit the order and input range of input content, the accuracy of generating structured information is high, but the data dimensions that can be represented by structured input are limited, and many types of information are difficult to enter through interactive forms such as clicking. In addition, the number of predefined templates is limited, and it cannot fully cover the medical record writing needs of different special situations of different clinical diseases, and its versatility and scalability are weak.
[0004] Medical record post-structuring uses natural language processing technology to analyze the electronic medical records entered and stored by doctors in natural language, parse their internal structure, and extract the corresponding information in the order of the structure. Medical record post-structuring is an electronic medical record information extraction technology that has developed in recent years with the rise of artificial intelligence natural language processing technology. It has no restrictions on the input and storage form of the original medical records, and post-structuring has no restrictions on the dimensions of the extracted information. It can improve the breadth and accuracy of information extraction by continuously optimizing the natural language processing technology's ability to process and understand medical texts.
[0005] Considering that many hospitals already have some pre-structured or nearly pre-structured working modes in actual use, such as some preset medical record templates that are widely used in clinical practice, doctors can quickly complete medical record writing by copying and pasting medical record templates and modifying and supplementing them according to the patient's actual condition. Although these templates will be modified by doctors due to personal habits during the specific implementation process, the general structure still exists, but doctors are still flexible in their actual medical record descriptions, resulting in the inability to directly structure the medical record text or poor structuring effect. Summary of the invention
[0006] To solve the above problems, the present invention provides a medical record structuring method, comprising the following steps:
[0007] Combing the medical record template from the root node to the leaf node according to the feature description level, thereby converting the medical record template into a tree structure;
[0008] List the parent node path of each leaf node to the root node in the tree structure;
[0009] Generate a regular expression corresponding to each leaf node based on the content that the leaf node is suitable for filling;
[0010] Use regular expressions to traverse the actual medical records, count the number of occurrences of the regular expression corresponding to the leaf node in the entire actual medical record, and count the matching results that match the regular expression. If the number of occurrences of the regular expression and the number of matching results are the same and both are 1, obtain the matching result and position, and save the regular expression and the matching result. Otherwise, from the parent node path, combine the regular expression and reassemble the regular expression at each parent node to traverse the actual medical record until the number of occurrences of the regular expression and the number of matching results are both 1 or 0, and the loop ends.
[0011] Optionally, saving the regular expression and the matching result refers to saving the regular expression and the matching result in the form of a key-value pair.
[0012] Optionally, combing the medical record template from the root node to the leaf node according to the feature description level to convert the medical record template into a tree structure includes:
[0013] The medical record template is taken as the root node, the title, fixed description field or keywords in the medical record template are taken as tree nodes, and the symptoms, results or non-fixed description results are taken as leaf nodes, and they are classified according to the understanding of medical relationships to form a tree structure.
[0014] Optionally, generating a regular expression corresponding to each leaf node according to the content that is suitable for filling in the leaf node includes:
[0015] The written contents of the leaf nodes in different actual medical records using the medical record template are counted to determine the regular expression of the leaf nodes.
[0016] Optionally, the entry options limited by the leaf node are obtained from the design document of the medical record template as the regular expression of the leaf node.
[0017] Optionally, the leaf node and its parent node combined regular expression conform to the regular bidirectional shortest matching rule, the regular bidirectional shortest matching rule refers to the shortest distance from the matching string a_string to b_string, and its regular expression is: a_string+((?!cc).)*? +b_string,
[0018] ? ! indicates a negative lookahead, matching the search string at the beginning of any unmatched string cc;
[0019] *? indicates the shortest match;
[0020] Among them, a_string represents the string of the leaf node;
[0021] b_string represents the string of the parent node;
[0022] cc = a string formed by concatenating the sibling nodes of the leaf node's successive parent nodes.
[0023] The present invention also provides a medical record structuring device, comprising:
[0024] A tree structure generation module, used to sort the medical record template from the root node to the leaf node according to the feature description level, so as to convert the medical record template into a tree structure;
[0025] A parent node path generation module, used for listing the parent node path of each leaf node to the root node in the tree structure;
[0026] A regular expression generation module is used to generate a regular expression corresponding to each leaf node according to the content suitable for filling in the leaf node;
[0027] The medical record data extraction module is used to traverse the actual medical records using regular expressions, count the number of occurrences of the regular expression corresponding to the leaf node in the entire actual medical record, and count the matching results that match the regular expression. If the number of occurrences of the regular expression and the number of matching results are the same and both are 1, the matching result and position are obtained, and the regular expression and the matching result are saved. Otherwise, the regular expression is combined with the regular expression from the parent node path to reassemble the regular expression at each parent node level to traverse the actual medical record until the number of matching results of the regular expression is 1 or 0, and the loop ends.
[0028] The present invention also provides an electronic device, including a processor and a memory, wherein a medical record structuring program is stored in the memory, and when the medical record structuring program is executed by the processor, the medical record structuring method as described above is implemented.
[0029] The present invention also provides a computer-readable storage medium, in which a computer program is stored. The computer program includes program instructions. When the program instructions are executed by a processor, the medical record structuring method as described above is implemented.
[0030] On the one hand, the present invention can make use of the implicit structured information in the existing customized templates, and on the other hand, it can obtain free sentences written by doctors that exceed the fixed limits of the templates due to personal habits or medical conditions. As a supplement to the relevant technologies for post-structuring of medical records, it can greatly improve the structuring effect.
[0031] The present invention adopts the existing customized templates and constructs the relationship mapping of each field by creating a tree structure. The value in the key-value pair is accurately located and extracted through regular expressions and parent nodes in the combined path through loop requests, solving the problem that the current hospitals have customized templates but the actual medical record descriptions are still flexible and cannot be directly structured. As a supplement to structuring through deep learning, the structuring effect is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The above-mentioned features and technical advantages of the present invention will become clearer and easier to understand by describing its embodiments in conjunction with the following drawings.
[0033] Figure 1 is a flow chart showing a medical record structuring method according to an embodiment of the present invention;
[0034] Figure 2 is a schematic diagram showing a tree structure of an embodiment of the present invention;
[0035] Figure 3 is a schematic diagram showing the hardware architecture of an electronic device according to an embodiment of the present invention;
[0036] Figure 4 It is a program module diagram showing the medical record structuring program according to an embodiment of the present invention. DETAILED DESCRIPTION
[0037] The embodiments of the present invention will be described below with reference to the accompanying drawings. It will be appreciated by those skilled in the art that the described embodiments may be modified in various ways or combinations thereof without departing from the spirit and scope of the present invention. Therefore, the drawings and descriptions are illustrative in nature and are not intended to limit the scope of the claims. In addition, in this specification, the drawings are not drawn to scale and the same reference numerals represent the same parts.
[0038] The medical record structuring method of this embodiment is used for structural analysis of medical records to extract relevant information from actual medical records, including the following steps:
[0039] Step S1, sorting the medical record template into a tree structure starting from the root node according to the feature description level;
[0040] Specifically, different medical record templates can be used as different root nodes to form different tree structures. In each medical record template, the title, fixed description field or keyword in the medical record template can be used as a tree node, and the symptoms, results or non-fixed description results can be used as leaf nodes, and each tree structure can be formed by attributing them according to the understanding of medical relationships.
[0041] Take a medical record template as an example. The root node represents the entire medical record template. The first-level nodes include "Current Medical History", "Physical Examination", "Past Medical History", "Family History", etc. The second-level nodes such as "Physical Examination" include "General Condition", "Head and Facial Features", "Chest", "Abdomen", etc. The third-level nodes such as "General Condition" include "Height", "Weight", "Blood Pressure", "Heart Rhythm", etc. The nodes at the lowest level are leaf nodes. The number of branches of each node and the depth of the secondary branches depend on the specific structure of the medical record template.
[0042] Step S2, listing the parent node paths from the leaf nodes to the root node in the tree structure.
[0043] That is, for any leaf node, all nodes on the path from the leaf node to the root node are listed, forming the parent node path of the leaf node.
[0044] For example Figure 2 In the tree structure, the parent nodes of [regex](presence|absence) edema are skin and mucous membrane, and physical examination. The parent nodes of one [regex](normal|abnormal) are color, skin and mucous membrane, and physical examination, and the parent nodes of another [regex](normal|abnormal) are elasticity, skin and mucous membrane, and physical examination.
[0045] Step S3, generating a regular expression corresponding to each leaf node according to the content suitable for filling in the leaf node.
[0046] The actual written content of the leaf node in different medical records using the medical record template can be counted. For example, the corresponding regular expression of "blood pressure" should be a conventional blood pressure range. The blood pressure range can be obtained by a large number of queries from different medical records as the regular expression of the leaf node "blood pressure".
[0047] Alternatively, you can directly obtain the input options limited by the leaf node from the design document of the medical record template, and record a regular expression that can adapt to the different written contents of the leaf node and correspond it to the leaf node. For example, for "blood pressure", the corresponding regular expression should be a conventional blood pressure range. The filling range may have been limited when designing the medical record template, and the filling range can be found in its design document as the regular expression of the leaf node "blood pressure".
[0048] In this way, a tree is constructed consisting of leaf nodes composed of regular expressions and upper parent nodes composed of medical understandings.
[0049] Step S4, use regular expressions to traverse the actual medical records, count the number of occurrences of the regular expression corresponding to the leaf node in the entire actual medical record, and count the matching results that match the regular expression. If the number of occurrences of the regular expression and the number of matching results are the same and both are 1, then obtain the matching result and position, and save the regular expression and the matching result in the form of a key-value pair. Otherwise, from the parent node path, combine its parent nodes step by step to reassemble the regular expression to traverse the actual medical records until the number of occurrences of the regular expression and the number of matching results are both 1 or 0, and the loop ends. The number is 1, indicating a successful match, and the number is 0, indicating a failed match.
[0050] This is because sometimes leaf nodes under different parent node paths may have similar expressions.
[0051] For example, the first actual medical record is:
[0052] Physical examination: Skin and mucous membranes: normal color, no edema, abnormal elasticity, no rash.
[0053] The second actual medical record is:
[0054] Physical examination: Skin and mucous membranes: abnormal color, edema, normal elasticity, and rash.
[0055] The tree structures formed by combing are like this Figure 2 shown.
[0056] The leaf nodes are the following four regular expressions: [regex](normal|abnormal), [regex](presence|abnormal) edema, [regex](normal|abnormal), [regex](presence|abnormal) rash, where [regex] means regular expression.
[0057] exist Figure 2 , corresponding to the first actual medical record,
[0058] The regular expression number of [regex] (yes|no) edema is 1, and the result of the actual medical record is edema, and the matching result is also 1, so the match is successful and it is converted into kv format: edema: no;
[0059] Similarly, the regular expression number and matching result of [regex](with|without) rash is 1, the match is successful, and it is converted to kv format: rash: without.
[0060] The regular expression [regex] (normal|abnormal) has a statistical count of 2 and a matching result of 2. It is impossible to determine the corresponding relationship. It is necessary to obtain its upper parent node from the tree structure and then combine it with its upper parent node into the following expression:
[0061] [regex]color((?!elastic).)*? (normal|abnormal)
[0062] [regex] elastic((?!color).)*? (normal|abnormal)
[0063] At this time, the regular expression statistics and matching results are both 1, and the match is successful. The tree structure is no longer queried to request the parent node "skin and mucous membrane" to combine regular expressions for matching positioning. At this time, the matching results can be converted into kv format: color: normal; elasticity: abnormal.
[0064] In this way, all leaf nodes can be obtained from the actual medical records through regular expressions and converted into the following structured data in the form of key-value pairs:
[0065]
[0066]
[0067] In an optional embodiment, the leaf node and its parent node combined regular expression conform to the regular bidirectional shortest matching rule. The regular bidirectional shortest matching rule means that when matching the shortest distance from string a_string to b_string, its regular expression is: a_string+((?!cc).)*? +b_string,
[0068] ? ! indicates a negative lookahead, matching the search string at the beginning of any unmatched string cc;
[0069] a_string+((?!cc).) means that a_string will only match if it is followed by a string other than cc, thus achieving the shortest left approach;
[0070] *? indicates the shortest match to the right;
[0071] Among them, a_string represents the string of the leaf node;
[0072] b_string represents the string of the parent node;
[0073] cc=a_string.
[0074] Alternatively, you can use the following regular expression: a_string+(.(?!cc))*? +b_string, but a_string+(.(?!cc)) means a_string is followed by a string, which cannot be followed by cc, so the shortest approach to the left cannot be achieved, so bidirectional approach cannot be achieved, so it is not optimal.
[0075] Furthermore, in order to prevent cross-matching confusion, considering that the text description between the leaf node and the parent node may use the fields of the successive parent nodes, the negative preview only includes the sibling nodes of each node in the path, excluding the current node, that is, cc = a string of sibling nodes of the successive parent nodes concatenated with “|”.
[0076] See also Figure 3 , which is a schematic diagram of the hardware architecture of an embodiment of the electronic device of the present invention. In this embodiment, the electronic device 2 is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions. For example, it can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc. Figure 3 As shown, the electronic device 2 at least includes, but is not limited to, a memory 21 and a processor 22 that can be interconnected and communicated via a system bus. Wherein: the memory 21 includes at least one type of computer-readable storage medium, and the readable storage medium includes a flash memory, a hard disk, a multimedia card, a card-type memory, etc. In some embodiments, the memory 21 can be an internal storage unit of the electronic device 2, such as a hard disk or a memory of the electronic device 2. In other embodiments, the memory 21 can also be an external storage device of the electronic device 2, such as a plug-in hard disk, a smart memory card, etc. equipped on the electronic device 2. Of course, the memory 21 can also include both the internal storage unit of the electronic device 2 and its external storage device. In this embodiment, the memory 21 is generally used to store the operating system and various application software installed on the electronic device 2, such as the medical record structured program code, etc. In addition, the memory 21 can also be used to temporarily store various types of data that have been output or are to be output.
[0077] The processor 22 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 22 is generally used to control the overall operation of the electronic device 2, such as executing control and processing related to data interaction or communication with the electronic device 2. In this embodiment, the processor 22 is used to run the program code stored in the memory 21 or process data, such as running the medical record structuring program.
[0078] It should be pointed out that Figure 3 The electronic device 2 is shown only with components 21 - 22 , but it should be understood that implementation of all of the components shown is not required, and more or fewer components may alternatively be implemented.
[0079] The memory 21 including a readable storage medium may include an operating system, a medical record structuring program 50, etc. When the processor 22 executes the medical record structuring program 50 in the memory 21, the steps described in the above medical record structuring method are implemented. In this embodiment, the medical record structuring program stored in the memory 21 may be divided into one or more program modules, and the one or more program modules are stored in the memory 21 and can be executed by one or more processors (the processor 22 in this embodiment) to complete the present invention. For example, Figure 4 A schematic diagram of the program module of the medical record structuring program is shown. In this embodiment, the medical record structuring program 50 can be divided into a tree structure generating module 501, a parent node path generating module 502, a regular expression generating module 503, and a medical record data extracting module 504. The program module referred to in the present invention refers to a series of computer program instruction segments that can complete specific functions, which is more suitable for describing the execution process of the medical record structuring program in the electronic device 2 than a program. The following description will specifically introduce the specific functions of the program module.
[0080] The tree structure generation module 501 is used to sort the medical record template from the root node according to the feature description level to the leaf node, so as to convert the medical record template into a tree structure;
[0081] The parent node path generation module 502 is used to list the parent node path of each leaf node to the root node in the tree structure;
[0082] The regular expression generation module 503 is used to generate a regular expression corresponding to each leaf node according to the content suitable for filling in the leaf node;
[0083] The medical record data extraction module 504 is used to use regular expressions to traverse the actual medical records, count the number of occurrences of the regular expression corresponding to the leaf node in the entire actual medical record, and count the matching results that match the regular expression. If the number of occurrences of the regular expression and the number of matching results are the same and both are 1, the matching result and position are obtained, and the regular expression and the matching result are saved. Otherwise, the regular expression is recombined from the parent node path and combined with the upper parent node of the regular expression to traverse the actual medical record until the number of matching results of the regular expression is 1 or 0, and the loop ends.
[0084] In addition, the embodiment of the present invention further proposes a computer-readable storage medium, which may be any one or any combination of a hard disk, a multimedia card, an SD card, a flash memory card, an SMC, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disk read-only memory (CD-ROM), a USB memory, etc. The computer-readable storage medium includes a medical record structuring program, and the medical record structuring program implements the medical record structuring method when executed by the processor 22. The specific implementation of the computer-readable storage medium of the present invention is roughly the same as the specific implementation of the medical record structuring method and the electronic device 2 described above, and will not be repeated here.
[0085] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for structuring medical records, characterized in that: The following steps are involved: Combing the medical record template from the root node to the leaf node according to the feature description level, thereby converting the medical record template into a tree structure; List the parent node path of each leaf node to the root node in the tree structure; Generate a regular expression corresponding to each leaf node based on the content that the leaf node is suitable for filling; Use regular expressions to traverse the actual medical records, count the number of occurrences of the regular expression corresponding to the leaf node in the entire actual medical record, and count the matching results that match the regular expression. If the number of occurrences of the regular expression and the number of matching results are the same and both are 1, obtain the matching result and position, and save the regular expression and the matching result. Otherwise, from the parent node path, combine the regular expression and reassemble the regular expression at each parent node to traverse the actual medical record until the number of occurrences of the regular expression and the number of matching results are both 1 or 0, and the loop ends.
2. The medical record structuring method according to claim 1, characterized in that: Saving the regular expression and the matching result refers to saving the regular expression and the matching result in the form of a key-value pair.
3. The medical record structuring method according to claim 1, characterized in that: The step of combing the medical record template from the root node to the leaf node according to the feature description level, and converting the medical record template into a tree structure includes: The medical record template is taken as the root node, the title, fixed description field or keywords in the medical record template are taken as tree nodes, and the symptoms, results or non-fixed description results are taken as leaf nodes, and they are classified according to the understanding of medical relationships to form a tree structure.
4. The medical record structuring method according to claim 1, characterized in that: The step of generating a regular expression corresponding to each leaf node according to the content suitable for filling in the leaf node includes: The written contents of the leaf nodes in different actual medical records using the medical record template are counted to determine the regular expression of the leaf nodes.
5. The medical record structuring method according to claim 1, characterized in that: The input options limited by the leaf node are obtained from the design document of the medical record template as the regular expression of the leaf node.
6. The medical record structuring method according to claim 1, characterized in that: The leaf node and its parent node combined regular expression conforms to the regular bidirectional shortest matching rule, which refers to the shortest distance from the matching string a_string to b_string, and its regular expression is: a_string+((?!cc).)*? +b_string, ? ! indicates a negative lookahead, matching the search string at the beginning of any unmatched string cc; *? indicates the shortest match; Among them, a_string represents the string of the leaf node; b_string represents the string of the parent node; cc = a string formed by concatenating the sibling nodes of the leaf node's successive parent nodes.
7. A medical record structuring device, characterized in that: include: A tree structure generation module, used to sort the medical record template from the root node to the leaf node according to the feature description level, so as to convert the medical record template into a tree structure; A parent node path generation module, used for listing the parent node path of each leaf node to the root node in the tree structure; A regular expression generation module is used to generate a regular expression corresponding to each leaf node according to the content suitable for filling in the leaf node; The medical record data extraction module is used to traverse the actual medical records using regular expressions, count the number of occurrences of the regular expression corresponding to the leaf node in the entire actual medical record, and count the matching results that match the regular expression. If the number of occurrences of the regular expression and the number of matching results are the same and both are 1, the matching result and position are obtained, and the regular expression and the matching result are saved. Otherwise, the regular expression is combined with the regular expression from the parent node path to reassemble the regular expression at each parent node level to traverse the actual medical record until the number of matching results of the regular expression is 1 or 0, and the loop ends.
8. An electronic device, characterized in that: It comprises a processor and a memory, wherein a medical record structuring program is stored in the memory, and when the medical record structuring program is executed by the processor, the medical record structuring method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor, the medical record structuring method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method and device for excavating data regular expressions
CN103425771A
Log analysis method and system based on syntax tree, and computer readable medium
CN109726185A
Text mining method and system based on unstructured electronic medical records
CN110428907A
